# setOrderPaymentType

Source: <https://telegafirst.com/docs/api-op-setorderpaymenttype>
Locale: ru
releaseGitSha: 005a4dc9d76f69a0815df4e3f98b9050d4d46afb
sourceContentDigest: c87d45238a7701386baa3e454f543138a820f112b2f2086a6a8f5cf2ffef2cee
Version: 5

# setOrderPaymentType

`POST /api/v1/sales/orders/{order_id}/payment-type`

setOrderPaymentType

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

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 | "order\_id" |
| 0.required | true |
| 0.schema | [0.schema](https://telegafirst.com/docs/schema-1530eae3d9b69eb0d4bf2268a4cc47372fcec06f1cf1736785dd6f16848382fc) |
| 1.description | "Required; a repeat with the same key within 24 hours replays the stored answer." |
| 1.in | "header" |
| 1.name | "Idempotency-Key" |
| 1.required | true |
| 1.schema | [1.schema](https://telegafirst.com/docs/schema-c82b42b2810fa0ee377c088ab8bf7e5bb94f8f2c318f682ee4e9451a9740bc06) |

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

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

## Ответы

| Поле | Значение |
| - | - |
| 201.content.application/json.schema | [SetOrderPaymentTypeResponse](https://telegafirst.com/docs/schema-a360fd50368309e85961442a29763ce075165b78020153d319d0537568e708e2) |
| 201.description | "The order after the call" |

## Ошибки

| Поле | Значение |
| - | - |
| 400.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-47fdf0d8395ef5a30fe38dcbde38e65bcdd30fe0fcf5d639ae3a647e01aef684) |
| 400.description | "Invalid strict body or path (VALIDATION\_ERROR/INVALID\_REQUEST), missing/blank Idempotency-Key (IDEMPOTENCY\_KEY\_REQUIRED), or missing credential provenance (INVALID\_REQUEST)" |
| 401.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-47fdf0d8395ef5a30fe38dcbde38e65bcdd30fe0fcf5d639ae3a647e01aef684) |
| 401.description | "Missing or invalid API key; a surface-session JWT is not accepted" |
| 403.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-47fdf0d8395ef5a30fe38dcbde38e65bcdd30fe0fcf5d639ae3a647e01aef684) |
| 403.description | "Missing orders:write scope (INSUFFICIENT\_SCOPE) or a credential not admitted to this tenant (FORBIDDEN)" |
| 404.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-47fdf0d8395ef5a30fe38dcbde38e65bcdd30fe0fcf5d639ae3a647e01aef684) |
| 404.description | "The tenant-local buyer, catalogue, registration or order was not found" |
| 409.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-47fdf0d8395ef5a30fe38dcbde38e65bcdd30fe0fcf5d639ae3a647e01aef684) |
| 409.description | "The durable receipt is pending and its effect cannot be recovered (IDEMPOTENCY\_KEY\_IN\_FLIGHT), a line cannot be held (STOCK\_EXHAUSTED), or the order's invoice is already out and the body does not ask for a reissue (ALREADY\_SENT)" |
| 413.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-47fdf0d8395ef5a30fe38dcbde38e65bcdd30fe0fcf5d639ae3a647e01aef684) |
| 413.description | "The per-tool resource policy rejects the request size" |
| 422.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-47fdf0d8395ef5a30fe38dcbde38e65bcdd30fe0fcf5d639ae3a647e01aef684) |
| 422.description | "Divergent receipt-key reuse (IDEMPOTENCY\_KEY\_MISMATCH), declared unit prices in two currencies (MIXED\_CURRENCY), or invalid current money preconditions such as a buyer without a receipt contact for an invoice" |
| 429.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-47fdf0d8395ef5a30fe38dcbde38e65bcdd30fe0fcf5d639ae3a647e01aef684) |
| 429.description | "The per-tool rate limit is exceeded or its subsystem is unavailable" |
| 429.headers.Retry-After.description | "Retry delay in seconds when supplied by the resource limiter" |
| 429.headers.Retry-After.required | false |
| 429.headers.Retry-After.schema | [429.headers.Retry-After.schema](https://telegafirst.com/docs/schema-f0765dbf409c74f001806c446f2cf171d8c46b5b15779d54423dde921a4b0670) |
| 500.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-47fdf0d8395ef5a30fe38dcbde38e65bcdd30fe0fcf5d639ae3a647e01aef684) |
| 500.description | "Unexpected money failure" |

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

| Поле | Значение |
| - | - |
| description | "Switch how the buyer pays an open, unpaid order: manual (the buyer's card loses the payment-provider buttons; record the payment with mark-paid) or online (the provider links are issued again; needs a connected payment provider and an order card sent to the buyer, else ORDER\_NOT\_PAYABLE). An order already on that branch answers outcome unchanged. A card of several items is refused with FAILED\_PRECONDITION; a paid order with ORDER\_ALREADY\_PAID." |
| operationId | "setOrderPaymentType" |
| tags | \["sales"] |
