Orders
An order is the record of any financial operation on CoinMENA. Every trade (buy / sell), every fiatdeposit, and every fiat withdrawal produces one order. This page explains the order object, how to interpret the debit and credit fields, the order lifecycle, and the three ways you can retrieve an order.
Overview
An order represents any financial operation performed on behalf of a client:
| Operation | Endpoint | Order type |
|---|---|---|
| Execute a quote (trade) | POST /v1/partner/quotes/execute | buy or sell |
| Create a fiat deposit | POST /v1/partner/deposits | deposit |
| Create a fiat withdrawal | POST /v1/partner/withdrawals | withdrawal |
Each of those calls returns a freshly created order in the response body. From there, you can retrieve the order again later using one of three lookup endpoints, or list orders across your partner account with filters.
One order object, multiple shapesAll four order types share the same JSON shape. What changes between types is which fields are populated and what they mean. See Reading Order Fields for the per-type mapping.
This page is about the order objectIf you want to create a trade order, see the Trading guide. For creating a deposit or withdrawal, see the Funding guide. This page covers what an order looks like, what its statuses mean, and how to retrieve it.
Core Rules
Orders created through the Partner API are synchronousOrders created through
POST /v1/partner/quotes/execute,POST /v1/partner/deposits, andPOST /v1/partner/withdrawalsare returned in a final status on the creation response — typicallycompletedon success, orfailed/rejectedif something went wrong. You do not need to poll for completion.
The order object is the source of truthFor any transaction, the order object is authoritative for status, amounts, and fees. Do not recalculate values from the quote, and do not treat the quote response as final — the order response is final. Always persist the order and use it for reconciliation and accounting.
The Order Object
Every order endpoint returns the same shape, regardless of type.
Identifiers
| Field | Type | Description |
|---|---|---|
id | integer | CoinMENA's numeric order identifier. Used in GET /v1/partner/orders/{order_id} |
order_no | string | Human-readable order reference number (e.g. CRB0000067890) |
partner_order_ref | string, nullable | Your own internal reference, if one was provided at creation |
partner_client_id | string | The client this order belongs to |
Classification
| Field | Type | Values | Description |
|---|---|---|---|
type | string | deposit, withdrawal, buy, sell | What kind of order this is |
source | string | bank, card, blockchain, referral, bonus, market, limit, fee, entity_change, botim | The channel or origin of the order |
status | string | See Order Statuses | Current lifecycle state |
Amounts
The meaning of debit and credit depends on the order's type — see Reading Order Fields below for the mapping.
| Field | Type | Description |
|---|---|---|
price | string, nullable | Execution price for trade orders (e.g. "75261.5254"). null for funding orders |
credit | string, nullable | See mapping table |
credit_asset_id | string, nullable | Asset ID of the credit field |
debit | string, nullable | See mapping table |
debit_asset_id | string, nullable | Asset ID of the debit field |
fee | string | Fee recorded for this order |
fee_asset_id | string | Asset ID the fee is denominated in |
vat | string | VAT amount recorded for this order |
Timestamps
| Field | Type | Description |
|---|---|---|
created_at | string (datetime) | When the order was created |
transitioned_at | string (datetime) | Timestamp of the last status transition |
updated_at | string (datetime) | Timestamp of the last record update |
Reading Order Fields
This is the most important table on this page. The debit and credit fields hold different things depending on the order type. Always check type first, then read the fields according to this mapping:
Order type | debit holds | credit holds | Client's balance effect |
|---|---|---|---|
deposit | Amount deposited (fiat, e.g. 1000.00 USD) | null | Fiat balance increases by debit |
withdrawal | null | Amount withdrawn (fiat, e.g. 500.00 USD) | Fiat balance decreases by credit |
buy | Base asset the client receives (e.g. 0.0013 BTC) | Quote asset the client pays (e.g. 98.50 USD) | Base asset up, quote asset down |
sell | Quote asset the client receives (e.g. 82.11 USD) | Base asset the client gives (e.g. 0.0011 BTC) | Base asset down, quote asset up |
Why the field names do not match the client's perspectiveThe
debitandcreditfields reflect CoinMENA's internal accounting convention, not the client's view of the transaction. You do not need to understand the accounting model — read thetypefield first, then apply the mapping above. The client's balance effect column tells you exactly what happens to the client.
Worked Examples
Here is how the mapping applies in practice.
Buy trade — client bought BTC using USD:
{
"type": "buy",
"credit": "98.50",
"credit_asset_id": "USD",
"debit": "0.00130000",
"debit_asset_id": "BTC",
"price": "75198.9192",
"fee": "0.73",
"fee_asset_id": "USD"
}Client paid 98.50 USD (credit) and received 0.00130000 BTC (debit). Fee was 0.73 USD.
Sell trade — client sold BTC for USD:
{
"type": "sell",
"credit": "0.00110000",
"credit_asset_id": "BTC",
"debit": "82.11",
"debit_asset_id": "USD",
"price": "75208.4784",
"fee": "0.00000825",
"fee_asset_id": "BTC"
}Client gave 0.00110000 BTC (credit) and received 82.11 USD (debit). Fee was 0.00000825 BTC.
Deposit — client deposited USD:
{
"type": "deposit",
"credit": null,
"credit_asset_id": null,
"debit": "1000.00",
"debit_asset_id": "USD",
"price": null
}Client's USD balance increased by 1000.00 (read from debit).
Withdrawal — client withdrew USD:
{
"type": "withdrawal",
"credit": "500.00",
"credit_asset_id": "USD",
"debit": null,
"debit_asset_id": null,
"price": null
}Client's USD balance decreased by 500.00 (read from credit).
Order Types
| Type | Meaning | Created By |
|---|---|---|
buy | Client bought the base asset using the quote asset | POST /v1/partner/quotes/execute |
sell | Client sold the base asset for the quote asset | POST /v1/partner/quotes/execute |
deposit | Fiat credited to the client's balance | POST /v1/partner/deposits |
withdrawal | Fiat debited from the client's balance | POST /v1/partner/withdrawals |
Order Sources
The source field identifies the channel or origin of the order. Most partner-created orders will be bank (deposits, withdrawals) or market (trades), but the full enum lets you distinguish partner orders from other activity on the account:
| Source | Description |
|---|---|
bank | Bank-based fiat deposit or withdrawal |
card | Card-based transaction |
blockchain | On-chain transaction |
referral | Referral-program credit |
bonus | Bonus credit |
market | Market order (standard trade execution) |
limit | Limit order |
fee | Fee entry |
entity_change | Entity-level adjustment |
botim | Platform-specific source |
Order Statuses
The status field reflects the order's current lifecycle state.
| Status | Meaning |
|---|---|
new | Order has been created but has not yet started processing |
open | Order is open and waiting to be filled (applies to non-market order types) |
pending | Order is in an intermediate state awaiting further action |
processing | Order is being processed |
completed | Order completed successfully. This is the success terminal state |
expired | Order expired before being filled |
queued_cancel | Cancellation has been requested and is being processed |
canceled | Order was canceled |
rejected | Order was rejected before execution |
failed | Order failed during processing |
Final vs Non-Final Statuses
A final status means the order is finished and will not transition further. A non-final status means the order may still change state.
| Final | Non-Final |
|---|---|
completed, expired, canceled, rejected, failed | new, open, pending, processing, queued_cancel |
For orders created through the Partner API, the status returned on the creation response is always a final status — typically completed. Your integration does not need to poll for status changes on partner-created orders.
When you might see non-final statusesNon-final statuses exist in the enum because the same order model is used elsewhere on the CoinMENA platform. Orders you retrieve via the list or lookup endpoints reflect the current state of the underlying record — in practice, for partner-API-created orders this will almost always be a final status. If you ever see a non-final status on a partner-API order, treat it as an exceptional case worth logging.
Retrieving an Order
The API provides three ways to retrieve orders:
| Endpoint | Use When |
|---|---|
GET /v1/partner/orders/{order_id} | You have CoinMENA's numeric id from the creation response |
GET /v1/partner/orders/ref/{partner_order_ref} | You stored your own partner_order_ref and want to look up by that |
GET /v1/partner/orders | You want to list multiple orders, filtered or paginated |
By Order ID
GET /v1/partner/orders/{order_id} returns a single order by CoinMENA's numeric identifier:
GET /v1/partner/orders/67890Returns the single matching order. If the order does not exist or does not belong to your partner account, the API returns 404 Not Found.
By Partner Order Reference
GET /v1/partner/orders/ref/{partner_order_ref} returns a single order using your own reference:
GET /v1/partner/orders/ref/order-abc-123This is the reconciliation-friendly lookup path — you never need to store or map CoinMENA's internal id if you tracked your partner_order_ref at creation. Returns 404 if no order under your partner account has that reference.
Listing Orders
GET /v1/partner/orders returns a paginated list of orders. Supported query filters:
| Parameter | Type | Description |
|---|---|---|
partner_client_id | string | Filter to a specific client |
source | string array | Filter by one or more order sources (can be specified multiple times) |
status | string array | Filter by one or more order statuses (can be specified multiple times) |
from_datetime | ISO 8601 | Return orders created on or after this datetime |
to_datetime | ISO 8601 | Return orders created on or before this datetime |
page | integer | Page number, starting at 1 |
page_size | integer | Items per page (default 10, max 100) |
See the Pagination guide for the list response shape.
Filter aggressively before paginatingCombine
partner_client_id,from_datetime, andstatusto narrow results before iterating pages. Listing all orders across your partner account and filtering client-side is slower and wastes bandwidth. See the Pagination guide for full guidance.
partner_order_ref on Orders
partner_order_ref on Orders
partner_order_refmust be unique per partnerEvery
partner_order_refmust be unique across all orders under your partner account — deposits, withdrawals, and trades share the same namespace. Reusing a value when creating an order returns error2020with HTTP409 Conflict. This prevents duplicate order creation. It is not silent retry — a conflict means you must fetch the existing order yourself.
- Required for
POST /v1/partner/depositsandPOST /v1/partner/withdrawals. - Optional for
POST /v1/partner/quotes/execute. If omitted, the returned order haspartner_order_ref: nulland can only be retrieved later by its numericid.
Handling a 2020 Conflict
2020 ConflictIf an order-creating call returns 2020:
- Do not retry with the same
partner_order_ref. - Fetch the existing order with
GET /v1/partner/orders/ref/{partner_order_ref}. - Check the
status:- If
completed— the original succeeded. Treat as done. - If
failed/rejected— retry with a newpartner_order_ref.
- If
- Update your internal state to reflect the actual outcome.
See Trading and Funding for the full creation flows.
Reconciliation Patterns
How you reconcile depends on whether you tracked partner_order_ref at order creation.
Pattern 1 — You Submitted partner_order_ref (Recommended)
partner_order_ref (Recommended)At creation, use your internal order ID as partner_order_ref. Reconciliation becomes a direct lookup:
- Your system records its internal order ID as
partner_order_ref. - Periodically (or on demand), call
GET /v1/partner/orders/ref/{partner_order_ref}. - Match the returned order fields against your records.
No ID mapping needed — your system remains the system of record.
Pattern 2 — You Only Have the CoinMENA id
idIf you did not provide a partner_order_ref at creation (only applicable to trades), persist the id from the execute response and look up by GET /v1/partner/orders/{order_id} later.
Pattern 3 — Bulk Reconciliation
For daily or batch reconciliation:
- Call
GET /v1/partner/orders?from_datetime=...&to_datetime=...&page=1&page_size=100with your target time window. - Paginate through results until all pages are fetched.
- Match each order against your records using
partner_order_ref(preferred) orid. - Flag any orders in CoinMENA but not in your system, and vice versa.
Filter by status: completed if you only want successful orders, or omit the filter to catch failures too.
Common Mistakes
The most frequent issues partners hit when working with orders:
| Mistake | Fix |
|---|---|
Assuming credit always means "client received" | The meaning of debit / credit depends on order type — use the Reading Order Fields table |
Storing only order_no for reconciliation | Store id and partner_order_ref. order_no is a human-readable label, not a lookup key |
Assuming trade orders always have partner_order_ref | It is optional on trade orders — may be null. It is required on deposits and withdrawals |
Parsing price, credit, debit, fee as float / Number | Use a decimal-aware type — these are strings and may use scientific notation |
Expecting price on funding orders | price is null for deposits and withdrawals — only trade orders have an execution price |
Expecting both credit and debit to be populated on funding orders | Funding orders populate only one side; the other is null |
| Polling a completed order for status changes | Partner-API-created orders are returned in a final status — no polling needed |
| Listing all orders without time or status filters | Always filter from_datetime and status to minimize result size and avoid rate limiting |
| Recalculating amounts from the original quote | The order is the source of truth — use its fields, not derived values from the quote |
Related Error Codes
The errors you are most likely to see when retrieving orders:
| Code | Trigger | Endpoint |
|---|---|---|
404 | Order not found, or does not belong to your partner account | GET /v1/partner/orders/{order_id}, GET /v1/partner/orders/ref/{partner_order_ref} |
422 | Invalid query parameter (e.g. malformed datetime, unknown status value) | GET /v1/partner/orders |
See the Error Codes guide for the full reference.
Updated 1 day ago
| Next Step | Description |
|---|---|
| Trading | The two-step quote-and-execute model that creates buy / sell orders |
| Funding | Deposits and withdrawals that create deposit / withdrawal orders |
| Pagination | How to iterate through paginated lists like GET /v1/partner/orders |
| Error Codes | Full reference for every error the API returns |
