The Yordex platform sends Webhooks when certain events happen in the system. You can subscribe to these notifications by setting up a webhook. This allows you to react to notifications to build your bespoke integration.

Webhooks

Notifications are sent to your webhook as a POST request with a JSON body. Each notification will have the following headers set:

NameValue
user-agentYordex/1.0
X-yordex-webhook-keyThe key you received when setting up the webhook
content-typeapplication/json

Each notification will also have a traderId field in the request body.


Setup webhooks

How to set up webhooks is explained in the setup webhook guide

Verify the payload

To verify the payload:

  • Verify that the notification has the required headers.
  • Make sure the traderId and Webhook key combination match what you have stored on your side.
  • The notification Id is unique, so make sure that you do not process the same notification more than once by checking the notification id

Webhook reference

We will send notifications for the following events

EventDescription
Authorisation ApprovedThis event is triggered when an authorisation is approved.
Authorisation DeclinedThis event is triggered when an authorisation is declined.
Authorisation ReversedThis event is triggered when an authorisation is fully reversed.

Authorisation Approved

{
    "notificationType": "cardTransaction",
    "notificationDate": "2011-12-03T10:15:30Z",
    "notificationId": "<Id of the notification>",
    "traderId": "traderId",
    "data":
    {
        "id": "transaction id",
      	"event": "AUTHORISATION_APPROVED",
        "amountInCents": 328, 
        "bankTransactionId": "transaction id from the partner bank",
        "cardHolder": "[email protected]",
        "cardId": "card id",
        "cardHolderName": "Name of the user",
        "currency": "GBP",
        "date": "2011-12-03T10:15:30Z",
        "debitCredit": "DEBIT",
        "lastDigits": "6235",
        "status": "PENDING",
        "transactionAmountInCents": 328, 
        "transactionCurrency": "USD",
        "accountId": "Id of the account",
        "description": "Description",
        "type": "eg ATM/TOPUP/PURCHASE/etc..",
        "mcc": "7372",
        "mccDescription": "Grocery stores",
        "mid": "OCYSREKSTJVUPVX"
    }
}

Authorisation Declined

{
    "notificationType": "cardTransaction",
    "notificationDate": "2011-12-03T10:15:30Z",
    "notificationId": "<Id of the notification>",
    "traderId": "traderId",
    "data":
    {
        "id": "transaction id",
       	"event": "AUTHORISATION_DECLINED",
       	"declinedReason": "insufficient funds",
        "amountInCents": 328, 
        "bankTransactionId": "transaction id from the partner bank",
        "cardHolder": "[email protected]",
        "cardId": "card id",
        "cardHolderName": "Name of the user",
        "currency": "GBP",
        "date": "2011-12-03T10:15:30Z",
        "debitCredit": "DEBIT",
        "lastDigits": "6235",
        "status": "DECLINED",
        "transactionAmountInCents": 328, 
        "transactionCurrency": "USD",
        "accountId": "Id of the account",
        "description": "Declined reasons",
        "type": "eg ATM/TOPUP/PURCHASE/etc..",
        "mcc": "7372",
        "mccDescription": "Grocery stores",
        "mid": "OCYSREKSTJVUPVX"
    }
}

Authorisation Reversed

{
    "notificationType": "cardTransaction",
    "notificationDate": "2011-12-03T10:15:30Z",
    "notificationId": "<Id of the notification>",
    "traderId": "traderId",
    "data":
    {
        "id": "transaction id",
       	"event": "AUTHORISATION_REVERSED",
        "amountInCents": 328, 
        "bankTransactionId": "transaction id from the partner bank",
        "cardHolder": "[email protected]",
        "cardId": "card id",
        "cardHolderName": "Name of the user",
        "currency": "GBP",
        "date": "2011-12-03T10:15:30Z",
        "debitCredit": "DEBIT",
        "lastDigits": "6235",
        "status": "REVERSED",
        "transactionAmountInCents": 328, 
        "transactionCurrency": "USD",
        "accountId": "Id of the account",
        "description": "Declined reasons",
        "type": "eg ATM/TOPUP/PURCHASE/etc..",
        "mcc": "7372",
        "mccDescription": "Grocery stores",
        "mid": "OCYSREKSTJVUPVX"
    }
}