Skip to Content
ELK Developers

POST /v1/accept

Accept a quote

Download .md
POST
/v1/accept

Accepts a quote by quote_id using its original terms. Requires ViewQuotes, AcceptTrade, product and market access, and sufficient funds or credit. The quote must be unexpired for a new acceptance. Use a distinct Idempotency-Key for acceptance; retries with that key and body return the existing order and its current status, including after quote expiry. Replay requires read access.

Authorization

ApiKey
headerAuthorizationBearer <token>

Send Authorization: Bearer over HTTPS. Each key is associated with an account and environment. Invalid, expired or revoked keys return 401.

Header Parameters

Idempotency-Key*string

Client-generated UUID, scoped to account and operation. Use the same UUID and body for retries. Decimal strings are normalized and JSON property order is ignored when comparing requests. A changed request with the same UUID returns idempotency_conflict.

Formatuuid
Length36 <= length <= 36
X-Request-ID?string

Optional request tracing UUID. The server generates one if omitted.

Formatuuid
Length36 <= length <= 36

Request Body

application/json
  1. body
quote_id*QuoteId

Cryptographically random server-generated UUIDv4. Nonselectable and immutably account-bound. Knowledge of an ID never grants access.

Formatuuid
Length36 <= length <= 36

Response Body

Order ID, quote terms, accepted_at and current status. Initial status is pending; subsequent statuses are filled or cancelled.

application/json
  1. response
order_id*Identifier

UUID identifier; server responses use lowercase canonical spelling.

Formatuuid
Length36 <= length <= 36
status*string

Current order status.

Value in"pending""filled""cancelled"
updated_at*UtcTimestamp

Time the quote was accepted.

Formatdate-time
trade_id*Identifier

UUID identifier; server responses use lowercase canonical spelling.

Formatuuid
Length36 <= length <= 36
quote*

Quoted price, final pay/receive amounts and expiry. Use pay and receive as the complete exchange amounts.

accepted_at*UtcTimestamp

Time the quote was accepted.

Formatdate-time
Example Request
curl -X POST 'https://api.elkcrypto.com/sandbox/v1/accept' \  -H 'Idempotency-Key: 497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{  "quote_id": "22222222-2222-4222-8222-222222222222"}'
Example Response
{  "order_id": "93101167-9065-4b9c-b98b-5d789a3ed9fe",  "status": "pending",  "updated_at": "2019-08-24T14:15:22Z",  "trade_id": "716cb486-5256-4659-973c-189b58daa723",  "quote": {    "quote_id": "3c071a1d-db86-46a7-9dc8-72ba3fbca992",    "symbol": "string",    "market": "string",    "side": "buy",    "price": "string",    "pay": {      "asset": "string",      "amount": "string"    },    "receive": {      "asset": "string",      "amount": "string"    },    "issued_at": "2019-08-24T14:15:22Z",    "expires_at": "2019-08-24T14:15:22Z"  },  "accepted_at": "2019-08-24T14:15:22Z"}