Skip to main content
Version: v2

Orders

The Orders endpoints allow you to create and manage cryptocurrency exchange orders using the simplified v2 API format.

List Orders

Retrieve a list of orders with v2 field format.

Request

curl -X GET "https://api.n.exchange/en/api/v2/orders/" \
-H "Accept: application/json" \
-H "Authorization: ApiKey api_key"

Query Parameters:

ParameterTypeRequiredDescription
pageintegerNoPage number for pagination (default: 1)
page_sizeintegerNoNumber of items per page (1-100, default: 20)

Response

Returns a paginated list of orders.

Response Fields:

FieldTypeDescription
countintegerTotal number of orders
nextstring/nullURL for next page
previousstring/nullURL for previous page
resultsarrayArray of order objects

Example Response:

{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"unique_reference": "ABCDEF",
"side": "SELL",
"withdraw_amount": "0.01000000",
"deposit_amount": "500.00",
"deposit_currency": "USDC",
"withdraw_currency": "BTC",
"status": "INITIAL",
"created_on": "2023-10-15T10:30:00Z",
"payment_window_minutes": 60,
"fixed_rate_deadline": "2023-10-15T11:30:00Z",
"rate": "50000.00",
"deposit_address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
"deposit_address_extra_id": "",
"withdraw_address": "",
"withdraw_extra_id": "",
"refund_address": "",
"refund_address_extra_id": "",
"deposit_transaction": "",
"withdraw_transaction": ""
}
]
}

Create Order

Create a new cryptocurrency exchange order using v2 simplified format.

Request

curl -X POST "https://api.n.exchange/en/api/v2/orders/" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "x-referral-token: your-referral-token" \
-H "X-User-Timezone: GMT +04:00 (Asia/Dubai)"
-d '{
"side": "SELL",
"withdraw_amount": "0.01000000",
"deposit_currency": "USDC",
"withdraw_currency": "BTC",
"withdraw_address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
}'

Headers:

HeaderRequiredDescription
x-referral-tokenNoReferral token for identification
AuthorizationYesBearer token for additional authorization (e.g., "ApiKey api_key")
X-User-TimezoneYesGMT offset + IANA_Timezone (GMT ±HH:MM (IANA_Timezone)) wiki

Request Fields:

FieldTypeRequiredDescription
sidestringNoOrder side: "BUY" or "SELL" (default: "SELL")
withdraw_amountstringYes*Amount to withdraw (required if deposit_amount not provided)
deposit_amountstringYes*Amount to deposit (required if withdraw_amount not provided)
deposit_currencystringYesCurrency code for deposit
withdraw_currencystringYesCurrency code for withdrawal
withdraw_addressstringNoAddress where withdrawal should be sent (can be set later)
withdraw_extra_idstringNoExtra ID for withdraw address
refund_addressstringNoAddress for refunds (optional)
rate_idstringNoRate id (optional), could be retrieved from rate/ endpoint
refund_extra_idstringNoOrder with refund address extra ID (for currencies requiring memo/destination tag)
*Either withdraw_amount or deposit_amount must be provided.

Example Request Bodies:

Buy BTC with USDT:

{
"side": "BUY",
"deposit_amount": "500.00",
"deposit_currency": {
"code": "USDT",
"network": "ETH"
},
"withdraw_currency": {
"code": "BTC",
"network": "BTC"
},
"rate_id": "waq1T39kPFn9LOETpzTnX6by7Yc-001ABB",
"refund_extra_id": "12345"
}

or

{
"side": "BUY",
"deposit_amount": "500.00",
"deposit_currency": "USDTERC",
"withdraw_currency": "BTC",
}

Response

Returns the created order with deposit instructions and tracking information.

Response Fields:

FieldTypeDescription
unique_referencestringUnique order identifier for tracking
sidestringOrder side - "BUY" or "SELL"
withdraw_amountstringAmount being withdrawn (sent out)
deposit_amountstringAmount being deposited (received)
deposit_currencystring or objectCurrency code for the deposit (what you send to us), {code: USDT, network: EHT}
withdraw_currencystring or objectCurrency code for the withdrawal (what we send to you), {code: USDT, network: EHT}
statusstringCurrent status of the order
created_onstringOrder creation timestamp
payment_window_minutesintegerTime window for payment in minutes
fixed_rate_deadlinestring/nullDeadline for fixed rate (if applicable)
deposit_addressstringAddress where you must send your funds
deposit_address_extra_idstringExtra ID for deposit address (memo, destination tag, etc.)
withdraw_addressstringAddress where withdrawal will be sent
withdraw_extra_idstringExtra ID for withdraw address
refund_addressstringAddress for refunds if needed
refund_extra_idstringOrder with refund address extra ID (for currencies requiring memo/destination tag)
deposit_transactionstringTransaction ID of the deposit
withdraw_transactionstringTransaction ID of the withdrawal

Example Response:

{
"unique_reference": "ABCDEF123456",
"side": "SELL",
"withdraw_amount": "0.01000000",
"deposit_amount": "500.00",
"deposit_currency": "USDC",
"withdraw_currency": "BTC",
"status": "INITIAL",
"created_on": "2023-10-15T10:30:00Z",
"payment_window_minutes": 60,
"fixed_rate_deadline": "2023-10-15T11:30:00Z",
"deposit_address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
"deposit_address_extra_id": "",
"withdraw_address": "",
"withdraw_extra_id": "",
"refund_address": "",
"refund_extra_id": "",
"deposit_transaction": "",
"withdraw_transaction": ""
}

