---
title: "Exchange"
method: POST
path: "/api/v1/sms/exchange"
tags: ["sms"]
---

# Exchange

`POST /api/v1/sms/exchange`

## Request

- Base URL: `https://api.food24.kz` (the document declares no server; this is the origin it was published from)
- URL: `https://api.food24.kz/api/v1/sms/exchange`
- Auth: OAuth 2
  - Password
  - Token URL: `/api/v1/auth/login`
- TypeScript: <https://skmtc.dev/food24/apis/goodfood/docs/api/v1/sms/exchange/post.ts> (a function with typed inputs; its response is checked against the schema)

Меняет вечный токен старой схемы на пару access/refresh.

Нужен на время перехода: у клиентов, которые авторизовались до релиза,
в localStorage лежит токен со сроком жизни 100 лет и без возможности отзыва.

## Response `200`

Successful Response

- CustomerSession: Ответ на вход, обновление и обмен токена. Refresh уходит отдельно, в cookie.
  - `ok` boolean
  - `token` string, required
  - `phone` string, required
  - `name` string, nullable
  - `customer_id` integer, nullable
  - `expires_in` integer, required
  - `is_blocked` boolean

---

[API](https://skmtc.dev/food24/apis/goodfood.md) - [All operations](https://skmtc.dev/food24/apis/goodfood/llms.txt) - [OpenAPI document](https://skmtc.dev/food24/apis/goodfood/revisions/f75c731597d3?raw)
