# linkOrderUser

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

# linkOrderUser

`POST /api/v1/orders/{id}/link-user`

linkOrderUser

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

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) |
| 1.in | "path" |
| 1.name | "id" |
| 1.required | true |
| 1.schema | [1.schema](https://telegafirst.com/docs/schema-00404e686415370f1711c4d7acfa2905444d3cf23cef2e10c47d445ebe690f96) |

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

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

## Ответы

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

## Ошибки

| Поле | Значение |
| - | - |
| 400.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 400.description | "Malformed request or a missing Idempotency-Key header" |
| 401.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 401.description | "Missing or invalid API key" |
| 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 | "Order or user was not found for this tenant" |
| 409.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 409.description | "The order cannot be linked or request is already in progress" |
| 422.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 422.description | "The requested user cannot be linked to this order" |

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

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