---
title: "POST /deals"
method: POST
path: "/deals"
tags: ["Сделки"]
---

# POST /deals

`POST /deals`

Создание сделки

## Headers

- `Idempotence-Key` string, required

## Request body

- SafeDealRequest
  - `type` 'safe_deal', required
  - `fee_moment` 'payment_succeeded' | 'deal_closed', required
  - `metadata` Metadata — Любые дополнительные данные, которые нужны вам для работы (например, номер заказа). Передаются в виде набора пар «ключ-значение» и возвращаются в ответе от ЮKassa. Ограничения: максимум 16 ключей, имя ключа не больше 32 символов, значение ключа не больше 512 символов, тип данных — строка в формате UTF-8.
  - `description` string

## Response `200`

The request has succeeded.

- SafeDeal
  - `type` 'safe_deal', required

## Other responses

- `400` — The server could not understand the request due to invalid syntax.
- `401` — Access is unauthorized.
- `403` — Access is forbidden.
- `429` — Client error
- `500` — Server error

## Changes

- **2026-02-14** `fe24d3dfadad` — 10 breaking, 1 warning, 27 info
  - added `#/components/schemas/DealType` to the `type` request property `allOf` list
  - added `#/components/schemas/FeeMoment` to the `fee_moment` request property `allOf` list
  - the request property `metadata/additionalProperties/` became not nullable
  - removed the enum value `deal_closed` of the request property `fee_moment`
  - …34 more

[Change history](https://skmtc.dev/hexlet/apis/api-kassa/changes/deals/post.md)

---

[API](https://skmtc.dev/hexlet/apis/api-kassa.md) · [All operations](https://skmtc.dev/hexlet/apis/api-kassa/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hexlet/api-kassa/revisions/f35dc69c1c37/schema)
