Events Publisher
Overview
Electrum generates notifications, known as events or event postings, for every transaction throughout its lifecycle. These notifications give information about the status of the transaction at a given time.
Some of the important pieces of information included in the event payload are:
- Event class – indicates the type of information provided by the event.
TRANSACTION_STATE
indicates that the event provides information about the transaction's current state of processing, and is the only class currently supported. - Event type – for events in the
TRANSACTION_STATE
class, event type indicates the transaction processing stage that led to the event notification, e.g.,CREDIT_AUTH_RECEIVED
. - Transaction payload at the time of the event posting. This will be embedded inside the event posting message. Its schema, as defined by the Electrum API, will also be specified.
The example below shows a typical transaction journey of an outbound proxy resolution transaction. An event is generated each time a transaction progresses to a different state. So, for this example, you would expect to receive seven event notifications. Note that this example is illustrative – different scenarios will arise for the various transaction types that are supported.
Implementing the Events Publisher
Electrum generates event postings as a matter of course. You may choose whether or not you would like to receive these postings. These are some of the reasons that you may want to receive postings:
- For informational and record-keeping purposes
- To maintain an audit trail of all transactions
- For customer support purposes – to provide a reference source for when consumers query the status of their transactions. For example, if a consumer is concerned that their payment has not been finalised after an expected time period, you could refer to the event postings and inform them if their transaction is still pending at a certain stage of the process.
Important
Event postings are purely informational. They do not affect transaction processing and do not require that you take any action.
What You Need To Implement
You will need to implement a single API endpoint,/events
. Refer to our API documentation for a full definition of this call.Once your endpoint is set up, Electrum will send a
POST
call for every event that occurs for every transaction that is processed.You must also ensure that you have a system or database that can handle the receiving and storage of incoming event postings.
The events schema is shown below.
Important
class
and type
of the event, as well as the schema
of the original transaction at the point of event generation.Request Body schema: application/json
apiVersion required | string The version of the Electrum Regulated Payments Events API which the event format conforms to i.e. the version of this API. |
class required | string The class of the event. |
actionDate required | string <date> The date at which the transaction should take effect.
The date must be formatted as defined by |
creationDateTime required | string <date-time> The date and time at which the event was created, in senders local timezone or UTC.
The date must be formatted as defined by |
object (EventEsmPayload) | |
required | object (EventEsmIdentifiers) Holds a series of identifiers to identify the transaction or an individual message that is part of a transaction. |
required | object (EventEsmState) |
required | object (EventEsmTransactionInfo) |
Request for the inboundCreditTransferAuthorization
operation is received by the Switch. A customer at Grey Bank, Bob, is paying a customer at Blue Bank, Alice, using RTC. Electrum's partner is Blue Bank.
{- "name": "TRANSACTION_STATE_CREDIT_AUTH_RECEIVED",
- "apiVersion": "0.27.0",
- "class": "TRANSACTION_STATE",
- "type": "CREDIT_AUTH_RECEIVED",
- "stageVersion": 1,
- "tranInfo": {
- "tranUetr": "f27a34ad-c5ab-4b70-a3f9-946d743eaeaa",
- "direction": "INBOUND",
- "paymentScheme": "ZA_RTC",
- "service": "RTC_INBOUND"
}, - "messageInfo": {
- "messageIdentification": "8fd51c7124ba4819b9253e296a68e1da",
- "creationDateTime": "2022-05-04T03:02:01Z"
}, - "payload": {
- "schema": "CreditTransfer",
- "messageIdentifiers": {
- "messageIdentification": "8fd51c7124ba4819b9253e296a68e1da",
- "creationDateTime": "2022-05-04T03:02:01Z"
}, - "paymentScheme": {
- "schema": "ZA_RTC",
- "schemeData": {
- "userReference": "Ab1 xxxxxxxxxxxxxxxx",
- "originatorEchoData": "Ab1 xxxxxxxxxxxxxxxx",
- "businessReference": "11Ab1xxxxx"
}
}, - "transactionIdentifiers": {
- "endToEndIdentification": "6249118655591098",
- "transactionIdentification": "RRN000000001",
- "uetr": "f27a34ad-c5ab-4b70-a3f9-946d743eaeaa"
}, - "amounts": {
- "bankSettlementAmount": {
- "value": 1,
- "currency": "ZAR"
}, - "instructedAmount": {
- "value": 1,
- "currency": "ZAR"
}
}, - "paymentTypeInformation": {
- "localInstrument": {
- "schema": "CODE",
- "value": "BTR"
}
}, - "creditor": {
- "address": {
- "addressType": "ADDR",
- "department": "Department of Mysteries",
- "streetName": "Street of Mysteries",
- "buildingNumber": 42,
- "buildingName": "Mysterious Building",
- "floor": 42,
- "postBox": 1024,
- "postCode": 4242,
- "townName": "Mysty Town",
- "townLocationName": "Mysty Location",
- "districtName": "Mysty District",
- "countrySubDivision": "Mysterious Cape",
- "country": "ZA",
- "addressLine": [
- "16A",
- "New market street",
- "Foreshore",
- "Cape Town",
- "ZA",
- 8001
]
}, - "contactDetails": {
- "phoneNumber": "+27-0214620000",
- "mobileNumber": "+27-08230000000",
- "emailAddress": "bob@grey.com"
}, - "countryOfResidence": "ZA",
- "identification": {
- "schema": "PERSON",
- "identifiers": [
- {
- "identification": 90001236549870,
- "issuer": "Dept of Home Affairs",
- "scheme": {
- "schema": "CODE",
- "value": "NIDN"
}
}
]
}
}, - "creditorAccount": {
- "identification": {
- "schema": "GENERIC",
- "scheme": {
- "schema": "PROPRIETARY",
- "value": "AProprietaryCode123"
}, - "issuer": "Blue Bank",
- "value": "abcdef987654"
}, - "type": {
- "schema": "CODE",
- "value": "CACC"
}, - "currency": "ZAR"
}, - "creditorAgent": {
- "bicfi": "BLUEZAJ0",
- "memberId": "BlueBankId",
- "name": "Blue Bank Inc",
- "branch": {
- "identification": 210514,
- "name": "ABC Plettenberg Bay",
- "address": {
- "addressType": "ADDR",
- "department": "Department of Mysteries",
- "streetName": "Street of Mysteries",
- "buildingNumber": 42,
- "buildingName": "Mysterious Building",
- "floor": 42,
- "postBox": 1024,
- "postCode": 4242,
- "townName": "Mysty Town",
- "townLocationName": "Mysty Location",
- "districtName": "Mysty District",
- "countrySubDivision": "Mysterious Cape",
- "country": "ZA",
- "addressLine": [
- "16A",
- "New market street",
- "Foreshore",
- "Cape Town",
- "ZA",
- 8001
]
}
}
}, - "debtor": {
- "address": {
- "addressType": "ADDR",
- "department": "Department of Mysteries",
- "streetName": "Street of Mysteries",
- "buildingNumber": 42,
- "buildingName": "Mysterious Building",
- "floor": 42,
- "postBox": 1024,
- "postCode": 4242,
- "townName": "Mysty Town",
- "townLocationName": "Mysty Location",
- "districtName": "Mysty District",
- "countrySubDivision": "Mysterious Cape",
- "country": "ZA",
- "addressLine": [
- "16A",
- "New market street",
- "Foreshore",
- "Cape Town",
- "ZA",
- 8001
]
}, - "contactDetails": {
- "phoneNumber": "+27-0214620000",
- "mobileNumber": "+27-08230000000",
- "emailAddress": "bob@grey.com"
}, - "countryOfResidence": "ZA",
- "identification": {
- "schema": "PERSON",
- "identifiers": [
- {
- "identification": 90001236549870,
- "issuer": "Dept of Home Affairs",
- "scheme": {
- "schema": "CODE",
- "value": "NIDN"
}
}
]
}
}, - "debtorAccount": {
- "identification": {
- "schema": "GENERIC",
- "scheme": {
- "schema": "PROPRIETARY",
- "value": "AProprietaryCode123"
}, - "issuer": "Grey Bank",
- "value": "abcdef987654"
}, - "type": {
- "schema": "CODE",
- "value": "CACC"
}, - "currency": "ZAR"
}, - "debtorAgent": {
- "bicfi": "GREYZAJ0",
- "memberId": "GreyBankId",
- "name": "Grey Bank Inc",
- "branch": {
- "identification": 210514,
- "name": "ABC Plettenberg Bay",
- "address": {
- "addressType": "ADDR",
- "department": "Department of Mysteries",
- "streetName": "Street of Mysteries",
- "buildingNumber": 42,
- "buildingName": "Mysterious Building",
- "floor": 42,
- "postBox": 1024,
- "postCode": 4242,
- "townName": "Mysty Town",
- "townLocationName": "Mysty Location",
- "districtName": "Mysty District",
- "countrySubDivision": "Mysterious Cape",
- "country": "ZA",
- "addressLine": [
- "16A",
- "New market street",
- "Foreshore",
- "Cape Town",
- "ZA",
- 8001
]
}
}
}, - "instructingAgent": {
- "bicfi": "GREYZAJ0",
- "memberId": "GreyBankId",
- "name": "Grey Bank Inc",
- "branch": {
- "identification": 210514,
- "name": "ABC Plettenberg Bay",
- "address": {
- "addressType": "ADDR",
- "department": "Department of Mysteries",
- "streetName": "Street of Mysteries",
- "buildingNumber": 42,
- "buildingName": "Mysterious Building",
- "floor": 42,
- "postBox": 1024,
- "postCode": 4242,
- "townName": "Mysty Town",
- "townLocationName": "Mysty Location",
- "districtName": "Mysty District",
- "countrySubDivision": "Mysterious Cape",
- "country": "ZA",
- "addressLine": [
- "16A",
- "New market street",
- "Foreshore",
- "Cape Town",
- "ZA",
- 8001
]
}
}
}, - "instructedAgent": {
- "bicfi": "GREYZAJ0",
- "memberId": "GreyBankId",
- "name": "Grey Bank Inc",
- "branch": {
- "identification": 210514,
- "name": "ABC Plettenberg Bay",
- "address": {
- "addressType": "ADDR",
- "department": "Department of Mysteries",
- "streetName": "Street of Mysteries",
- "buildingNumber": 42,
- "buildingName": "Mysterious Building",
- "floor": 42,
- "postBox": 1024,
- "postCode": 4242,
- "townName": "Mysty Town",
- "townLocationName": "Mysty Location",
- "districtName": "Mysty District",
- "countrySubDivision": "Mysterious Cape",
- "country": "ZA",
- "addressLine": [
- "16A",
- "New market street",
- "Foreshore",
- "Cape Town",
- "ZA",
- 8001
]
}
}
}, - "instructionForCreditorAgent": [
- {
- "code": "TELA",
- "information": "Please email example@example.com"
}
], - "intermediaryAgents": [
- {
- "bicfi": "GREYZAJ0",
- "memberId": "GreyBankId",
- "name": "Grey Bank Inc",
- "branch": {
- "identification": 210514,
- "name": "ABC Plettenberg Bay",
- "address": {
- "addressType": "ADDR",
- "department": "Department of Mysteries",
- "streetName": "Street of Mysteries",
- "buildingNumber": 42,
- "buildingName": "Mysterious Building",
- "floor": 42,
- "postBox": 1024,
- "postCode": 4242,
- "townName": "Mysty Town",
- "townLocationName": "Mysty Location",
- "districtName": "Mysty District",
- "countrySubDivision": "Mysterious Cape",
- "country": "ZA",
- "addressLine": [
- "16A",
- "New market street",
- "Foreshore",
- "Cape Town",
- "ZA",
- 8001
]
}
}
}
], - "previousInstructingAgents": [
- {
- "bicfi": "GREYZAJ0",
- "memberId": "GreyBankId",
- "name": "Grey Bank Inc",
- "branch": {
- "identification": 210514,
- "name": "ABC Plettenberg Bay",
- "address": {
- "addressType": "ADDR",
- "department": "Department of Mysteries",
- "streetName": "Street of Mysteries",
- "buildingNumber": 42,
- "buildingName": "Mysterious Building",
- "floor": 42,
- "postBox": 1024,
- "postCode": 4242,
- "townName": "Mysty Town",
- "townLocationName": "Mysty Location",
- "districtName": "Mysty District",
- "countrySubDivision": "Mysterious Cape",
- "country": "ZA",
- "addressLine": [
- "16A",
- "New market street",
- "Foreshore",
- "Cape Town",
- "ZA",
- 8001
]
}
}
}
], - "purpose": {
- "schema": "CODE",
- "value": "BKDF"
}, - "remittanceInformation": {
- "unstructured": [
- "some",
- "unstructured",
- "information"
], - "structured": [
- {
- "referredDocuments": [
- {
- "type": {
- "issuer": "GreyBank123456",
- "schema": "CODE",
- "value": "CINV"
}, - "documentIdentifier": "A0123456789"
}
], - "referredDocumentAmount": {
- "duePayableAmount": {
- "value": 1,
- "currency": "ZAR"
}, - "remittedAmount": {
- "value": 1,
- "currency": "ZAR"
}
}, - "creditorReference": {
- "type": {
- "issuer": "GreyBank1234",
- "schema": "CODE",
- "value": "RADM"
}, - "reference": "ABC123XYZ999"
}, - "additionalRemittanceInformation": [
- "Some",
- "Additional",
- "Information"
]
}
]
}, - "tax": {
- "totalAmount": {
- "value": 1,
- "currency": "ZAR"
}
}
}
}