Legacy webhook body examples

Every webhook will include a body with the following keys:

  • eventType: (string) The event that triggered the webhook. See the Event type table for a full list of possible values
  • data: (object) Information about the event

This section contains examples of the data object returned in the body of a webhook response.

Transaction events

The data object will be shaped the same for any transaction event. To see full examples of the values contained in the data object, see the example 200 response in the Run card transaction endpoint.

Transaction Event Example Body
{
    "eventType": "TRANSACTION_CAPTURED",
    "data": {
        "id": "2eruYW1lIjoidXNhZXBheSIZYXABCiOiIxMDAwMzkiLCJyZWZOdW1iZXIiOiZYXABCcmFuZG9tIjowLCJjdXJyZW5jeSI6InVzZCJ9",
        "shouldUpdateCard": true,
        "merchantId": "100039",
        "transactionDate": "2019-12-23T20:50:23.060Z",
        "authCode": "458399",
        "transactionStatus": "pending",
        "amount": 1.15,
        "transactionType": "sale",
        "currency": "USD",
        "gatewayResponse": {...},
        "data": {
            "amount": 1.15,
            "currency": "USD",
            "settlementCurrency": "USD",
            "customFields": {...},
            "customer": {...},
            "cart": {...},
            "lodging": {...}
        },
        "card": {...},
        "kountResponse": {...},
        "token": {...}
    }
}

Card events

Account closed

Account Closed Example Body
{
  "eventType": "ACCOUNT_UPDATER_ACCOUNT_CLOSED",
  "data": {
    "updateCode": "203",
    "reportDate": "2021-09-09T16:44:41.000Z",
    "merchantId": "101039",
    "originalCard": {
      "lastFour": "2223",
      "firstSix": "400060"
    },
    "tokenex": {
      "lastFour": "2223",
      "token": "192b8c0f-ef3a-4e13-8465-2b41971db046",
      "firstSix": "400060"
    },
    "card": {
      "expirationYear": "02",
      "expirationMonth": "02"
    },
    "cardNumber": "400060******2223",
    "updateType": 30
  }
}

Card updated

To see full examples of the values contained in the data object, see the example 200 response in the Save card token endpoint.

The following example shows that the expiration date has been updated.

Card Saved Example 1 Body
{
  "eventType": "CARD_DATA_UPDATED",
  "data": {
    "updateCode": "201",
    "reportDate": "2021-09-09T16:12:32.000Z",
    "merchantId": "101039",
    "originalCard": {
      "lastFour": "2222",
      "firstSix": "400020"
    },
    "tokenex": {
      "lastFour": "2222",
      "token": "ac719225-cb55-4605-a673-8f0ccb822c4c",
      "firstSix": "400020"
    },
    "card": {
      "expirationYear": "2033",
      "expirationMonth": "02"
    },
    "cardNumber": "400020******2222",
    "updateType": 20
    }
  }
}

The following example shows that both the expiration date and the card number have been updated.

Card Saved Example 2 Body
{
  "eventType": "CARD_DATA_UPDATED",
  "data": {
    "updateCode": "202",
    "reportDate": "2021-09-09T16:44:41.000Z",
    "merchantId": "101039",
    "originalCard": {
      "lastFour": "2224",
      "firstSix": "400010"
    },
    "tokenex": {
      "lastFour": "2229",
      "token": "7f657119-a7e6-47cb-a0b5-153db253512a",
      "firstSix": "400010"
    },
    "card": {
      "expirationYear": "2033",
      "expirationMonth": "02"
    },
    "cardNumber": "400010******2229",
    "updateType": 10
  }
}

Card saved

To see full examples of the values contained in the data object, see the example 200 response in the Save card token endpoint.

