# Create Order (Bank Transfer, Open Banking) POST https://api-gateway-stg.transak.com/api/v2/orders Content-Type: application/json The **Create Order** is an **authenticated API** that is a crucial step in **Transak’s transaction flow**, allowing users to place a **crypto buy or sell order** based on their **reserved wallet address** and quote ID. This API ensures that the **order is securely created** and **ready for payment processing**. **Bank Transfers** - paymentInstrumentId should be passed as `sepa_bank_transfer` or `gbp_bank_transfer` **Open Banking** - paymentInstrumentId should be passed as `pm_open_banking` Reference: https://docs.transak.com/api/whitelabel/orders/create-order ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: whitelabel-api version: 1.0.0 paths: /api/v2/orders: post: operationId: create-order summary: Create Order (Bank Transfer, Open Banking) description: >- The **Create Order** is an **authenticated API** that is a crucial step in **Transak’s transaction flow**, allowing users to place a **crypto buy or sell order** based on their **reserved wallet address** and quote ID. This API ensures that the **order is securely created** and **ready for payment processing**. **Bank Transfers** - paymentInstrumentId should be passed as `sepa_bank_transfer` or `gbp_bank_transfer` **Open Banking** - paymentInstrumentId should be passed as `pm_open_banking` tags: - subpackage_orders parameters: - name: authorization in: header description: >- Authorization token is the accessToken received from the API -` api/v2/auth/verify` required: true schema: type: string default: YOUR_AUTHORIZATION_TOKEN - name: x-user-identifier in: header description: >- Your authenticated user Email Id address. Note: This is applicable only for [Auth Reliance Flows](/features/auth-reliance) required: false schema: type: string default: USER_EMAIL_ID - name: x-access-token in: header description: > Your Partner Access Token. Please refer [here](/guides/how-to-create-partner-access-token) for a tutorial on generating your access token. Note: This is applicable only for [Auth Reliance Flows](/features/auth-reliance) required: false schema: type: string default: YOUR_ACCESS_TOKEN responses: '200': description: 200 - Order Created content: application/json: schema: $ref: '#/components/schemas/Orders_create-order_Response_200' '400': description: 400 - Missing Field content: application/json: schema: $ref: '#/components/schemas/Create-orderRequestBadRequestError' '401': description: 401 - Unauthorized content: application/json: schema: $ref: '#/components/schemas/Create-orderRequestUnauthorizedError' '500': description: 500 - Internal Server Error content: application/json: schema: $ref: '#/components/schemas/Create-orderRequestInternalServerError' requestBody: content: application/json: schema: type: object properties: quoteId: type: string default: YOUR_QUOTE_ID description: Quote ID generated from api/v2/lookup/quotes paymentInstrumentId: type: string default: sepa_bank_transfer description: |- Payment method from api/v2/lookup/currencies/fiat-currencies e.g sepa_bank_transfer, pm_open_banking walletAddress: type: string default: '0x035eEd57433F835b455d345A44Ad9bd5Da2124a2' description: User's wallet address where crypto will be delivered required: - quoteId - paymentInstrumentId - walletAddress servers: - url: https://api-gateway-stg.transak.com components: schemas: ApiV2OrdersPostResponsesContentApplicationJsonSchemaDataPaymentDetailsItemsFieldsItems: type: object properties: name: type: string value: type: string required: - name - value title: >- ApiV2OrdersPostResponsesContentApplicationJsonSchemaDataPaymentDetailsItemsFieldsItems ApiV2OrdersPostResponsesContentApplicationJsonSchemaDataPaymentDetailsItems: type: object properties: fiatCurrency: type: string paymentMethod: type: string name: type: string fields: type: array items: $ref: >- #/components/schemas/ApiV2OrdersPostResponsesContentApplicationJsonSchemaDataPaymentDetailsItemsFieldsItems redirectUrl: type: string description: >- URL for Open Banking payment authorization (only present for Open Banking payments) required: - fiatCurrency - paymentMethod - name - fields title: >- ApiV2OrdersPostResponsesContentApplicationJsonSchemaDataPaymentDetailsItems ApiV2OrdersPostResponsesContentApplicationJsonSchemaData: 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/ApiV2OrdersPostResponsesContentApplicationJsonSchemaDataPaymentDetailsItems txHash: type: string walletLink: type: string required: - orderId - partnerUserId - status - isBuyOrSell - fiatCurrency - cryptoCurrency - paymentMethod - network - networkId - walletAddress - quoteId - fiatAmount - fiatAmountInUsd - amountPaid - cryptoAmount - conversionPrice - totalFeeInFiat - paymentDetails - txHash - walletLink title: ApiV2OrdersPostResponsesContentApplicationJsonSchemaData Orders_create-order_Response_200: type: object properties: data: $ref: >- #/components/schemas/ApiV2OrdersPostResponsesContentApplicationJsonSchemaData required: - data title: Orders_create-order_Response_200 ApiV2OrdersPostResponsesContentApplicationJsonSchemaError: type: object properties: statusCode: type: integer message: type: string errorCode: type: integer required: - statusCode - message - errorCode title: ApiV2OrdersPostResponsesContentApplicationJsonSchemaError Create-orderRequestBadRequestError: type: object properties: error: $ref: >- #/components/schemas/ApiV2OrdersPostResponsesContentApplicationJsonSchemaError required: - error title: Create-orderRequestBadRequestError Create-orderRequestUnauthorizedError: type: object properties: error: $ref: >- #/components/schemas/ApiV2OrdersPostResponsesContentApplicationJsonSchemaError required: - error title: Create-orderRequestUnauthorizedError Create-orderRequestInternalServerError: type: object properties: error: $ref: >- #/components/schemas/ApiV2OrdersPostResponsesContentApplicationJsonSchemaError required: - error title: Create-orderRequestInternalServerError ``` ## SDK Code Examples ```python Success (Open Banking) import requests url = "https://api-gateway-stg.transak.com/api/v2/orders" headers = { "authorization": "YOUR_AUTHORIZATION_TOKEN", "x-user-identifier": "USER_EMAIL_ID", "x-access-token": "YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript Success (Open Banking) const url = 'https://api-gateway-stg.transak.com/api/v2/orders'; const options = { method: 'POST', headers: { authorization: 'YOUR_AUTHORIZATION_TOKEN', 'x-user-identifier': 'USER_EMAIL_ID', 'x-access-token': 'YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: undefined }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Success (Open Banking) package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api-gateway-stg.transak.com/api/v2/orders" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("authorization", "YOUR_AUTHORIZATION_TOKEN") req.Header.Add("x-user-identifier", "USER_EMAIL_ID") req.Header.Add("x-access-token", "YOUR_ACCESS_TOKEN") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Success (Open Banking) require 'uri' require 'net/http' url = URI("https://api-gateway-stg.transak.com/api/v2/orders") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["authorization"] = 'YOUR_AUTHORIZATION_TOKEN' request["x-user-identifier"] = 'USER_EMAIL_ID' request["x-access-token"] = 'YOUR_ACCESS_TOKEN' request["Content-Type"] = 'application/json' response = http.request(request) puts response.read_body ``` ```java Success (Open Banking) import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api-gateway-stg.transak.com/api/v2/orders") .header("authorization", "YOUR_AUTHORIZATION_TOKEN") .header("x-user-identifier", "USER_EMAIL_ID") .header("x-access-token", "YOUR_ACCESS_TOKEN") .header("Content-Type", "application/json") .asString(); ``` ```php Success (Open Banking) request('POST', 'https://api-gateway-stg.transak.com/api/v2/orders', [ 'headers' => [ 'Content-Type' => 'application/json', 'authorization' => 'YOUR_AUTHORIZATION_TOKEN', 'x-access-token' => 'YOUR_ACCESS_TOKEN', 'x-user-identifier' => 'USER_EMAIL_ID', ], ]); echo $response->getBody(); ``` ```csharp Success (Open Banking) using RestSharp; var client = new RestClient("https://api-gateway-stg.transak.com/api/v2/orders"); var request = new RestRequest(Method.POST); request.AddHeader("authorization", "YOUR_AUTHORIZATION_TOKEN"); request.AddHeader("x-user-identifier", "USER_EMAIL_ID"); request.AddHeader("x-access-token", "YOUR_ACCESS_TOKEN"); request.AddHeader("Content-Type", "application/json"); IRestResponse response = client.Execute(request); ``` ```swift Success (Open Banking) import Foundation let headers = [ "authorization": "YOUR_AUTHORIZATION_TOKEN", "x-user-identifier": "USER_EMAIL_ID", "x-access-token": "YOUR_ACCESS_TOKEN", "Content-Type": "application/json" ] let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway-stg.transak.com/api/v2/orders")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" 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 Success (Bank Transfer) import requests url = "https://api-gateway-stg.transak.com/api/v2/orders" headers = { "authorization": "YOUR_AUTHORIZATION_TOKEN", "x-user-identifier": "USER_EMAIL_ID", "x-access-token": "YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript Success (Bank Transfer) const url = 'https://api-gateway-stg.transak.com/api/v2/orders'; const options = { method: 'POST', headers: { authorization: 'YOUR_AUTHORIZATION_TOKEN', 'x-user-identifier': 'USER_EMAIL_ID', 'x-access-token': 'YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: undefined }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Success (Bank Transfer) package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api-gateway-stg.transak.com/api/v2/orders" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("authorization", "YOUR_AUTHORIZATION_TOKEN") req.Header.Add("x-user-identifier", "USER_EMAIL_ID") req.Header.Add("x-access-token", "YOUR_ACCESS_TOKEN") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Success (Bank Transfer) require 'uri' require 'net/http' url = URI("https://api-gateway-stg.transak.com/api/v2/orders") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["authorization"] = 'YOUR_AUTHORIZATION_TOKEN' request["x-user-identifier"] = 'USER_EMAIL_ID' request["x-access-token"] = 'YOUR_ACCESS_TOKEN' request["Content-Type"] = 'application/json' response = http.request(request) puts response.read_body ``` ```java Success (Bank Transfer) import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api-gateway-stg.transak.com/api/v2/orders") .header("authorization", "YOUR_AUTHORIZATION_TOKEN") .header("x-user-identifier", "USER_EMAIL_ID") .header("x-access-token", "YOUR_ACCESS_TOKEN") .header("Content-Type", "application/json") .asString(); ``` ```php Success (Bank Transfer) request('POST', 'https://api-gateway-stg.transak.com/api/v2/orders', [ 'headers' => [ 'Content-Type' => 'application/json', 'authorization' => 'YOUR_AUTHORIZATION_TOKEN', 'x-access-token' => 'YOUR_ACCESS_TOKEN', 'x-user-identifier' => 'USER_EMAIL_ID', ], ]); echo $response->getBody(); ``` ```csharp Success (Bank Transfer) using RestSharp; var client = new RestClient("https://api-gateway-stg.transak.com/api/v2/orders"); var request = new RestRequest(Method.POST); request.AddHeader("authorization", "YOUR_AUTHORIZATION_TOKEN"); request.AddHeader("x-user-identifier", "USER_EMAIL_ID"); request.AddHeader("x-access-token", "YOUR_ACCESS_TOKEN"); request.AddHeader("Content-Type", "application/json"); IRestResponse response = client.Execute(request); ``` ```swift Success (Bank Transfer) import Foundation let headers = [ "authorization": "YOUR_AUTHORIZATION_TOKEN", "x-user-identifier": "USER_EMAIL_ID", "x-access-token": "YOUR_ACCESS_TOKEN", "Content-Type": "application/json" ] let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway-stg.transak.com/api/v2/orders")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" 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 Orders_create-order_example import requests url = "https://api-gateway-stg.transak.com/api/v2/orders" payload = { "quoteId": "YOUR_QUOTE_ID", "paymentInstrumentId": "sepa_bank_transfer", "walletAddress": "0x035eEd57433F835b455d345A44Ad9bd5Da2124a2" } headers = { "authorization": "YOUR_AUTHORIZATION_TOKEN", "x-user-identifier": "USER_EMAIL_ID", "x-access-token": "YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Orders_create-order_example const url = 'https://api-gateway-stg.transak.com/api/v2/orders'; const options = { method: 'POST', headers: { authorization: 'YOUR_AUTHORIZATION_TOKEN', 'x-user-identifier': 'USER_EMAIL_ID', 'x-access-token': 'YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: '{"quoteId":"YOUR_QUOTE_ID","paymentInstrumentId":"sepa_bank_transfer","walletAddress":"0x035eEd57433F835b455d345A44Ad9bd5Da2124a2"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Orders_create-order_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api-gateway-stg.transak.com/api/v2/orders" payload := strings.NewReader("{\n \"quoteId\": \"YOUR_QUOTE_ID\",\n \"paymentInstrumentId\": \"sepa_bank_transfer\",\n \"walletAddress\": \"0x035eEd57433F835b455d345A44Ad9bd5Da2124a2\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("authorization", "YOUR_AUTHORIZATION_TOKEN") req.Header.Add("x-user-identifier", "USER_EMAIL_ID") req.Header.Add("x-access-token", "YOUR_ACCESS_TOKEN") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Orders_create-order_example require 'uri' require 'net/http' url = URI("https://api-gateway-stg.transak.com/api/v2/orders") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["authorization"] = 'YOUR_AUTHORIZATION_TOKEN' request["x-user-identifier"] = 'USER_EMAIL_ID' request["x-access-token"] = 'YOUR_ACCESS_TOKEN' request["Content-Type"] = 'application/json' request.body = "{\n \"quoteId\": \"YOUR_QUOTE_ID\",\n \"paymentInstrumentId\": \"sepa_bank_transfer\",\n \"walletAddress\": \"0x035eEd57433F835b455d345A44Ad9bd5Da2124a2\"\n}" response = http.request(request) puts response.read_body ``` ```java Orders_create-order_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api-gateway-stg.transak.com/api/v2/orders") .header("authorization", "YOUR_AUTHORIZATION_TOKEN") .header("x-user-identifier", "USER_EMAIL_ID") .header("x-access-token", "YOUR_ACCESS_TOKEN") .header("Content-Type", "application/json") .body("{\n \"quoteId\": \"YOUR_QUOTE_ID\",\n \"paymentInstrumentId\": \"sepa_bank_transfer\",\n \"walletAddress\": \"0x035eEd57433F835b455d345A44Ad9bd5Da2124a2\"\n}") .asString(); ``` ```php Orders_create-order_example request('POST', 'https://api-gateway-stg.transak.com/api/v2/orders', [ 'body' => '{ "quoteId": "YOUR_QUOTE_ID", "paymentInstrumentId": "sepa_bank_transfer", "walletAddress": "0x035eEd57433F835b455d345A44Ad9bd5Da2124a2" }', 'headers' => [ 'Content-Type' => 'application/json', 'authorization' => 'YOUR_AUTHORIZATION_TOKEN', 'x-access-token' => 'YOUR_ACCESS_TOKEN', 'x-user-identifier' => 'USER_EMAIL_ID', ], ]); echo $response->getBody(); ``` ```csharp Orders_create-order_example using RestSharp; var client = new RestClient("https://api-gateway-stg.transak.com/api/v2/orders"); var request = new RestRequest(Method.POST); request.AddHeader("authorization", "YOUR_AUTHORIZATION_TOKEN"); request.AddHeader("x-user-identifier", "USER_EMAIL_ID"); request.AddHeader("x-access-token", "YOUR_ACCESS_TOKEN"); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"quoteId\": \"YOUR_QUOTE_ID\",\n \"paymentInstrumentId\": \"sepa_bank_transfer\",\n \"walletAddress\": \"0x035eEd57433F835b455d345A44Ad9bd5Da2124a2\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Orders_create-order_example import Foundation let headers = [ "authorization": "YOUR_AUTHORIZATION_TOKEN", "x-user-identifier": "USER_EMAIL_ID", "x-access-token": "YOUR_ACCESS_TOKEN", "Content-Type": "application/json" ] let parameters = [ "quoteId": "YOUR_QUOTE_ID", "paymentInstrumentId": "sepa_bank_transfer", "walletAddress": "0x035eEd57433F835b455d345A44Ad9bd5Da2124a2" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway-stg.transak.com/api/v2/orders")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data 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() ```