Webhooks are used to communicate changes in transactions. You can subscribe on multiple events types for the same transaction when creating the transaction. A transaction will have an optional field called "webhooks" where you can specify the webhook for a specific event. If you don't specify any webhooks, none will be sent.

Each event type can be used at most once per transaction. A URL can have multiple events.

{
  ...
   "webhooks": [
    {
      "url": "https://yourdomain.tld/statuschange?purchaseId=order123",
      "events": [
        "FINALSTATUS","STATUS_CHANGE"
      ]
    },
    {
      "url": "https://yourdomain.tld/refundchange?purchaseId=order123",
      "events": [
        "REFUND_STATUS"
      ]
    }
  ]
  ...
}

All event types:

Webhook EventsDescription
FINALSTATUSWhen the status of the transaction becomes SUCCESS, CANCELLED, EXPIRED, FAILURE.
STATUS_CHANGEWhen the status of the transaction has any change.
REFUND_STATUSWhen the status of a refund on the transaction has changed.
QR_PAYMENT_CREATEDWhen a payment is created using an iDEAL QR code.

Not all transaction types support the same webhook events. Below is a list specifying which event types are available per transaction type.

Transaction typeSupported Webhook Events
Checkout transactionFINALSTATUS, STATUS_CHANGE, REFUND_STATUS
iDEAL transactionFINALSTATUS, STATUS_CHANGE, REFUND_STATUS
iDEAL QR transactionFINALSTATUS, STATUS_CHANGE, REFUND_STATUS, QR_PAYMENT_CREATED
Credit Card transactionFINALSTATUS, STATUS_CHANGE, REFUND_STATUS
Bancontact transactionFINALSTATUS, STATUS_CHANGE, REFUND_STATUS
Apple Pay transactionFINALSTATUS, STATUS_CHANGE, REFUND_STATUS
Google Pay transactionFINALSTATUS, STATUS_CHANGE, REFUND_STATUS

Request Body

{
  "createdAt": "2006-01-02T15:04:05Z",
  "event": "FINALSTATUS",
  "transaction": "8db1e7fa-ba8a-4189-92fd-67a20217443d",
  "reference": "20210623130413",
  "payment": "fe77cd5f-2054-432d-b1c7-f019282785b2"
}

Parameters

ParameterTypeDescriptionConstraints
createdAtString(RFC3339)The creation time of the webhook.ISO 8601 date and time.
eventStringThe event that triggered the webhook.The possible values are: FINALSTATUS, STATUS_CHANGE , REFUND_STATUS, QR_PAYMENT_CREATED.
transactionString(36)The unique identifier of the transaction to which the webhook belongs.
referenceString(1...255)The reference you provided in the original transaction request

Optional parameters

ParameterTypeDescriptionConstraint
paymentString(36)The unique identifier of a payment related to a transaction.Only for specific webhook events such as QR_PAYMENT_CREATED.

What to do after receiving a webhook

A webhook call on its own does not contain the information you usually require to update the transaction in your application. Best practice is to see the webhook as a trigger. This trigger should then cause your application to GET the transaction. This insures you have the latest data and that the data originates from CM.com instead of being spoofed.

Error handling

In cases where your response is not a 2xx status code we will retry the webhook at a later time. We will attempt up to 50 deliveries over a span of about 14 days for the same webhook. If the webhook was not delivered successfully within that time, it will be discarded and not tried again.