Skip to main content
The Marks Partner API uses shared conventions for quotes, trade execution and position management. Use this page alongside the endpoint reference when building your integration.

Base URL

All endpoints are served over HTTPS and share one base:
Plain HTTP is not supported.

Authentication

Every request carries your API key as a Bearer token. The key prefix selects the environment: mk_live_ for production, mk_test_ for sandbox. The same endpoints serve both. See Authentication for the full details.

Response envelope

Every endpoint returns the same envelope:
This example shows the envelope structure. The contents of data depend on the endpoint and may be an object or a list. On success, data contains the result and error is null. On failure, data is null and error contains a machine-readable code, a human-readable message and optional details. Use error.code to decide how your integration handles an error. meta carries request context such as the data source.

Amounts and rates

Monetary amounts are in USDC unless a field name says otherwise (fields ending in _usd or _usdc). Exchange rates are decimal numbers in quote currency per USDT - a price of 1620.5 on USDTNGN means 1,620.5 naira per USDT. Timestamps are ISO-8601 in UTC.

Quotes

POST /quotes returns indicative pricing and a cost breakdown. Requesting a quote does not create a position or reserve a rate. Quotes are not binding or persisted. Trade submission reprices against the live market, and the final rate is confirmed when the order fills.

Asynchronous actions

Opening, increasing, reducing and closing an NDF position are asynchronous. A successful submission returns status: "submitted" with an order_tx_hash. Submission confirms that the order has been sent; execution is confirmed when it fills. For an opening trade, poll GET /hedges/{hedge_id} until status becomes filled. The filled record includes a fill_tx_hash and the struck_rate captured at fill. For increases, reductions and closes, check the resulting position size through GET /positions. There are no webhooks yet.

Idempotency

Send an Idempotency-Key header when opening, increasing, reducing or closing a position. Use a unique key for each new action, such as a UUID:
Retry the same endpoint with the same key and unchanged request body. A completed request returns its stored response. A request still processing returns 409 idempotency_in_flight; wait before retrying with the same key. Reusing a key for a different endpoint or body returns 409 idempotency_key_reuse. Keys are scoped to your partner account and environment. Keep the original key when retrying after a timeout. A replayed submission response describes the original submission; poll the trade or position to check its current execution status.

Rate limits

Requests are rate limited per API key. If you exceed the limit, you receive 429 rate_limited. Reduce your request rate and retry with backoff. The error details include your key’s limit_rpm (requests per minute). Poll read endpoints at a steady cadence, typically every second or two, and account for all requests sharing the same key.

Errors

Every error response has data: null and an error containing a stable code, a human-readable message and optional details.
Fix validation, authentication and access errors before retrying. Handle 409 conflicts according to their error code. For 429, reduce the request rate and retry with backoff. For 5xx responses or a lost connection, back off before retrying. For a trade request, check its execution status first and reuse the original Idempotency-Key if a retry is needed.

Error codes