Перейти к содержимому

Загрузить историю покупок

POST
/ex/client.purchases.history
curl --request POST \
--url https://api.tride.ru/ex/client.purchases.history \
--header 'Content-Type: application/json' \
--data '{ "key": "<ключ клуба>", "client_id": 1001 }'

Прошлые покупки клиента (архив страницы «Покупки»): статусы expired и cancelled, новые первыми. Отправьте ключ внешней системы клуба в поле key на своём сервере. Порядок подключения.

Media typeapplication/json
object
key
required

Отправьте ключ внешней системы клуба в поле key на своём сервере.

string
client_id

Идентификатор клиента TRIDE (client_id из client.info / check.auth)

integer
phone

Телефон клиента в любом написании (+7 999 …, 8999…, 7999…); ищется основной номер и дополнительные

string
external_client_id

Идентификатор клиента во внешней системе клуба (как в client.register), в любом клубе сети ключа

string
club_id

Филиал сети: для ключа клуба — необязателен (клуб той же сети); для ключа группы — сужает ответ до филиала, без него область — вся сеть

string
scope

Network (по умолчанию) — вся сеть клуба, club — только филиал (club_id или клуб ключа)

string
locale

Язык подписей: ru (по умолчанию), en, fr

string
image_size

Размер картинок в url: sm, md (по умолчанию), lg

string
limit

1..200, по умолчанию 50

integer
offset

Смещение, по умолчанию 0

integer

Example

{
"key": "<ключ клуба>",
"client_id": 1001
}

При ошибке сервер возвращает поле error.

Media typeapplication/json
Any of:
object
result
boolean
club

Клуб настроек ответа (явный club_id, клуб ключа или клуб клиента в сети)

object
id
string | null
name
string | null
group

Сеть клубов или null

object
id
string | null
name
string | null
scope

Network | club — область ответа

string | null
client_id

Идентификатор клиента TRIDE

integer | null
total
integer | null
limit
integer | null
offset
integer | null
items
Array<object>
object
id

Идентификатор покупки (экземпляра абонемента или пакета)

string | null
name
string | null
kind

Membership — абонемент (безлимит на срок), package — пакет тренировок или минут

string | null
product_type

Unlimited | limited_visits | class_pack | limited_time

string | null
product_id

Продукт магазина (public.shop.product.get)

string | null
status

Active | frozen | pending_activation | expired | cancelled

string | null
payment_type

Single — разовая, recurrent — подписка

string | null
is_subscription
boolean
club

Клуб покупки

object
id
string | null
name
string | null
visits

Тренировки пакета или null

object
total
integer | null
left
integer | null
minutes

Минуты пакета или null

object
total
integer | null
left
integer | null
days

Срок в днях или null

object
total
integer | null
left

Осталось дней (у ожидающих активации — null)

integer | null
purchased_at

Дата покупки ISO 8601 со смещением клуба

string | null
purchased_ts

Дата покупки, unix-секунды

integer | null
starts_at

Начало срока, гггг-мм-дд

string | null
activated_at

Когда активирована, ISO 8601

string | null
activate_until

Активировать до, гггг-мм-дд (ожидающие активации)

string | null
expires_at

Действует до, гггг-мм-дд (у ожидающих активации — null)

string | null
price

Цена покупки, строка с двумя знаками, или null

string | null
currency
string | null
frozen
object
is_frozen
boolean
until

Гггг-мм-дд или null

string | null
autopay

Автопродление подписки или null (у архивных — всегда null)

object
enabled
boolean
managed_by

Tride — продлевает TRIDE, external — внешняя CRM

string | null
method

{brand, last4} сохранённой карты или null

object | null
next_payment_ts
integer | null
amount
string | null
clubs

Где действует: тип доступа сети и список клубов (пустой — вся сеть)

object
type

Single_club | network | global | selected

string | null
home_club_id
string | null
allowed
Array<object>
object
id
string | null
name
string | null
sponsor

Компания или семья, оплатившая покупку, или null

object | null
external

{id, system: psport | onec} у зеркал внешних CRM, иначе null

object | null

Example generated

{
"result": true,
"club": {
"id": "example",
"name": "example"
},
"group": {
"id": "example",
"name": "example"
},
"scope": "example",
"client_id": 1,
"total": 1,
"limit": 1,
"offset": 1,
"items": [
{
"id": "example",
"name": "example",
"kind": "example",
"product_type": "example",
"product_id": "example",
"status": "example",
"payment_type": "example",
"is_subscription": true,
"club": {
"id": "example",
"name": "example"
},
"visits": {
"total": 1,
"left": 1
},
"minutes": {
"total": 1,
"left": 1
},
"days": {
"total": 1,
"left": 1
},
"purchased_at": "example",
"purchased_ts": 1,
"starts_at": "example",
"activated_at": "example",
"activate_until": "example",
"expires_at": "example",
"price": "example",
"currency": "example",
"frozen": {
"is_frozen": true,
"until": "example"
},
"autopay": {
"enabled": true,
"managed_by": "example",
"method": "example",
"next_payment_ts": 1,
"amount": "example"
},
"clubs": {
"type": "example",
"home_club_id": "example",
"allowed": [
{
"id": "example",
"name": "example"
}
]
},
"sponsor": "example",
"external": "example"
}
]
}

Ограничение частоты запросов. Повторите после указанной задержки.

Media typeapplication/json
object
error
required

Код или текст ошибки.

string
field

Параметр запроса, если сервер указал его.

string
retry_after

Задержка до следующей попытки в секундах.

integer

Example

{
"error": "rate_limited",
"retry_after": 15
}
Retry-After
integer