---
title: Webhooks
slug: webhooks
createdAt: 2023-09-21T07:48:57.335Z
---

A webhook is an HTTP request, triggered by an event in a source system and sent to a destination system, usually with a payload of data. Webhooks are automated, in other words they are automatically sent out when their event is fired in the source system.

You can use webhook notifications to listen for events on your CabCard account so your integration can automatically trigger actions.

## Webhook endpoints

A webhook endpoint defines:

- a complete endpoint URL, for example `https://api.your-company.com/webhooks/cabcard`
- the event types you wish to receive webhook notifications for
- which account the webhook notifications will be sent for

Each webhook endpoint also has its own signature secret which you can use to verify incoming webhook notifications.

CabCard currently supports webhook notifications for the following events:

- `sale.created`
- `intent.authorized`

Webhooks can be attached at the submerchant (driver) level, or the operator (fleet) level. You can set up a new webhook endpoint in the Developer Tools section of your online dashboard (either [my.cabcard.services](https://my.cabcard.services) or [fleets.cabcard.services](https://fleets.cabcard.services)).

Please note that your URL must be prefixed by `https`. We are unable to set up localhost addresses for testing purposes. We recommend using a tool like [Ngrok](https://ngrok.com) during development.

## Verifying Webhooks

We recommend you verify incoming webhook notifications, especially if you intend to take actions based on these webhooks which might have a financial impact, for example crediting a driver's account. This is to help prevent abuse and fraud.

After your webhook endpoint has been set up, we will provide you with a signing secret. This should be stored safely within your application (for example, in environment variables), and should not be exposed publicly.

All webhooks will be sent with a signature header `Webhook-Signature`. The header value will include a timestamp `tsp` and a SHA256 hash digest `sig` in the following format:

```text
Webhook-Signature:tsp=1602514909,sig=b46852fb83db1d391b988aa28b0c9857adb7fe1658571edb5cd43040ba87ac56
```

To verify a webhook:

1. Extract the timestamp and signatures from the header. Split the header, using the `,` character as the separator, to get a list of elements. Then split each element, using the `=` character as the separator, to get a prefix and value pair. The value for the prefix `tsp` corresponds to the timestamp, and `sig` corresponds to the signature (or signatures). You can discard any other elements.
2. Prepare the signed payload string. This is accomplished by conactenating: the timestamp (as a string), the character `.`, the actual JSON payload (i.e. the request body) as a string.
3. Determine the expected signature. Compute an HMAC with the SHA256 hash function. Use your endpoint’s signing secret as the key, and use the signed payload string from step 2 as the message.
4. Compare the signature in the header to the expected signature. If they don't match, don't proceed.

A code sample for verifying webhook signatures is shown below:

```javascript
const crypto = require('crypto');

const signingSecret = '379985ecf2af498787d207e6a6f0a007'; // secret for your webhook endpoint
const payload = `{"example":"test-purposes-only"}`; // incoming payload, ensure this is the raw payload string, not a parsed version
const header = `tsp=1602514909,sig=4bf8d21b30bc20372d11c38960947901dba598a4640b3ae37d025b08b108dd52`; // value from the HTTP header

// parse the header to get timestamp and signature
const parsedHeader = {};
header.split(",").forEach((item) => {
  const element = item.split('=');
  parsedHeader[element[0]] = element[1];
});

// prepare signed payload string: concatenate timestamp and JSON payload string
const signedPayloadString = `${parsedHeader.tmp}.${payload}`;

// compute an HMAC using SHA256 hash function. Use signing secret as the key.
const hash = crypto.createHmac('sha256', signingSecret).update(signedPayloadString).digest('hex');

if (hash === parsedHeader.sig) {
  // OK to proceed
  console.log('Signature verified');
} else {
  // Do not proceeed
  console.log('Signature not verified');

```

## Your webhook endpoint

For each event occurrence, CabCard will send a `POST` request containint the webhook data to your endpoint URL in JSON format. The full event details are included and can be used directly after parsing the JSON. Therefore, your webhook endpoint needs to expect data through a `POST` request and confirm successful receipt of that data.

To acknowledge receipt of an event, your endpoint must return a `2xx` HTTP status code to the originating server. All response codes outside this range, including `3xx` codes, indicate to that you did not receive the event.

If a `2xx` HTTP status code is not received, the notification attempt will be repeated, with retries attempted in an exponential backoff fashion. After multiple failures to send the notification, the event will be marked as failed and further sends will not be attempted. After multiple days without receiving any `2xx` HTTP status code responses, the endpoint will be considered as misconfigured and automatically disabled. You will need to fix the problem and re-enable the endpoint.

Because properly acknowledging receipt of the webhook notification is so important, your endpoint should return a `2xx` HTTP status code prior to any complex logic that could cause a timeout.

You can use the developer tools section of your CabCard dashboard to view all notification attempts for a given endpoint.

It is advisable to make the webhook request operation on youre integration idempotent, as you may receive the same webhook notification more than once. In this scenario, you would want to ensure that your response to a webhook request is not duplicated.

In addition, we cannot guarantee that event webhook notifications will be delivered within a particular time window (although our system attempts to deliver notifications as soon as possible). Therefore we recommend that your integration should not be time-sensitive.

## Event types

All events share a common format, with specific event types containing certain properties.

The webhook request body will contain the following properties:

- `id` String - a unique identifier for the object
- `type` String - the event type, for example `sale.created`, `submerchant.updated`, `payout.updated`
- `createdAt` String - date and time of the event creation, in ISO 8601 format, for example `2020-10-11T22:44:30.652Z`
- `data` Object - data associated with this event.

Detailed information about the data field for the most commonly used events are found below.

### Event: sale.created

The `data` property will contain the following properties:

- `sale` Object - sale transaction associated with this event
- `submerchant` Object - submerchant associated with this event (if sale is allocated to a submerchant)
- `balanceTransaction` Object - balance transaction associated with this event

Depending on the method used to accept this payment (POS, E-commerce or SoftPOS) the  following additional properties may be included:&#x20;

- `terminal` Object - terminal associated with this event if sale was carried out using a POS terminal (sale property `method` has value `pos`).
- `intent` Object - payment intent  associated with this event if sale arose from a completed payment intent (sale property `method` has value `ecommerce`).

**Example: webhook notification payload for ecommerce (payment link) transaction:**

```json
{
  "id":"evt_a8z8mxqklms0np8t",
  "type":"sale.created",
  "createdAt":"2023-09-20T17:26:56.141Z",
  "data":{
    "sale":{
      "id":"sal_example",
      "amount":14700,
      "saleAmount":14700,
      "gratuityAmount":0,
      "commissionAmount":0,
      "currency":"gbp",
      "authCode":"123456",
      "retrievalReferenceNumber":"123456789012",
      "capturedAt":"2023-09-20T17:26:55.000Z",
      "method":"ecommerce",
      "interface":"ecommerce",
      "cardholderVerificationMethod":"3d_secure",
      "terminalSerialNumber":null,
      "terminalId":null,
      "submerchantId":"sub_example",
      "panFirstSix":"412345",
      "panLastFour":"1234",
      "panLength":16,
      "cardScheme":"visa",
      "cardBrand":"Visa Classic",
      "cardType":"debit",
      "cardIssuer":"Example Bank",
      "cardIsPrepaid":false,
      "cardCountryCode":"GB",
      "cardCountryIsInEEA":true,
      "cardIsCommercial":false,
      "refundedAmount":0,
      "status":"approved",
      "statusExplanation":null,
      "actionCode":"00",
      "disbursementWithheld":false,
      "receiptSlug":"blue-tree-09",
      "balanceTransactionId":"btn_example",
      "settlementTransactionId":null,
      "createdAt":"2023-09-20T17:26:55.923Z",
      "updatedAt":"2023-09-20T17:26:55.923Z",
      "refunds":[
        
      ],
      "disputes":[
        
      ],
      "receiptId":"rct_example",
      "userId":"api_example",
      "externalReference":"12345678A"
    },
    "submerchant":{
      "id":"sub_example",
      "isActive":true,
      "deactivatedAt":null,
      "deactivationIsDerogatory":null,
      "name":"TaxiCo Limited",
      "legalName":"TaxiCo Limited",
      "phoneNumber":"+441493331111",
      "secondaryPhoneNumber":"",
      "emailAddress":"simon.kitchen@taxico.co.uk",
      "websiteUrl":"https://taxico-taxis.co.uk",
      "addressLine1":"Example Road",
      "addressLine2":"",
      "addressLine3":"",
      "addressCity":"Example City",
      "regionCode":"EXM",
      "postcode":"EX10 1AB",
      "countryCode":"GB",
      "addressLatitude":"52.000000",
      "addressLongitude":"1.000000",
      "language":"en",
      "signatory":{
        "role":"Director",
        "firstName":"Eric",
        "lastName":"Example",
        "dateOfBirth":"1980-01-01",
        "addressLine1":"18 Example Avenue",
        "addressLine2":"",
        "addressLine3":"",
        "addressCity":"Exampleton",
        "regionCode":"EXM",
        "postcode":"EX10 1AB",
        "countryCode":"GB"
      },
      "significantOwners":[
        {
          "firstName":"Eric",
          "lastName":"Example",
          "dateOfBirth":"1980-01-01",
          "addressLine1":"18 Example Avenue",
          "addressLine2":"",
          "addressLine3":"",
          "addressCity":"Exampleton",
          "regionCode":"EXM",
          "postcode":"EX10 1AB",
          "countryCode":"GB"
        },
      ],
      "reference":"",
      "note":null,
      "payoutsWithheld":false,
      "businessType":"llc_private",
      "businessRegistrationNumber":"09876543",
      "merchantCategoryCode":"4121",
      "amexSellerReference":"99999999999999999999",
      "createdAt":"2023-03-07T11:18:53.202Z",
      "updatedAt":"2023-03-08T11:10:34.917Z",
      "paymentFacilitatorId":"pfc_example",
      "operatorId":"opr_example",
      "planAttachment":{
        "id":"pat_example",
        "startDate":"2023-03-01",
        "activationDate":"2023-03-07",
        "endDate":null,
        "billingSourceId":"placeholder-billing-source",
        "payoutDestinationId":"pba_example",
        "createdBy":null,
        "createdAt":"2023-03-07T11:20:04.194Z",
        "updatedAt":"2023-03-07T11:20:04.194Z",
        "merchantId":null,
        "planId":"pla_example",
        "submerchantId":"sub_example",
        "plan":{
          "id":"pla_example",
          "name":"Example plan",
          "createdBy":"usr_example",
          "createdAt":"2021-02-11T16:29:52.765Z",
          "updatedAt":"2023-01-18T15:52:30.205Z",
          "accountId":"acc_example",
          "processingAgreementId":"agp_example",
          "billingAgreementId":"agb_example",
          "payoutAgreementId":"agd_example",
          "billingAgreement":{
            "type":"billing",
            "id":"agb_example",
            "name":"Billing agreement example name",
            "currency":"gbp",
            "charges":[
              
            ],
            "createdBy": "usr_example",
            "createdAt":"2021-02-11T16:29:52.768Z",
            "updatedAt":"2021-02-11T16:29:52.768Z",
            "accountId":"acc_example"
          },
          "processingAgreement":{
            "type":"processing",
            "id":"agp_example",
            "name":"Processing agreement example name",
            "currency":"gbp",
            "rates":{
              "american_express":{
                "type":"percentage",
                "value":0.025
              },
              "card_fallback":{
                "type":"percentage",
                "value":0.015
              },
              "decline":{
                "type":"flat",
                "value":10
              },
              "dispute":{
                "type":"flat",
                "value":1500
              },
              "ecommerce_authorisation":{
                "type":"flat",
                "value":10
              },
              "ecommerce_commercial_credit_european":{
                "type":"percentage",
                "value":0.025
              },
              "ecommerce_commercial_credit_non_european":{
                "type":"percentage",
                "value":0.025
              },
              "ecommerce_commercial_debit_european":{
                "type":"percentage",
                "value":0.025
              },
              "ecommerce_commercial_debit_non_european":{
                "type":"percentage",
                "value":0.025
              },
              "ecommerce_consumer_credit_european":{
                "type":"percentage",
                "value":0.015
              },
              "ecommerce_consumer_credit_non_european":{
                "type":"percentage",
                "value":0.025
              },
              "ecommerce_consumer_debit_european":{
                "type":"percentage",
                "value":0.015
              },
              "ecommerce_consumer_debit_non_european":{
                "type":"percentage",
                "value":0.025
              },
              "pos_authorisation":{
                "type":"flat",
                "value":10
              },
              "pos_commercial_credit_european":{
                "type":"percentage",
                "value":0.025
              },
              "pos_commercial_credit_non_european":{
                "type":"percentage",
                "value":0.025
              },
              "pos_commercial_debit_european":{
                "type":"percentage",
                "value":0.025
              },
              "pos_commercial_debit_non_european":{
                "type":"percentage",
                "value":0.025
              },
              "pos_consumer_credit_european":{
                "type":"percentage",
                "value":0.015
              },
              "pos_consumer_credit_non_european":{
                "type":"percentage",
                "value":0.025
              },
              "pos_consumer_debit_european":{
                "type":"percentage",
                "value":0.015
              },
              "pos_consumer_debit_non_european":{
                "type":"percentage",
                "value":0.025
              }
            },
            "createdBy":null,
            "createdAt":"2021-02-11T16:29:52.768Z",
            "updatedAt":"2021-02-11T16:29:52.768Z",
            "accountId":"acc_example"
          },
          "payoutAgreement":{
            "type":"payout",
            "scheduleNaturalLanguage":"every week on Wednesday",
            "id":"agd_example",
            "name":"Example payout agreement - paid weekly, £25 min.",
            "currency":"gbp",
            "schedule":"INTERVAL=1;FREQ=WEEKLY;BYDAY=WE",
            "minBalance":2500,
            "scheduledPayoutFee":{
              "type":"flat",
              "value":0
            },
            "unscheduledPayoutFee":{
              "type":"flat",
              "value":100
            },
            "createdBy":null,
            "createdAt":"2017-11-21T13:01:36.322Z",
            "updatedAt":"2018-12-28T12:07:52.437Z",
            "accountId":"acc_example"
          }
        }
      }
    },
    "intent":{
      "statusIsFinal":true,
      "clientAccessUrl":"https://pay.cabcard.services/beta?p=int_example&t=404d54a2c0491f2d136204",
      "clientAccessQrCode":"data:image/png;base64,example",
      "receiptUrl":"https://receipts.cabcard.services/blue-tree-09",
      "id":"int_example",
      "submerchantId":"sub_example",
      "paymentFacilitatorId":"pfc_example",
      "reference":"12345678A",
      "description":"Prepayment: taxi journey to Luton Airport on 2023-10-30 09:00",
      "status":"succeeded",
      "statusExplanation":null,
      "brandIdentifier":"sub_example",
      "brand":{
        "payeeName":"TaxiCo Limited",
        "smsSenderName":"TaxiCo Limited",
        "payeeAvatarUrl":"https://pay.cabcard.services/default-avatar.png",
        "processorName":"CabCard Services (UK) Ltd",
        "receiptContactInfo":"receipts@cabcard.services",
        "receiptsBaseUrl":"https://receipts.cabcard.services"
      },
      "currency":"gbp",
      "amount":14700,
      "saleAmount":14700,
      "gratuityAmount":0,
      "captureAmount":14700,
      "gratuityEnabled":true,
      "clientAccessToken":"404d54a2c0491f2d136204",
      "customerName":"Nozrul Iqbal",
      "customerIpAddress":"91.42.216.200",
      "customerIpInfo":null,
      "customerDeviceInfo":{
        "isYaBrowser":false,
        "isAuthoritative":true,
        "isMobile":true,
        "isMobileNative":false,
        "isTablet":false,
        "isiPad":false,
        "isiPod":false,
        "isiPhone":true,
        "isiPhoneNative":false,
        "isAndroid":false,
        "isAndroidNative":false,
        "isBlackberry":false,
        "isOpera":false,
        "isIE":false,
        "isEdge":false,
        "isIECompatibilityMode":false,
        "isSafari":true,
        "isFirefox":false,
        "isWebkit":false,
        "isChrome":false,
        "isKonqueror":false,
        "isOmniWeb":false,
        "isSeaMonkey":false,
        "isFlock":false,
        "isAmaya":false,
        "isPhantomJS":false,
        "isEpiphany":false,
        "isDesktop":false,
        "isWindows":false,
        "isLinux":false,
        "isLinux64":false,
        "isMac":true,
        "isChromeOS":false,
        "isBada":false,
        "isSamsung":false,
        "isRaspberry":false,
        "isBot":false,
        "isCurl":false,
        "isAndroidTablet":false,
        "isWinJs":false,
        "isKindleFire":false,
        "isSilk":false,
        "isCaptive":false,
        "isSmartTV":false,
        "isUC":false,
        "isFacebook":false,
        "isAlamoFire":false,
        "isElectron":false,
        "silkAccelerated":false,
        "browser":"Safari",
        "version":"16.6",
        "os":"OS X",
        "platform":"iPhone",
        "geoIp":{
          
        },
        "source":"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",
        "isWechat":false
      },
      "customerPhoneNumber":"+447712345678",
      "customerEmailAddress":"example@example.com",
      "customerSmsSent":true,
      "customerEmailSent":false,
      "customerAddress":null,
      "expiresAt":"2023-10-04T17:24:51.547Z",
      "succeededAt":"2023-09-20T17:26:55.757Z",
      "threeDSecureToken":null,
      "cardToken":"X0ZZ9aaac9347bcf47691d6",
      "tokenisedCard":{
        "token":"X0ZZ9aaac9347bcf47691d6",
        "panEnd":"1234",
        "panStart":"412345",
        "cardScheme":"visa"
      },
      "cardTokenType":null,
      "captureMode":"automatic",
      "capturedAt":"2023-09-20T17:26:55.757Z",
      "transactionDetails":{
        "amount":14700,
        "cipher":"c972fd367226428cbb124a7724495779c972fd367226428cbb124a7724495779",
        "acquirer":"finaro",
        "authCode":"123456",
        "currency":"GBP",
        "operation":"use_token_capture",
        "paymentId":"646f5b94b7a52df1f3637",
        "requestId":"4d1cc15149b6ab",
        "timestamp":"09/20/2023 17:26:55",
        "cardScheme":"visa",
        "merchantId":"20009183",
        "receiptSlug":"blue-tree-09",
        "submerchantId":"893823884734384",
        "transactionType":"straight_operation",
        "paymentProcessor":"credorax",
        "paymentSourceType":"online_order",
        "previousResponseId":"916b0740bb50bfaf480f",
        "gatewayResponseCode":"0",
        "paymentProcessorMid":"C0235423",
        "retrievalReferenceNumber":"123456789012",
        "operationResultDescription":"Transaction has been executed successfully.",
        "sourceGatewayTransactionId":"de5b9f33ee0c4bb5af400b9b177e5ded",
        "processingResponseReasonCode":"00",
        "paymentProcessorTransactionId":"de5b9f33ee0c4bb5af400b9b177e5ded",
        "gatewayResponseCodeDescription":"The transaction has been executed successfully.",
        "processingResponseReasonCodeDescription":"Approved or completed successfully"
      },
      "authorizedAt":"2023-09-20T17:26:50.368Z",
      "authorizationDetails":{
        "amount":14700,
        "cipher":"f86ab7a30f2341739db2bb500e109267f86ab7a30f2341739db2bb500e109267",
        "tdsEci":"05",
        "tdsCavv":"421cd0b1858b4e2faeabdbd7bed2745f=",
        "tdsData":"05:1234567890987654321234567890:none",
        "authCode":"123456",
        "currency":"GBP",
        "operation":"use_token_auth",
        "paymentId":"646f5b94b7a52df1f3637",
        "requestId":"1fuq2lms0mllv",
        "tdsStatus":"authentication_successful",
        "tdsVersion":"2.2.0",
        "3ds_acstrxid":"5f985d61-bd46-4487-8ffa-086aaff80885",
        "tdsValidPayment":"Y",
        "tdsTransactionId":"a459fe0c-66ed-4714-b1f7-bdebfd6fdc7e",
        "gatewayResponseCode":"0",
        "initialTransactionId":"098765432123456",
        "paymentAccountReference":"V001001381923939151234567890",
        "operationResultDescription":"Transaction has been executed successfully.",
        "sourceGatewayTransactionId":"916b0740bb50bfaf480f",
        "processingResponseReasonCode":"00",
        "gatewayResponseCodeDescription":"The transaction has been executed successfully.",
        "tdsDirectoryServerTransactionId":"342af42d-4731-421b-af96-238f4617b5b2",
        "processingResponseReasonCodeDescription":"Approved or completed successfully"
      },
      "verificationDetails":{
        "tdsChallengeUrl":"https://x3d-redirect.credorax.net/challenge/request/20009183/e69e5f140ec0e042bc09d8a0b928a47da961",
        "completionResult":{
          "amount":14700,
          "cipher":"f86ab7a30f2341739db2bb500e109267f86ab7a30f2341739db2bb500e109267",
          "tdsEci":"05",
          "tdsCavv":"421cd0b1858b4e2faeabdbd7bed2745f=",
          "tdsData":"05:1234567890987654321234567890:none",
          "authCode":"123456",
          "currency":"GBP",
          "operation":"use_token_auth",
          "paymentId":"646f5b94b7a52df1f3637",
          "requestId":"1fuq2lms0mllv",
          "tdsStatus":"authentication_successful",
          "tdsVersion":"2.2.0",
          "3ds_acstrxid":"b742fdfe-60fb-4b58-be3a-fcb248098bf3",
          "tdsValidPayment":"Y",
          "tdsTransactionId":"6c7740da-fb80-4449-a283-17d12e2be900",
          "gatewayResponseCode":"0",
          "initialTransactionId":"098765432123456",
          "paymentAccountReference":"V001001381923939151234567890",
          "operationResultDescription":"Transaction has been executed successfully.",
          "sourceGatewayTransactionId":"916b0740bb50bfaf480f",
          "processingResponseReasonCode":"00",
          "gatewayResponseCodeDescription":"The transaction has been executed successfully.",
          "tdsDirectoryServerTransactionId":"342af42d-4731-421b-af96-238f4617b5b2",
          "processingResponseReasonCodeDescription":"Approved or completed successfully"
        },
        "verificationMethod":"tds_challenge",
        "tdsChallengeUrlExpiresAt":"2023-09-20T17:27:05.791Z"
      },
      "saleId":"sal_example",
      "logs":[
        "[2023-09-20T17:24:51.551Z] Created by: api_example",
        "[2023-09-20T17:24:53.545Z] Customer SMS sent to: +447712345678",
        "[2023-09-20T17:25:11.547Z] Accessed using client access token. IP: 92.40.216.207",
        "[2023-09-20T17:25:53.197Z] Saved tokenised card: {\"cardScheme\":\"visa\",\"panStart\":\"412345\",\"panEnd\":\"1234\",\"token\":\"X0ZZ9aaac9347bcf47691d6\"}",
        "[2023-09-20T17:25:53.487Z] Requesting payment authorization via FNO",
        "[2023-09-20T17:25:53.696Z] Authorization response indicates cardholder authentication required (SCA)",
        "[2023-09-20T17:25:53.702Z] Using SCA method: 3D Secure Fingerprint",
        "[2023-09-20T17:25:53.724Z] Waiting for 3DS fingerprint data",
        "[2023-09-20T17:25:56.297Z] Accessed using client access token. IP: 92.40.216.205",
        "[2023-09-20T17:25:57.993Z] Accessed using client access token. IP: 92.40.216.205",
        "[2023-09-20T17:26:00.235Z] Accessed using client access token. IP: 92.40.216.205",
        "[2023-09-20T17:26:02.097Z] Accessed using client access token. IP: 92.40.216.205",
        "[2023-09-20T17:26:04.767Z] Finished waiting for 3DS fingerprint data",
        "[2023-09-20T17:26:05.782Z] Fingerprint completion result indicates cardholder authentication required (SCA)",
        "[2023-09-20T17:26:05.788Z] Using SCA method: 3D Secure Challenge",
        "[2023-09-20T17:26:06.217Z] Accessed using client access token. IP: 92.40.216.205",
        "[2023-09-20T17:26:56.062Z] Sale created. ID: sal_example"
      ],
      "createdBy":"api_example",
      "createdAt":"2023-09-20T17:24:51.546Z",
      "updatedAt":"2023-09-20T17:26:56.062Z"
    },
    "balanceTransaction":{
      "id":"btn_example",
      "feeAmount":231,
      "netAmount":14469,
      "amount":14700,
      "currency":"gbp",
      "description":"Sale (approved)",
      "type":"sale",
      "status":"pending",
      "fees":[
        {
          "amount":221,
          "currency":"gbp",
          "description":"Processing fee",
          "type":"psp_fee"
        },
        {
          "amount":10,
          "currency":"gbp",
          "description":"Authorisation fee",
          "type":"psp_fee"
        }
      ],
      "sourceId":"sal_example",
      "createdAt":"2023-09-20T17:26:55.853Z",
      "updatedAt":"2023-09-20T17:26:55.853Z"
    }
  }
}
```

**Example: webhook notification payload for POS (terminal) transaction:**

```json
{
  "id":"evt_aa1rluklmtawfil",
  "type":"sale.created",
  "createdAt":"2023-09-21T15:01:25.773Z",
  "data":{
    "sale":{
      "id":"sal_example",
      "amount":17000,
      "saleAmount":16500,
      "gratuityAmount":500,
      "commissionAmount":0,
      "currency":"gbp",
      "authCode":"123456",
      "retrievalReferenceNumber":"Av1KeI004534",
      "capturedAt":"2023-09-21T15:01:19.000Z",
      "method":"pos",
      "interface":"contact",
      "cardholderVerificationMethod":"offline_pin",
      "terminalSerialNumber":"1623116432",
      "terminalId":"ter_example",
      "submerchantId":"sub_example",
      "panFirstSix":"123456",
      "panLastFour":"0987",
      "panLength":16,
      "cardScheme":"visa",
      "cardBrand":"Visa Classic",
      "cardType":"debit",
      "cardIssuer":"Example Bank",
      "cardIsPrepaid":false,
      "cardCountryCode":"GB",
      "cardCountryIsInEEA":true,
      "cardIsCommercial":false,
      "refundedAmount":0,
      "status":"approved",
      "statusExplanation":"",
      "actionCode":"000",
      "disbursementWithheld":false,
      "receiptSlug":"green-tree-01",
      "balanceTransactionId":"btn_example",
      "settlementTransactionId":null,
      "createdAt":"2023-09-21T15:01:25.028Z",
      "updatedAt":"2023-09-21T15:01:25.028Z",
      "refunds":[
        
      ],
      "disputes":[
        
      ],
      "userId":null,
      "externalReference":null
    },
    "submerchant":{
      "id":"sub_example",
      "isActive":true,
      "deactivatedAt":null,
      "deactivationIsDerogatory":null,
      "name":"Example Taxi Company",
      "legalName":"TaxiCo Ltd",
      "phoneNumber":"+441234567890",
      "secondaryPhoneNumber":"",
      "emailAddress":"example@example.com",
      "websiteUrl":"",
      "addressLine1":"11 Example House Road",
      "addressLine2":"Example Town",
      "addressLine3":"",
      "addressCity":"Example",
      "regionCode":"EXP",
      "postcode":"EX1 9PL",
      "countryCode":"GB",
      "addressLatitude":"51.00000",
      "addressLongitude":"-0.00000",
      "language":"en",
      "signatory":{
        "role":"Manager",
        "firstName":"Eric",
        "lastName":"Example",
        "dateOfBirth":"1980-01-01",
        "addressLine1":"11 Example House Road",
        "addressLine2":"Example Town",
        "addressLine3":"",
        "addressCity":"Example",
        "regionCode":"EXP",
        "postcode":"EX1 9PL",
        "countryCode":"GB"
      },
      "significantOwners":[
        {
          "firstName":"Eric",
          "lastName":"Example",
          "dateOfBirth":"1980-01-01",
          "addressLine1":"11 Example House Road",
          "addressLine2":"Example Town",
          "addressLine3":"",
          "addressCity":"Example",
          "regionCode":"EXP",
          "postcode":"EX1 9PL",
          "countryCode":"GB"
        }
      ],
      "reference":"",
      "note":"",
      "payoutsWithheld":false,
      "businessType":"llc_private",
      "businessRegistrationNumber":"12345678",
      "merchantCategoryCode":"4121",
      "amexSellerReference":"99990001010293948585",
      "createdAt":"2021-10-13T10:15:57.406Z",
      "updatedAt":"2023-01-16T12:40:32.327Z",
      "paymentFacilitatorId":"pfc_example",
      "operatorId":"opr_example",
      "planAttachment":{
        "id":"pat_example",
        "startDate":"2023-03-01",
        "activationDate":"2023-03-07",
        "endDate":null,
        "billingSourceId":"placeholder-billing-source",
        "payoutDestinationId":"pba_example",
        "createdBy":null,
        "createdAt":"2023-03-07T11:20:04.194Z",
        "updatedAt":"2023-03-07T11:20:04.194Z",
        "merchantId":null,
        "planId":"pla_example",
        "submerchantId":"sub_example",
        "plan":{
          "id":"pla_example",
          "name":"Example plan",
          "createdBy":"usr_example",
          "createdAt":"2021-02-11T16:29:52.765Z",
          "updatedAt":"2023-01-18T15:52:30.205Z",
          "accountId":"acc_example",
          "processingAgreementId":"agp_example",
          "billingAgreementId":"agb_example",
          "payoutAgreementId":"agd_example",
          "billingAgreement":{
            "type":"billing",
            "id":"agb_example",
            "name":"Billing agreement example name",
            "currency":"gbp",
            "charges":[
              
            ],
            "createdBy": "usr_example",
            "createdAt":"2021-02-11T16:29:52.768Z",
            "updatedAt":"2021-02-11T16:29:52.768Z",
            "accountId":"acc_example"
          },
          "processingAgreement":{
            "type":"processing",
            "id":"agp_example",
            "name":"Processing agreement example name",
            "currency":"gbp",
            "rates":{
              "american_express":{
                "type":"percentage",
                "value":0.025
              },
              "card_fallback":{
                "type":"percentage",
                "value":0.015
              },
              "decline":{
                "type":"flat",
                "value":10
              },
              "dispute":{
                "type":"flat",
                "value":1500
              },
              "ecommerce_authorisation":{
                "type":"flat",
                "value":10
              },
              "ecommerce_commercial_credit_european":{
                "type":"percentage",
                "value":0.025
              },
              "ecommerce_commercial_credit_non_european":{
                "type":"percentage",
                "value":0.025
              },
              "ecommerce_commercial_debit_european":{
                "type":"percentage",
                "value":0.025
              },
              "ecommerce_commercial_debit_non_european":{
                "type":"percentage",
                "value":0.025
              },
              "ecommerce_consumer_credit_european":{
                "type":"percentage",
                "value":0.015
              },
              "ecommerce_consumer_credit_non_european":{
                "type":"percentage",
                "value":0.025
              },
              "ecommerce_consumer_debit_european":{
                "type":"percentage",
                "value":0.015
              },
              "ecommerce_consumer_debit_non_european":{
                "type":"percentage",
                "value":0.025
              },
              "pos_authorisation":{
                "type":"flat",
                "value":10
              },
              "pos_commercial_credit_european":{
                "type":"percentage",
                "value":0.025
              },
              "pos_commercial_credit_non_european":{
                "type":"percentage",
                "value":0.025
              },
              "pos_commercial_debit_european":{
                "type":"percentage",
                "value":0.025
              },
              "pos_commercial_debit_non_european":{
                "type":"percentage",
                "value":0.025
              },
              "pos_consumer_credit_european":{
                "type":"percentage",
                "value":0.015
              },
              "pos_consumer_credit_non_european":{
                "type":"percentage",
                "value":0.025
              },
              "pos_consumer_debit_european":{
                "type":"percentage",
                "value":0.015
              },
              "pos_consumer_debit_non_european":{
                "type":"percentage",
                "value":0.025
              }
            },
            "createdBy":null,
            "createdAt":"2021-02-11T16:29:52.768Z",
            "updatedAt":"2021-02-11T16:29:52.768Z",
            "accountId":"acc_example"
          },
          "payoutAgreement":{
            "type":"payout",
            "scheduleNaturalLanguage":"every week on Wednesday",
            "id":"agd_example",
            "name":"Example payout agreement - paid weekly, £25 min.",
            "currency":"gbp",
            "schedule":"INTERVAL=1;FREQ=WEEKLY;BYDAY=WE",
            "minBalance":2500,
            "scheduledPayoutFee":{
              "type":"flat",
              "value":0
            },
            "unscheduledPayoutFee":{
              "type":"flat",
              "value":100
            },
            "createdBy":null,
            "createdAt":"2017-11-21T13:01:36.322Z",
            "updatedAt":"2018-12-28T12:07:52.437Z",
            "accountId":"acc_example"
          }
        }
      }
    },
    "terminal":{
      "id":"ter_example",
      "manufacturer":"datecs",
      "model":"bluePad55_4g",
      "serialNumber":"1623116432",
      "reference":64329489,
      "customReference":"258",
      "lastConnectionAt":"2023-09-21T15:01:24.092Z",
      "createdAt":"2022-04-01T08:44:41.279Z",
      "updatedAt":"2023-09-21T14:38:59.097Z",
      "currentAllocation":{
        "id":"tal_example",
        "endedAt":null,
        "createdAt":"2022-04-07T10:15:41.080Z",
        "createdBy":"9xsxFTfCaFTFG5gpPf9r68v7Iac8ZOki@clients",
        "startedAt":"2022-04-07T10:15:41.007Z",
        "updatedAt":"2022-04-07T10:15:41.080Z",
        "merchantId":null,
        "terminalId":"ter_example",
        "depositoryId":null,
        "submerchantId":"sub_example"
      },
      "simCardId":"sim_example"
    },
    "balanceTransaction":{
      "id":"btn_example",
      "feeAmount":175,
      "netAmount":16825,
      "amount":17000,
      "currency":"gbp",
      "description":"Sale (approved)",
      "type":"sale",
      "status":"pending",
      "fees":[
        {
          "amount":170,
          "currency":"gbp",
          "description":"Processing fee",
          "type":"psp_fee"
        },
        {
          "amount":5,
          "currency":"gbp",
          "description":"Authorisation fee",
          "type":"psp_fee"
        }
      ],
      "sourceId":"sal_example",
      "createdAt":"2023-09-21T15:01:24.947Z",
      "updatedAt":"2023-09-21T15:01:24.947Z"
    }
  }
}
```

### Event: intent.authorized

This event is triggered when a payment intent in capture mode: `manual` is authorized. An example webhook payload is available on request.

