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
/v1/order/{order_id}/emergencyThis 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
| Parameter | Required | Description |
|---|---|---|
| action | Yes | One of: "continue", "refund", "recalculate" |
| refund_address | No* | 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
- User sends 0.09 BTC instead of required 0.1 BTC
- Order status changes to EMERGENCY
- User can choose:
- Refund - Get 0.09 BTC back
- Recalculate - Exchange 0.09 BTC for proportional USDT
Rate Slippage Scenario
- Float rate order created at rate 831.34
- During processing, rate drops to 800.00 (3.8% slippage)
- Order status changes to EMERGENCY
- 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"
}