# Get Order By ID GET https://api-gateway-stg.transak.com/api/v2/orders/{orderId} The **Get Order By ID** is an **authenticated API** that allows partners to **fetch details of a specific order** using its unique identifier. This API provides **detailed transaction information**, including order status, payment details, and wallet address. This API helps **track a particular order’s status** and ensures users can **monitor their transactions in real-time**. Reference: https://docs.transak.com/api/whitelabel/orders/get-order-by-id ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: whitelabel-api version: 1.0.0 paths: /api/v2/orders/{orderId}: get: operationId: get-order-by-id summary: Get Order By ID description: >- The **Get Order By ID** is an **authenticated API** that allows partners to **fetch details of a specific order** using its unique identifier. This API provides **detailed transaction information**, including order status, payment details, and wallet address. This API helps **track a particular order’s status** and ensures users can **monitor their transactions in real-time**. tags: - subpackage_orders parameters: - name: orderId in: path description: orderId received from the API - api/v2/orders required: true schema: type: string default: f34df59c-3ba4-41f1-962c-8c7945bf83ff - name: authorization in: header description: >- Authorization token is the accessToken received from the API -` api/v2/auth/verify` required: true schema: type: string default: USER_AUTHORIZATION_TOKEN responses: '200': description: 200 - Success content: application/json: schema: $ref: '#/components/schemas/Orders_get-order-by-id_Response_200' '400': description: 400 - Invalid Access Token content: application/json: schema: $ref: '#/components/schemas/Get-order-by-idRequestBadRequestError' '401': description: 401 - Unauthorized content: application/json: schema: $ref: '#/components/schemas/Get-order-by-idRequestUnauthorizedError' '500': description: 500 - Internal Server Error content: application/json: schema: $ref: '#/components/schemas/Get-order-by-idRequestInternalServerError' servers: - url: https://api-gateway-stg.transak.com components: schemas: ApiV2OrdersOrderIdGetResponsesContentApplicationJsonSchemaDataPaymentDetailsItemsFieldsItems: type: object properties: name: type: string value: type: string required: - name - value title: >- ApiV2OrdersOrderIdGetResponsesContentApplicationJsonSchemaDataPaymentDetailsItemsFieldsItems ApiV2OrdersOrderIdGetResponsesContentApplicationJsonSchemaDataPaymentDetailsItems: type: object properties: fiatCurrency: type: string paymentMethod: type: string name: type: string fields: type: array items: $ref: >- #/components/schemas/ApiV2OrdersOrderIdGetResponsesContentApplicationJsonSchemaDataPaymentDetailsItemsFieldsItems redirectUrl: type: string description: >- URL for Open Banking payment authorization (only present for Open Banking payments) required: - fiatCurrency - paymentMethod - name - fields title: >- ApiV2OrdersOrderIdGetResponsesContentApplicationJsonSchemaDataPaymentDetailsItems ApiV2OrdersOrderIdGetResponsesContentApplicationJsonSchemaData: type: object properties: orderId: type: string partnerUserId: type: string status: type: string isBuyOrSell: type: string fiatCurrency: type: string cryptoCurrency: type: string paymentMethod: type: string network: type: string networkId: type: string walletAddress: type: string quoteId: type: string fiatAmount: type: integer fiatAmountInUsd: type: number format: double amountPaid: type: integer cryptoAmount: type: number format: double conversionPrice: type: number format: double totalFeeInFiat: type: number format: double paymentDetails: type: array items: $ref: >- #/components/schemas/ApiV2OrdersOrderIdGetResponsesContentApplicationJsonSchemaDataPaymentDetailsItems txHash: type: - string - 'null' walletLink: type: - string - 'null' transactionLink: type: string required: - orderId - partnerUserId - status - isBuyOrSell - fiatCurrency - cryptoCurrency - paymentMethod - network - networkId - walletAddress - quoteId - fiatAmount - fiatAmountInUsd - amountPaid - cryptoAmount - conversionPrice - totalFeeInFiat - paymentDetails - txHash - walletLink - transactionLink title: ApiV2OrdersOrderIdGetResponsesContentApplicationJsonSchemaData Orders_get-order-by-id_Response_200: type: object properties: data: $ref: >- #/components/schemas/ApiV2OrdersOrderIdGetResponsesContentApplicationJsonSchemaData required: - data title: Orders_get-order-by-id_Response_200 ApiV2OrdersOrderIdGetResponsesContentApplicationJsonSchemaError: type: object properties: statusCode: type: integer message: type: string required: - statusCode - message title: ApiV2OrdersOrderIdGetResponsesContentApplicationJsonSchemaError Get-order-by-idRequestBadRequestError: type: object properties: error: $ref: >- #/components/schemas/ApiV2OrdersOrderIdGetResponsesContentApplicationJsonSchemaError required: - error title: Get-order-by-idRequestBadRequestError Get-order-by-idRequestUnauthorizedError: type: object properties: error: $ref: >- #/components/schemas/ApiV2OrdersOrderIdGetResponsesContentApplicationJsonSchemaError required: - error title: Get-order-by-idRequestUnauthorizedError Get-order-by-idRequestInternalServerError: type: object properties: error: $ref: >- #/components/schemas/ApiV2OrdersOrderIdGetResponsesContentApplicationJsonSchemaError required: - error title: Get-order-by-idRequestInternalServerError ``` ## SDK Code Examples ```python Success import requests url = "https://api-gateway-stg.transak.com/api/v2/orders/f34df59c-3ba4-41f1-962c-8c7945bf83ff" headers = {"authorization": "USER_AUTHORIZATION_TOKEN"} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript Success const url = 'https://api-gateway-stg.transak.com/api/v2/orders/f34df59c-3ba4-41f1-962c-8c7945bf83ff'; const options = {method: 'GET', headers: {authorization: 'USER_AUTHORIZATION_TOKEN'}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Success package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api-gateway-stg.transak.com/api/v2/orders/f34df59c-3ba4-41f1-962c-8c7945bf83ff" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("authorization", "USER_AUTHORIZATION_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Success require 'uri' require 'net/http' url = URI("https://api-gateway-stg.transak.com/api/v2/orders/f34df59c-3ba4-41f1-962c-8c7945bf83ff") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["authorization"] = 'USER_AUTHORIZATION_TOKEN' response = http.request(request) puts response.read_body ``` ```java Success import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api-gateway-stg.transak.com/api/v2/orders/f34df59c-3ba4-41f1-962c-8c7945bf83ff") .header("authorization", "USER_AUTHORIZATION_TOKEN") .asString(); ``` ```php Success request('GET', 'https://api-gateway-stg.transak.com/api/v2/orders/f34df59c-3ba4-41f1-962c-8c7945bf83ff', [ 'headers' => [ 'authorization' => 'USER_AUTHORIZATION_TOKEN', ], ]); echo $response->getBody(); ``` ```csharp Success using RestSharp; var client = new RestClient("https://api-gateway-stg.transak.com/api/v2/orders/f34df59c-3ba4-41f1-962c-8c7945bf83ff"); var request = new RestRequest(Method.GET); request.AddHeader("authorization", "USER_AUTHORIZATION_TOKEN"); IRestResponse response = client.Execute(request); ``` ```swift Success import Foundation let headers = ["authorization": "USER_AUTHORIZATION_TOKEN"] let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway-stg.transak.com/api/v2/orders/f34df59c-3ba4-41f1-962c-8c7945bf83ff")! 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() ```