API Webhooks

A webhook is a callback that UnDosTres API uses to send notifications regarding your merchant events/actions. For secutiry, payload will be always encrypted using AES-128-ECB algorithm and the secret key will be shared only between involved parts.

Setting up your Webhook URLs:

To set up your Webhook URLs please see Update your account data

Parameters to take into account:

  • main_url : Mandatory webhook url where high priority notifications are sent.
  • second_url: Secondary webhook url where medium priority notifications are sent (this one is optional).
  • extra_url: Additional webhook url where less priority notifications could be sent (this one is optional).
  • working_time_only: If enabled, notifications will be scheduled to be sent only in working time (Monday to Friday between 8:00am - 5:00pm only).

Webhook core payload

{
	  "event_type": "ACCOUNT", /* API Event Type */
	  "event_type_description": "EMAIL_UPDATED", /* Event Sub-Type description */
	  "webhook_notification_code": 1001, /* Webhook notification event code */
	  "created_at": "2024-05-15 12:34:56", /* The timestamp when the event was created */
	  "first_sent_at": "2024-05-15 12:40:00", /* The timestamp of first attempt to send the event */
	  "attempts": 1, /* Attempts made by the webhook */
	  "account_id": 321, /* Account ID related with the event sent */
	  "customer_id": 345, /* Customer ID related with the event, if exist. */
	  "transaction_id": "trx_ehe77r6t8et5", /* If exist, external transaction ID related with the event. */
    "request_id": 12343, /* If exist, our internal request ID related with the event. */
	  "details": {
		    "id": 321, /* Object Instance ID of the API resource created/updated */
		    "code": "", /* Object Code ID of the API resource created/updated */
        "name": "", /* Object Name of the API resource created/updated */
        "amount": "", /* Amount related with the API resource created/updated */
		    "status": "success", /* The status of the action */
		    "failed_reason": "", /* If status=failed, a failure code */
		    "failed_message": "" /* If status=failed, a description of the failure */
	  },
    "metadata": null /*Json object with data related to the specific event type */
}

Webhook List

For information about specific payloads for a given API event type and webhook notification code, just click on the corresponding Webhook Code in the table below.

