Webhook Format
Event Categories
The event category that you subscribed for within the Webhook Merchant Portal setup.
Category | Triggered When |
approved | Transaction status is APPROVED |
declined | Transaction status is anything other than APPROVED (HOST_DECLINED, INVALID etc) |
Each event also includes the transaction action (SALE, AUTHORIZATION, CAPTURE, REFUND, VOID, REVERSAL etc) so you can distinguish event types within each category.
Event Payload Format
Each webhook delivery is an HTTP POST with a JSON body:
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"type": "approved",
"created": "2024-11-14T22:13:20Z",
"merchantId": "M10000000000001",
"data": {
"transactionId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"action": "SALE",
"status": "APPROVED",
"isApproved": true,
"amount": 1500,
"currency": "USD",
"cardType": "VISA",
"firstSix": "411111",
"lastFour": "1111",
"responseCode": "00",
"responseText": "Approved",
"authCode": "ABC123",
"originalTransactionId": null,
"clientReference": "ORDER-12345",
"receiptNumber": "RN000001"
}
}
Payload Fields
Field | Type | Description |
id | string (UUID) | Unique event identifier. Use this for idempotency. |
type | string | Event category: approved or declined |
created | string (ISO 8601) | Timestamp of the event |
merchantId | string | Your TNS merchant identifier. Note - this will be different to your Acquirers Bank Merchant ID. |
data.transactionId | string (UUID) | The transaction identifier |
data.action | string | Transaction action: SALE, AUTHORIZATION, CAPTURE, LINKED_REFUND, VOID |
data.status | string | Transaction status: APPROVED, HOST_DECLINED, INVALID, SUSPECT |
data.isApproved | boolean | Whether the transaction was approved. TRUE,FALSE |
data.amount | integer | Amount in minor currency units (e.g. 1500 = $15.00) |
data.currency | string | ISO 4217 currency code (e.g. EUR, USD, GBP) |
data.cardType | string | Card scheme: VISA, MASTERCARD, AMEX, etc. |
data.firstSix | string | First 6 digits of the card number |
data.lastFour | string | Last 4 digits of the card number |
data.responseCode | string | TNS platform response code |
data.responseText | string | Human-readable response description |
data.authCode | string | Authorisation code (present when approved) |
data.originalTransactionId | string | Original transaction reference (for subsequent transactions such as refunds, voids, captures) |
data.clientReference | string | Your merchant-supplied reference |
data.receiptNumber | string | TNS receipt number |
On this page
- Webhook Format