Coins.ph Spot API
Spot trading operations including order placement, querying, cancellation, and trade history.
Spot trading operations including order placement, querying, cancellation, and trade history.
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: <your api key>''
'
- lang: Shell
label: Single Trading Pair
source: 'curl --get --location ''https://api.pro.coins.ph/openapi/v1/exchangeInfo?symbol=BTCPHP'' \
--header ''X-COINS-APIKEY: <your api key>''
'
- 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: <your api key>''
'
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: <your api key>'' \
--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=<calculated_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: <your api key>'' \
--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=<calculated_signature>''
'
- lang: Shell
label: MARKET Order
source: 'curl --location --request POST ''https://api.pro.coins.ph/openapi/v1/order'' \
--header ''X-COINS-APIKEY: <your api key>'' \
--data-urlencode ''symbol=ETHUSDT'' \
--data-urlencode ''side=BUY'' \
--data-urlencode ''type=MARKET'' \
--data-urlencode ''quoteOrderQty=1000'' \
--data-urlencode ''timestamp=1656900365976'' \
--data-urlencode ''signature=<calculated_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: <your api key>'' \
--data-urlencode ''orderId=1799249051008066560'' \
--data-urlencode ''timestamp=1507725176532'' \
--data-urlencode ''signature=<calculated_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 pri
# --- truncated at 32 KB (99 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/coinsph/refs/heads/main/openapi/coinsph-spot-api-openapi.yml