Callbacks

Decentro uses callbacks to intimate the platform about transactions, incoming or outgoing and irrespective of the mode of transfer. The callback will be posted on the endpoints provided by the platform.

Decentro can configure custom endpoints (URLs) that you can share with our team on [email protected] or with your assigned RM, you can receive callbacks for any changes in the balance for your virtual accounts, or status updates for any transaction.

Transaction Status

This callback is triggered by Decentro to an endpoint provided by the platform for a specific transaction. This is over and above the account balance callback provided for updates in a specific virtual account.

Salient points:

  • 3 times maximum retry, post which the explicit Get status call has to be made for obtaining the transaction status.
  • It is mandatory to adhere to the response structure as specified in the examples.
  • It is recommended that you whitelist Decentro's originating IP.
  • It is recommended that you share your auth of preference with us, which will then be propagated as part of the callback request.
  • Callbacks will be triggered only in case of conclusive statuses (failure or success) and not while the transaction is pending.
  • Beneficiary Name and Bank Reference Number will be present only when Decentro's banking partners respond accordingly.
  • The keys in the request will be in snake/ camel case based on the company configuration (defaulting to camel case if nothing has opted). Response, however, has to be in snake case always.

Scenario Overview

Scenario

Callback HTTP Status code

Expected Callback Response

Successful transaction, successful callback

200, 201

{"response_code": "CB_S00000"}

Successful transaction, unauthorized callback

401, 403

{"response_code": "CB_E00013"}

Successful transaction, failed callback

Other 4xx

{"response_code": "CB_E00009"}

Successful transaction, failed callback due to internal server error

5xx

{"response_code": "CB_E00000"}

Failed transaction, successful callback

200, 201

{"response_code": "CB_S00000"}

Failed transaction, unauthorized callback

401, 403

{"response_code": "CB_E00013"}

Failed transaction, failed callback

Other 4xx

{"response_code": "CB_E00009"}

Failed transaction, failed callback due to internal server error

5xx

{"response_code": "CB_E00000"}

Sample: Transaction Status API

curl --location --request POST '<your_custom_endpoint>' \
--header 'your_custom_key_1: custom_value_1' \
--header 'your_custom_key_2: custom_value_2' \
--data-raw '{
    "attempt": 1,
    "timestamp": "2020-09-16 22:22:22",
    "callbackTxnId": "CLBACKxx",
    "originalCallbackTxnId": "CLBACKxx",
    "transactionStatus": "success",
    "referenceId": "company_reference_id_1",
    "decentroTxnId": "DCTRTXxx",
    "transactionMessage": "This is the message for a successful transaction",
    "transferType": "IMPS",
    "bankReferenceNumber": "abcdefghijk",
    "beneficiaryName": "some_beneficiary_name",
    "transactionAmount": 5.0
}'
{
  "response_code": "CB_S00000"
}

Pre-Deposit Check

Via this callback, it is possible for any company to accept or reject incoming transactions for their virtual accounts based on their custom criteria.

The incoming transactions will be accepted under the following scenarios:

  • Company has not opted for pre-deposit checks.
  • Company accepts the transaction.
  • Company does not respond with the valid payload. (Refer to examples)
  • Company does not respond within the configured timeframe of 15 seconds.

The custom endpoints for different providers(if opted) need to be different.

curl --location --request POST '<your_custom_endpoint>' \
--header 'your_custom_key_1: custom_value_1' \
--header 'your_custom_key_2: custom_value_2' \
--data-raw '{
    "urn": "F5FC3D989A2845479DB0XXXXXXXXXXXX",
    "beneficiaryConsumerBankAccountNumber": "462515XXXXXXXXXX",
    "transferType": "IMPS",
    "amount": 10000.0,
    "remitterName": "A K AGARWAL",
    "remitterConsumerBankAccountNumber": "02XXXXXXXXXXXX",
    "remitterProvider": "",
    "bankReferenceNumber": "11XXXXXXXXXXXX"
}'
{
  "is_accepted": 1
}

Did this page help you?