Event TypeEvent Sub TypeCodescheduled to be sent whenever...Up
ACCOUNTACCOUNT_CREATED1000an account is created.
ACCOUNTACCOUNT_UPDATED1100an account is updated.
ACCOUNTACCOUNT_CANCELLED1101an account is cancelled.
ACCOUNTACCOUNT_FAILED1005an account failed on being created, updated or cancelled.
ACCOUNTEMAIL_UPDATED1001the account email is changed/replaced.
ACCOUNTMOBILE_UPDATED1002the account mobile is changed/replaced.
ACCOUNTSECRET_KEY_CREATED1010initial Secret API Key is created (by the first time only).
ACCOUNTSECRET_KEY_UPDATED1011a new Secret API Key is created and old one is scheduled to expire (second time and so on).
ACCOUNTSECRET_KEY_WARNING1012a Secret API Key is near to expire (1, 3 and 7 days before expire).
ACCOUNTCREDENTIAL_UPDATED1013new account credentials are created.
ACCOUNTCREDENTIAL_WARNING1014account credentials are expired (1, 3 and 5 days after expired).
ACCOUNTUNAUTHORIZED_ACTION1015an unauthorized action is requested (account behalf).
ACCOUNTSUB_ACCOUNT_CREATED1200a sub-account is created.
ACCOUNTSUB_ACCOUNT_UPDATED1300a sub-account is updated.
ACCOUNTSUB_ACCOUNT_CANCELLED1301a sub-account is cancelled.
ACCOUNTSUB_ACCOUNT_FAILED1205a sub-account failed on being created, updated or cancelled.
ACCOUNTSA_EMAIL_UPDATED1201Sub-Account email is changed/replaced.
ACCOUNTSA_MOBILE_UPDATED1202Sub-Account mobile is changed/replaced.
ACCOUNTSA_SECRET_KEY_CREATED1210Sub-Account initial Secret API Key is created (first time only).
ACCOUNTSA_SECRET_KEY_UPDATED1211a new Secret API Key is created and old one is scheduled to expire (second time and so on).
ACCOUNTSA_SECRET_KEY_WARNING1212Sub-Account Secret API Key is near to expire (1, 3 and 7 days before expire)
ACCOUNTSA_CREDENTIAL_UPDATED1213new sub-account credentials are created.
ACCOUNTSA_CREDENTIAL_WARNING1214sub-account credentials are expired (1, 3 and 5 days after expired)
ACCOUNTSA_UNAUTHORIZED_ACTION1215an unauthorized action is requested (sub-account behalf).
ACCOUNTSPEI_REFERENCE_CREATED1030account SPEI reference is created.
ACCOUNTSPEI_WEBHOOK_ACCEPTED1031a success SPEI webhook is received (accepted).
ACCOUNTSPEI_WEBHOOK_CANCELLED1032a previous success SPEI webhook is requested to be cancelled.
ACCOUNTSPEI_WEBHOOK_REJECTED1033a failed SPEI webhook is received (rejected).
ACCOUNTSPEI_WEBHOOK_REFUNDED1034a SPEI transaction refund webhook is received (REFUND)
ACCOUNTSPEI_ACCOUNT_CASH_OUT_CREATED1060account spei cashout successfully created
ACCOUNTSPEI_ACCOUNT_CASH_OUT_FAILED1065an account SPEI cash out failed on being created.
ACCOUNTSPEI_ACCOUNT_CASH_OUT_SUCCESS1061an account SPEI cash out is successfully executed.
ACCOUNTSPEI_ACCOUNT_CASH_OUT_CANCELLED1062Spei cashout cancelled by bank or system
ACCOUNTSPEI_ACCOUNT_CASH_OUT_REJECTED1063Spei cashout rejected by bank or system
ACCOUNTSPEI_ACCOUNT_CASH_OUT_DECLINED1064Spei cashout declined by bank or system
ACCOUNTCASH_REFERENCE_CREATED1040account CASH reference is created
ACCOUNTCASH_WEBHOOK_ACCEPTED1041a success CASH webhook is received (accepted).
ACCOUNTCASH_WEBHOOK_CANCELLED1042a previous success CASH webhook is requested to be cancelled.
ACCOUNTCASH_WEBHOOK_REJECTED1043a failed CASH webhook is received (rejected).
ACCOUNTCODI_WEBHOOK_ACCEPTED1051a success CODI webhook is received (accepted).
ACCOUNTCODI_WEBHOOK_REJECTED1053a failed CODI webhook is received (rejected).
CUSTOMERCUSTOMER_CREATED2000a customer is created.
CUSTOMERCUSTOMER_UPDATED2100a customer is updated.
CUSTOMERCUSTOMER_ENABLED2101a customer is enabled.
CUSTOMERCUSTOMER_DISABLED2102a customer is disabled.
CUSTOMERCUSTOMER_FAILED2002a customer failed on being created, updated or enabled/disabled.
PAYMENT_METHOD_CARDPAYMENT_METHOD_CREATED3000a card payment method is created.
PAYMENT_METHOD_CARDPAYMENT_METHOD_UPDATED3100a card payment method is updated.
PAYMENT_METHOD_CARDPAYMENT_METHOD_DELETED3101a card payment method is deleted.
PAYMENT_METHOD_CARDPAYMENT_METHOD_USED3300a card payment method is used (a charge was requested).
PAYMENT_METHOD_CARDPAYMENT_METHOD_FAILED3002a card payment method failed on being created, updated or deleted
PAYMENT_METHOD_DMCLPAYMENT_METHOD_CREATED4000a domiciled payment method is created.
PAYMENT_METHOD_DMCLPAYMENT_METHOD_UPDATED4100a domiciled payment method is updated.
PAYMENT_METHOD_DMCLPAYMENT_METHOD_DELETED4101a domiciled payment method is deleted.
PAYMENT_METHOD_DMCLPAYMENT_METHOD_USED4300a domiciled payment method is used (a charge was requested).
PAYMENT_METHOD_DMCLPAYMENT_METHOD_FAILED4002a domiciled payment method failed on being created, updated or deleted.
PAYMENT_METHOD_DMCLBANK_INSTITUTION_ADDED4305a new BANK INSTITUTION is added.
PAYMENT_METHOD_DMCLBANK_INSTITUTION_UPDATED4105any existing BANK INSTITUTION is updated.
PAYMENT_REQUEST_CARDCARD_REQUEST_CREATED5000a card payment request is created.
PAYMENT_REQUEST_CARDCARD_REQUEST_UPDATED5100a card payment request is updated.
PAYMENT_REQUEST_CARDCARD_REQUEST_CANCELLED5101a card payment request is cancelled.
PAYMENT_REQUEST_CARDCARD_REQUEST_FAILED5002a card payment request failed on being created, updated, cancelled or we have confirmation from providers that payment attempt was rejected.
PAYMENT_REQUEST_CARDCARD_REQUEST_SUCCESS5001we got confirmation from providers that payment attempt was success.
PAYMENT_REQUEST_CARDCARD_REQUEST_CHARGEBACK5005we got confirmation from providers that chargeback has been made by your customer.
PAYMENT_REQUEST_DMCLDMCL_REQUEST_CREATED6000a domiciled payment request is created.
PAYMENT_REQUEST_DMCLDMCL_REQUEST_UPDATED6100a domiciled payment request is updated.
PAYMENT_REQUEST_DMCLDMCL_REQUEST_CANCELLED6101a domiciled payment request is cancelled.
PAYMENT_REQUEST_DMCLDMCL_REQUEST_FAILED6002a domiciled payment request failed on being created, updated, cancelled or we have confirmation from providers that payment attempt was rejected.
PAYMENT_REQUEST_DMCLDMCL_REQUEST_SUCCESS6001we got confirmation from providers that payment attempt was success.
PAYMENT_REQUEST_DMCLDMCL_REQUEST_CHARGEBACK6005we got confirmation from providers that chargeback has been made by your customer.
PAYMENT_REQUEST_CASHINCASHIN_REFERENCE_CREATED7000a cash-in reference is created.
PAYMENT_REQUEST_CASHINCASHIN_REFERENCE_COMPLETED7001we got confirmation from providers that payment attempt was success.
PAYMENT_REQUEST_CASHINCASHIN_REFERENCE_CANCELED7002a cash-in reference is cancelled.
PAYMENT_REQUEST_CASHINCASHIN_REQUEST_FAILED7003a cash-in reference is failed on being created.
PAYMENT_REQUEST_CASHINCASHIN_REFERENCE_EXPIRED7004a cash-in reference is expired without payment
PAYMENT_REQUEST_CASHOUTCASHOUT_REFERENCE_CREATED8000a cash-out reference is created.
PAYMENT_REQUEST_CASHOUTCASHOUT_REFERENCE_COMPLETED8001we got confirmation from providers that reference was fulfilled successfully.
PAYMENT_REQUEST_CASHOUTCASHOUT_REFERENCE_CANCELED8002a cash-out reference is cancelled.
PAYMENT_REQUEST_CASHOUTCASHOUT_REQUEST_FAILED8003a cash-out reference is failed on being created.
PAYMENT_REQUEST_CASHOUTCASHOUT_REFERENCE_EXPIRED8004a cash-out reference is expired.
CHECKOUT_ORDERSCHECKOUT_ORDER_CREATED9000a checkout order is created.
CHECKOUT_ORDERSCHECKOUT_ORDER_COMPLETED9001Confirmation that payment attempt was success.
CHECKOUT_ORDERSCHECKOUT_ORDER_FAILED9103a checkout order failed on being created.
CHECKOUT_ORDERSCHECKOUT_ORDER_PAYMENT_FAILED9004a checkout created order failed the payment attempt.

