# createOrder

Source: <https://telegafirst.com/docs/api-op-createorder>
Locale: ru
releaseGitSha: ea133cd4ad87fe549ef000b139be145be9bd1717
sourceContentDigest: 782e51ab7fa8e2409743895471cd7d799568f2b59c69beda9df97006d0dc31c2
Version: 2

# createOrder

`POST /api/v1/orders`

createOrder

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

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.description | "Required for nonempty POST bodies; optional for an empty refresh body." |
| 0.in | "header" |
| 0.name | "Idempotency-Key" |
| 0.required | true |
| 0.schema | [0.schema](https://telegafirst.com/docs/schema-9ac136edb99a2063b3091602181c8d2022fdccb5b514991319d58544c2e57e95) |

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

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

## Ответы

| Поле | Значение |
| - | - |
| 201.content.application/json.schema | [CreateOrderResponse](https://telegafirst.com/docs/schema-9d4785c122a2bb707728b6edcd55c97d7449c223a7b5b56f82960d042c102b60) |
| 201.description | "Create external order" |

## Ошибки

| Поле | Значение |
| - | - |
| 400.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 400.description | "The accepted pricing quote is malformed, forged, or bound to a different tenant, subject, surface, zone, or basket" |
| 401.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 401.description | "Missing or invalid authentication" |
| 403.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 403.description | "The caller lacks the orders scope or tenant access" |
| 404.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 404.description | "A product or requested user was not found for this tenant" |
| 409.content.application/problem+json.schema | [409.content.application/problem+json.schema](https://telegafirst.com/docs/schema-cae6c5cccc8d50ae313c4fdd91b6478c7eb0ec8e35858923f2fce27f523c01c4) |
| 409.description | "The accepted quote is stale. \`details.freshQuote\` contains the sole new six-field signed quote; retry with a new Idempotency-Key." |
| 422.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 422.description | "The basket is invalid or a RU fiscal route requires a valid buyer email or phone (YooKassa requires email)" |
| 428.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 428.description | "An accepted six-field pricing quote is required" |

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

| Поле | Значение |
| - | - |
| operationId | "createOrder" |
| tags | \["orders"] |
| x-idempotency | "http-cache" |
