Exchange History

Use this endpoint to retrieve a list of exchange transactions for a specific business. The list can be filtered by various criteria, such as time range, currency, type (autoConvert or manualSwap or swapByApi), and more. Pagination is also available to fetch the results in smaller sets.

POST https://api.oxapay.com/exchange/list

Request Body

{
  "result": integer, // The result code indicates the success or failure of the request.
  "message": string, // A message providing additional information about the result.
  "data": [
    {
      "trackId": string, // The uniqe id for the exchange.
      "fromCurrency": string, // The currency code of the cryptocurrency you want to convert from
      "toCurrency": string, // The currency code of the cryptocurrency you want to convert to
      "fromAmount": string, // Amount you want to exchange
      "toAmount": string, // The amount you'll receive in your desired cryptocurrency.
      "rate": string, // The real-time exchange rate representing the number of units of `fromCurrency` equivalent to `toCurrency`.
      "type": string, // The type of the exchange (e.g., \"autoConvert\" or \"manualSwap\" or \"swapByApi\").
      "date": string // The timestamp of the exchange transaction in Unix time format.
    }
  ],
  "meta": {
    "size": integer, // The number of exchange transactions returned in the current page.
    "page": integer, // The current page number of the result set.
    "pages": integer, // The total number of pages available based on the number of records and page size.
    "total": integer // The total number of exchange transactions available for the specified criteria.
  }
}

Please note that this response sample includes a list of exchange transactions with their respective details and a metadata section providing information about the total number of records and pages available.

Please note that a successful request will return a result code 100. In case of any issues or validation problems, refer to the corresponding result codes for further details.

Example codes

curl -X POST https://api.oxapay.com/exchange/list \
  -d '{
    "key": "YOUR_GENERAL_API_KEY",
    "fromDate": 1690848000,
    "toDate": 1691625600,
    "size": 20,
    "page": 0
  }'

Please remember to replace YOUR_GENERAL_API_KEY with your actual general API key and adjust the parameters as needed for your specific use case.

Last updated