openapi: 3.0.0 info: title: TRADING Account Spot API version: 1.0.0 description: API reference for Account management — Coins.ph servers: - url: https://api.pro.coins.ph description: Production - url: https://api.9001.pl-qa.coinsxyz.me description: Sandbox tags: - name: Spot description: Spot trading operations including order placement, querying, cancellation, and trade history. paths: /openapi/v1/exchangeInfo: get: tags: - Spot summary: Exchange Information description: 'Returns current exchange trading rules and symbol information. Provides comprehensive details about available trading pairs, their configurations, trading rules, and filters that apply to orders. **Key Notes** - Use `symbol` to query a single trading pair. - Use `symbols` (comma-separated) to query multiple trading pairs. Cannot be used together with `symbol`. - If neither is provided, returns information for all trading pairs. --- ## Additional Info **Rate Limit** [📖 Learn More](https://api.docs.coins.ph/reference/general#api-limit-introduction) Weight: 1 **Use Cases** [🧩 SDK](https://api.docs.coins.ph/reference/general#sdk) - **Order Validation** — Fetch PRICE_FILTER and LOT_SIZE filters before placing orders to avoid rejection - **Trading Pair Discovery** — Enumerate all active trading pairs and their supported order types - **Precision Handling** — Retrieve baseAssetPrecision and quoteAssetPrecision to format amounts correctly **Best Practices** - Cache exchange information at application startup and refresh periodically (every few hours) - Always check `status === ''TRADING''` before allowing orders on a symbol - Validate order price and quantity against PRICE_FILTER and LOT_SIZE before submitting ' operationId: get_exchange_info parameters: - in: header name: X-COINS-APIKEY required: true schema: type: string description: API key for authentication. - in: query name: symbol required: false schema: type: string example: BTCPHP description: Specify a single trading pair. Cannot be used with `symbols`. - in: query name: symbols required: false schema: type: string example: BTCPHP,ETHPHP description: Comma-separated list of trading pairs. Cannot be used with `symbol`. x-codeSamples: - lang: Shell label: All Trading Pairs source: 'curl --get --location ''https://api.pro.coins.ph/openapi/v1/exchangeInfo'' \ --header ''X-COINS-APIKEY: '' ' - lang: Shell label: Single Trading Pair source: 'curl --get --location ''https://api.pro.coins.ph/openapi/v1/exchangeInfo?symbol=BTCPHP'' \ --header ''X-COINS-APIKEY: '' ' - lang: Shell label: Multiple Trading Pairs source: 'curl --get --location ''https://api.pro.coins.ph/openapi/v1/exchangeInfo?symbols=BTCPHP,ETHPHP,BTCUSDT'' \ --header ''X-COINS-APIKEY: '' ' responses: '200': description: Exchange information retrieved successfully. content: application/json: schema: type: object properties: timezone: type: string description: Server timezone. example: UTC serverTime: type: integer format: int64 description: Current server time in milliseconds. example: 1538323200000 exchangeFilters: type: array description: Exchange-level filters (currently empty). symbols: type: array description: Array of trading pair information. items: type: object properties: symbol: type: string description: Trading pair symbol. example: BTCPHP status: type: string description: 'Trading status: TRADING (active) or HALT (suspended).' example: TRADING baseAsset: type: string description: Base asset (the asset being bought or sold). example: BTC baseAssetPrecision: type: integer description: Decimal precision for base asset amounts. example: 8 quoteAsset: type: string description: Quote asset (the asset used for pricing). example: PHP quoteAssetPrecision: type: integer description: Decimal precision for quote asset amounts. example: 8 orderTypes: type: array description: Supported order types for this trading pair. items: type: string example: - LIMIT - MARKET - LIMIT_MAKER - STOP_LOSS_LIMIT - STOP_LOSS - TAKE_PROFIT_LIMIT - TAKE_PROFIT filters: type: array description: Trading rules and filters for this pair. examples: success: summary: Exchange Info (BTCPHP) value: timezone: UTC serverTime: 1538323200000 exchangeFilters: [] symbols: - symbol: BTCPHP status: TRADING baseAsset: BTC baseAssetPrecision: 8 quoteAsset: PHP quoteAssetPrecision: 8 orderTypes: - LIMIT - MARKET - LIMIT_MAKER - STOP_LOSS_LIMIT - STOP_LOSS - TAKE_PROFIT_LIMIT - TAKE_PROFIT filters: - filterType: PRICE_FILTER minPrice: '0.00000100' maxPrice: '100000.00000000' tickSize: '0.00000100' - filterType: LOT_SIZE minQty: '0.00100000' maxQty: '100000.00000000' stepSize: '0.00100000' - filterType: NOTIONAL minNotional: '0.00100000' - filterType: MAX_NUM_ORDERS maxNumOrders: 200 - filterType: MAX_NUM_ALGO_ORDERS maxNumAlgoOrders: 5 default: description: 'API error response. The `code` field contains the internal API error code (not an HTTP status code). | Code | Description | |---|---| | -1121 | Invalid symbol | | -100013 | Parameter symbol and symbols cannot be used in combination | For the full list of error codes, see [Error Codes](https://api.docs.coins.ph/reference/error-codes). ' /openapi/v1/order/test: post: tags: - Spot summary: Test New Order (TRADE) description: 'Test order creation without sending it to the matching engine. Validates parameters, signature, and recvWindow. Returns empty object on success. Accepts the same parameters as POST /openapi/v1/order. --- ## Additional Info **Rate Limit** [📖 Learn More](https://api.docs.coins.ph/reference/general#api-limit-introduction) Weight: 1 **Use Cases** [🧩 SDK](https://api.docs.coins.ph/reference/general#sdk) - **Dry-Run Validation** — Submit a test order to confirm that price, quantity, and parameter formatting pass all exchange filters - **Order Type Exploration** — Test different order type and parameter combinations without risking actual funds **Best Practices** - Use during development to validate request format before placing live orders - Test all parameter combinations for each order type ' operationId: test_new_order parameters: - in: header name: X-COINS-APIKEY required: true schema: type: string description: API key for authentication. requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object required: - symbol - side - type - timestamp - signature properties: symbol: type: string default: BTCPHP description: Trading pair symbol. side: type: string enum: - BUY - SELL example: BUY description: Order side. type: type: string enum: - LIMIT - MARKET - LIMIT_MAKER - STOP_LOSS - STOP_LOSS_LIMIT - TAKE_PROFIT - TAKE_PROFIT_LIMIT example: LIMIT description: Order type. timeInForce: type: string enum: - GTC - IOC - FOK example: GTC description: Time in force. Required for LIMIT order types. quantity: type: string example: '0.001' description: Order quantity in base asset units. The quantity must be a multiple of the symbol's stepSize. If the submitted quantity is not aligned with the stepSize, the excess portion will be truncated. quoteOrderQty: type: string example: '1000.00' description: Quote asset quantity for MARKET orders. price: type: string example: '50000.00' description: Order price per unit. newClientOrderId: type: string example: my_order_123 description: Client-assigned unique order ID. stopPrice: type: string example: '49000.00' description: Trigger price for stop orders. newOrderRespType: type: string enum: - ACK - RESULT - FULL example: FULL description: Response type. stpFlag: type: string enum: - CB - CN - CO example: CB description: 'Self-trade prevention flag. Default: CB.' recvWindow: type: integer format: int64 minimum: 0 maximum: 60000 example: 5000 description: 'Request validity window in milliseconds. Default: 5000, Maximum: 60000.' timestamp: type: integer format: int64 example: 1507725176532 description: Unix timestamp in milliseconds. signature: type: string example: c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71 description: HMAC SHA256 signature of the query string [📖 Learn More](https://api.docs.coins.ph/reference/general#signed-endpoint-examples-for-post-openapiv1order) x-codeSamples: - lang: Shell label: Test LIMIT Order source: 'curl --location --request POST ''https://api.pro.coins.ph/openapi/v1/order/test'' \ --header ''X-COINS-APIKEY: '' \ --data-urlencode ''symbol=BTCPHP'' \ --data-urlencode ''side=BUY'' \ --data-urlencode ''type=LIMIT'' \ --data-urlencode ''timeInForce=GTC'' \ --data-urlencode ''quantity=0.001'' \ --data-urlencode ''price=50000.00'' \ --data-urlencode ''timestamp=1507725176532'' \ --data-urlencode ''signature='' ' responses: '200': description: Order validated. Returns empty object (order not placed). content: application/json: schema: type: object properties: {} additionalProperties: false example: {} example: success: summary: Validation Passed value: {} default: description: 'API error response. The `code` field contains the internal API error code (not an HTTP status code). | Code | Description | |---|---| | -1100 | Illegal characters in parameter | | -1102 | Mandatory parameter was not sent | | -1116 | Invalid orderType | For the full list of error codes, see [Error Codes](https://api.docs.coins.ph/reference/error-codes). ' /openapi/v1/order: post: tags: - Spot summary: New Order (TRADE) description: 'Submit a new trading order. Supports LIMIT, MARKET, STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT, and LIMIT_MAKER order types. **Order Type Requirements** | Type | Required Additional Parameters | |---|---| | LIMIT | timeInForce, quantity, price | | MARKET | quantity OR quoteOrderQty | | STOP_LOSS | quantity OR quoteOrderQty, stopPrice | | STOP_LOSS_LIMIT | timeInForce, quantity, price, stopPrice | | TAKE_PROFIT | quantity OR quoteOrderQty, stopPrice | | TAKE_PROFIT_LIMIT | timeInForce, quantity, price, stopPrice | | LIMIT_MAKER | quantity, price | **Time In Force** - GTC (Good-Till-Cancel): Active until filled or cancelled - IOC (Immediate-Or-Cancel): Fill immediately, cancel remainder - FOK (Fill-Or-Kill): Fill entirely or cancel completely **Self-Trade Prevention (stpFlag)** - CB (Cancel Both): Cancel both orders (default) - CO (Cancel Oldest): Cancel the older order - CN (Cancel Newest): Cancel the newer order --- ## Additional Info **Rate Limit** [📖 Learn More](https://api.docs.coins.ph/reference/general#api-limit-introduction) Weight: 1 **Use Cases** [🧩 SDK](https://api.docs.coins.ph/reference/general#sdk) - **Limit Order** - Buy/sell at a specific price; stays in order book until filled or cancelled - **Market Order** - Execute immediately at best available price - **Stop-Loss** - Limit losses by triggering a market order when stop price is reached - **Take-Profit** - Lock in gains by triggering a market order at target price - **LIMIT_MAKER** - Post-only order guaranteeing maker fees **Best Practices** - Use newClientOrderId for idempotency and order tracking - Use newOrderRespType=FULL to receive fill details in the response - Validate price/quantity against exchangeInfo filters before placing orders ' operationId: create_new_order parameters: - in: header name: X-COINS-APIKEY required: true schema: type: string description: API key for authentication. requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object required: - symbol - side - type - timestamp - signature properties: symbol: type: string default: BTCPHP description: Trading pair symbol (e.g., BCHUSDT, BTCUSDT). side: type: string enum: - BUY - SELL description: Order side. type: type: string enum: - LIMIT - MARKET - STOP_LOSS - STOP_LOSS_LIMIT - TAKE_PROFIT - TAKE_PROFIT_LIMIT - LIMIT_MAKER description: Order type. timeInForce: type: string enum: - GTC - IOC - FOK example: GTC description: Time in force policy. Required for LIMIT order types. quantity: type: string example: '1' description: Order quantity in base asset units. The quantity must be a multiple of the symbol's stepSize. If the submitted quantity is not aligned with the stepSize, the excess portion will be truncated. quoteOrderQty: type: string example: '400' description: Order quantity in quote asset units. Used for MARKET orders as alternative to quantity. price: type: string example: '400' description: Limit price. Required for LIMIT, STOP_LOSS_LIMIT, TAKE_PROFIT_LIMIT, LIMIT_MAKER. newClientOrderId: type: string maxLength: 100 example: my_order_001 description: Client-assigned unique order ID for idempotency. Auto-generated if not provided. stopPrice: type: string example: '390' description: 'Trigger price for conditional orders. Direction rules: - STOP_LOSS / STOP_LOSS_LIMIT BUY: stop price must be above current market price - STOP_LOSS / STOP_LOSS_LIMIT SELL: stop price must be below current market price - TAKE_PROFIT / TAKE_PROFIT_LIMIT SELL: stop price must be above current market price - TAKE_PROFIT / TAKE_PROFIT_LIMIT BUY: stop price must be below current market price ' newOrderRespType: type: string enum: - ACK - RESULT - FULL example: FULL description: 'Response detail level. Default: FULL for MARKET/LIMIT, ACK for others.' stpFlag: type: string enum: - CB - CO - CN - NONE example: CB description: 'Self-Trade Prevention flag. Default: CB.' recvWindow: type: integer format: int64 minimum: 0 maximum: 60000 example: 5000 description: 'Request validity window in milliseconds. Default: 5000, Maximum: 60000.' timestamp: type: integer format: int64 example: 1656900365976 description: Unix timestamp in milliseconds. signature: type: string example: c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71 description: HMAC SHA256 signature of the query string [📖 Learn More](https://api.docs.coins.ph/reference/general#signed-endpoint-examples-for-post-openapiv1order) x-codeSamples: - lang: Shell label: LIMIT Order source: 'curl --location --request POST ''https://api.pro.coins.ph/openapi/v1/order'' \ --header ''X-COINS-APIKEY: '' \ --data-urlencode ''symbol=BCHUSDT'' \ --data-urlencode ''side=BUY'' \ --data-urlencode ''type=LIMIT'' \ --data-urlencode ''timeInForce=GTC'' \ --data-urlencode ''quantity=1'' \ --data-urlencode ''price=400'' \ --data-urlencode ''timestamp=1656900365976'' \ --data-urlencode ''signature='' ' - lang: Shell label: MARKET Order source: 'curl --location --request POST ''https://api.pro.coins.ph/openapi/v1/order'' \ --header ''X-COINS-APIKEY: '' \ --data-urlencode ''symbol=ETHUSDT'' \ --data-urlencode ''side=BUY'' \ --data-urlencode ''type=MARKET'' \ --data-urlencode ''quoteOrderQty=1000'' \ --data-urlencode ''timestamp=1656900365976'' \ --data-urlencode ''signature='' ' responses: '200': description: Order submitted successfully. content: application/json: schema: type: object properties: symbol: type: string example: BCHUSDT orderId: type: integer format: int64 example: 1202289462787244800 clientOrderId: type: string example: '165806087267756' transactTime: type: integer format: int64 example: 1656900365976 price: type: string example: '400' origQty: type: string example: '1' executedQty: type: string example: '1' cummulativeQuoteQty: type: string example: '400' status: type: string example: FILLED timeInForce: type: string example: GTC type: type: string example: LIMIT side: type: string example: BUY fills: type: array description: Fill details (FULL response only). items: type: object properties: price: type: string example: '400' qty: type: string example: '1' commission: type: string example: '0.001' commissionAsset: type: string example: BCH tradeId: type: string example: '1205027741844507648' examples: full_response: summary: FULL Response (FILLED) value: symbol: BCHUSDT orderId: 1202289462787244800 clientOrderId: '165806087267756' transactTime: 1656900365976 price: '400' origQty: '1' executedQty: '1' cummulativeQuoteQty: '400' status: FILLED timeInForce: GTC type: LIMIT side: BUY fills: - price: '400' qty: '1' commission: '0.001' commissionAsset: BCH tradeId: '1205027741844507648' default: description: 'API error response. The `code` field contains the internal API error code (not an HTTP status code). | Code | Description | |---|---| | -1013 | Filter failure: PRICE_FILTER or LOT_SIZE | | -1116 | Invalid orderType | | -2010 | New order rejected | For the full list of error codes, see [Error Codes](https://api.docs.coins.ph/reference/error-codes). ' get: tags: - Spot summary: Query Order (USER_DATA) description: 'Check an order''s status. Either orderId or origClientOrderId must be sent. If both are sent, orderId takes precedence. **Order Status Values** | Status | Description | |---|---| | NEW | Accepted but not yet executed | | PARTIALLY_FILLED | Part of order has been filled | | FILLED | Completely executed | | PARTIALLY_CANCELED | Part canceled due to self-trade | | CANCELED | Cancelled by user | | EXPIRED | Cancelled by matching engine | --- ## Additional Info **Rate Limit** [📖 Learn More](https://api.docs.coins.ph/reference/general#api-limit-introduction) Weight: 2 **Use Cases** [🧩 SDK](https://api.docs.coins.ph/reference/general#sdk) - **Fill Confirmation** — Query order status after submission to confirm whether a fill occurred before placing a follow-up order - **State Reconciliation** — Sync local order state with the exchange after a network interruption or reconnect - **Partial Fill Check** — Inspect `executedQty` against `origQty` to determine how much of a partially filled order has been executed **Best Practices** - Use orderId for precision when available - Cache order details locally to reduce API calls ' operationId: query_order parameters: - in: header name: X-COINS-APIKEY required: true schema: type: string description: API key for authentication. - in: query name: orderId required: false schema: type: integer format: int64 description: System-assigned order ID. example: 1799249051008066600 - in: query name: origClientOrderId required: false schema: type: string description: Client-assigned order ID. example: test5678 - in: query name: recvWindow required: false schema: type: integer format: int64 minimum: 0 maximum: 60000 description: 'Request validity window in milliseconds. Default: 5000, Maximum: 60000.' - in: query name: timestamp required: true schema: type: integer format: int64 minimum: 0 description: Unix timestamp in milliseconds. example: 1507725176532 - in: query name: signature required: true schema: type: string description: HMAC SHA256 signature of the query string [📖 Learn More](https://api.docs.coins.ph/reference/general#signed-endpoint-examples-for-post-openapiv1order) x-codeSamples: - lang: Shell label: Query by Order ID source: 'curl --get --location ''https://api.pro.coins.ph/openapi/v1/order'' \ --header ''X-COINS-APIKEY: '' \ --data-urlencode ''orderId=1799249051008066560'' \ --data-urlencode ''timestamp=1507725176532'' \ --data-urlencode ''signature='' ' responses: '200': description: Order details retrieved successfully. content: application/json: schema: type: object properties: symbol: type: string example: BTCPHP orderId: type: integer format: int64 example: 1799249051008066600 clientOrderId: type: string example: test5678 price: type: string example: '0' origQty: type: string example: '0.001' executedQty: type: string example: '0.001' cummulativeQuoteQty: type: string example: '3946.87326' status: type: string example: FILLED timeInForce: type: string example: GTC type: type: string example: MARKET side: type: string example: BUY stopPrice: type: string example: '0' isWorking: type: boolean example: false time: type: integer format: int64 example: 1729223201090 updateTime: type: integer format: int64 example: 1729223201201 examples: filled_order: summary: Filled MARKET Order value: symbol: BTCPHP orderId: 1799249051008066600 clientOrderId: test5678 price: '0' origQty: '0.001' executedQty: '0.001' cummulativeQuoteQty: '3946.87326' status: FILLED timeInForce: GTC type: MARKET side: BUY stopPrice: '0' isWorking: false time: 1729223201090 updateTime: 1729223201201 default: description: 'API error response. The `code` field contains the internal API error code (not an HTTP status code). | Code | Description | |---|---| | -1102 | Mandatory parameter orderId or origClientOrderId was not sent | | -2013 | Order does not exist | For the full list of error codes, see [Error Codes](https://api.docs.coins.ph/reference/error-codes). ' delete: tags: - Spot summary: Cancel Order (TRADE) description: 'Cancel an active order. Either orderId or origClientOrderId must be sent. Only NEW or PARTIALLY_FILLED orders can be cancelled. The filled portion is not reversed. --- ## Additional Info **Rate Limit** [📖 Learn More](https://api.docs.coins.ph/reference/general#api-limit-introduction) Weight: 1 **Use Cases** [🧩 SDK](https://api.docs.coins.ph/reference/general#sdk) - **Price Update** — Cancel an existing limit order to replace it at a more competitive price level - **Risk Reduction** — Remove a pending order when market conditions change and the position is no longer desired - **Order Cleanup** — Cancel a stale order that missed its fill window before resubmitting with updated parameters **Best Practices** - Verify order status is cancellable before sending cancel request - Always check response status is CANCELED to confirm success ' operationId: cancel_order parameters: - in: header name: X-COINS-APIKEY required: true schema: type: string description: API key for authentication. - in: query name: orderId required: false schema: type: integer format: int64 description: System-assigned order ID. example: 1205324142243592400 - in: query name: origClientOrderId required: false schema: type: string description: Client-assigned order ID. example: '165838718862761' - in: query name: recvWindow required: false schema: type: integer format: int64 minimum: 0 maximum: 60000 description: 'Request validity window in milliseconds. Default: 5000, Maximum: 60000.' - in: query name: timestamp required: true schema: type: integer format: int64 minimum: 0 description: Unix timestamp in milliseconds. example: 1507725176532 - in: query name: signature required: true schema: type: string description: HMAC SHA256 signature of the query string [📖 Learn More](https://api.docs.coins.ph/reference/general#signed-endpoint-examples-for-post-openapiv1order) x-codeSamples: - lang: Shell label: Cancel Order source: 'curl --location --request DELETE ''https://api.pro.coins.ph/openapi/v1/order'' \ --header ''X-COINS-APIKEY: '' \ --data-urlencode ''orderId=1205324142243592448'' \ --data-urlencode ''timestamp=1507725176532'' \ --data-urlencode ''signature='' ' responses: '200': description: Order cancelled successfully. content: application/json: schema: type: object properties: symbol: type: string example: BCHBUSD orderId: type: integer format: int64 example: 1205324142243592400 clientOrderId: type: string example: '165838718862761' price: type: string example: '2' origQty: type: string example: '10' executedQty: type: string example: '3' cummulativeQuoteQty: type: string example: '16' status: type: string example: CANCELED timeInForce: type: string example: GTC type: type: string example: LIMIT side: type: string example: SELL examples: canceled: summary: Order Canceled value: symbol: BCHBUSD orderId: 1205324142243592400 clientOrderId: '165838718862761' price: '2' origQty: '10' executedQty: '3' cummulativeQuoteQty: '16' status: CANCELED timeInForce: GTC type: LIMIT side: SELL default: description: 'API error response. The `code` field contains the internal API error code (not an HTTP status code). | Code | Description | |---|---| | -2011 | Unknown order sent | | -2013 | Order does not exist | For the full list of error codes, see [Error Codes](https://api.docs.coins.ph/reference/error-codes). ' /openapi/v1/openOrders: get: tags: - Spot summary: Current Open Orders (USER_DATA) description: 'Get all open orders on a symbol. If symbol is not sent, returns open orders for all symbols. --- ## Additional Info **Rate Limit** [📖 Learn More](https://api.docs.coins.ph/reference/general#api-limit-introduction) Weight: 10 **Use Cases** [🧩 SDK](https://api.docs.coins.ph/reference/general#sdk) - **Exposure Check** — Retrieve all open orders on a symbol to calculate total pending exposure before placing additional orders - **State Sync** — Reload all active orders after a reconnect or application restart to restore local state - **Strategy Audit** — List all open orders across symbols to confirm no stale orders remain before switching strategies **Best Practices** - Always pass symbol when possible to minimize weight usage - Use this endpoint to sync local order state with the exchange ' operationId: get_open_orders parameters: - in: header name: X-COINS-APIKEY required: true schema: type: string description: API key for authentication. - in: query name: symbol required: false schema: type: string description: Trading pair symbol. If omitted, returns open orders for all symbols. example: BTCUSDT - in: query name: recvWindow required: false schema: type: integer format: int64 minimum: 0 maximum: 60000 description: 'Request validity window in milliseconds. Default: 5000, Maximum: 60000.' - in: query name: timestamp required: true schema: type: integer format: int64 minimum: 0 description: Unix timestamp in milliseconds. example: 1507725176532 - in: query name: signature required: true schema: type: string description: HMAC SHA256 signature of the query string [📖 Learn More](https://api.docs.coins.ph/reference/general#signed-endpoint-examples-for-post-openapiv1order) x-codeSamples: - lang: Shell label: Open Orders by Symbol source: 'curl --get --location ''https://api.pro.coins.ph/openapi/v1/openOrders'' \ --header ''X-COINS-APIKEY: '' \ --data-urlencode ''symbol=BTCUSDT'' \ --data-urlencode ''timestamp=1507725176532'' \ --data-urlencode ''signature='' ' responses: '200': description: Open orders retrieved successfully. content: application/json: schema: type: array items: type: object properties: symbol: type: string example: BTCUSDT orderId: type: integer format: int64 example: 1202289462787244800 clientOrderId: type: string example: '165806087267756' price: type: string example: '20000' origQty: type: string example: '0.01' executedQty: type: string example: '0' cummulativeQuoteQty: type: string example: '0' status: type: string example: NEW timeInForce: type: string example: GTC type: type: string example: LIMIT side: type: string example: BUY stopPrice: type: string example: '0' isWorking: type: boolean example: true time: type: integer format: int64 example: 1507725176532 updateTime: type: integer format: int64 example: 1507725176532 examples: open_orders: summary: Open Orders List value: - symbol: BTCUSDT orderId: 1202289462787244800 clientOrderId: '165806087267756' price: '20000' origQty: '0.01' executedQty: '0' cummulativeQuoteQty: '0' status: NEW timeInForce: GTC type: LIMIT side: BUY stopPrice: '0' isWorking: true time: 1507725176532 updateTime: 1507725176532 default: description: 'API error response. The `code` field contains the internal API error code (not an HTTP status code). | Code | Description | |---|---| | -1121 | Invalid symbol | For the full list of error codes, see [Error Codes](https://api.docs.coins.ph/reference/error-codes). ' delete: tags: - Spot summary: Cancel All Open Orders on a Symbol (TRADE) description: 'Cancels all active orders on a symbol. Quickly cancel all open orders for a specific trading pair in a single request, useful for risk management and rapid position adjustment. **Key Notes** - Cancels ALL active orders (NEW and PARTIALLY_FILLED) for the specified symbol. - Does not affect orders already FILLED, CANCELED, or EXPIRED. - Returns an array of all cancelled orders. - Empty array `[]` if no open orders exist for the symbol. --- ## Additional Info **Rate Limit** [📖 Learn More](https://api.docs.coins.ph/reference/general#api-limit-introduction) Weight: 1 **Use Cases** [🧩 SDK](https://api.docs.coins.ph/reference/general#sdk) - **Emergency Stop** — Cancel all orders immediately during unexpected market conditions - **Strategy Reset** — Clear all pending orders before applying a new trading strategy - **Risk Management** — Remove all exposure for a specific trading pair quickly **Best Practices** - Verify the `symbol` parameter is correctly formatted and valid - Use cautiously — this is a powerful operation that affects all orders on a symbol ' operationId: cancel_all_open_orders parameters: - in: header name: X-COINS-APIKEY required: true schema: type: string description: API key for authentication. - in: query name: symbol required: true schema: type: string description: Trading pair symbol for which to cancel all open orders. example: BTCUSDT - in: query name: recvWindow required: false schema: type: integer format: int64 minimum: 0 maximum: 60000 description: 'Request validity window in milliseconds. Default: 5000, Maximum: 60000.' - in: query name: timestamp required: true schema: type: integer format: int64 minimum: 0 description: Unix timestamp in milliseconds. example: 1507725176532 - in: query name: signature required: true schema: type: string description: HMAC SHA256 signature of the query string [📖 Learn More](https://api.docs.coins.ph/reference/general#signed-endpoint-examples-for-post-openapiv1order) x-codeSamples: - lang: Shell label: Cancel All Open Orders on a Symbol source: 'curl --location --request DELETE ''https://api.pro.coins.ph/openapi/v1/openOrders'' \ --header ''X-COINS-APIKEY: '' \ --data-urlencode ''symbol=BTCUSDT'' \ --data-urlencode ''timestamp=1507725176532'' \ --data-urlencode ''signature='' ' responses: '200': description: All open orders for the symbol cancelled successfully. content: application/json: schema: type: array items: type: object properties: symbol: type: string example: BTCUSDT orderId: type: integer format: int64 example: 1200757068661824000 clientOrderId: type: string example: '165787781474653' price: type: string example: '19999' origQty: type: string example: '0.01' executedQty: type: string example: '0' cummulativeQuoteQty: type: string example: '0' status: type: string example: CANCELED timeInForce: type: string example: GTC type: type: string example: LIMIT side: type: string example: BUY stopPrice: type: string example: '0' origQuoteOrderQty: type: string example: '0' examples: canceled_all: summary: All Orders Cancelled value: - symbol: BTCUSDT orderId: 1200757068661824000 clientOrderId: '165787781474653' price: '19999' origQty: '0.01' executedQty: '0' cummulativeQuoteQty: '0' status: CANCELED timeInForce: GTC type: LIMIT side: BUY stopPrice: '0' origQuoteOrderQty: '0' default: description: 'API error response. The `code` field contains the internal API error code (not an HTTP status code). | Code | Description | |---|---| | -4020 | No open orders | | -1121 | Invalid symbol | For the full list of error codes, see [Error Codes](https://api.docs.coins.ph/reference/error-codes). ' /openapi/v1/order/cancelReplace: post: tags: - Spot summary: Cancel and Replace Order (TRADE) description: 'Cancel an existing active order and place a new order on the same symbol in a single atomic operation. If the cancellation or new order placement fails, the entire operation is rolled back. This endpoint is used to modify parameters (such as quantity, price) of an existing open order by cancelling it and immediately placing a replacement order. **Cancel Replace Mode** | Mode | Description | |---|---| | STOP_ON_FAILURE | If the cancel request fails, the new order placement will not be attempted | | ALLOW_FAILURE | New order placement will be attempted even if the cancel request fails | **Cancel Restrictions** | Restriction | Description | |---|---| | ONLY_NEW | Cancel will succeed only if the order status is NEW | | ONLY_PARTIALLY_FILLED | Cancel will succeed only if the order status is PARTIALLY_FILLED | **Order Type Requirements** | Type | Required Additional Parameters | |---|---| | LIMIT | timeInForce, quantity, price | | MARKET | quantity OR quoteOrderQty | | STOP_LOSS | quantity OR quoteOrderQty, stopPrice | | STOP_LOSS_LIMIT | timeInForce, quantity, price, stopPrice | | TAKE_PROFIT | quantity OR quoteOrderQty, stopPrice | | TAKE_PROFIT_LIMIT | timeInForce, quantity, price, stopPrice | | LIMIT_MAKER | quantity, price | **Key Notes** - Either `cancelOrderId` or `cancelOrigClientOrderId` must be sent to identify the order to cancel. - If both `cancelOrderId` and `cancelOrigClientOrderId` are provided, `cancelOrderId` takes precedence. - `newClientOrderId` will replace `clientOrderId` of the cancelled order, freeing it up for new orders. - The new order placed may trigger an immediate fill if conditions are met. --- ## Additional Info **Rate Limit** [📖 Learn More](https://api.docs.coins.ph/reference/general#api-limit-introduction) Weight: 1 **Use Cases** [🧩 SDK](https://api.docs.coins.ph/reference/general#sdk) - **Price Adjustment** — Modify the price of an existing limit order without missing fills between cancel and new order - **Quantity Adjustment** — Change the size of an existing order atomically - **Order Upgrade** — Change order type (e.g., from LIMIT to STOP_LOSS_LIMIT) while maintaining position in queue **Best Practices** - Use `STOP_ON_FAILURE` mode when you want to ensure the old order is cancelled before placing the new one - Use `ALLOW_FAILURE` mode when placing the new order is more important than cancelling the old one - Always provide `newClientOrderId` for tracking and idempotency - Check response `cancelResult` and `newOrderResult` fields to verify both operations succeeded ' operationId: cancel_replace_order parameters: - in: header name: X-COINS-APIKEY required: true schema: type: string description: API key for authentication. requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object required: - symbol - side - type - cancelReplaceMode - timestamp - signature properties: symbol: type: string default: BTCPHP description: Trading pair symbol (e.g., BTCPHP, ETHUSDT). side: type: string enum: - BUY - SELL example: BUY description: Order side. type: type: string enum: - LIMIT - MARKET - STOP_LOSS - STOP_LOSS_LIMIT - TAKE_PROFIT - TAKE_PROFIT_LIMIT - LIMIT_MAKER example: LIMIT description: Order type for the new replacement order. cancelReplaceMode: type: string enum: - STOP_ON_FAILURE - ALLOW_FAILURE example: STOP_ON_FAILURE description: 'Mode controlling behavior when cancel fails. STOP_ON_FAILURE: abort if cancel fails. ALLOW_FAILURE: proceed with new order even if cancel fails.' timeInForce: type: string enum: - GTC - IOC - FOK example: GTC description: Time in force policy. Required for LIMIT order types. quantity: type: string example: '1' description: Order quantity in base asset units. quoteOrderQty: type: string example: '400' description: Order quantity in quote asset units. Used for MARKET orders as alternative to quantity. price: type: string example: '50000' description: Limit price for the new order. Required for LIMIT, STOP_LOSS_LIMIT, TAKE_PROFIT_LIMIT, LIMIT_MAKER. cancelOrderId: type: integer format: int64 example: 1202289462787244800 description: System-assigned order ID of the order to cancel. cancelOrigClientOrderId: type: string example: my_order_001 description: Client-assigned order ID of the order to cancel. Used as alternative to cancelOrderId. newClientOrderId: type: string maxLength: 100 example: my_new_order_001 description: Client-assigned unique ID for the new replacement order. Auto-generated if not provided. stopPrice: type: string example: '49000' description: Trigger price for conditional orders (STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT). newOrderRespType: type: string enum: - ACK - RESULT - FULL example: FULL description: 'Response detail level. Default: FULL for MARKET/LIMIT, ACK for others.' stpFlag: type: string enum: - CB - CO - CN - NONE example: CB description: 'Self-Trade Prevention flag. Default: CB.' cancelRestrictions: type: string enum: - ALL - ONLY_NEW - ONLY_PARTIALLY_FILLED example: ONLY_NEW description: 'Restrict cancel by order status. Default: ALL (cancel any status). ONLY_NEW: cancel only if status is NEW. ONLY_PARTIALLY_FILLED: cancel only if status is PARTIALLY_FILLED.' recvWindow: type: integer format: int64 minimum: 0 maximum: 60000 example: 5000 description: 'Request validity window in milliseconds. Default: 5000, Maximum: 60000.' timestamp: type: integer format: int64 example: 1656900365976 description: Unix timestamp in milliseconds. signature: type: string example: c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71 description: HMAC SHA256 signature of the query string [📖 Learn More](https://api.docs.coins.ph/reference/general#signed-endpoint-examples-for-post-openapiv1order) x-codeSamples: - lang: Shell label: Cancel and Replace LIMIT Order source: 'curl --location --request POST ''https://api.pro.coins.ph/openapi/v1/order/cancelReplace'' \ --header ''X-COINS-APIKEY: '' \ --data-urlencode ''symbol=BTCPHP'' \ --data-urlencode ''side=BUY'' \ --data-urlencode ''type=LIMIT'' \ --data-urlencode ''cancelReplaceMode=STOP_ON_FAILURE'' \ --data-urlencode ''timeInForce=GTC'' \ --data-urlencode ''quantity=0.001'' \ --data-urlencode ''price=50000'' \ --data-urlencode ''cancelOrderId=1202289462787244800'' \ --data-urlencode ''newClientOrderId=my_new_order_001'' \ --data-urlencode ''timestamp=1656900365976'' \ --data-urlencode ''signature='' ' responses: '200': description: Cancel and replace operation completed. content: application/json: schema: type: object properties: cancelResult: type: string description: 'Result of the cancel operation: SUCCESS or FAILURE.' example: SUCCESS newOrderResult: type: string description: 'Result of the new order placement: SUCCESS or NOT_ATTEMPTED.' example: SUCCESS cancelResponse: type: object description: Details of the cancelled order. properties: symbol: type: string example: BTCPHP orderId: type: integer format: int64 example: 1202289462787244800 clientOrderId: type: string example: my_order_001 price: type: string example: '48000' origQty: type: string example: '0.001' executedQty: type: string example: '0' cummulativeQuoteQty: type: string example: '0' status: type: string example: CANCELED timeInForce: type: string example: GTC type: type: string example: LIMIT side: type: string example: BUY newOrderResponse: type: object description: Details of the newly placed order. properties: symbol: type: string example: BTCPHP orderId: type: integer format: int64 example: 1202289462787244800 clientOrderId: type: string example: my_new_order_001 transactTime: type: integer format: int64 example: 1656900365976 price: type: string example: '50000' origQty: type: string example: '0.001' executedQty: type: string example: '0' cummulativeQuoteQty: type: string example: '0' status: type: string example: NEW timeInForce: type: string example: GTC type: type: string example: LIMIT side: type: string example: BUY examples: success: summary: Successful Cancel and Replace value: cancelResult: SUCCESS newOrderResult: SUCCESS cancelResponse: symbol: BTCPHP orderId: 1202289462787244800 clientOrderId: my_order_001 price: '48000' origQty: '0.001' executedQty: '0' cummulativeQuoteQty: '0' status: CANCELED timeInForce: GTC type: LIMIT side: BUY newOrderResponse: symbol: BTCPHP orderId: 1202289462787244800 clientOrderId: my_new_order_001 transactTime: 1656900365976 price: '50000' origQty: '0.001' executedQty: '0' cummulativeQuoteQty: '0' status: NEW timeInForce: GTC type: LIMIT side: BUY default: description: 'API error response. The `code` field contains the internal API error code (not an HTTP status code). | Code | Description | |---|---| | -2011 | Unknown order sent (cancel target not found) | | -2013 | Order does not exist | | -1013 | Filter failure: PRICE_FILTER or LOT_SIZE | | -1116 | Invalid orderType | | -2010 | New order rejected | For the full list of error codes, see [Error Codes](https://api.docs.coins.ph/reference/error-codes). ' /openapi/v1/historyOrders: get: tags: - Spot summary: History Orders By Create Time (USER_DATA) description: 'Get all historical orders of the account filtered by order **create time**: cancelled, filled, or rejected. Retrieves historical orders for a specific symbol with pagination support via the `orderId` parameter and time-based filtering based on when the order was originally created. **Key Notes** - If `symbol` is omitted, returns historical orders for all symbols (weight: 40). - If `orderId` is set, returns orders with order ID >= this value (pagination). - `startTime` and `endTime` filter by order create time (the `time` field). - Default limit is 500; maximum is 1000. - Only data from the **last 90 days** is available. This endpoint returns only **closed** orders. Returned statuses: FILLED, CANCELED, REJECTED, EXPIRED. Open orders (NEW, PARTIALLY_FILLED) are not returned — use the Current Open Orders endpoint for those. **Time Filtering** - This endpoint filters orders by their **create time** (`time` field), i.e., the timestamp when the order was originally submitted to the exchange. - If you need to filter by the time an order was last updated (filled, cancelled, etc.), use the [History Orders By Update Time](/openapi/v1/getHistoryOrdersByUpdateTime) endpoint instead. --- ## Additional Info **Rate Limit** [📖 Learn More](https://api.docs.coins.ph/reference/general#api-limit-introduction) | Condition | Weight | |---|---| | With symbol | 10 | | Without symbol | 40 | **Use Cases** [🧩 SDK](https://api.docs.coins.ph/reference/general#sdk) - **Trade History** — Retrieve complete order history for reconciliation based on when orders were placed - **Audit** — Verify all orders placed (created) during a specific time period - **Export** — Pull data for external analysis by order create date **Best Practices** - Use `startTime` / `endTime` for time-range queries to avoid fetching the full history - Use `orderId` from the last result as pagination cursor for the next query - Set a reasonable `limit` to balance API calls and data volume - Use this endpoint when you want to find orders created within a specific window; use History Orders By Update Time when you need orders whose status changed within a window ' operationId: get_history_orders parameters: - in: header name: X-COINS-APIKEY required: true schema: type: string description: API key for authentication. - in: query name: symbol required: false schema: type: string description: Trading pair symbol. If omitted, returns historical orders for all symbols. example: BCHBUSD - in: query name: orderId required: false schema: type: integer format: int64 description: Returns orders with order ID >= this value. Used for pagination. example: 1194453962386908700 - in: query name: startTime required: false schema: type: integer format: int64 description: Start time filter in milliseconds. example: 1657126000000 - in: query name: endTime required: false schema: type: integer format: int64 description: End time filter in milliseconds. example: 1657130000000 - in: query name: limit required: false schema: type: integer default: 500 maximum: 1000 description: 'Maximum number of orders to return. Default: 500, Maximum: 1000.' example: 500 - in: query name: recvWindow required: false schema: type: integer format: int64 minimum: 0 maximum: 60000 description: 'Request validity window in milliseconds. Default: 5000, Maximum: 60000.' - in: query name: timestamp required: true schema: type: integer format: int64 minimum: 0 description: Unix timestamp in milliseconds. example: 1507725176532 - in: query name: signature required: true schema: type: string description: HMAC SHA256 signature of the query string [📖 Learn More](https://api.docs.coins.ph/reference/general#signed-endpoint-examples-for-post-openapiv1order) x-codeSamples: - lang: Shell label: History Orders source: 'curl --get --location ''https://api.pro.coins.ph/openapi/v1/historyOrders'' \ --header ''X-COINS-APIKEY: '' \ --data-urlencode ''symbol=BCHBUSD'' \ --data-urlencode ''timestamp=1507725176532'' \ --data-urlencode ''signature='' ' - lang: Shell label: History Orders with Time Range source: 'curl --get --location ''https://api.pro.coins.ph/openapi/v1/historyOrders'' \ --header ''X-COINS-APIKEY: '' \ --data-urlencode ''symbol=BCHBUSD'' \ --data-urlencode ''startTime=1657126000000'' \ --data-urlencode ''endTime=1657130000000'' \ --data-urlencode ''limit=500'' \ --data-urlencode ''timestamp=1507725176532'' \ --data-urlencode ''signature='' ' responses: '200': description: Historical orders retrieved successfully. content: application/json: schema: type: array items: type: object properties: symbol: type: string example: BCHBUSD orderId: type: integer format: int64 example: 1194453962386908700 clientOrderId: type: string example: Y1657126007990 price: type: string example: '4.56' origQty: type: string example: '1' executedQty: type: string example: '1' cummulativeQuoteQty: type: string example: '4.56' status: type: string example: FILLED timeInForce: type: string example: GTC type: type: string example: LIMIT side: type: string example: SELL stopPrice: type: string example: '0' isWorking: type: boolean example: false time: type: integer format: int64 example: 1657126008273 updateTime: type: integer format: int64 example: 1657126008357 origQuoteOrderQty: type: string example: '0' examples: history_orders: summary: History Orders List value: - symbol: BCHBUSD orderId: 1194453962386908700 clientOrderId: Y1657126007990 price: '4.56' origQty: '1' executedQty: '1' cummulativeQuoteQty: '4.56' status: FILLED timeInForce: GTC type: LIMIT side: SELL stopPrice: '0' isWorking: false time: 1657126008273 updateTime: 1657126008357 origQuoteOrderQty: '0' default: description: 'API error response. The `code` field contains the internal API error code (not an HTTP status code). | Code | Description | |---|---| | -1121 | Invalid symbol | | -1100 | Illegal characters found in parameter | For the full list of error codes, see [Error Codes](https://api.docs.coins.ph/reference/error-codes). ' /openapi/v1/getHistoryOrdersByUpdateTime: get: tags: - Spot summary: History Orders By Update Time (USER_DATA) description: "Get all historical orders of the account filtered by order **update time**: cancelled, filled, or rejected.\nThis endpoint is identical to History Orders By Create Time except that `startTime` and `endTime` filter\nbased on the order's **last update time** rather than the order's **create time**.\n\n**Key Notes**\n\n- `symbol` is required.\n- If `orderId` is set, returns orders with order ID >= this value (pagination).\n- `startTime` and `endTime` filter by order update time (e.g., the time an order was filled, cancelled, or partially filled).\n- Default limit is 500; maximum is 1000.\n- Only data from the **last 90 days** is available. \n\nThis endpoint returns only **closed** orders. Returned statuses: FILLED, CANCELED, REJECTED, EXPIRED.\nOpen orders (NEW, PARTIALLY_FILLED) are not returned — use the Current Open Orders endpoint for those.\n\n**Difference from History Orders By Create Time**\n\n- History Orders By Create Time (`/openapi/v1/historyOrders`): `startTime` / `endTime` match against order **create time** (`time` field).\n- This endpoint: `startTime` / `endTime` match against order **update time** (`updateTime` field).\n\n---\n\n## Additional Info\n\n**Rate Limit** [\U0001F4D6 Learn More](https://api.docs.coins.ph/reference/general#api-limit-introduction)\n\nWeight: 10\n\n**Use Cases** [\U0001F9E9 SDK](https://api.docs.coins.ph/reference/general#sdk)\n\n- **Recent Activity Sync** — Retrieve orders that were recently filled or cancelled, regardless of when they were originally placed\n- **Incremental Polling** — Poll for order status changes since the last sync using `startTime` = last poll time\n- **Reconciliation** — Identify all orders whose state changed within a specific time window\n\n**Best Practices**\n\n- Use `startTime` / `endTime` based on the last known `updateTime` for efficient incremental sync\n- Use `orderId` from the last result as pagination cursor for the next query\n- Set a reasonable `limit` to balance API calls and data volume\n" operationId: get_history_orders_by_update_time parameters: - in: header name: X-COINS-APIKEY required: true schema: type: string description: API key for authentication. - in: query name: symbol required: true schema: type: string description: Trading pair symbol. example: BCHBUSD - in: query name: orderId required: false schema: type: integer format: int64 description: Returns orders with order ID >= this value. Used for pagination. example: 1194453962386908700 - in: query name: startTime required: false schema: type: integer format: int64 description: Start time filter in milliseconds (based on order update time). example: 1657126000000 - in: query name: endTime required: false schema: type: integer format: int64 description: End time filter in milliseconds (based on order update time). example: 1657130000000 - in: query name: limit required: false schema: type: integer default: 500 maximum: 1000 description: 'Maximum number of orders to return. Default: 500, Maximum: 1000.' example: 500 - in: query name: recvWindow required: false schema: type: integer format: int64 minimum: 0 maximum: 60000 description: 'Request validity window in milliseconds. Default: 5000, Maximum: 60000.' - in: query name: timestamp required: true schema: type: integer format: int64 minimum: 0 description: Unix timestamp in milliseconds. example: 1507725176532 - in: query name: signature required: true schema: type: string description: HMAC SHA256 signature of the query string [📖 Learn More](https://api.docs.coins.ph/reference/general#signed-endpoint-examples-for-post-openapiv1order) x-codeSamples: - lang: Shell label: History Orders By Update Time source: 'curl --get --location ''https://api.pro.coins.ph/openapi/v1/getHistoryOrdersByUpdateTime'' \ --header ''X-COINS-APIKEY: '' \ --data-urlencode ''symbol=BCHBUSD'' \ --data-urlencode ''timestamp=1507725176532'' \ --data-urlencode ''signature='' ' - lang: Shell label: History Orders By Update Time with Time Range source: 'curl --get --location ''https://api.pro.coins.ph/openapi/v1/getHistoryOrdersByUpdateTime'' \ --header ''X-COINS-APIKEY: '' \ --data-urlencode ''symbol=BCHBUSD'' \ --data-urlencode ''startTime=1657126000000'' \ --data-urlencode ''endTime=1657130000000'' \ --data-urlencode ''limit=500'' \ --data-urlencode ''timestamp=1507725176532'' \ --data-urlencode ''signature='' ' responses: '200': description: Historical orders retrieved successfully (filtered by update time). content: application/json: schema: type: array items: type: object properties: symbol: type: string example: BCHBUSD orderId: type: integer format: int64 example: 1194453962386908700 clientOrderId: type: string example: Y1657126007990 price: type: string example: '4.56' origQty: type: string example: '1' executedQty: type: string example: '1' cummulativeQuoteQty: type: string example: '4.56' status: type: string example: FILLED timeInForce: type: string example: GTC type: type: string example: LIMIT side: type: string example: SELL stopPrice: type: string example: '0' isWorking: type: boolean example: false time: type: integer format: int64 example: 1657126008273 updateTime: type: integer format: int64 example: 1657126008357 origQuoteOrderQty: type: string example: '0' examples: history_orders: summary: History Orders List (by Update Time) value: - symbol: BCHBUSD orderId: 1194453962386908700 clientOrderId: Y1657126007990 price: '4.56' origQty: '1' executedQty: '1' cummulativeQuoteQty: '4.56' status: FILLED timeInForce: GTC type: LIMIT side: SELL stopPrice: '0' isWorking: false time: 1657126008273 updateTime: 1657126008357 origQuoteOrderQty: '0' default: description: 'API error response. The `code` field contains the internal API error code (not an HTTP status code). | Code | Description | |---|---| | -1121 | Invalid symbol | | -1100 | Illegal characters found in parameter | For the full list of error codes, see [Error Codes](https://api.docs.coins.ph/reference/error-codes). ' /openapi/v1/myTrades: get: tags: - Spot summary: Account Trade List (USER_DATA) description: "Get trades for a specific account and symbol.\n\n- If fromId is set, returns trades with id >= fromId.\n- If startTime and endTime are both set, fromId is not required.\n- startTime and endTime cannot span more than 24 hours.\n- Maximum 1000 trades returned per request.\n- Only data from the **last 90 days** is available. \n\n---\n\n## Additional Info\n\n**Rate Limit** [\U0001F4D6 Learn More](https://api.docs.coins.ph/reference/general#api-limit-introduction)\n\nWeight: 10\n\n**Use Cases** [\U0001F9E9 SDK](https://api.docs.coins.ph/reference/general#sdk)\n\n- **P&L Calculation** - Calculate realized profit/loss from fills\n- **Fee Audit** - Track commissions paid per trade\n- **Reconciliation** - Match trades against order history\n\n**Best Practices**\n\n- Use time range (startTime/endTime) to paginate large histories\n- Use fromId to continue from last known trade when polling\n- Commission amounts and assets vary by fee tier and promotions\n" operationId: get_my_trades parameters: - in: header name: X-COINS-APIKEY required: true schema: type: string description: API key for authentication. - in: query name: symbol required: true schema: type: string description: Trading pair symbol. example: BTCUSDT - in: query name: startTime required: false schema: type: integer format: int64 description: Start time in milliseconds. example: 1507725176532 - in: query name: endTime required: false schema: type: integer format: int64 description: End time in milliseconds. example: 1507811576532 - in: query name: fromId required: false schema: type: integer format: int64 description: 'TradeId to fetch from. Default: most recent trades.' example: 1202289462787244800 - in: query name: limit required: false schema: type: integer default: 500 maximum: 1000 description: 'Number of results to return. Default: 500; Maximum: 1000.' example: 500 - in: query name: recvWindow required: false schema: type: integer format: int64 minimum: 0 maximum: 60000 description: 'Request validity window in milliseconds. Default: 5000, Maximum: 60000.' - in: query name: timestamp required: true schema: type: integer format: int64 minimum: 0 description: Unix timestamp in milliseconds. example: 1507725176532 - in: query name: signature required: true schema: type: string description: HMAC SHA256 signature of the query string [📖 Learn More](https://api.docs.coins.ph/reference/general#signed-endpoint-examples-for-post-openapiv1order) x-codeSamples: - lang: Shell label: My Trades source: 'curl --get --location ''https://api.pro.coins.ph/openapi/v1/myTrades'' \ --header ''X-COINS-APIKEY: '' \ --data-urlencode ''symbol=BTCUSDT'' \ --data-urlencode ''startTime=1507725176532'' \ --data-urlencode ''endTime=1507811576532'' \ --data-urlencode ''timestamp=1507811576532'' \ --data-urlencode ''signature='' ' responses: '200': description: Trade list retrieved successfully. content: application/json: schema: type: array items: type: object properties: symbol: type: string example: BTCUSDT id: type: integer format: int64 example: 1205027741844507600 orderId: type: integer format: int64 example: 1202289462787244800 price: type: string example: '20000' qty: type: string example: '0.01' quoteQty: type: string example: '200' commission: type: string example: '0.0001' commissionAsset: type: string example: BTC time: type: integer format: int64 example: 1507725176532 isBuyer: type: boolean example: true isMaker: type: boolean example: false isBestMatch: type: boolean example: true examples: trades: summary: Trade List value: - symbol: BTCUSDT id: 1205027741844507600 orderId: 1202289462787244800 price: '20000' qty: '0.01' quoteQty: '200' commission: '0.0001' commissionAsset: BTC time: 1507725176532 isBuyer: true isMaker: false isBestMatch: true default: description: 'API error response. The `code` field contains the internal API error code (not an HTTP status code). | Code | Description | |---|---| | -1121 | Invalid symbol | For the full list of error codes, see [Error Codes](https://api.docs.coins.ph/reference/error-codes). ' /openapi/v1/asset/transaction/history: get: tags: - Spot summary: Transaction History (USER_DATA) description: "Get historical fund flow records (transaction history) for a specific token on the account.\nThis endpoint returns all balance changes including deposits, withdrawals, trades, fees,\ntransfers, and other fund movements — providing a complete audit trail of asset changes.\n\n**Key Notes**\n\n- `tokenId` is required — specifies which asset's transaction history to retrieve.\n- Supports pagination via `pageNum` and `pageSize`.\n- Only data from the **last 90 days** is available. \n- `startTime` and `endTime` filter by transaction time; their range cannot exceed 90 days.\n- `endTime` must be greater than `startTime`.\n- Maximum `pageSize` is 100; maximum `pageNum` is 1000.\n- Optionally filter by `subUserId` to view a sub-account's transaction history.\n\n**Difference from Account Trade List**\n\n- Account Trade List (`/openapi/v1/myTrades`): Returns only trade fills (buy/sell executions).\n- This endpoint: Returns all types of fund movements including deposits, withdrawals, trades, fees, transfers, dividends, and other balance changes.\n\n---\n\n## Additional Info\n\n**Rate Limit** [\U0001F4D6 Learn More](https://api.docs.coins.ph/reference/general#api-limit-introduction)\n\nWeight: 5\n\n**Use Cases** [\U0001F9E9 SDK](https://api.docs.coins.ph/reference/general#sdk)\n\n- **Fund Reconciliation** — Track all balance changes for a specific asset across all activity types.\n- **Audit Trail** — Generate a complete history of fund movements for compliance or accounting.\n- **Sub-Account Monitoring** — View transaction history for specific sub-accounts.\n- **Balance Verification** — Cross-reference fund flows against expected balance changes.\n\n**Best Practices**\n\n- Use `startTime` / `endTime` to limit results to a specific time window for faster queries.\n- Paginate through large result sets using `pageNum` incrementally.\n- Keep `pageSize` at a reasonable value (e.g., 50-100) to balance response time and data volume.\n- Use in conjunction with Account Trade List for a complete picture: trades + other fund movements.\n" operationId: get_transaction_history parameters: - in: header name: X-COINS-APIKEY required: true schema: type: string description: API key for authentication. - in: query name: tokenId required: true schema: type: string description: Token/asset identifier (e.g., BTC, USDT, PHP). example: BTC - in: query name: subUserId required: false schema: type: integer format: int64 description: Sub-account user ID. If provided, returns transaction history for the specified sub-account. example: 1234567890 - in: query name: pageNum required: false schema: type: integer default: 1 maximum: 1000 description: 'Page number for pagination. Default: 1, Maximum: 1000.' example: 1 - in: query name: pageSize required: false schema: type: integer default: 20 maximum: 100 description: 'Number of records per page. Default: 20, Maximum: 100.' example: 20 - in: query name: startTime required: false schema: type: integer format: int64 description: Start time filter in milliseconds. Time range with endTime cannot exceed 90 days. example: 1657126000000 - in: query name: endTime required: false schema: type: integer format: int64 description: End time filter in milliseconds. Must be greater than startTime. example: 1657730000000 - in: query name: recvWindow required: false schema: type: integer format: int64 minimum: 0 maximum: 60000 description: 'Request validity window in milliseconds. Default: 5000, Maximum: 60000.' - in: query name: timestamp required: true schema: type: integer format: int64 minimum: 0 description: Unix timestamp in milliseconds. example: 1507725176532 - in: query name: signature required: true schema: type: string description: HMAC SHA256 signature of the query string [📖 Learn More](https://api.docs.coins.ph/reference/general#signed-endpoint-examples-for-post-openapiv1order) x-codeSamples: - lang: Shell label: Transaction History source: 'curl --get --location ''https://api.pro.coins.ph/openapi/v1/asset/transaction/history'' \ --header ''X-COINS-APIKEY: '' \ --data-urlencode ''tokenId=BTC'' \ --data-urlencode ''pageNum=1'' \ --data-urlencode ''pageSize=20'' \ --data-urlencode ''timestamp=1507725176532'' \ --data-urlencode ''signature='' ' - lang: Shell label: Transaction History with Time Range source: 'curl --get --location ''https://api.pro.coins.ph/openapi/v1/asset/transaction/history'' \ --header ''X-COINS-APIKEY: '' \ --data-urlencode ''tokenId=USDT'' \ --data-urlencode ''startTime=1657126000000'' \ --data-urlencode ''endTime=1657730000000'' \ --data-urlencode ''pageNum=1'' \ --data-urlencode ''pageSize=50'' \ --data-urlencode ''timestamp=1507725176532'' \ --data-urlencode ''signature='' ' responses: '200': description: Transaction history retrieved successfully. content: application/json: schema: type: object properties: total: type: integer description: Total number of records matching the query. example: 150 pageNum: type: integer description: Current page number. example: 1 pageSize: type: integer description: Number of records per page. example: 20 rows: type: array description: Array of transaction records. items: type: object properties: tokenId: type: string description: Token/asset identifier. example: BTC amount: type: string description: Transaction amount (positive for inflow, negative for outflow). example: '0.005' flowType: type: string description: Type of fund flow (e.g., TRADE, DEPOSIT, WITHDRAW, TRANSFER, FEE). example: TRADE time: type: integer format: int64 description: Transaction time (Unix timestamp in milliseconds). example: 1657126008273 bizId: type: string description: Business ID associated with this transaction. example: '1205027741844507648' examples: success: summary: Transaction History List value: total: 150 pageNum: 1 pageSize: 20 rows: - tokenId: BTC amount: '0.005' flowType: TRADE time: 1657126008273 bizId: '1205027741844507648' - tokenId: BTC amount: '-0.0001' flowType: FEE time: 1657126008273 bizId: '1205027741844507649' - tokenId: BTC amount: '0.1' flowType: DEPOSIT time: 1657100000000 bizId: '1205000000000000001' - tokenId: BTC amount: '-0.05' flowType: WITHDRAW time: 1657080000000 bizId: '1205000000000000002' - tokenId: BTC amount: '0.01' flowType: TRANSFER time: 1657060000000 bizId: '1205000000000000003' default: description: 'API error response. The `code` field contains the internal API error code (not an HTTP status code). | Code | Description | |---|---| | -1102 | Mandatory parameter ''tokenId'' was not sent | | -1100 | Illegal characters found in parameter | | -100011 | Invalid query time range | For the full list of error codes, see [Error Codes](https://api.docs.coins.ph/reference/error-codes). ' /openapi/v1/asset/tradeFee: get: tags: - Spot summary: Trade Fee (USER_DATA) description: 'Fetch the current trading fee rates (maker and taker commission) for one or all trading pairs on the account. Fee rates may vary based on VIP level or trading volume. **Key Notes** - If `symbol` is omitted, returns fee rates for all trading pairs. - Fee rates are returned as decimal values (e.g., `0.001` = 0.1%). --- ## Additional Info **Rate Limit** [📖 Learn More](https://api.docs.coins.ph/reference/general#api-limit-introduction) Weight: 1 **Use Cases** [🧩 SDK](https://api.docs.coins.ph/reference/general#sdk) - **Cost Calculation** — Calculate trading costs before placing orders - **Fee Tier Monitoring** — Check current maker/taker fee rates - **Profitability Analysis** — Factor in fees when calculating expected P&L **Best Practices** - Cache fee rates and refresh daily or weekly; they change infrequently - Use maker orders (LIMIT_MAKER) to benefit from lower maker fees - Calculate total cost: `fee = executedQty * price * commissionRate` ' operationId: get_trade_fee parameters: - in: header name: X-COINS-APIKEY required: true schema: type: string description: API key for authentication. - in: query name: symbol required: false schema: type: string example: BTCUSDT description: Trading pair symbol. If omitted, returns fee rates for all trading pairs. - in: query name: recvWindow required: false schema: type: integer format: int64 minimum: 0 maximum: 60000 example: 5000 description: 'Request validity window in milliseconds. Default: 5000, Maximum: 60000.' - in: query name: timestamp required: true schema: type: integer format: int64 minimum: 0 example: 1507725176532 description: Unix timestamp in milliseconds. - in: query name: signature required: true schema: type: string description: HMAC SHA256 signature of the query string [📖 Learn More](https://api.docs.coins.ph/reference/general#signed-endpoint-examples-for-post-openapiv1order) x-codeSamples: - lang: Shell label: Trade Fee (All Symbols) source: 'curl --get --location ''https://api.pro.coins.ph/openapi/v1/asset/tradeFee'' \ --header ''X-COINS-APIKEY: '' \ --data-urlencode ''timestamp=1507725176532'' \ --data-urlencode ''signature='' ' - lang: Shell label: Trade Fee (Single Symbol) source: 'curl --get --location ''https://api.pro.coins.ph/openapi/v1/asset/tradeFee'' \ --header ''X-COINS-APIKEY: '' \ --data-urlencode ''symbol=BTCUSDT'' \ --data-urlencode ''timestamp=1507725176532'' \ --data-urlencode ''signature='' ' responses: '200': description: Trade fee rates retrieved successfully. content: application/json: schema: type: array items: type: object properties: symbol: type: string description: Trading pair symbol. example: BTCUSDT makerCommission: type: string description: Maker commission rate (e.g., 0.001 = 0.1%). example: '0.001' takerCommission: type: string description: Taker commission rate (e.g., 0.001 = 0.1%). example: '0.001' examples: success: summary: Trade fee rates value: - symbol: BTCUSDT makerCommission: '0.001' takerCommission: '0.001' - symbol: ETHUSDT makerCommission: '0.001' takerCommission: '0.001' default: description: 'API error response. The `code` field contains the internal API error code (not an HTTP status code). | Code | Description | |---|---| | -1121 | Invalid symbol | | -1022 | Signature for this request is not valid | For the full list of error codes, see [Error Codes](https://api.docs.coins.ph/reference/error-codes). ' components: securitySchemes: ApiKeyAuth: type: apiKey in: header name: X-COINS-APIKEY x-readme: proxy-enabled: false