### Create Market Order API & PHP Example Source: https://github.com/payeer/docs/blob/main/trade-api/ru.md This section details the API endpoint and parameters for creating a market order. It includes a PHP example demonstrating how to construct the request, sign it, and send it using cURL, along with example request and response bodies. ```APIDOC Endpoint: POST /api/trade/order_create Method: order_create Request Parameters: - pair (string, required): Trading pair (e.g., TRX_USD) - type (string, required): Order type, must be 'market' - action (string, required): Trading action, 'buy' or 'sell' - amount (string, optional): Quantity of the asset to trade. Either 'amount' or 'value' must be specified. - value (string, optional): Total value of the order. Either 'amount' or 'value' must be specified. - ts (long, required): Timestamp in milliseconds (e.g., 1644489441948) Request Headers: - Content-Type: application/json - API-ID: Your API ID (e.g., bd443f00-092c-4436-92a4-a704ef679e24) - API-SIGN: HMAC-SHA256 signature of (method + JSON request body) using API secret key Example Request Body: { "pair": "TRX_USD", "type": "market", "action": "buy", "amount": "10", "ts": 1644489441948 } Response 200 (application/json): { "success": true, "order_id": 37054922, "params": { "pair": "TRX_USD", "type": "market", "action": "buy", "amount": "10.000000", "price": "0.07200", "value": "0.72" } } ``` ```PHP $msec = round(microtime(true) * 1000); $apiId = 'bd443f00-092c-4436-92a4-a704ef679e24'; $apiSecret = 'api_secret_key'; $method = 'order_create'; $req = json_encode(array( 'pair' => 'TRX_USD', 'type' => 'market', 'action' => 'buy', 'amount' => '10', 'ts' => $msec, )); $sign = hash_hmac('sha256', $method.$req, $apiSecret); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://payeer.com/api/trade/".$method); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $req); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-Type: application/json", "API-ID: ".$apiId, "API-SIGN: ".$sign )); $response = curl_exec($ch); curl_close($ch); echo '
'; print_r(json_decode($response, true)); echo '
'; ``` -------------------------------- ### Create Stop-Limit Order API & PHP Example Source: https://github.com/payeer/docs/blob/main/trade-api/ru.md This section outlines the API endpoint and parameters for creating a stop-limit order. It provides a PHP example showing how to prepare and send the signed request via cURL, along with example request and response bodies. ```APIDOC Endpoint: POST /api/trade/order_create Method: order_create Request Parameters: - pair (string, required): Trading pair (e.g., TRX_USD) - type (string, required): Order type, must be 'stop_limit' - action (string, required): Trading action, 'buy' or 'sell' - amount (string, required): Quantity of the asset to trade. - price (string, required): The limit price for the order. - stop_price (string, required): The stop price that triggers the limit order. - ts (long, required): Timestamp in milliseconds (e.g., 1644492621264) Request Headers: - Content-Type: application/json - API-ID: Your API ID (e.g., bd443f00-092c-4436-92a4-a704ef679e24) - API-SIGN: HMAC-SHA256 signature of (method + JSON request body) using API secret key Example Request Body: { "pair": "TRX_USD", "type": "stop_limit", "action": "buy", "amount": "10", "price": "0.08", "stop_price": "0.078", "ts": 1644492621264 } Response 200 (application/json): { "success": true, "order_id": 37057767, "params": { "pair": "TRX_USD", "type": "stop_limit", "action": "buy", "amount": "10.000000", "price": "0.08000", "value": "0.80", "stop_price": "0.07800" } } ``` ```PHP $msec = round(microtime(true) * 1000); $apiId = 'bd443f00-092c-4436-92a4-a704ef679e24'; $apiSecret = 'api_secret_key'; $method = 'order_create'; $req = json_encode(array( 'pair' => 'TRX_USD', 'type' => 'stop_limit', 'action' => 'buy', 'amount' => '10', 'price' => '0.08', 'stop_price' => '0.078', 'ts' => $msec, )); $sign = hash_hmac('sha256', $method.$req, $apiSecret); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://payeer.com/api/trade/".$method); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $req); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-Type: application/json", "API-ID: ".$apiId, "API-SIGN: ".$sign )); $response = curl_exec($ch); curl_close($ch); echo '
'; print_r(json_decode($response, true)); echo '
'; ``` -------------------------------- ### Payeer API Connection Test Endpoint (/time) and PHP Example Source: https://github.com/payeer/docs/blob/main/trade-api/en.md Documentation for the `/time` API endpoint, used to check connectivity with the Payeer API and retrieve the server's current timestamp. This snippet includes the API specification and a practical PHP code example for making the request and parsing the response. ```APIDOC Endpoint: /time Method: GET Request Weight: 1 Response Parameters: success: boolean - Request success indicator (true, false) time: long - Server timestamp (e.g., 1644322909335) Example Response (200 OK, application/json): { "success": true, "time": 1644322909335 } ``` ```PHP $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://payeer.com/api/trade/time"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); $response = curl_exec($ch); curl_close($ch); echo '
'; print_r(json_decode($response, true)); echo '
'; ``` -------------------------------- ### Create Stop Limit Order on Payeer API Source: https://github.com/payeer/docs/blob/main/trade-api/en.md This snippet outlines the process for creating a stop-limit order via the Payeer API. It provides the API endpoint details, necessary request parameters including stop price, example JSON request and response structures, and a PHP code example for making the API call with proper authentication. ```APIDOC API Endpoint: POST /api/trade/order_create Description: Creates a stop-limit order on the Payeer exchange. Request Parameters: - pair (string, required): Trading pair (e.g., TRX_USD) - type (string, required): Order type, must be 'stop_limit' - action (string, required): Order action, 'buy' or 'sell' - amount (string, required): Amount to buy/sell - price (string, required): Limit price for the order - stop_price (string, required): Stop price that triggers the limit order - ts (long, required): Timestamp in milliseconds (e.g., 1644492621264) Request Headers: - Content-Type: application/json - API-ID: Your API ID - API-SIGN: HMAC-SHA256 signature of method + request body using API secret Example Request Body (application/json): { "pair": "TRX_USD", "type": "stop_limit", "action": "buy", "amount": "10", "price": "0.08", "stop_price": "0.078", "ts": 1644492621264 } Example Success Response 200 (application/json): { "success": true, "order_id": 37057767, "params": { "pair": "TRX_USD", "type": "stop_limit", "action": "buy", "amount": "10.000000", "price": "0.08000", "value": "0.80", "stop_price": "0.07800" } } ``` ```PHP $msec = round(microtime(true) * 1000); $apiId = 'bd443f00-092c-4436-92a4-a704ef679e24'; $apiSecret = 'api_secret_key'; $method = 'order_create'; $req = json_encode(array( 'pair' => 'TRX_USD', 'type' => 'stop_limit', 'action' => 'buy', 'amount' => '10', 'price' => '0.08', 'stop_price' => '0.078', 'ts' => $msec, )); $sign = hash_hmac('sha256', $method.$req, $apiSecret); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://payeer.com/api/trade/".$method); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $req); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-Type: application/json", "API-ID: ".$apiId, "API-SIGN: ".$sign )); $response = curl_exec($ch); curl_close($ch); echo '
'; print_r(json_decode($response, true)); echo '
'; ``` -------------------------------- ### Get Price Statistics for Trading Pairs (GET /api/trade/ticker) Source: https://github.com/payeer/docs/blob/main/trade-api/en.md This section details how to retrieve current price statistics and 24-hour changes for trading pairs from the Payeer API. It provides a PHP cURL example for making the GET request and comprehensive documentation of the request parameters (optional `pair` list) and the detailed structure of the JSON response, including ask, bid, last prices, and 24-hour min/max/delta values. ```PHP $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://payeer.com/api/trade/ticker"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); $response = curl_exec($ch); curl_close($ch); echo '
'; print_r(json_decode($response, true)); echo '
'; ``` ```APIDOC Endpoint: GET /api/trade/ticker Description: Getting price statistics and their changes over the last 24 hours. Request Weight: 1 Request Parameters: pair: string (optional, comma-separated list of pairs, e.g., "BTC_USD,BTC_RUB") Response 200 (application/json): success: boolean (request success indicator) pairs: object (list of pairs, key-value pairs where key is the trading pair) : object ask: string (ask price) bid: string (bid price) last: string (last price) min24: string (minimum price for 24 hours) max24: string (maximum price for 24 hours) delta: string (price change in 24 hours as a percentage) delta_price: string (price change in 24 hours) Example Response Body: { "success": true, "pairs": { "BTC_USD": { "ask": "43555.55", "bid": "43506.01", "last": "43555.55", "min24": "43006.01", "max24": "46000.00", "delta": "1.06", "delta_price": "455.55" }, "BTC_RUB": { "ask": "3258999.99", "bid": "3230001.02", "last": "3230001.00", "min24": "3175000.00", "max24": "3390000.00", "delta": "1.41", "delta_price": "45000.97" }, "BTC_EUR": { "ask": "40000.00", "bid": "39000.00", "last": "40100.00", "min24": "37560.00", "max24": "40100.00", "delta": "6.79", "delta_price": "2549.00" } } } ``` -------------------------------- ### Create Market Order on Payeer API Source: https://github.com/payeer/docs/blob/main/trade-api/en.md This snippet details how to create a market order using the Payeer API. It includes the API endpoint specification, required request parameters, example JSON request and response bodies, and a PHP implementation demonstrating the API call with HMAC-SHA256 signing. ```APIDOC API Endpoint: POST /api/trade/order_create Description: Creates a market order on the Payeer exchange. Request Parameters: - pair (string, required): Trading pair (e.g., TRX_USD) - type (string, required): Order type, must be 'market' - action (string, required): Order action, 'buy' or 'sell' - amount (string, optional): Amount to buy/sell. Specify either 'amount' or 'value'. - value (string, optional): Value in quote currency. Specify either 'amount' or 'value'. - ts (long, required): Timestamp in milliseconds (e.g., 1644489441948) Request Headers: - Content-Type: application/json - API-ID: Your API ID - API-SIGN: HMAC-SHA256 signature of method + request body using API secret Example Request Body (application/json): { "pair": "TRX_USD", "type": "market", "action": "buy", "amount": "10", "ts": 1644489441948 } Example Success Response 200 (application/json): { "success": true, "order_id": 37054922, "params": { "pair": "TRX_USD", "type": "market", "action": "buy", "amount": "10.000000", "price": "0.07200", "value": "0.72" } } ``` ```PHP $msec = round(microtime(true) * 1000); $apiId = 'bd443f00-092c-4436-92a4-a704ef679e24'; $apiSecret = 'api_secret_key'; $method = 'order_create'; $req = json_encode(array( 'pair' => 'TRX_USD', 'type' => 'market', 'action' => 'buy', 'amount' => '10', 'ts' => $msec, )); $sign = hash_hmac('sha256', $method.$req, $apiSecret); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://payeer.com/api/trade/".$method); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $req); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-Type: application/json", "API-ID: ".$apiId, "API-SIGN: ".$sign )); $response = curl_exec($ch); curl_close($ch); echo '
'; print_r(json_decode($response, true)); echo '
'; ``` -------------------------------- ### Payeer API: Get Available Payment Systems Source: https://github.com/payeer/docs/blob/main/rest-api/en.md This API endpoint retrieves a list of payment systems currently available for payout transactions. It provides details for each system, including ID, name, commission rates, supported currencies, and required fields for creating a payout. ```APIDOC POST /getPaySystems Headers: Content-Type: application/x-www-form-urlencoded Request Body Parameters: account: Your account number in the Payeer system (e.g., P1000000) apiId: The API user’s ID; given out when adding the API (e.g., 12345) apiPass: The API user's secret key (e.g., qwerty) action: Action type, must be 'getPaySystems' Example Request Body: account=P1000000&apiId=12345&apiPass=qwerty&action=getPaySystems Response 200 (application/json): { "auth_error":"0", "errors":[], "list":{ "1136053":{ "id":"1136053", "name":"Payeer", "gate_commission":[], "gate_commission_min":[], "gate_commission_max":[], "currencies":["USD","RUB","EUR"], "commission_site_percent":0, "r_fields":{ "ACCOUNT_NUMBER":{ "name":"Номер счета", "reg_expr":"#^P[0-9]+$#", "example":"P1000000" } } } } } Response List Array Parameters: id: payment system ID (required for payout) name: payment system name gate_commission: gateway fee for each supported currency gate_commission_min: minimum gateway fee for each currency gate_commission_max: maximum gateway fee for each currency currencies: supported currencies commission_site_percent: Payeer’s fee in percent r_fields: list of parameters for creating a payout ``` -------------------------------- ### Payeer API: Create Order Endpoint (`/order_create`) Source: https://github.com/payeer/docs/blob/main/trade-api/en.md Details the API endpoint for creating new trading orders on Payeer, supporting limit, market, and stop limit types. This includes general response parameters, specific request parameters for limit orders, required headers, and example request/response bodies. ```APIDOC Endpoint: /order_create Method: POST Request Weight: 5 (10 for market order) General Response Parameters: success: boolean - Request success indicator (true, false) order_id: integer - ID of the created order (e.g., 37057767) params: object - Parameters of the created order pair: string - Trading pair (e.g., TRX_USD) type: string - Order type (limit, market, stop_limit) action: string - Action (buy, sell) amount: string - Amount (e.g., 10.000000) price: string - Price (e.g., 0.08000) value: string - Value (e.g., 0.80) stop_price: string - Stop price (e.g., 0.07800) (for stop_limit orders) Limit Order Request Parameters: pair: string - Trading pair (e.g., TRX_USD) type: string - Order type (must be 'limit') action: string - Action (buy, sell) amount: string - Amount (e.g., 10) price: string - Price (e.g., 0.08) ts: long - Timestamp in milliseconds (e.g., 1644488888211) Request Headers: API-ID: string - Your API ID (e.g., bd443f00-092c-4436-92a4-a704ef679e24) API-SIGN: string - HMAC-SHA256 signature of (method + request_body) Content-Type: application/json Example Request Body (application/json): { "pair": "TRX_USD", "type": "limit", "action": "buy", "amount": "10", "price": "0.08", "ts": 1644488888211 } Example Response 200 Body (application/json): { "success": true, "order_id": 37054386, "params": { "pair": "TRX_USD", "type": "limit", "action": "buy", "amount": "10.000000", "price": "0.08000", "value": "0.80" } } ``` -------------------------------- ### PHP Example: Fetching Payeer Transaction History with Filtering Source: https://github.com/payeer/docs/blob/main/trade-api/en.md This PHP code demonstrates how to construct and send a POST request to the Payeer API's 'my_history' method. It includes setting up API credentials, signing the request with HMAC-SHA256, and handling JSON data for filtering transaction records by pair, action, status, and date range. ```php $msec = round(microtime(true) * 1000); $apiId = 'bd443f00-092c-4436-92a4-a704ef679e24'; $apiSecret = 'api_secret_key'; $method = 'my_history'; $req = json_encode(array( 'pair' => 'BTC_USD,BTC_RUB', 'action' => 'buy', 'status' => 'canceled', 'date_from' => strtotime('01.09.2021 00:00:00'), 'date_to' => strtotime('30.09.2021 23:59:59'), 'limit' => 3, 'ts' => $msec, )); $sign = hash_hmac('sha256', $method.$req, $apiSecret); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://payeer.com/api/trade/".$method); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $req); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-Type: application/json", "API-ID: ".$apiId, "API-SIGN: ".$sign )); $response = curl_exec($ch); curl_close($ch); echo '
'; print_r(json_decode($response, true)); echo '
'; ``` -------------------------------- ### Fetch All Trading Pairs and Limits using PHP cURL Source: https://github.com/payeer/docs/blob/main/trade-api/en.md This PHP code snippet demonstrates how to make a GET request to the Payeer API's `/info` endpoint using cURL to retrieve all available trading pairs and their associated limits. The response is then decoded from JSON and printed for inspection. ```php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://payeer.com/api/trade/info"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); $response = curl_exec($ch); curl_close($ch); echo '
'; print_r(json_decode($response, true)); echo '
'; ``` -------------------------------- ### Retrieve Trade Pair Information (POST /api/trade/info) Source: https://github.com/payeer/docs/blob/main/trade-api/en.md This snippet demonstrates how to make a POST request to the Payeer API to retrieve detailed information about specified trading pairs. It includes a PHP cURL example for sending the request, along with the expected JSON request and response structures, detailing pair prices, limits, and fees. ```PHP $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://payeer.com/api/trade/info"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array( 'pair' => 'BTC_USD,BTC_RUB', ))); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-Type: application/json" )); $response = curl_exec($ch); curl_close($ch); echo '
'; print_r(json_decode($response, true)); echo '
'; ``` ```APIDOC Endpoint: POST /api/trade/info Description: Retrieve detailed information for specified trading pairs. Request Body (application/json): pair: string (comma-separated list of pairs, e.g., "BTC_USD,BTC_RUB") Response 200 (application/json): success: boolean (request success indicator) limits: object requests: array interval: string ("min") interval_num: number (e.g., 1) limit: number (e.g., 600) pairs: object (key-value pairs where key is the trading pair) : object price_prec: number (price precision) min_price: string (minimum price) max_price: string (maximum price) min_amount: number (minimum trade amount) min_value: number (minimum trade value) fee_maker_percent: number (maker fee percentage) fee_taker_percent: number (taker fee percentage) Example Request Body: { "pair": "BTC_USD,BTC_RUB" } Example Response Body: { "success": true, "limits": { "requests": [ { "interval": "min", "interval_num": 1, "limit": 600 } ] }, "pairs": { "BTC_USD": { "price_prec": 2, "min_price": "4332.68", "max_price": "82321.00", "min_amount": 0.0001, "min_value": 0.5, "fee_maker_percent": 0.01, "fee_taker_percent": 0.095 }, "BTC_RUB": { "price_prec": 2, "min_price": "326269.32", "max_price": "6199117.08", "min_amount": 0.0001, "min_value": 20, "fee_maker_percent": 0.01, "fee_taker_percent": 0.095 } } } ``` -------------------------------- ### Payeer API: Cancel Orders Endpoint (`/orders_cancel`) Source: https://github.com/payeer/docs/blob/main/trade-api/en.md Comprehensive documentation for the `/orders_cancel` API endpoint, which allows for the cancellation of all or a subset of orders. This includes details on request parameters, response structures, and examples for different cancellation types. ```APIDOC Endpoint: POST /orders_cancel Description: Cancellation all/partially of orders. Request Weight: 300 Request Parameters: - pair (string, optional): Comma-separated list of pairs to cancel orders (e.g., TRX_RUB,DOGE_RUB) - action (string, optional): Action type for orders (e.g., buy, sell). Used with 'pair'. - ts (long, required): Timestamp in milliseconds (e.g., 1644330189737) Response Parameters: - success (boolean): Indicates if the request was successful (true, false) - items (array of strings): List of IDs of cancelled orders Cancellation with pairs and directions Example: Request Headers: API-ID: bd443f00-092c-4436-92a4-a704ef679e24 API-SIGN: f133d2e7a960a3db86052be6d4f7699313e9416bce557868e7ad0f026c67c9ca Request Body (application/json): { "pair": "TRX_RUB,DOGE_RUB", "action": "buy", "ts": 1644389071011 } Response 200 Body (application/json): { "success": true, "items": [ "36987301", "36987294" ] } Cancellation with pairs Example: Request Headers: API-ID: bd443f00-092c-4436-92a4-a704ef679e24 API-SIGN: f133d2e7a960a3db86052be6d4f7699313e9416bce557868e7ad0f026c67c9ca Request Body (application/json): { "pair": "TRX_RUB,DOGE_RUB", "ts": 1644389254696 } Response 200 Body (application/json): { "success": true, "items": [ "36987703", "36987698" ] } Cancel all orders Example: Request Headers: API-ID: bd443f00-092c-4436-92a4-a704ef679e24 API-SIGN: f133d2e7a960a3db86052be6d4f7699313e9416bce557868e7ad0f026c67c9ca Request Body (application/json): { "ts": 1644388528500 } Response 200 Body (application/json): { "success": true, "items": [ "36987021", "36987015" ] } ``` -------------------------------- ### Payeer Trades API Endpoint Reference Source: https://github.com/payeer/docs/blob/main/trade-api/en.md Comprehensive documentation for the Payeer `/trades` API endpoint, used to retrieve the history of transactions for specified trading pairs. This section details the request parameters, response structure, and example values. ```APIDOC Endpoint: /trades Method: POST Description: Getting the history of transactions for the specified pairs. Request Weight: 1 * count of pairs Request Parameters: - pair (string, required): Description: Comma-separated list of trading pairs. Example: BTC_USD,BTC_RUB Response Parameters: - success (boolean): Description: Indicates if the request was successful. Example: true, false - pairs (object): Description: An object containing trade history for each requested pair. Properties for each trade entry within a pair: - id (string): Description: Unique trade identifier. Example: 14162760 - date (integer): Description: Timestamp of the trade. Example: 1644327656 - type (string): Description: Action type (buy or sell). Example: buy, sell - amount (string): Description: Amount of the cryptocurrency traded. Example: 0.00031422 - price (string): Description: Price at which the trade occurred. Example: 43790.00 - value (string): Description: Total value of the trade. Example: 13.76 Request Body Example (application/json): { "pair": "BTC_USD,BTC_RUB" } Response 200 Body Example (application/json): { "success": true, "pairs": { "BTC_USD": [ { "id": "14162760", "date": 1644327656, "type": "buy", "amount": "0.00060372", "price": "44299.99", "value": "26.75" }, { "id": "14162734", "date": 1644327545, "type": "sell", "amount": "0.00000119", "price": "44399.98", "value": "0.06" } ], "BTC_RUB": [ { "id": "14162750", "date": 1644327611, "type": "buy", "amount": "0.01152539", "price": "3230100.00", "value": "37228.16" }, { "id": "14162749", "date": 1644327610, "type": "buy", "amount": "0.00988444", "price": "3230100.00", "value": "31927.73" } ] } } ``` -------------------------------- ### Payeer Orders API Endpoint (GET /orders) Source: https://github.com/payeer/docs/blob/main/trade-api/en.md Documents the Payeer Orders API endpoint, used for retrieving available buy and sell orders for specified cryptocurrency pairs. It outlines the request parameters, response structure, and the detailed fields for each order, including price, amount, and value. ```APIDOC Endpoint: GET /orders Description: Getting available orders for the specified pairs. Request Weight: 1 * count of pairs Request Parameters: - pair (string): Comma-separated list of pairs (e.g., "BTC_USD,BTC_RUB"). Response Parameters: - success (boolean): Request success indicator (true, false). - pairs (object): List of pairs, where each key is a pair name (e.g., "BTC_USD"). - [pair_name] (object): - ask (string): Ask price (e.g., "43790.00"). - bid (string): Bid price (e.g., "43520.00"). - asks (array): List of sell orders. - price (string): Price of the sell order (e.g., "43790.00"). - amount (string): Amount of the sell order (e.g., "0.00031422"). - value (string): Value of the sell order (e.g., "13.76"). - bids (array): List of buy orders. - price (string): Price of the buy order (e.g., "43520.00"). - amount (string): Amount of the buy order (e.g., "0.00034788"). - value (string): Value of the buy order (e.g., "15.13"). ``` -------------------------------- ### API Endpoint: Get User Orders (/my_orders) Source: https://github.com/payeer/docs/blob/main/trade-api/en.md Retrieves a user's open orders, with options for filtering by trading pair and action. This endpoint has a request weight of 60 and provides detailed information about each order, including ID, date, type, amounts, prices, and processing status. ```APIDOC Endpoint: /my_orders Method: GET (implied) Description: Getting your open orders with the ability to filtering. Request Weight: 60 Request Parameters: - pair (string): List of trading pairs. Example: BTC_USD,TRX_USD - action (string): Action type (buy or sell). Example: buy, sell - ts (long): Timestamp in milliseconds. Example: 1644396742116 Response Parameters: - success (boolean): Request success indicator. Example: true, false - items (array of objects): List of orders. - id (long): Order ID. Example: 36989287 - date (long): Timestamp of order creation. Example: 1644391218 - pair (string): Trading pair. Example: TRX_USD - action (string): Action type (buy or sell). Example: buy, sell - type (string): Order type (limit, market, stop_limit). Example: limit, market, stop_limit - amount (float): Order amount. Example: 10.000000 - price (float): Order price. Example: 0.05000 - stop_price (float, optional): Stop price. Example: 0.04000 - value (float): Order value. Example: 0.50 - amount_processed (float): Processed amount. Example: 0.000000 - amount_remaining (float): Remaining amount. Example: 10.000000 - value_processed (float): Processed value. Example: 0.00 - value_remaining (float): Remaining value. Example: 0.50 - api (boolean): Mark of order creation via API. Example: true, false ``` -------------------------------- ### Payeer API: my_history POST Request and Response Specification Source: https://github.com/payeer/docs/blob/main/trade-api/ru.md This section outlines the structure for the `my_history` POST request to the Payeer API, including required headers and the JSON body parameters for filtering history records. It also provides an example of a successful 200 OK JSON response, detailing the structure of individual history items. ```APIDOC POST /api/trade/my_history Description: Retrieves historical trade data with filtering options. Request Headers: API-ID: string (Your API ID, e.g., bd443f00-092c-4436-92a4-a704ef679e24) API-SIGN: string (HMAC-SHA256 signature of method + request body, e.g., f133d2e7a960a3db86052be6d4f7699313e9416bce557868e7ad0f026c67c9ca) Content-Type: application/json Request Body (application/json): { "pair": "BTC_USD,BTC_RUB", // string, comma-separated currency pairs (e.g., "BTC_USD" or "BTC_USD,BTC_RUB") "action": "buy", // string, optional, filter by action ("buy" or "sell") "status": "canceled", // string, optional, filter by status (e.g., "active", "canceled", "completed") "date_from": 1630443600, // integer, optional, Unix timestamp for start date "date_to": 1633035599, // integer, optional, Unix timestamp for end date "limit": 3, // integer, optional, maximum number of items to return "ts": 1644399382490 // integer, required, current timestamp in milliseconds } Response 200 OK (application/json): { "success": true, // boolean, indicates if the request was successful "items": { // object, contains historical trade items indexed by their ID "28203919": { "id": "28203919", // string, unique trade ID "date": 1631198637, // integer, Unix timestamp of the trade "pair": "BTC_USD", // string, currency pair "action": "buy", // string, "buy" or "sell" "type": "stop_limit", // string, type of order (e.g., "limit", "market", "stop_limit") "status": "canceled", // string, status of the order "amount": "0.00010000", // string, original amount "price": "47880.00", // string, price per unit "value": "4.79", // string, total value "amount_processed": "0.00000000", // string, amount processed "amount_remaining": "0.00010000", // string, amount remaining "value_processed": "0.00", // string, value processed "value_remaining": "4.79", // string, value remaining "stop_price": "60000.00" // string, optional, stop price for stop_limit orders }, "28252727": { "id": "28252727", "date": 1631274716, "pair": "BTC_USD", "action": "buy", "type": "limit", "status": "canceled", "amount": "0.00010000", "price": "10000.00", "value": "1.00", "amount_processed": "0.00000000", "amount_remaining": "0.00010000", "value_processed": "0.00", "value_remaining": "1.00" }, "29032159": { "id": "29032159", "date": 1632483924, "pair": "BTC_USD", "action": "buy", "type": "stop_limit", "status": "canceled", "amount": "0.00010000", "price": "44717.16", "value": "4.48", "amount_processed": "0.00000000", "amount_remaining": "0.00010000", "value_processed": "0.00", "value_remaining": "4.48", "stop_price": "10000.00" } } } ``` -------------------------------- ### Payeer Account Balance API Endpoint Specification Source: https://github.com/payeer/docs/blob/main/trade-api/en.md This section details the API endpoint for retrieving a user's account balance. It specifies the request parameters, response structure, and provides examples for both the request and successful response. The endpoint requires a timestamp and returns a breakdown of total, available, and held funds across various currencies. ```APIDOC Endpoint: /account Method: POST Request Weight: 10 Request Parameters: ts: timestamp in milliseconds (Example: 1644327967240) Response Parameters: success: boolean - request success indicator (Example: true, false) balances: object - list of user's currencies total: float - total balance (Example: 1598.99) available: float - available balance (Example: 1548.99) hold: float - frozen balance (Example: 50) Request Example (application/json): Headers: API-ID: bd443f00-092c-4436-92a4-a704ef679e24 API-SIGN: f133d2e7a960a3db86052be6d4f7699313e9416bce557868e7ad0f026c67c9ca Body: { "ts": 1644327967240 } Response 200 Example (application/json): { "success": true, "balances": { "USD": { "total": 0.92, "available": 0.92, "hold": 0 }, "RUB": { "total": 1598.99, "available": 1548.99, "hold": 50 }, "EUR": { "total": 2.97, "available": 0, "hold": 2.97 }, "BTC": { "total": 0, "available": 0, "hold": 0 }, "ETH": { "total": 0, "available": 0, "hold": 0 }, "BCH": { "total": 0, "available": 0, "hold": 0 }, "LTC": { "total": 0, "available": 0, "hold": 0 }, "DASH": { "total": 0, "available": 0, "hold": 0 }, "USDT": { "total": 3, "available": 0, "hold": 3 }, "XRP": { "total": 0.9981, "available": 0.9981, "hold": 0 }, "DOGE": { "total": 94.55549964, "available": 94.55549964, "hold": 0 }, "TRX": { "total": 223.681806, "available": 208.681806, "hold": 15 } } } ``` -------------------------------- ### Payeer API: my_history Method (Paginated) Source: https://github.com/payeer/docs/blob/main/trade-api/en.md Describes the API request structure for fetching paginated transaction history via the 'my_history' method, highlighting the use of the 'append' parameter for continuation. Includes required headers and the JSON body parameters (append, limit, ts). Provides an example of a successful 200 OK response with paginated transaction items. ```APIDOC POST /api/trade/my_history Headers: API-ID: string (Your API ID) API-SIGN: string (HMAC-SHA256 signature of method + request body) Request Body (application/json): { "append": integer, // ID of the last transaction from the previous request to fetch older records "limit": integer, // Maximum number of records to return "ts": integer // Timestamp in milliseconds } Example Request Body: { "append": 36989301, "limit": 3, "ts": 1644399899071 } Response 200 (application/json): { "success": boolean, "items": { "[transaction_id]": { "id": string, "date": integer, // Unix timestamp "pair": string, // e.g., "TRX_RUB" "action": string, // "buy" or "sell" "type": string, // e.g., "limit", "stop_limit" "status": string, // e.g., "success", "canceled", "processing" "amount": string, "price": string, "value": string, "amount_processed": string, "amount_remaining": string, "value_processed": string, "value_remaining": string, "stop_price": string // Optional, for stop_limit orders } // ... more transaction items } } ``` -------------------------------- ### Fetch Payeer API Transaction History (Unfiltered) in PHP Source: https://github.com/payeer/docs/blob/main/trade-api/en.md Demonstrates how to make an authenticated POST request to the Payeer API's 'my_history' method to retrieve transaction history without specific filtering. It includes API key setup, request signing using HMAC-SHA256, and sending the request via cURL to get the latest transactions. ```php $msec = round(microtime(true) * 1000); $apiId = 'bd443f00-092c-4436-92a4-a704ef679e24'; $apiSecret = 'api_secret_key'; $method = 'my_history'; $req = json_encode(array( 'limit' => 3, 'ts' => $msec, )); $sign = hash_hmac('sha256', $method.$req, $apiSecret); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://payeer.com/api/trade/".$method); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $req); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-Type: application/json", "API-ID: ".$apiId, "API-SIGN: ".$sign )); $response = curl_exec($ch); curl_close($ch); echo '
'; print_r(json_decode($response, true)); echo '
'; ``` -------------------------------- ### Payeer API: Get Payout Details Source: https://github.com/payeer/docs/blob/main/rest-api/en.md Retrieves detailed information about a specific payout using its reference ID. This endpoint is used to check the status and details of a payout initiated through the Payeer system. ```APIDOC Endpoint: /payoutDetails (implied) Method: POST (implied by typical API patterns for detailed queries) Request Parameters (Body - form-urlencoded): - account (string): Your account number in the Payeer system. Example: P1000000 - apiId (integer): The API user’s ID; given out when adding the API. Example: 12345 - apiPass (string): The API user's secret key. Example: qwerty - action (string): Action type, must be 'payoutDetails'. - referenceId (string): identification number in your accounting system. Example: 08d7f228-5a03-4dc7-b13a-7c14146df8f7 Optional Request Parameters (Body - form-urlencoded): - referenceApiId (integer): id of the api-user (apiId is used by default). Example: 123456 Response: (Not explicitly provided, but expected to be JSON with payout details) ``` -------------------------------- ### Payeer API: Fetch User Orders (my_orders) Endpoint Source: https://github.com/payeer/docs/blob/main/trade-api/en.md Comprehensive documentation for the `my_orders` API endpoint, which allows users to retrieve their trade orders. This section details the required HTTP method (POST), request headers for authentication, the structure of the JSON request body, and the expected format of a successful JSON response, including various attributes for each order. ```APIDOC Endpoint: POST /api/trade/my_orders Headers: API-ID: string (Your API ID. Example: bd443f00-092c-4436-92a4-a704ef679e24) API-SIGN: string (HMAC-SHA256 signature of 'method + request_body' using your API secret key. Example: f133d2e7a960a3db86052be6d4f7699313e9416bce557868e7ad0f026c67c9ca) Content-Type: application/json Request Body (application/json): { "ts": 1644398635534 (integer, timestamp in milliseconds) } Response 200 (application/json): { "success": true, (boolean, indicates if the request was successful) "items": { "36149941": { (object, key is order ID, value is order details) "id": "36149941", (string, unique order identifier) "date": 1643186519, (integer, Unix timestamp of order creation) "pair": "TRX_RUB", (string, trading pair, e.g., "TRX_RUB") "action": "buy", (string, "buy" or "sell") "type": "stop_limit", (string, order type, e.g., "limit", "stop_limit") "amount": "10.000000", (string, total amount of currency) "price": "5.00", (string, price per unit) "value": "50.00", (string, total value of the order) "amount_processed": "0.000000", (string, amount of currency processed) "amount_remaining": "10.000000", (string, remaining amount of currency) "value_processed": "0.00", (string, value processed) "value_remaining": "50.00", (string, remaining value) "stop_price": "4.30" (string, optional, stop price for stop-limit orders) }, "36150146": { ... }, "36989287": { ... }, "36989301": { ... }, "36989322": { ... }, "36995144": { ... } } } ``` -------------------------------- ### Payeer API: Get Transaction History (POST) Source: https://github.com/payeer/docs/blob/main/rest-api/en.md Retrieves a detailed history of transactions from the Payeer system. This endpoint allows users to query past transactions based on various criteria and requires specific authentication parameters. ```APIDOC Endpoint: /history (implied) Method: POST Request Headers: Content-Type: application/x-www-form-urlencoded Request Parameters (Body - form-urlencoded): - account (string): Your account number in the Payeer system. Example: P1000000 - apiId (integer): The API user’s ID; given out when adding the API. Example: 12345 - apiPass (string): The API user's secret key. Example: qwerty - action (string): Action type, must be 'history'. Optional Request Parameters (Body - form-urlencoded): - id (integer): transaction ID. Example: 197941397 - date (string): Date/time of creation in the format YYYY-MM-DD HH:MM:SS. Example: 2016-03-02 15:35:17 - type (string): transaction type. Values: transfer, deposit, withdrawal, sci. - status (string): transaction status. Values: success, processing, canceled, waiting, pending. - from (string): sender's account number. Example: P1000000, @anonum, @merchant, null - debitedAmount (float): amount withdrawn. Example: 1 - debitedCurrency (string): withdrawal currency. Values: USD, EUR, RUB - to (string): recipient's account number. Example: P1000001, @sms, null - creditedAmount (float): amount received. Example: 1 - creditedCurrency (string): deposit currency. Values: USD, EUR, RUB - payeerFee (float): Payeer’s fee. Example: 0.01 - gateFee (float): gateway fee. Example: 0.01 - comment (string): comments. Example: test - paySystem (string): name payment method. Example: Payeer - shopId (integer): merchant id. Example: 12345 - shopOrderId (integer): id invoice of merchant. Example: 123 - exchangeRate (float): exchange rate for auto-conversion. Example: 1 - protect (string): transaction protection for transfer. Values: Y, N - protectDay (string): number of days for protection. Values: 1-30, null - isApi (string): via API. Values: Y, N - shop (object): sci parameters. Fields: id (store id), domain (domain store), orderid (invoice id of store), description (description). - apiId (integer): API user ID the transaction was made through. Example: 12345 - referenceId (string): identification number in your accounting system. Example: 08d7f228-5a03-4dc7-b13a-7c14146df8f7 Request Body Example: account=P1000000&apiId=12345&apiPass=qwerty&action=history Response 200 (application/json): - auth_error (string): Authentication error code. '0' indicates success. - errors (array): List of errors, if any. - params (object): Additional parameters. - history (object): Object containing transaction history data. Response Body Example: {"auth_error":"0","errors":[],"params":{},"history":{}} ```