With the help of this API, Travelpayouts partners can receive information about their balance and payouts.
Travelpayouts partners can also access statistics for all affiliate programs without logging in to their personal accounts.
With this API, partners can receive:
- Their current balance and actions that influence it
- Their payment history of affiliate rewards
- Detailed information on their actions
Pay attention, as these API methods have limits, which are described in the API rate limits post.
Data access
To return data upon request, an API token is required. It is available after registering on the Travelpayouts platform and connecting to the Aviasales or Hotelook program. You can find the API token on the Tools tab in the API section.
Current account balance
Request:
curl --request GET \
--url 'https://api.travelpayouts.com/finance/v2/get_user_balance' \
--header 'X-Access-Token: <TOKEN>'
Response:
{
"balance": {
"usd": "1794.34",
"eur": "1524.08",
"rub": "134661.93"
}
}
Actions that influence the user balance
Request:
curl --request GET \
--url 'https://api.travelpayouts.com/finance/v2/get_user_actions_affecting_balance?currency=usd&limit=3' \
--header 'X-Access-Token: <TOKEN>'
Request Parameters:
- currency — currency, possible options — [rub, usd, eur], by default — rub
- action_id — restriction by action ID, for example — 100:012345678
- action_state — restriction by action status, possible options — [paid, processing, cancelled]
- campaign_id — restriction by affiliate program ID, for example — 100
- from, until — restriction by action creation date (the created_at field), for example — 2020-01-01
- offset, limit — pagination, maximal limit — 300
Response:
{
"actions": [
{
"action_id": "100:14358982146",
"campaign_id": 100,
"action_state": "paid",
"price": "60.83",
"profit": "1.52",
"description": "Cape Girardeau (US), 2022-01-20 – 2022-01-21, Agoda",
"booked_at": "2021-05-12 06:26:54",
"updated_at": "2021-05-12 06:30:58"
}
],
"total_price": "45364.93",
"total_profit": "1794.34",
"available_campaigns": [
0,
75,
100,
101,
157
],
"count": 289
}
Payout amount for the user
Request:
curl --request GET \
--url 'https://api.travelpayouts.com/finance/v2/get_user_next_payout' \
--header 'X-Access-Token: <TOKEN>'
Response:
{
"next_payout": {
"usd": "2322.25",
"eur": "2124.65",
"rub": "192022.6"
}
}
List of user payouts
Request:
curl --request GET \
--url 'https://api.travelpayouts.com/finance/v2/get_user_payments' \
--header 'X-Access-Token: <TOKEN>'
Response:
[
{
"paid_at": "2021-04-20 13:34:42",
"payment_uuid": "4af0c247-df4c-4873-a6b6-7bbf91afa3b9",
"amount": "29.82",
"currency": "usd",
"payment_info_id": 92798,
"comment": "test"
}
]
List of actions for a specific payout of the user
Request:
curl --request GET \
--url 'https://api.travelpayouts.com/finance/v2/get_user_actions_affecting_payment?payment_uuid=<UUID>&limit=3' \
--header 'X-Access-Token: <TOKEN>'
Request Parameters:
- payment_uuid — payout ID, for example — 4af0c247-df4c-4873-a6b6-7bbf91afa3b9
- offset, limit — pagination; maximal limit — 300
Response:
{
"actions": [
{
"campaign_id": 100,
"action_id": "100:10080977893",
"finished_amount": "0.01",
"booked_at": "2020-02-25 11:05:21"
}
],
"currency": "usd",
"count": 396
}
Detailing by specific action
Request:
curl --request GET \
--url 'https://api.travelpayouts.com/finance/v2/get_action_details?action_id=<ACTION_ID>¤cy=usd' \
--header 'X-Access-Token: <TOKEN>'
Request Parameters:
- action_id — action ID, for example — 100:012345678
- currency — currency, possible options — [rub, usd, eur], by default rub
Response:
{
"action_id": "100:14195346240",
"campaign_id": 100,
"action_state": "paid",
"sub_id": ".mobile_app_1eddc55e58ba904651d31ad2f1473e80",
"price": "397.9",
"profit": "21.09",
"history": [
{
"action_state": "paid",
"price": "397.9",
"profit": "21.09",
"profit_diff": "0",
"updated_at": "2021-04-28 08:33:46"
}
],
"metadata": [
{
"name": "user_country",
"value": "Bahrain"
},
{
"name": "user_city",
"value": "Manama"
},
{
"name": "user_device_type",
"value": "Desktop"
},
{
"name": "user_os",
"value": "Unknown"
},
{
"name": "user_browser",
"value": "Unknown"
},
{
"name": "referrer_domain",
"value": "iphone.wl.aviasales.ru"
},
{
"name": "is_mobile_app",
"value": "Yes"
},
{
"name": "direction",
"value": "Dubai (DXB) – Tashkent (TAS)"
},
{
"name": "count",
"value": "3"
},
{
"name": "depart_date",
"value": "2021-05-05"
},
{
"name": "gate",
"value": "Uzairways.online"
},
{
"name": "trip_class",
"value": "Economy"
},
{
"name": "airline",
"value": "HY - Uzbekistan Airways"
},
{
"name": "flights",
"value": "HY 334"
}
],
"booked_at": "2021-04-28 08:13:47"
}
Note: The object metadata doesn’t have any fixed range of fields and can be specific for each program. Meanwhile, it always has an array of objects name/value, in which value is a string.