Card Saved Example Body
{
  "eventType": "CARD_SAVED",
  "data": {
    "data": {
      "customer": {...}
    },
    "merchantId": "101040",
    "shouldUpdateCard": true,
    "cardType": "masterCard",
    "kountResponse": {...},
    "card": {
      "expirationYear": "2021",
      "cardType": "masterCard",
      "expirationMonth": "10",
      "cardHolderName": "Jane Doe"
    },
    "token": {
      "lastFour": "5100",
      "cardType": "masterCard",
      "firstSix": "510510",
      "token": "b01bfaee-31b2-4222-8d89-24d1a42fd50e"
    }
  }
}

Contact cardholder

Contact Cardholder Example Body
{
  "eventType": "ACCOUNT_UPDATER_CONTACT_CARDHOLDER",
  "data": {
    "updateCode": "204",
    "reportDate": "2021-09-09T16:46:41.000Z",
    "merchantId": "101039",
    "originalCard": {
      "lastFour": "2221",
      "firstSix": "400070"
    },
    "tokenex": {
      "lastFour": "2221",
      "token": "269c3057-4f7d-47a2-80cd-3196f803631e",
      "firstSix": "400070"
    },
    "card": {
      "expirationYear": "02",
      "expirationMonth": "02"
    },
    "cardNumber": "400070******2221",
    "updateType": 40
  }
}

Echeck events

Echeck saved

To see full examples of the values contained in the data object, see the example 200 response in the Save echeck token reference section.

Echeck Saved Example Body
{
  "eventType": "ECHECK_SAVED",
  "data": {
    "data": {
      "key": "871446789.5292712865664733",
      "merchantId": "100039",
      "data": {
        "customer": {...},
        "customFields": {...}
      },
      "tokenex": {
        "success": true,
        "error": null,
        "token": "871446789",
        "sesssionID": "fca21ef9067d4f009e58e302dbc115a4",
        "customerRefNumber": "b210bad6-a013-4e91-b5bf-0",
        "characterCount": 9,
        "lastFour": "6789"
      },
      "dateCreated": "2019-12-30T18:06:15.188Z",
      "dateLastModified": "2019-12-30T18:06:15.193Z",
      "bank": {
        "accountHolderName": "Todd Smitherton",
        "routingNumber": "123456789"
      }
    }
  }
}

Payout events

After configuring legacy webhooks for payouts, a webhook will be sent every time one of the following happens:

  • A payout gets submitted (Note: This means that you will receive multiple webhooks when submitting a batch payout)
  • A payout status changes
  • A transfer status changes

For example, after the recipient accepts the payout, the data.transferStatus changes to 20.

For more information about the parameters returned in the data object, see the specific Response parameters in the View a payout or View payouts endpoint.

📘

Note

For payouts, the body of the webhook contains most of the possible parameters for a payout. To view the values for all the available parameters, use the View a payout or View payouts endpoint.

Payout Example Body
{
  "eventType": "PAYOUT",
  "data": {
    "id": 2440195,
    "payoutStatus": "pendingRecipientAction",
    "transferStatus": "available",
    "recipientRef": "testRecipient",
    "providerRecipientRef": "testRecipient",
    "batchRef": "batch-2022-12-12T22:04:25.568Z",
    "amount": 22.25,
    "currency": "USD",
    "description": "Payout for company",
    "payoutDate": "2022-12-12T22:04:53.000Z",
    "payoutRef": "46237c84-4159-462e-9765-ef378b27f036",
    "payoutProviderRef": "46237c84-4159-462e-9765-ef378b27f036",
    "payoutProviderAdditionalRef": "NEBS07ZPPY4MY16P9",
    "email": "[email protected]",
    "firstName": "John",
    "lastName": "Doe",
    "phoneNumber": null,
    "mobileNumber": null,
    "addressLine1": null,
    "addressLine2": null,
    "city": null,
    "region": null,
    "postalCode": null,
    "country": "US",
    "countryOfBirth": null,
    "countryOfNationality": null,
    "providerResponse": "TransactionStatusType_Pending",
    "recipientId": 1223456,
    "providerId": 12608,
    "payoutAccountId": 1234,
    "providerType": "payquicker",
    "createdAt": "2022-12-12T22:04:53.000Z",
    "updatedAt": "2022-12-12T22:04:53.000Z",
    "payoutId": 2440195
  }
}

