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

Пересчитать состав корзины

POST
/club/goods.cart.preview
curl --request POST \
--url https://api.tride.ru/club/goods.cart.preview \
--header 'Content-Type: application/json' \
--data '{ "access_token": "<токен клиента>", "club_id": "000000000000000000000001", "items": [ { "product_id": "000000000000000000000002", "quantity": 1 } ] }'

Вызывайте от имени вошедшего клиента: в JSON нужен access_token его клиентской сессии. Порядок подключения.

Media typeapplication/json
object
access_token
required

Токен вошедшего клиента.

string
account_context

Выбранная компания или семья: account_id, self_pay

object
club_id
required

Клуб витрины

string
items
required

Корзина: [{product_id, variant_id, quantity}], не больше 30 строк

Array<object>
object
promo_code

Промокод (необязательно)

string

Example

{
"access_token": "<токен клиента>",
"club_id": "000000000000000000000001",
"items": [
{
"product_id": "000000000000000000000002",
"quantity": 1
}
]
}

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

Media typeapplication/json
Any of:
object
lines

Строки: product_id, variant_id, quantity, unit_price, price_kind, total, name, variant_value, fileid

Array<object>
object
removed

Убранные строки: product_id, variant_id, reason (out_of_stock|locked|hidden|not_purchasable|variant_required|quantity_reduced), quantity_max

Array<object>
object
subtotal

Сумма строк

string | null
promo

Промокод: valid, code, discount_amount, reason_code

object | null
total

Итого к оплате

string | null

Example generated

{
"lines": [
{}
],
"removed": [
{}
],
"subtotal": "example",
"promo": "example",
"total": "example"
}