API reference · Trading
Accept a quote
POST/v1/trades
Executes an open quote. Returns 201 when filled, or 202 while the trade is still pending; poll GET /v1/trades/{id}. Refused with price_moved when the market has moved against the quote by more than the account's tolerance. Idempotency-Key is required: on a timeout, retry with the same key.
Parameters
Idempotency-Keystringheaderrequired1 to 64 characters of [A-Za-z0-9_-]. Kept for 24 h; reuse it to retry safely.
Request body
application/json · CreateTradeRequest. Unknown fields are rejected.
quote_idstringrequired
Responses
201 Created
The trade, filled or failed. application/json · Trade
idstringquote_idstringnullablenull for trades made before quotes existed.
assetstringAn upper-case asset symbol.
sidestring (enum)quote_currency"USDC"base_amountstring (decimal)quote_amountstring (decimal)pricestring (decimal)statusstring (enum)sourcestring (enum)Where the record was made: this API, the mobile app or the webapp.
created_atstring (date-time)filled_atstring (date-time)nullablefailure_reasonstring | null
202 Accepted
The trade, still pending. application/json · Trade
idstringquote_idstringnullablenull for trades made before quotes existed.
assetstringAn upper-case asset symbol.
sidestring (enum)quote_currency"USDC"base_amountstring (decimal)quote_amountstring (decimal)pricestring (decimal)statusstring (enum)sourcestring (enum)Where the record was made: this API, the mobile app or the webapp.
created_atstring (date-time)filled_atstring (date-time)nullablefailure_reasonstring | null
Every response carries MK-Request-Id, plus RateLimit-Policy and RateLimit.
Errors
Errors use the error envelope. Match on code.
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_request | The request is malformed: bad JSON, an unknown or invalid field, or a missing header. |
| 401 | invalid_signature | The MK-* headers are missing or malformed, the key id is unknown, or the signature doesn't match. |
| 401 | key_expired | The key has passed its expiry date. |
| 401 | key_revoked | The key was revoked. |
| 401 | timestamp_out_of_range | MK-Timestamp is more than 30 seconds from the server clock. |
| 401 | nonce_reused | This key already used this MK-Nonce. |
| 403 | ip_not_allowed | The request came from an address outside the key's IP allowlist. |
| 403 | insufficient_scope | The key doesn't have the scope this endpoint needs. |
| 403 | account_restricted | The account can't use the API right now (for example locked, inactive, or onboarding not finished). |
| 403 | api_access_disabled | API access is switched off. |
| 404 | not_found | No such resource. |
| 409 | idempotency_conflict | This Idempotency-Key was used with a different request body. |
| 409 | idempotency_in_progress | A request with this Idempotency-Key is still being processed. |
| 409 | quote_already_used | The quote was already accepted. |
| 413 | payload_too_large | The request body is larger than 8 KB. |
| 415 | unsupported_media_type | Request bodies must be application/json. |
| 422 | quote_expired | The quote has expired. |
| 422 | price_moved | The market moved too far from the quoted price. |
| 422 | insufficient_funds | The available balance doesn't cover the trade, gift card or withdrawal. |
| 422 | limit_exceeded | A daily or 30-day limit would be exceeded. |
| 422 | asset_not_tradable | The asset can't be traded right now. |
| 429 | rate_limited | Too many requests. Wait for Retry-After seconds. |
| 429 | too_many_concurrent_requests | Too many requests in flight for this key or account. |
| 429 | key_suspended | The key is suspended, for example after sustained rate limiting. |
| 500 | internal_error | Something went wrong on our side. |
| 502 | bad_gateway | An upstream service answered unexpectedly. |
| 503 | overloaded | The service is overloaded. Retry after Retry-After seconds. |
| 503 | service_unavailable | The service is temporarily unavailable. |
| 503 | maintenance | The API is read-only for maintenance. |
| 503 | trading_halted | Trading is paused: switched off, or paused for this asset for a short while after a fast price move. |
| 504 | gateway_timeout | An upstream service didn't answer in time. A POST may still complete; retry with the same Idempotency-Key. |
Request
# Signed by sign-headers.sh: see Authentication
body='{"quote_id":"qt_01JB8X2Q4M7Z3V9K5T1N6R0P2W"}'
idempotency_key=$(uuidgen) # reuse it to retry safely
curl https://public-api.myntkaup.is/v1/trades \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $idempotency_key" \
$(./sign-headers.sh POST /v1/trades "$body" | sed 's/^/-H /') \
--data "$body"import { Myntkaup } from "@myntkaup/api";
const client = new Myntkaup(); // reads the key from the environment
// Sends a random Idempotency-Key unless you pass idempotencyKey.
const trade = await client.trades.create({ quoteId: "qt_01JB8X2Q4M7Z3V9K5T1N6R0P2W" });
console.log(trade.status, trade.base_amount);from myntkaup import Myntkaup
client = Myntkaup() # reads the key from the environment
# Sends a random Idempotency-Key unless you pass idempotency_key.
trade = client.trades.create(quote_id="qt_01JB8X2Q4M7Z3V9K5T1N6R0P2W")
print(trade["status"], trade["base_amount"])Response
{
"id": "tr_01JB8X2Q4M7Z3V9K5T1N6R0P2W",
"quote_id": "qt_01JB8X2Q4M7Z3V9K5T1N6R0P2W",
"asset": "BTC",
"side": "buy",
"quote_currency": "USDC",
"base_amount": "0.00104210",
"quote_amount": "100.00",
"price": "95960.12",
"status": "filled",
"source": "public_api",
"created_at": "2026-11-03T10:15:12Z",
"filled_at": "2026-11-03T10:15:13Z",
"failure_reason": null
}{
"id": "tr_01JB8X2Q4M7Z3V9K5T1N6R0P2W",
"quote_id": "qt_01JB8X2Q4M7Z3V9K5T1N6R0P2W",
"asset": "BTC",
"side": "buy",
"quote_currency": "USDC",
"base_amount": "0.00104210",
"quote_amount": "100.00",
"price": "95960.12",
"status": "pending",
"source": "public_api",
"created_at": "2026-11-03T10:15:12Z",
"filled_at": null,
"failure_reason": null
}Base URL https://public-api.myntkaup.is