This documentation outlines the integration process for receiving and handling payout information through our Webhook and Payout Download API. The process is designed to provide detailed payout information, including transaction-level data, to our users whether merchants or platforms.
Flow Overview
Payout Webhook: Initiated for each payout, this webhook sends a summary of payout-related information.
Payout Download API: After receiving a payout ID from the webhook, this API is used to download detailed payout files, including transaction-level data.
Payout Webhook Specification
Payout Webhook structure
The webhook response includes the following objects:
- payoutId :Unique identifier for the payout.
- payoutStatus : Shows status of the payout (PENDING, INITIATED, FAILED, PAID_OUT).
- payoutDate :Date when the payout was processed.
- payoutAmount: Total amount of the payout.
- payoutCurrency: Currency of the payout amount.
- merchantId: Unique identifier for the merchant.
- wallet : Which will include walletId, legacy_id, walletCountry, wallet Bank (bankId, bankCountry, bankName, swift and beneficiary information (beneficiaryName and beneficiaryIBAN).
Response Example
{
"id": "payout_33271023375023",
"status": "PAID_OUT",
"date": 1698589980000,
"amount": 8.16,
"currency": "SAR",
"merchant_id": "26374580",
"wallet": {
"id": "26374580",
"legacy_id": "26374580",
"country": "SA",
"bank": {
"id": "55",
"country": "SA",
"name": "RAJHI",
"swift": "RJHISARI",
"beneficiary": {
"name": "Nowaf Naif D Almarkhan",
"iban": "XXXXX8715"
}
}
}
}
Webhook Endpoint
User needs to provide an endpoint to receive webhook notifications. This endpoint should be capable of handling HTTPS POST responses with a JSON payload.
Also there is an alternative approach to filtering the payout report according to specific dates. Instead of manually sorting through the report, you can utilize our "List All Payouts" endpoint, which provides the functionality to filter the report based on specific dates. By utilizing this endpoint, you will be able to streamline the process and efficiently extract the desired data without the need for manual filtering.
List all payout endpoint
Request Example
curl --request POST \
--url https://api.tap.company/v2/payouts/list \
--header 'authorization: Bearer sk_test_UCSe**********zyh8' \
--header 'content-type: application/json' \
--data '{
"period": {
"date": {
"from": 1701523751000,
"to": 1704202151000
}
}
}'
Response Example
{
"object": "list",
"live_mode": false,
"api_version": "V2",
"count": 7,
"has_more": false,
"payouts": [
{
"id": "payout_1234567234567876",
"status": "PAID_OUT",
"date": 1690848301000,
"amount": 7351.874,
"currency": "KWD",
"merchant_id": "20860903",
"wallet": {
"id": "wallet_34567876",
"legacy_id": "34567876",
"country": "KW",
"bank": {
"id": "10",
"country": "KW",
"name": "KFH",
"swift": "KFHOKWKW",
"beneficiary": {
"name": "TEST",
"iban": "XXXXX6275"
}
}
},
"settlements_available": true
},
{
"id": "payout_1234567234567877",
"status": "PAID_OUT",
"date": 1691107501000,
"amount": 10233.934,
"currency": "KWD",
"merchant_id": "20860903",
"wallet": {
"id": "wallet_34567877",
"legacy_id": "34567877",
"country": "KW",
"bank": {
"id": "10",
"country": "KW",
"name": "KFH",
"swift": "KFHOKWKW",
"beneficiary": {
"name": "TEST",
"iban": "XXXXX6275"
}
}
},
"settlements_available": true
},
{
"id": "payout_1234567234567879",
"status": "PAID_OUT",
"date": 1691193901000,
"amount": 7197.136,
"currency": "KWD",
"merchant_id": "20860903",
"wallet": {
"id": "wallet_34567879",
"legacy_id": "34567879",
"country": "KW",
"bank": {
"id": "10",
"country": "KW",
"name": "KFH",
"swift": "KFHOKWKW",
"beneficiary": {
"name": "TEST",
"iban": "XXXXX6275"
}
}
},
"settlements_available": true
},
{
"id": "payout_1234567234567878",
"status": "PAID_OUT",
"date": 1691625901000,
"amount": 7300.088,
"currency": "KWD",
"merchant_id": "20860903",
"wallet": {
"id": "wallet_34567878",
"legacy_id": "34567878",
"country": "KW",
"bank": {
"id": "10",
"country": "KW",
"name": "KFH",
"swift": "KFHOKWKW",
"beneficiary": {
"name": "TEST",
"iban": "XXXXX6275"
}
}
},
"settlements_available": false,
"settlements_description": ""
},
{
"id": "payout_1234567234567871",
"status": "PAID_OUT",
"date": 1691798701000,
"amount": 15767.762,
"currency": "KWD",
"merchant_id": "20860903",
"wallet": {
"id": "wallet_34567871",
"legacy_id": "34567871",
"country": "KW",
"bank": {
"id": "10",
"country": "KW",
"name": "KFH",
"swift": "KFHOKWKW",
"beneficiary": {
"name": "TEST",
"iban": "XXXXX6275"
}
}
},
"settlements_available": true
},
{
"id": "payout_1234567234567872",
"status": "PAID_OUT",
"date": 1691885101000,
"amount": 7917.486,
"currency": "KWD",
"merchant_id": "20860903",
"wallet": {
"id": "wallet_34567872",
"legacy_id": "34567872",
"country": "KW",
"bank": {
"id": "10",
"country": "KW",
"name": "KFH",
"swift": "KFHOKWKW",
"beneficiary": {
"name": "TEST",
"iban": "XXXXX6275"
}
}
},
"settlements_available": true
},
{
"id": "payout_1234567234567873",
"status": "PAID_OUT",
"date": 1692057901000,
"amount": 11190.685,
"currency": "KWD",
"merchant_id": "20860903",
"wallet": {
"id": "wallet_34567873",
"legacy_id": "34567873",
"country": "KW",
"bank": {
"id": "10",
"country": "KW",
"name": "KFH",
"swift": "KFHOKWKW",
"beneficiary": {
"name": "TEST",
"iban": "XXXXX6275"
}
}
},
"settlements_available": true
}
]
}
Security
Webhook responses will include a signature header for verification. Please ensure your endpoint validates this signature before processing the endpoint.
Payout Download API
The below describes the Payout Download API request and response. Again, note that in the request, you will be passing the Payout ID that you will get from the Payout Webhook:
Request
curl --location 'https://api.tap.company/v2/payouts/download' \
--header 'Authorization: Bearer sk_live_jKA******************8Mn' \
--header 'Content-Type: application/json' \
--data '{
"payouts": {
"payout_id": [
"payout_33235465657023"
]
}
}'
The payout request includes the following object:
payoutId: The unique identifier for the payout (obtained from the webhook).
Response
After executing the provided cURL command, you will receive a response in a file format. It is important that you save this file as it will be in the format of a zip file. Inside the zip file, you will find the payout information and sheets.
PK Re�W���9 � &