Spendback events

After configuring legacy webhooks for spendbacks, a webhook will be sent every time one of the following happens:

For example, after the recipient's payout account has been debited, the data.spendbackStatus changes to completed.

For more information about the parameters returned in the data object, see the specific Response parameters in the View a payout or View payouts endpoint.

📘

Note

For payouts, the body of the webhook contains most of the possible parameters for a payout. To view the values for all the available parameters, use the View a spendback or View spendbacks endpoint.

Spendback Example Body
{
  "eventType": "SPENDBACK",
  "data": {
    "id": 5,
    "spendbackStatus": "completed",
    "spendbackRef": "18214ebf-6be5-4e34-8deb-3170f3ded4f8",
    "providerSpendbackRef": "spnd_bk_343e4d77-7fea-11ed-9f8b-02450efa1c35",
    "amount": 15,
    "currency": "USD",
    "description": null,
    "spendbackDate": "2022-12-19T22:12:19.000Z",
    "providerResponse": null,
    "recipientRef": "[email protected]",
    "recipientId": 138128,
    "providerId": 12685,
    "payoutAccountId": 3927,
    "providerType": "masspay",
    "spendbackType": 10,
    "createdAt": "2022-12-19T22:12:19.000Z",
    "updatedAt": "2022-12-19T22:12:19.000Z",
    "spendbackId": 5
  }
}

Subscription events

After being configured, webhooks will be sent every time a recurring payment is run through the subscription service.

You will also receive webhooks for all transaction events that have previously been configured.

To see full examples of the values contained in the data.paymentResult object, see the example 200 response in the Run card transaction or Run echeck transaction endpoint.

The payment object contains the values provided when the subscription was created.

Subscription Example Body
{
  "eventType": "SUBSCRIPTION_DETAILS",
  "data": {
    "dateCreated": "2020-09-21T17:27:46.836Z",
    "accountId": "6862a4dc-490e-4eec-9a23-a3fec25979b6",
    "customerRef": "metest2",
    "paymentResult": {
      "id": "eyJuYW1lIjoidXNhZXBheSIsIm1lcmNoYW50SWQiOiIxMDEwMzkiLCJyZWZOdW1iZXIiOiIzMTEzMjc5MDI0IiwicmFuZG9tIjowLCJjdXJyZW5jeSI6InVzZCJ9",
      "merchantId": "101039",
      "transactionDate": "2020-09-21T17:31:49.680Z",
      "authCode": "026252",
      "transactionStatus": "pending",
      "amount": 10,
      "transactionType": "sale",
      "currency": "USD",
      "gatewayResponse": {...},
      "data": {
        "amount": 10,
        "currency": "USD",
        "settlementCurrency": "USD",
        "customer": {...},
        "cart": {...}
      },
      "card": {...},
      "kountResponse": {...},
      "token": {...}
    },
    "dateLastModified": "2020-09-21T17:32:11.016Z",
    "userName": "[email protected]",
    "dateNextRun": "2020-10-21",
    "active": true,
    "schedule": {
      "duration": 5,
      "dateInitialBillingEnd": "2020-09-21",
      "initialBillingAmount": null,
      "balance": 30,
      "scheduleType": 20,
      "intervalCount": 1,
      "initialBalance": 50,
      "interval": "month"
    },
    "lastPaymentStatus": "success",
    "dateLastRun": "2020-09-21T17:31:28.699Z",
    "payment": {
      "data": {
        "amount": 10,
        "currency": "USD",
        "cart": {...},
        "customer": {...}
      },
      "tokenex": {...},
      "isProcessedFromServer": true,
      "clientIp": "10.0.0.1"
    },
    "id": "cdd9d4b2-bf86-445b-8b54-59861a9ad3ae",
    "accessRights": {
      "merchantIds": {
        "101039": "A"
      }
    }
  }
}