# checkoutCart

Source: <https://telegafirst.com/docs/api-op-checkoutcart>
Locale: ru
releaseGitSha: ea133cd4ad87fe549ef000b139be145be9bd1717
sourceContentDigest: 25fc421d18ad0cebf304629acd36d5d4ed7ccf0272909ba2d4c5c052802e84f1
Version: 2

# checkoutCart

`POST /api/v1/carts/{code}/checkout`

checkoutCart

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

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:write"] |

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

| Поле | Значение |
| - | - |
| 0.in | "path" |
| 0.name | "code" |
| 0.required | true |
| 0.schema | [0.schema](https://telegafirst.com/docs/schema-46feeaff5156934ff5aa18bda9501891f2b15e520703af2ac60c0fa351d0127d) |
| 1.in | "header" |
| 1.name | "If-Match" |
| 1.required | true |
| 1.schema | [1.schema](https://telegafirst.com/docs/schema-c368c9e6d62cd43841854a0c6b6f706bca622d6fb3feae05cb9569025bbfe2d8) |
| 2.in | "header" |
| 2.name | "Idempotency-Key" |
| 2.required | true |
| 2.schema | [2.schema](https://telegafirst.com/docs/schema-9ac136edb99a2063b3091602181c8d2022fdccb5b514991319d58544c2e57e95) |

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

| Поле | Значение |
| - | - |
| content.application/json.schema | [CheckoutCartRequest](https://telegafirst.com/docs/schema-425aeafccb18c99f22f6411b2fb7a2c62cf572291ed3eecff7b6c0347e0dcd9f) |
| required | true |

## Ответы

| Поле | Значение |
| - | - |
| 201.content.application/json.schema | [CreateOrderResponse](https://telegafirst.com/docs/schema-9d4785c122a2bb707728b6edcd55c97d7449c223a7b5b56f82960d042c102b60) |
| 201.description | "One Order was created and the Cart was converted atomically" |

## Ошибки

| Поле | Значение |
| - | - |
| 400.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 400.description | "Cart checkout header is malformed, the request grammar is invalid, or the accepted pricing quote is structurally invalid" |
| 400.x-error-codes | \["IDEMPOTENCY\_KEY\_REQUIRED","MALFORMED\_IF\_MATCH","VALIDATION\_ERROR","INVALID\_PRICING\_QUOTE"] |
| 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"] |
| 404.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 404.description | "Cart is unknown or belongs to a different tenant" |
| 409.content.application/problem+json.schema | [409.content.application/problem+json.schema](https://telegafirst.com/docs/schema-308b4c8df64924bda400ce404866d5488389c2825338a8229d25c261d85d5c27) |
| 409.description | "Cart checkout is inactive, conflicts with an existing idempotency receipt, or rejects a stale accepted quote. PRICE\_CHANGED includes the sole replacement Cart-bound quote." |
| 412.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 412.description | "If-Match does not match the current Cart revision" |
| 412.headers.ETag.description | "Strong Cart composition validator" |
| 412.headers.ETag.required | true |
| 412.headers.ETag.schema | [412.headers.ETag.schema](https://telegafirst.com/docs/schema-c368c9e6d62cd43841854a0c6b6f706bca622d6fb3feae05cb9569025bbfe2d8) |
| 422.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 422.description | "Cart composition or checkout business rule failed" |
| 428.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 428.description | "If-Match, Idempotency-Key, and accepted pricing quote are required" |
| 428.x-error-codes | \["ETAG\_REQUIRED","PRICING\_QUOTE\_REQUIRED"] |

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

| Поле | Значение |
| - | - |
| operationId | "checkoutCart" |
| tags | \["Carts"] |
| 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 |
