# Get Orders GET https://api-stg.transak.com/partners/api/v2/orders This is the partner API for fetching orders. Filtering: `Get Orders` supports filters such as `filter[status]`, `filter[sortOrder]`, `filter[walletAddress]`, and `filter[productsAvailed]=["BUY"|"SELL"]`, plus exact match on `filter[partnerOrderId]`. Pagination: Respect `limit` and `skip` to avoid large responses. Reference: https://docs.transak.com/api/public/get-orders ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: partner-api version: 1.0.0 paths: /orders: get: operationId: get-orders summary: Get Orders description: |- This is the partner API for fetching orders. Filtering: `Get Orders` supports filters such as `filter[status]`, `filter[sortOrder]`, `filter[walletAddress]`, and `filter[productsAvailed]=["BUY"|"SELL"]`, plus exact match on `filter[partnerOrderId]`. Pagination: Respect `limit` and `skip` to avoid large responses. tags: - '' parameters: - name: limit in: query description: limits the number of records returned. required: false schema: type: integer default: 100 - name: skip in: query description: skip omits the specified number of returned records required: false schema: type: integer default: 0 - name: startDate in: query description: >- startDate in YYYY-MM-DD format. Default to 90 days prior to current date required: false schema: type: string - name: endDate in: query description: endDate in YYYY-MM-DD format. Defaults to current date required: false schema: type: string - name: filter[productsAvailed] in: query description: products availed i.e., BUY or SELL required: false schema: type: array items: type: string - name: filter[status] in: query description: order status filter required: false schema: type: string default: COMPLETED - name: filter[sortOrder] in: query description: sort order by which you want your orders either desc or asc required: false schema: type: string default: desc - name: filter[walletAddress] in: query description: >- filter orders based on a wallet address. Note: Returns BUY orders only required: false schema: type: string default: '0x5CCb2C2EAe7f1f4A49d66f0E2B42580028C555AF' - name: filter[partnerOrderId] in: query description: filter orders based on a partnerOrderId parameter required: false schema: type: string - name: access-token in: header description: >- Your Access Token, you can generate one using our [Refresh Token](/api/public/refresh-access-token) endpoint required: true schema: type: string default: YOUR_ACCESS_TOKEN responses: '200': description: Orders fetched successfully content: application/json: schema: $ref: '#/components/schemas/get-orders_Response_200' '400': description: '400' content: application/json: schema: $ref: '#/components/schemas/Get-ordersRequestBadRequestError' '401': description: '401' content: application/json: schema: $ref: '#/components/schemas/Get-ordersRequestUnauthorizedError' servers: - url: https://api-stg.transak.com/partners/api/v2 components: schemas: OrdersGetResponsesContentApplicationJsonSchemaMetaFilter: type: object properties: {} title: OrdersGetResponsesContentApplicationJsonSchemaMetaFilter OrdersGetResponsesContentApplicationJsonSchemaMeta: type: object properties: filter: $ref: >- #/components/schemas/OrdersGetResponsesContentApplicationJsonSchemaMetaFilter sortOrder: type: string startDate: type: string endDate: type: string limit: type: integer skip: type: integer totalCount: type: integer title: OrdersGetResponsesContentApplicationJsonSchemaMeta OrdersGetResponsesContentApplicationJsonSchemaDataItems: type: object properties: _id: type: string walletAddress: type: string createdAt: type: string status: type: string fiatCurrency: type: string cryptoCurrency: type: string isBuyOrSell: type: string fiatAmount: type: number format: double amountPaid: type: number format: double paymentOptionId: type: string network: type: string quoteId: type: string title: OrdersGetResponsesContentApplicationJsonSchemaDataItems get-orders_Response_200: type: object properties: meta: $ref: >- #/components/schemas/OrdersGetResponsesContentApplicationJsonSchemaMeta data: type: array items: $ref: >- #/components/schemas/OrdersGetResponsesContentApplicationJsonSchemaDataItems title: get-orders_Response_200 OrdersGetResponsesContentApplicationJsonSchemaError: type: object properties: statusCode: type: integer default: 0 name: type: string message: type: string title: OrdersGetResponsesContentApplicationJsonSchemaError Get-ordersRequestBadRequestError: type: object properties: error: $ref: >- #/components/schemas/OrdersGetResponsesContentApplicationJsonSchemaError title: Get-ordersRequestBadRequestError Get-ordersRequestUnauthorizedError: type: object properties: error: $ref: >- #/components/schemas/OrdersGetResponsesContentApplicationJsonSchemaError title: Get-ordersRequestUnauthorizedError ``` ## SDK Code Examples ```python Buy Order import requests url = "https://api-stg.transak.com/partners/api/v2/orders" headers = {"access-token": "YOUR_ACCESS_TOKEN"} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript Buy Order const url = 'https://api-stg.transak.com/partners/api/v2/orders'; const options = {method: 'GET', headers: {'access-token': 'YOUR_ACCESS_TOKEN'}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Buy Order package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api-stg.transak.com/partners/api/v2/orders" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("access-token", "YOUR_ACCESS_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Buy Order require 'uri' require 'net/http' url = URI("https://api-stg.transak.com/partners/api/v2/orders") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["access-token"] = 'YOUR_ACCESS_TOKEN' response = http.request(request) puts response.read_body ``` ```java Buy Order import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api-stg.transak.com/partners/api/v2/orders") .header("access-token", "YOUR_ACCESS_TOKEN") .asString(); ``` ```php Buy Order request('GET', 'https://api-stg.transak.com/partners/api/v2/orders', [ 'headers' => [ 'access-token' => 'YOUR_ACCESS_TOKEN', ], ]); echo $response->getBody(); ``` ```csharp Buy Order using RestSharp; var client = new RestClient("https://api-stg.transak.com/partners/api/v2/orders"); var request = new RestRequest(Method.GET); request.AddHeader("access-token", "YOUR_ACCESS_TOKEN"); IRestResponse response = client.Execute(request); ``` ```swift Buy Order import Foundation let headers = ["access-token": "YOUR_ACCESS_TOKEN"] let request = NSMutableURLRequest(url: NSURL(string: "https://api-stg.transak.com/partners/api/v2/orders")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ```python Sell Order import requests url = "https://api-stg.transak.com/partners/api/v2/orders" headers = {"access-token": "YOUR_ACCESS_TOKEN"} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript Sell Order const url = 'https://api-stg.transak.com/partners/api/v2/orders'; const options = {method: 'GET', headers: {'access-token': 'YOUR_ACCESS_TOKEN'}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Sell Order package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api-stg.transak.com/partners/api/v2/orders" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("access-token", "YOUR_ACCESS_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Sell Order require 'uri' require 'net/http' url = URI("https://api-stg.transak.com/partners/api/v2/orders") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["access-token"] = 'YOUR_ACCESS_TOKEN' response = http.request(request) puts response.read_body ``` ```java Sell Order import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api-stg.transak.com/partners/api/v2/orders") .header("access-token", "YOUR_ACCESS_TOKEN") .asString(); ``` ```php Sell Order request('GET', 'https://api-stg.transak.com/partners/api/v2/orders', [ 'headers' => [ 'access-token' => 'YOUR_ACCESS_TOKEN', ], ]); echo $response->getBody(); ``` ```csharp Sell Order using RestSharp; var client = new RestClient("https://api-stg.transak.com/partners/api/v2/orders"); var request = new RestRequest(Method.GET); request.AddHeader("access-token", "YOUR_ACCESS_TOKEN"); IRestResponse response = client.Execute(request); ``` ```swift Sell Order import Foundation let headers = ["access-token": "YOUR_ACCESS_TOKEN"] let request = NSMutableURLRequest(url: NSURL(string: "https://api-stg.transak.com/partners/api/v2/orders")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```