Get Order Details

Retrieve detailed information about a specific order.

Request

curl -X GET "https://api.n.exchange/en/api/v2/orders/ABCDEF123456/" \
-H "Accept: application/json" \
-H "Authorization: ApiKey api_key"

Path Parameters:

ParameterTypeRequiredDescription
unique_referencestringYesUnique reference identifier for the order (pattern: ^[A-Za-z0-9_-]+$)

Authentication: Bearer token required

Response

Returns complete order information including transaction details.

Example Response:

{
"unique_reference": "ABCDEF123456",
"side": "SELL",
"withdraw_amount": "0.01000000",
"deposit_amount": "500.00",
"deposit_currency": "USDC",
"withdraw_currency": "BTC",
"status": "UNCONFIRMED PAYMENT",
"created_on": "2023-10-15T10:30:00Z",
"payment_window_minutes": 60,
"fixed_rate_deadline": "2023-10-15T11:30:00Z",
"rate": "50000.00",
"deposit_address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
"deposit_address_extra_id": "",
"withdraw_address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
"withdraw_extra_id": "",
"refund_address": "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2",
"refund_address_extra_id": "",
"deposit_transaction": "a1b2c3d4e5f6...",
"withdraw_transaction": ""
}

Update Order

Update specific fields of an order.

Request

curl -X PATCH "https://api.n.exchange/en/api/v2/orders/ABCDEF123456/" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey api_key" \
-d '{
"withdraw_address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
}'

Path Parameters:

ParameterTypeRequiredDescription
unique_referencestringYesUnique reference identifier for the order (pattern: ^[A-Za-z0-9_-]+$)

Update Fields:

FieldTypeDescription
withdraw_addressstringSet the withdrawal address (only once, before processing)
withdraw_extra_idstringExtra ID for withdraw address
marked_as_paidbooleanMark order as paid (true) or cancel payment (false)
deposit_transactionstringProvide deposit transaction ID

Authentication: Bearer token required

Example Request Bodies:

Set withdraw address:

{
"withdraw_address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
}

Mark as paid with transaction:

{
"marked_as_paid": true,
"deposit_transaction": "a1b2c3d4e5f6789abcdef..."
}

Cancel payment:

{
"marked_as_paid": false
}

Response

Returns the updated order information with the same structure as the create order response.

Order Status Lifecycle

Orders progress through several states during processing:

Status Values

Status CodeStatus NameDescription
0CANCELEDDeposit not received and order expired
11INITIALOrder created, awaiting deposit
12UNCONFIRMED PAYMENTDeposit detected but not confirmed
13PAIDDeposit confirmed
14PRE-RELEASEWithdrawal transaction being created
15RELEASEDWithdrawal transaction broadcasted
16COMPLETEDWithdrawal transaction confirmed
6INITIATED REFUNDOrder refund process initiated
8REFUNDEDOrder refunded successfully
7REFUND FAILEDOrder refund failed
9PENDING KYCWaiting for additional due diligence

Typical order flow

✅ Success Flow:

INITIAL → UNCONFIRMED PAYMENT → PAID → PRE-RELEASE → RELEASED → COMPLETED

❌ Unpaid Flow:

INITIAL → CANCELED

🔍 KYC Success Flow:

INITIAL → UNCONFIRMED PAYMENT → PENDING KYC → PAID → PRE-RELEASE → RELEASED → COMPLETED

🔍 KYC Failure Flow:

INITIAL → UNCONFIRMED PAYMENT → PENDING KYC → INITIATED REFUND → REFUNDED

🔄 Refund Retry Flow:

INITIATED REFUND → REFUND FAILED → INITIATED REFUND → REFUNDED

Transaction statuses

Transaction objects are nested in order responses with their own state machine:

Status CodeStatus NameDescription
-10FAILEDTransaction failed
-5DROPPEDTransaction dropped
-1AUDIT_FAILEDFailed audit (withdrawal only)
0CANCELEDTransaction canceled (withdrawal only)
1INITIALInitial state (withdrawal only)
4STAGEDTransaction staged (withdrawal only)
7AUDITEDTransaction audited (withdrawal only)
10UNCONFIRMEDTransaction broadcasted but unconfirmed
13CONFIRMEDTransaction confirmed

Normal Withdrawal Flow:

INITIAL → STAGED → AUDITED → UNCONFIRMED → CONFIRMED

Deposit Transactions start at UNCONFIRMED status.

Key Changes from v1

Simplified Field Names

API v2 uses more descriptive field names:

  • amount_basewithdraw_amount
  • amount_quotedeposit_amount
  • order_typeside (uses "BUY"/"SELL" strings)
  • status_name[0][1]status (flat string)
  • payment_windowpayment_window_minutes
  • payment_deadlinefixed_rate_deadline

Flat Structure

v2 removes nested objects for simpler integration:

Transaction Fields

  • transactions[].tx_id split into deposit_transaction and withdraw_transaction
  • Direct string fields instead of nested transaction arrays

Error Responses

400 Bad Request

Returned for invalid input data.

Example:

{
"detail": "Invalid input",
"errors": {
"deposit_currency": ["This field is required."],
"withdraw_currency": ["This field is required."]
}
}

401 Unauthorized

Returned when authentication credentials are missing or invalid.

Example:

{
"detail": "Authentication credentials were not provided"
}

404 Not Found

Returned when the specified order doesn't exist.

Example:

{
"detail": "Not found"
}

Next Steps