# createCart

Source: <https://telegafirst.com/docs/api-op-createcart>
Locale: ru
releaseGitSha: ea133cd4ad87fe549ef000b139be145be9bd1717
sourceContentDigest: 0b2ea29ae09fa9d0be5bddeedf298580364e555115749c09499b3e35fbe446f2
Version: 2

# createCart

`POST /api/v1/carts`

createCart

## Авторизация и права

Scopes: ALL. Auth alternatives: OR; scopes внутри альтернативы: ALL.

| Поле | Значение |
| - | - |
| security.0.hubApiKey | \[] |
| security.1.hubBearer | \[] |
| securitySchemes.hubApiKey.in | "header" |
| securitySchemes.hubApiKey.name | "X-Api-Key" |
| securitySchemes.hubApiKey.type | "apiKey" |
| securitySchemes.hubBearer.scheme | "bearer" |
| securitySchemes.hubBearer.type | "http" |
| x-required-scopes | \["orders"] |

## Параметры запроса

| Поле | Значение |
| - | - |
| 0.in | "header" |
| 0.name | "Idempotency-Key" |
| 0.required | true |
| 0.schema | [0.schema](https://telegafirst.com/docs/schema-9ac136edb99a2063b3091602181c8d2022fdccb5b514991319d58544c2e57e95) |

## Тело запроса

| Поле | Значение |
| - | - |
| Тело запроса | null |

## Ответы

| Поле | Значение |
| - | - |
| 201.content.application/json.schema | [CreateCartResponse](https://telegafirst.com/docs/schema-0803da5ac2d0147a1c0f885e2f4def1c2ff7a95cd706663da66009df36339e9d) |
| 201.description | "Cart and its UniversalLink row were committed atomically" |
| 201.headers.ETag.description | "Strong Cart composition validator" |
| 201.headers.ETag.required | true |
| 201.headers.ETag.schema | [201.headers.ETag.schema](https://telegafirst.com/docs/schema-c368c9e6d62cd43841854a0c6b6f706bca622d6fb3feae05cb9569025bbfe2d8) |

## Ошибки

| Поле | Значение |
| - | - |
| 400.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 400.description | "Idempotency-Key is absent, blank, or malformed" |
| 400.x-error-codes | \["IDEMPOTENCY\_KEY\_REQUIRED"] |
| 401.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 401.description | "Missing, invalid, revoked, or expired Hub credential" |
| 401.x-error-codes | \["INVALID\_API\_KEY","INVALID\_JWT"] |
| 403.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 403.description | "The authenticated credential lacks the required Cart operation scope" |
| 403.x-error-codes | \["INSUFFICIENT\_SCOPE"] |
| 409.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 409.description | "Cart idempotency request hash differs from the original request" |
| 409.x-error-codes | \["CART\_INACTIVE","IDEMPOTENCY\_KEY\_MISMATCH"] |
| 422.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 422.description | "Cart creation input is not processable" |

## Дополнительные условия

| Поле | Значение |
| - | - |
| operationId | "createCart" |
| tags | \["Carts"] |
| x-idempotency | "none" |
| x-idempotency-boundary.implementation | "cart-local-durable-receipt" |
| x-idempotency-boundary.rationale | "Cart owns the transaction-atomic replay result; the global 24-hour interceptor must not shadow its receipt or change its conflict semantics." |
| x-idempotency-boundary.skip\_global\_interceptor | true |
