# Swap History

This endpoint allows you to retrieve a list of swap transactions based on your General API Key. You can filter the results by various criteria, including time range, currency, and swap type (e.g., auto\_convert, manual\_swap, or swap\_by\_api). Pagination support lets you fetch the results in smaller, manageable sets for better control and efficiency.

## GET /general/swap

>

```json
{"openapi":"3.0.0","info":{"title":"Swaps","version":"1.0.0"},"servers":[{"url":"https://api.oxapay.com/v1"}],"security":[],"paths":{"/general/swap":{"get":{"operationId":"swapHistory","responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"list":{"type":"array","items":{"type":"object","properties":{"track_id":{"type":"string","description":"Unique identifier for the transaction, typically represented as a string."},"from_currency":{"type":"string","description":"The currency being exchanged from."},"to_currency":{"type":"string","description":"The currency being exchanged to."},"from_amount":{"type":"number","format":"decimal","description":"The amount of the \"from_currency\" being swapped, represented with high precision."},"to_amount":{"type":"number","format":"decimal","description":"The amount of the \"to_currency\" received after the swap, represented with high precision."},"rate":{"type":"number","format":"decimal","description":"The exchange rate between the \"from_currency\" and \"to_currency\" at the time of the transaction."},"date":{"type":"integer","description":"Timestamp (UNIX epoch) representing when the swap occurred, typically in seconds."}}}},"meta":{"type":"object","properties":{"page":{"type":"integer","description":"The current page number of the result set."},"last_page":{"type":"integer","description":"The total number of pages available based on the number of records and page size."},"total":{"type":"integer","description":"The total number of payments available for the specified criteria."}}}}},"message":{"type":"string","description":"A message containing additional information about the result of the request."},"error":{"type":"object","description":"An object that provides details about any errors that occurred.","nullable":true,"properties":{"type":{"type":"string","description":"Type of the error"},"key":{"type":"string","description":"Key related to the error"},"message":{"type":"string","description":"Error message"}}},"status":{"type":"integer","description":"The status of the request response. Typically provided as a numeric code (e.g., 200 for success or other codes for errors)."},"version":{"type":"string","description":"The version of the API being used."}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{}},"message":{"type":"string","description":"A message containing additional information about the result of the request."},"error":{"type":"object","description":"An object that provides details about any errors that occurred.","nullable":true,"properties":{"type":{"type":"string","description":"Type of the error"},"key":{"type":"string","description":"Key related to the error"},"message":{"type":"string","description":"Error message"}}},"status":{"type":"integer","description":"The status of the request response. Typically provided as a numeric code (e.g., 200 for success or other codes for errors)."},"version":{"type":"string","description":"The version of the API being used."}}}}}}},"tags":["Swap-history"],"parameters":[{"in":"header","name":"general_api_key","required":true,"schema":{"type":"string"},"description":"Your General API Key for authentication and authorization."},{"in":"header","name":"Content-Type","required":true,"schema":{"type":"string","default":"application/json"}},{"name":"track_id","in":"query","description":"Filter spesific exchange by it`s trackId.","required":false,"schema":{"type":"integer"}},{"name":"type","in":"query","description":"Filter exchanges based on type.","required":false,"schema":{"type":"string","enum":["autoConvert","manualSwap","swapByApi"]}},{"name":"from_currency","in":"query","description":"Specify the currency symbol for filtering exchanges in a specific fromCurrency.","required":false,"schema":{"type":"string"}},{"name":"to_currency","in":"query","description":"Specify the currency symbol for filtering exchanges in a specific toCurrency.","required":false,"schema":{"type":"string"}},{"name":"from_date","in":"query","description":"The start of the date window to query for exchanges in unix format.","required":false,"schema":{"type":"integer"}},{"name":"to_date","in":"query","description":"The start of the date window to query for exchanges in unix format.","required":false,"schema":{"type":"integer"}},{"name":"sort_by","in":"query","description":"Sort the received list by a parameter.","required":false,"schema":{"type":"string","enum":["create_date","amount"],"default":"create_date"}},{"name":"sort_type","in":"query","description":"Display the list in ascending or descending order.","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"}},{"name":"size","in":"query","description":"Number of records to be displayed on one page.","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":10}},{"name":"page","in":"query","description":"The page number of the results you want to retrieve.","required":false,"schema":{"type":"integer","minimum":1,"default":1}}]}}}}
```
