Decline webhooks

Webhooks allow your server to automatically receive notifications about events in our system. Instead of periodically polling the API, you configure one endpoint and we send you an HTTP request for each important event.

To connect webhooks, you need:

  1. Create an HTTPS endpoint that accepts JSON requests.
  2. Send us the URL of this endpoint.
  3. Choose which events you want to receive.
  4. Accept and test webhook.
Possible payment events
Reason
Event
Action
Outcome
To get information about unsuccess charge
charge_unsuccess
Decline or fail
When a charge is declined, the payment fails and no funds are collected.
Depending on the order type and billing rules, this may result in no new charge being created or in changes to the subscription flow.
Webhook-request format
Attribute
Type
Requirement
Description
Standard
type
string
mandatory
Type of event.
There will always be a subscription.
-
action
string
mandatory
Indicates event (subscription_user_renew, subscription_user_create, etc)
-
merchant
string
mandatory
Merchant's name
-
buyer
object
mandatory
Contains buyer details
-
chargeData
object
mandatory
Contains charge details
-
{
  "type": "charge_unsuccess",
  "action": "charge_unsuccess",
  "merchant": "merchant",
  "buyer": {
    "id": "UUID",
    "email": "email@email.email",
    "metaData": []
  },
  "chargeData": {
    "id": "UUID",
    "status": "declined",
    "firstName": "first name",
    "lastName": "last name",
    "createdAt": "2024-03-30 23:35:00.123456",
    "isServiceFee": false,
    "order": {
      "id": "order id",
      "type": "initial",
      "currency": "USD",
      "amount": "123.12",
      "metaData": [],
      "locale": "en"
    },
    "paymentMethod": {
      "type": "card",
      "data": {
        "bin": "123456",
        "lastFour": "1234"
      }
    },
    "provider": {
      "name": "provider",
      "mid": {
        "name": "mid"
      }
    },
    "declineData": {
      "type": "general_decline",
      "errorMessage": "Token does not exist",
      "code": "decline code"
    }
  }
}