Overview
Notification service provides a couple of webhooks that can be used to notify your system about multiple events. Currently, the webhooks are designed to support B2B services. Webhooks are an architectural pattern that allows third parties and developers to subscribe to anb events.
Name | Key | Description |
---|---|---|
End of Day statements created | statement.created | Whenever a new end of day statement is created |
Outgoing payment triggered from API | payment.received | Whenever a new payment is sent from API and ready to be processed |
Outgoing payment completed from API | payment. completed | Whenever a payment has completed processing |
WPS file generated | wps.generated | Whenever WPS file is created |
WPS payment success | wps.payment.success | when you have successfully submitted your payment to ANB and Mudad |
WPS file sent to Mudad | wps.sent | Whenever WPS file is sent to Mudad |
WPS insufficient funds | wps.insufficient.funds | When the account balance is lower than the amount drawn |
WPS sent successfully | wps.success | Whenever ANB received a successfull response from Mudad |
WPS failed | wps.failed | Whenever ANB received a failed response from Mudad |
Payment status updated | payment.status.updated | Whenever a payment status has changed |
Prerequisites
To use the Notification service, you need to do the following:
- Register/Login to the anb Developer Portal.
- Create an app.
- You should now have a client id and secret associated with your app.
- Get an access token from our auth service using your client id and secret.
Webhook Service Specification
Your webhook URL will be triggered with a POST request with the below structure. Note that in case of failures we will attempt to retry 4 times to guarantee delivery.
Field | Description |
---|---|
Type | Event key |
Payload | Event payload The structure of the payload changes based on the event type |
Due to multiple factors related to security, your endpoint might need to be whitelisted at anb system. In case the events are not reaching your endpoint, provide your endpoint URL to anb to whitelist it
statement.created Event
Whenever a new statement gets generated for one of your accounts, this event will be published. This event is associated with end-of-day service
{
"type": "statement.created",
"payload": {
"data": ":20:RPMS-210318131402\n:25:0108061198800019\n:28c:77/001\n:60F:C210318SAR1988902010,05\n:61:2103180318D3,45NTRFB2B-سريع-مدفوعات تجارية//OUTGOING TRANSFEE\n:86:SDC176382'\n2103180318D5,75NTRFB2B-سريع-مدفوعات تجارية//OUTGOING TRANSFEE\n:86:SDC176384'\n2103180318D5,75NTRFB2B-سريع-مدفوعات تجارية//OUTGOING TRANSFEE\n:86:SDC176388'\n2103180318D5,75NTRFB2B-سريع-مدفوعات تجارية//OUTGOING TRANSFEE\n:86:SDC176395'\n2103180318D5,75NTRFB2B-سريع-مدفوعات تجارية//OUTGOING TRANSFEE\n:86:SDC176397'\n2103180318D5,75NTRFB2B-سريع-مدفوعات تجارية//OUTGOING TRANSFEE\n:86:SDC176410'\n2103180318D5,75NTRFB2B-سريع-مدفوعات تجارية//OUTGOING:62:C210318SAR1988907756,00"
}
}
payment.received Event
Whenever a new payment is received from API and ready to be processed, this event will be published. This event is associated with single payment service
{
"type": "payment.received",
"payload": {
"payment": {
"id": "84859891-2336-4737-9694-4a6ea6afabf7",
"fee": {
"id": "1fb4904e-2781-49ae-98da-4ba306c97481",
"status": "PENDING",
"segment": null,
"category": null,
"createdAt": "2021-11-08T09:12:02.176Z",
"feeAmount": null,
"updatedAt": "2021-11-08T09:12:02.176Z",
"vatAmount": null,
"feeIncluded": false,
"totalAmount": null,
"waivedAmount": null,
"vatPercentage": null,
"feesAndVATAccount": null
},
"amount": "10",
"status": "INITIATED",
"channel": "ANB",
"currency": "SAR",
"createdAt": "2021-11-08T09:12:02.160Z",
"narrative": "test",
"updatedAt": "2021-11-08T09:12:02.160Z",
"valueDate": "211108",
"uetrNumber": null,
"requesterId": "7885544",
"debitAccount": "0108095040630028",
"exchangeRate": null,
"creditAccount": "0108095040630011",
"debitedAmount": null,
"orderingParty": "string",
"sequenceNumber": "8798545",
"beneficiaryName": "string",
"reasonOfFailure": null,
"purposeOfTransfer": "38",
"destinationBankBIC": "ARNBSARI",
"transactionComment": "string",
"beneficiaryAddress1": "string",
"beneficiaryAddress2": "string",
"intermediateAccount": null,
"orderingPartyAddress1": "string",
"orderingPartyAddress2": "string",
"orderingPartyAddress3": "string",
"externalReferenceNumber": null,
"transactionReferenceNumber": "9512272636"
}
}
}
payment.completed Event
Whenever a payment has completed processing, this event will be published This event is associated with single payment service
{
"type": "payment.completed",
"payload": {
"payment": {
"id": "84859891-2336-4737-9694-4a6ea6afabf7",
"fee": {
"id": "1fb4904e-2781-49ae-98da-4ba306c97481",
"status": "FAILED",
"segment": null,
"category": "default",
"dtoClass": null,
"createdAt": "2021-11-08T09:12:02.176Z",
"feeAmount": "0",
"updatedAt": "2021-11-08T09:12:02.839Z",
"vatAmount": "0.00",
"feeIncluded": false,
"totalAmount": "0.00",
"waivedAmount": "0",
"vatPercentage": "15",
"feesAndVATAccount": null
},
"iban": {
"id": "d28f87a0-2788-4c90-bad9-0f1fa7fe0cfe",
"bic": "ARNBSARIXXX",
"city": "RIYADH",
"country": "SAUDI ARABIA",
"createdAt": "2021-11-08T09:12:02.446Z",
"updatedAt": "2021-11-08T09:12:02.446Z",
"subAddress": "",
"countryCode": "SA",
"mainAddress": "KING FAISAL STREET NORTH MURABA",
"institutionName": "ARAB NATIONAL BANK"
},
"amount": "10",
"status": "FAILED",
"channel": "ANB",
"currency": "SAR",
"createdAt": "2021-11-08T09:12:02.160Z",
"narrative": "test",
"updatedAt": "2021-11-08T09:12:03.320Z",
"valueDate": "211108",
"uetrNumber": null,
"requesterId": "7885544",
"debitAccount": "0108095040630028",
"exchangeRate": "1",
"creditAccount": "0108095040630011",
"debitedAmount": "10",
"orderingParty": "string",
"sequenceNumber": "8798545",
"beneficiaryName": "string",
"reasonOfFailure": "No Fund and Account limit exceeded",
"purposeOfTransfer": "38",
"destinationBankBIC": "ARNBSARI",
"transactionComment": "string",
"beneficiaryAddress1": "string",
"beneficiaryAddress2": "string",
"intermediateAccount": null,
"orderingPartyAddress1": "string",
"orderingPartyAddress2": "string",
"orderingPartyAddress3": "string",
"externalReferenceNumber": null,
"transactionReferenceNumber": "9512272636"
}
}
}