# ZebPay Trade API

**Canonical:** https://apis.io/apis/zebpay/zebpay-trade-api-api/  
**Provider:** ZebPay — https://apis.io/providers/zebpay/  
**Base URL:** https://futuresbe.zebpay.com  
**Documentation:** https://apidocs.zebpay.com/

ZebPay Trade API is one of 9 APIs that [ZebPay](https://apis.io/providers/zebpay/) publishes on the [APIs.io](https://apis.io/) network, described by a machine-readable OpenAPI specification. Tagged areas include Trade API. The published artifact set on APIs.io includes an OpenAPI specification and API documentation.

<p>This endpoint allows users to read order data, create a new order, or cancel a previously placed order.</p> <h3 id="signature-generation-for-post-methods"><strong>Signature Generation for POST Methods:</strong></h3> <p>The following JavaScript code should be added to the <strong>Pre-request Script</strong> tab in Postman. It automatically generates the required signature and includes the API key and signature in the request headers.</p> <pre class="click-to-expand-wrapper is-snippet-wrapper"><code class="language-javascript">// Import crypto for HMAC-SHA256 signature calculation const CryptoJS = require('crypto-js'); // API key and secret const APIKEY = ''; const SECRET = ''; // Generate the current timestamp const timestamp = Date.now(); // Unix time in milliseconds //read boday data and pass update timestamp const body = pm.request.body.raw const payload = JSON.parse(body); payload.timestamp = timestamp; // Stringify the payload const payloadString = JSON.stringify(payload); // Function to calculate HMAC-SHA256 signature function calculateSignature(payload, secret) { const hash = CryptoJS.HmacSHA256(payload, secret); return hash.toString(CryptoJS.enc.Hex); } // Calculate the signature const signature = calculateSignature(payloadString, SECRET); // Set headers dynamically pm.request.headers.upsert({ key: "X-AUTH-APIKEY", value: APIKEY, }); pm.request.headers.upsert({ key: "X-AUTH-SIGNATURE", value: signature, }); // Replace request body with the dynamically generated payload pm.request.body.update(payloadString); </code></pre> <h3 id="signature-generation-for-get-methods"><strong>Signature Generation for GET Methods:</strong></h3> <pre class="click-to-expand-wrapper is-snippet-wrapper"><code class="language-javascript">// Import crypto for HMAC-SHA256 signature calculation const CryptoJS = require('crypto-js'); // API key and secret const APIKEY = ''; const SECRET = ''; // Function to calculate HMAC-SHA256 signature function calculateSignature(payload, secret) { const hash = CryptoJS.HmacSHA256(payload, secret); // Use CryptoJS for HMAC return hash.toString(CryptoJS.enc.Hex); // Convert to hexadecimal } // Generate a timestamp const timestamp = Date.now(); // Current Unix timestamp in milliseconds // Access the query parameters from the request URL let queryParams = pm.request.url.query; // Convert query parameters into a key-value object let queryObject = {}; queryParams.each(param =&gt; { queryObject[param.key] = param.value; }); // Update or set the parameter dynamically queryObject['timestamp'] = Date.now() // Update 'timestamp' parameter // Convert query parameters to query string const queryString = Object.entries(queryObject) .map(([key, value]) =&gt; `${encodeURIComponent(key)}=${encodeURIComponent(value)}`) .join('&amp;'); // Generate the signature const signature = calculateSignature(queryString, SECRET); // Set headers dynamically pm.request.headers.upsert({ key: "X-AUTH-APIKEY", value: APIKEY, }); pm.request.headers.upsert({ key: "X-AUTH-SIGNATURE", value: signature, }); // Update the URL with the query parameters pm.request.url.query.clear(); // Clear existing query params queryString.split('&amp;').forEach((param) =&gt; { const [key, value] = param.split('='); pm.request.url.query.add({ key, value }); }); </code></pre>

## Operations (10)

| Method | Path | Summary |
|---|---|---|
| POST | `/orders` | Place a New Market Sell Order |
| GET | `/orders` | List Trade Complete Orders |
| GET | `/orders/{orderId}/fills` | Fills |
| DELETE | `/orders/{orderId}` | Cancel Trade Order |
| DELETE | `/orders/cancelall` | Cancel All Trade Orders |
| GET | `/tradefees/BTC-INR` | TDS and Fees |
| GET | `/orders/balance` | Trade Balance |
| GET | `/wallet/balance` | Wallet Balance |
| GET | `/tradepairs/IN` | Trade Pairs |
| GET | `/Instantcoins/IN` | QT Pairs |

## Machine-readable artifacts (3)

- **OpenAPI** — https://artifacts.apis.io/zebpay/openapi/zebpay-trade-api-api-openapi.yml
- **PostmanCollection** — https://artifacts.apis.io/zebpay/postman/zebpay-api-collection.json
- **Documentation** — https://apidocs.zebpay.com/

## Other ZebPay APIs (8)

- [ZebPay Spot API v2](https://apis.io/apis/zebpay/zebpay-spot-api/)
- [ZebPay Futures API](https://apis.io/apis/zebpay/zebpay-futures-api/)
- [ZebPay Futures > Exchange API](https://apis.io/apis/zebpay/zebpay-futures-exchange-api/)
- [ZebPay Futures > Market API](https://apis.io/apis/zebpay/zebpay-futures-market-api/)
- [ZebPay Futures > Trade API](https://apis.io/apis/zebpay/zebpay-futures-trade-api/)
- [ZebPay Futures > User Leverage API](https://apis.io/apis/zebpay/zebpay-futures-user-leverage-api/)
- [ZebPay Futures > Wallet API](https://apis.io/apis/zebpay/zebpay-futures-wallet-api/)
- [ZebPay Market API](https://apis.io/apis/zebpay/zebpay-market-api/)

## Tags

Trade API

---

Profiled by [API Evangelist](https://apievangelist.com) and published on [APIs.io](https://apis.io/apis/zebpay/zebpay-trade-api-api/). The API's provider profile, Kin Score and agent-readiness rating are at https://apis.io/providers/zebpay/.
