Операции
Операция — единица работы с деньгами клиента: создание, чтение состояния, список активных и передача решения по операции.
List active operationsGET/api/v1/operations
listActiveOperationsНужен токен
Returns the caller's operations that have not reached a final status (COMPLETED, PARTIALLY_COMPLETED, FAILED, CANCELLED) with their current phase, the action expected from the client and open timeout events. Pages are cursor-based: pass nextCursor from the previous page as cursor.
Параметры запроса
| Поле | Тип | Описание |
|---|---|---|
cursor | string | |
limit | integer (int32) |
|
Ответы
200OKListActiveOperationsResponse
| Поле | Тип | Описание | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
itemsобязательно | массив (объект ActiveOperationSummaryResponse) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
nextCursor | string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Ошибки
Коды ошибок в контракте не описаны.
Create an operationPOST/api/v1/operations
createOperationНужен токен
Accepts a business operation — a sequence of money actions (payment, payout, refund) with execution policies — and starts executing it. The request is accepted as a whole and frozen at acceptance: later changes to settings do not affect it. Retrying with the same context.idempotencyKey and identical content returns the same operation; the same key with different content is rejected. The response carries operationId, the current status and phase, and the action expected from the client, if any.
Тело запросаобязательноCreateOperationRequest
| Поле | Тип | Описание | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
settlementAccountIdобязательно | string | Settlement account ID that owns the operation
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
typeобязательно | string |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
controls | объект CreateOperationControlsRequest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
moneyобязательно | массив (Один из вариантов) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Один из вариантов — Вариант выбирается значением поля kind
Await decision intent (business gate, ADR-0100)
Payment intent
Payout intent (ADR-0114)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
contextобязательно | объект CreateOperationContextRequest | Operation context | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Ответы
201CreatedCreateOperationResponse
| Поле | Тип | Описание | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
operationIdобязательно | string | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
typeобязательно | string |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
statusобязательно | string |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
phaseобязательно | string | Client-facing operational phase (ADR-0052). Distinct from
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
message | string | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
requiredAction | string |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
requiredActionSince | string (дата и время, ISO 8601) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
requiredActionPayload | объект OperationRequiredActionPayloadResponse | Payload for required action | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
linksобязательно | массив (объект LinkResponse) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Ошибки
Коды ошибок в контракте не описаны.
Get an operationGET/api/v1/operations/{operationId}
getOperationНужен токен
Returns the current state of an operation: status, phase, the action expected from the client with its payload (payments to perform or the decision to submit), the money actions with their outcomes, and open timeout events.
Параметры пути
| Поле | Тип | Описание |
|---|---|---|
operationIdобязательно | string |
Ответы
200OKOperationViewResponse
| Поле | Тип | Описание | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
operationIdобязательно | string | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
statusобязательно | string |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
typeобязательно | string |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
phaseобязательно | string | Client-facing operational phase (ADR-0052). Distinct from
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
createdAt | string (дата и время, ISO 8601) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
finalizedAt | string (дата и время, ISO 8601) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
deadlineAt | string (дата и время, ISO 8601) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
finalizationReason | string |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
finalizationMode | string |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
requiredAction | string |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
requiredActionSince | string (дата и время, ISO 8601) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
requiredActionPayload | объект OperationRequiredActionPayloadResponse | Payload for required action | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
links | массив (объект LinkResponse) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
activeTimeoutEvents | массив (объект ActiveTimeoutEventResponse) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
payments | массив (объект OperationPaymentResponse) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
paymentsRevision | integer (int64) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Ошибки
Коды ошибок в контракте не описаны.
Submit a decision on an operationPOST/api/v1/operations/{operationId}/decisions
submitOperationDecisionНужен токен
Submits the client's decision for an operation of type EXTERNAL_DECISION that is waiting for it (requiredAction = SUBMIT_DECISION): FINALIZE_AS_IS, ADJUST or COMPENSATE_AND_FINALIZE. decisionVersion must equal expectedDecisionVersion from the required-action payload; a repeated submission with the same version and content is idempotent. Responds with 202: the decision is accepted and executed asynchronously — follow the operation state or webhooks for the outcome. An operation that is not waiting for a decision rejects the request with OPERATION_NOT_WAITING_FOR_DECISION.
Параметры пути
| Поле | Тип | Описание |
|---|---|---|
operationIdобязательно | string |
Тело запросаобязательноSubmitDecisionRequest
| Поле | Тип | Описание | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
decisionVersionобязательно | integer (int32) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
decisionобязательно | Один из вариантов | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Один из вариантов — Вариант выбирается значением поля kind
Денежная корректировка решения (ADR-0111)
Компенсировать исполненные денежные действия и финализировать операцию (ADR-0111)
Закрыть операцию в текущем финансовом состоянии (ADR-0111)
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
context | словарь (string) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Ответы
202AcceptedSubmitDecisionResponse
| Поле | Тип | Описание | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
operationIdобязательно | string | |||||||||||||
statusобязательно | string |
| ||||||||||||
phaseобязательно | string | Client-facing operational phase (ADR-0052). Distinct from
| ||||||||||||
decisionобязательно | объект DecisionStatusResponse | Decision status in response | ||||||||||||
| ||||||||||||||
linksобязательно | массив (объект LinkResponse) | |||||||||||||
| ||||||||||||||
Ошибки
Коды ошибок в контракте не описаны.