Cancel order
POST /v1/accounts/{externalUserId}/orders/{orderId}/cancel
Use this operation for cancel order. Follow the markets and trading guide for the complete workflow.
Markets and trading guide · All endpoints · SDK: cancelOrder
Authentication
Server-to-server HMAC. Your key selects the partner; your backend must authorize the end user.
CRISP enables access to the features agreed for your integration. Contact CRISP if an enabled feature returns an access error.
Idempotency-Key: Required — persist one key per intent. Signing and authentication →
Request fields
Required means the field must be present. Nullable means an explicit JSON null is allowed; it does not mean optional.
Path parameters
| Field | Type / presence | Description and constraints |
|---|---|---|
externalUserId | stringRequired Non-null | Your stable user ID within the authenticated partner. Derive it from your authorized server session. Validation pattern^[A-Za-z0-9._:@-]{1,200}$ |
orderId | stringRequired Non-null | — |
Query parameters
None.
Header parameters
| Field | Type / presence | Description and constraints |
|---|---|---|
Idempotency-Key | stringRequired Non-null | Validation pattern^[A-Za-z0-9._:-]{8,200}$ |
JSON body
No request body.
Request example
Illustrative identifiers only: replace them with resources from your integration. Keep credentials on your backend. HTTP placeholders must be signed; the SDK signs automatically. Financial intent keys must be persisted and unique per new action.
POST /v1/accounts/user-123/orders/example/cancel
Host: partner-api.crisp.trade
X-Crisp-Partner-Key: <server-key-id>
X-Crisp-Timestamp: <fresh-ISO-8601-UTC-timestamp>
X-Crisp-Nonce: <fresh-unique-nonce>
X-Crisp-Signature: <computed-base64-HMAC>
Idempotency-Key: persisted-intent-0001Response fields
HTTP responses use the envelope below. SDK calls expose its payload as result.data, with HTTP status and request metadata on the SDK wrapper.
202 · Accepted; inspect lifecycle state. This is not proof of a fill or payout.
Accepted for processing, not proof of a fill, completed provisioning or settled payout. Inspect resource state and follow the recovery guide.
Data payload
| Field | Type / presence | Description and constraints | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
crispAccountId | stringRequired Non-null | CRISP's account identifier; distinct from your external user ID. Format: uuid | |||||||||||||||
externalUserId | stringRequired Non-null | Your stable user ID within the authenticated partner. Derive it from your authorized server session. Validation pattern^[A-Za-z0-9._:@-]{1,200}$ | |||||||||||||||
command | objectRequired Non-null | Expand the structure below. | |||||||||||||||
command: expand fields
Additional fields are not allowed in this object. | |||||||||||||||||
orderId | stringRequired Non-null | — | |||||||||||||||
response | object | nullRequired Nullable | Expand the structure below. | |||||||||||||||
response: expand fieldsVenue-owned JSON extension; fields are not a stable CRISP contract. Handle missing fields. | |||||||||||||||||
Additional fields are not allowed in this object.
Full HTTP envelope
| Field | Type / presence | Description and constraints | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | objectRequired Non-null | Expand the structure below. | |||||||||||||||||||||||||||||||||||||||
data: expand fields
Additional fields are not allowed in this object. | |||||||||||||||||||||||||||||||||||||||||
requestId | stringRequired Non-null | Request correlation ID for debugging and support. | |||||||||||||||||||||||||||||||||||||||
Additional fields are not allowed in this object.
Response example
Schema illustration, not live account data. Null means unavailable or not applicable, never an invented zero. Empty arrays do not imply the endpoint always returns no results.
202 response JSON
{
"data": {
"crispAccountId": "11111111-1111-4111-8111-111111111111",
"externalUserId": "user-123",
"command": {
"id": "11111111-1111-4111-8111-111111111111",
"state": "queued",
"failureCode": null
},
"orderId": "example",
"response": null
},
"requestId": "example-request-id"
}Errors and recovery
| Status | Meaning |
|---|---|
400 | Inspect error.code and retain the original financial intent. |
401 | Inspect error.code and retain the original financial intent. |
403 | Inspect error.code and retain the original financial intent. |
404 | Not visible for this account. A recovery lookup miss is not proof that an in-flight submission failed. |
409 | Inspect error.code and retain the original financial intent. |
429 | Inspect error.code and retain the original financial intent. |
500 | Inspect error.code and retain the original financial intent. |
502 | Inspect error.code and retain the original financial intent. |
503 | Inspect error.code and retain the original financial intent. |
Inspect the error code and outcomeUnknown, not just the HTTP status. Preserve the original intent after financial uncertainty. Read-only retries should honor Retry-After. Recovery workflow →
Error response fields
| Field | Type / presence | Description and constraints | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
error | objectRequired Non-null | Expand the structure below. | ||||||||||||
error: expand fields
Additional fields are not allowed in this object. | ||||||||||||||
Additional fields are not allowed in this object.