Webhook to use by code format

  • high priority notifications, last 3 digits of the webhook notification code are in the range [000 - 099]. Examples: 1001, 2050, 3030, X010. This group is expected to be sent to the main webhook url (i.e. the one provided in main_url parameter).
  • medium priority notifications, last 3 digits of the webhook notification code are in the range [100 - 299]. Examples: 1100, 2150, 3200, X210. This group is expected to be sent to the secondary webhook url (i.e. the one provided in second_url parameter).
  • less priority notifications, last 3 digits of the webhook notification code are in the range [300 - 599]. Examples: 1501, 2350, 3333, X310. This group is expected to be sent to the additional webhook url (i.e. the one provided in extra_url parameter).

Retry policy

If your system does not returns us 2XX status code, we automatically tries to send the webhook notification again. This retry process will be scheduled to happen depending of the retry logic configured for each of your webhook url. We currently manage following retry logic options:

  1. Continue retry; if the first attempt fails, our system will try again and will continue this pattern until it either receives a successful response or reaches the maximum allowed retries.
  2. Retry after 5 minute; if the first attempt fails, our system waits for 1 minute before trying again and will continue this pattern until it either receives a successful response or reaches the maximum allowed retries.
  3. Retry after 15 minute; if the first attempt fails, our system waits for 10 minutes before trying again and will continue this pattern until it either receives a successful response or reaches the maximum allowed retries.

This logic may be affected if your webhook is configured to receive notifications in working time only (Monday to Friday between 8:00am-5:00pm only).