Emergency Action

Handle emergency situations that require user intervention

When EMERGENCY Happens

An order enters EMERGENCY status when an unexpected situation occurs that requires user action. This can happen due to various reasons:

  • Underpayment - User sent less than the required amount
  • Overpayment - User sent more than the required amount
  • Rate Slippage - For float rate orders, the rate changed significantly during processing
  • Network Issues - Temporary blockchain network problems affecting the exchange
  • Address Issues - Problems with the destination address

Endpoint

POST/v1/order/{order_id}/emergency

This endpoint requires authentication

User Options

Continue Exchange

Proceed with the exchange using the current conditions. This is typically used when the user accepts the current state (e.g., accepts the new rate after slippage, or accepts receiving less due to underpayment).

Action: continue

The order will proceed to completion with the adjusted amounts.

Refund

Cancel the order and refund the deposited amount back to the user's refund address (or the original sending address if no refund address was specified).

Action: refund

The order will be cancelled and funds will be returned. This may take 1-24 hours depending on the network.

Recalculate

Recalculate the exchange based on the actual amount received. This is useful for underpayment or overpayment scenarios where you want to adjust the exchange amount.

Action: recalculate

The order will be recalculated with the actual received amount and a new rate will be applied.

Request Parameters

ParameterRequiredDescription
actionYesOne of: "continue", "refund", "recalculate"
refund_addressNo*Refund address (required if action is "refund" and no refund_address was set during order creation)

Request Example

POST /v1/order/MM1234567890/emergency
Content-Type: application/json
X-API-KEY: your_api_key
X-API-SIGN: generated_signature
X-API-TIMESTAMP: 1706284800

{
  "action": "continue"
}

Response Example

{
  "success": true,
  "data": {
    "order_id": "MM1234567890",
    "status": "EXCHANGE",
    "message": "Order will continue with adjusted amounts",
    "updated_at": "2025-01-27T11:35:00Z"
  }
}

Example Flows

Underpayment Scenario

  1. User sends 0.09 BTC instead of required 0.1 BTC
  2. Order status changes to EMERGENCY
  3. User can choose:
    • Refund - Get 0.09 BTC back
    • Recalculate - Exchange 0.09 BTC for proportional USDT

Rate Slippage Scenario

  1. Float rate order created at rate 831.34
  2. During processing, rate drops to 800.00 (3.8% slippage)
  3. Order status changes to EMERGENCY
  4. User can choose:
    • Continue - Accept the new rate and receive less
    • Refund - Cancel and get original deposit back

Processing Timeframes

  • Continue: Order proceeds immediately (usually completes within minutes)
  • Recalculate: Recalculation happens immediately, then order proceeds (usually completes within minutes)
  • Refund: Refunds typically process within 1-24 hours depending on network congestion and the currency

Error Responses

Order Not in Emergency

{
  "error": true,
  "error_code": "NOT_EMERGENCY",
  "message": "Order is not in EMERGENCY status"
}

Invalid Action

{
  "error": true,
  "error_code": "INVALID_ACTION",
  "message": "Action must be one of: continue, refund, recalculate"
}