> For a complete page index, fetch https://docs.transak.com/llms.txt

# Create Order

POST https://api-stg.transak.com/partners/api/v2/business/create-order
Content-Type: application/json

Submit a deposit transaction hash with payout instructions to initiate a swap order.

Reference: https://docs.transak.com/api/transak-swaps-b2b/create-order

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: transak-swaps-b2b-api
  version: 1.0.0
paths:
  /partners/api/v2/business/create-order:
    post:
      operationId: create-order
      summary: Create Order
      description: >-
        Submit a deposit transaction hash with payout instructions to initiate a
        swap order.
      tags:
        - ''
      parameters:
        - name: 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.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrderResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrderRequest'
servers:
  - url: https://api-stg.transak.com
    description: https://api-stg.transak.com
components:
  schemas:
    CreateOrderRequest:
      type: object
      properties:
        depositTxHash:
          type: string
          description: The on-chain transaction hash of the deposit
        depositNetwork:
          type: string
          description: The network on which the deposit was made
        payoutCryptoCurrency:
          type: string
          description: The cryptocurrency to be paid out
        payoutNetwork:
          type: string
          description: The network on which the payout should be made
      required:
        - depositTxHash
        - depositNetwork
        - payoutCryptoCurrency
        - payoutNetwork
      title: CreateOrderRequest
    PayoutInstruction:
      type: object
      properties:
        payoutCryptoCurrency:
          type: string
        payoutNetwork:
          type: string
        tokenId:
          type: string
      title: PayoutInstruction
    CreateOrderData:
      type: object
      properties:
        status:
          type: string
        depositTxHash:
          type: string
        depositNetwork:
          type: string
        payoutInstructionId:
          type: string
        payoutInstruction:
          $ref: '#/components/schemas/PayoutInstruction'
      title: CreateOrderData
    CreateOrderResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/CreateOrderData'
      title: CreateOrderResponse
    BadRequestErrorResponseError:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
      title: BadRequestErrorResponseError
    BadRequestErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/BadRequestErrorResponseError'
      title: BadRequestErrorResponse
    ErrorResponseError:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
      title: ErrorResponseError
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorResponseError'
      title: ErrorResponse

```

## Examples



**Request**

```json
{
  "depositTxHash": "0x8f2a559490b1c3d4e5f6789abcde1234567890abcdef1234567890abcdef1234",
  "depositNetwork": "EthereumMainnet",
  "payoutCryptoCurrency": "USDT",
  "payoutNetwork": "Polygon"
}
```

**Response**

```json
{
  "data": {
    "status": "INSTRUCTION_STORED",
    "depositTxHash": "0x3920b50ce3176630665d4f34bd09bf4bf1d3c62f3d696bdf1bc94d8372e6aca1",
    "depositNetwork": "SepoliaETH",
    "payoutInstructionId": "6a2fcd7843ca0311a57e0ed4",
    "payoutInstruction": {
      "payoutCryptoCurrency": "USDC",
      "payoutNetwork": "solana",
      "tokenId": "SOL_USDC"
    }
  }
}
```

**SDK Code**

```python Success
import requests

url = "https://api-stg.transak.com/partners/api/v2/business/create-order"

payload = {
    "depositTxHash": "0x8f2a559490b1c3d4e5f6789abcde1234567890abcdef1234567890abcdef1234",
    "depositNetwork": "EthereumMainnet",
    "payoutCryptoCurrency": "USDT",
    "payoutNetwork": "Polygon"
}
headers = {
    "access-token": "",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Success
const url = 'https://api-stg.transak.com/partners/api/v2/business/create-order';
const options = {
  method: 'POST',
  headers: {'access-token': '', 'Content-Type': 'application/json'},
  body: '{"depositTxHash":"0x8f2a559490b1c3d4e5f6789abcde1234567890abcdef1234567890abcdef1234","depositNetwork":"EthereumMainnet","payoutCryptoCurrency":"USDT","payoutNetwork":"Polygon"}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-stg.transak.com/partners/api/v2/business/create-order"

	payload := strings.NewReader("{\n  \"depositTxHash\": \"0x8f2a559490b1c3d4e5f6789abcde1234567890abcdef1234567890abcdef1234\",\n  \"depositNetwork\": \"EthereumMainnet\",\n  \"payoutCryptoCurrency\": \"USDT\",\n  \"payoutNetwork\": \"Polygon\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("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
require 'uri'
require 'net/http'

url = URI("https://api-stg.transak.com/partners/api/v2/business/create-order")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["access-token"] = ''
request["Content-Type"] = 'application/json'
request.body = "{\n  \"depositTxHash\": \"0x8f2a559490b1c3d4e5f6789abcde1234567890abcdef1234567890abcdef1234\",\n  \"depositNetwork\": \"EthereumMainnet\",\n  \"payoutCryptoCurrency\": \"USDT\",\n  \"payoutNetwork\": \"Polygon\"\n}"

response = http.request(request)
puts response.read_body
```

```java Success
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api-stg.transak.com/partners/api/v2/business/create-order")
  .header("access-token", "")
  .header("Content-Type", "application/json")
  .body("{\n  \"depositTxHash\": \"0x8f2a559490b1c3d4e5f6789abcde1234567890abcdef1234567890abcdef1234\",\n  \"depositNetwork\": \"EthereumMainnet\",\n  \"payoutCryptoCurrency\": \"USDT\",\n  \"payoutNetwork\": \"Polygon\"\n}")
  .asString();
```

```php Success
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-stg.transak.com/partners/api/v2/business/create-order', [
  'body' => '{
  "depositTxHash": "0x8f2a559490b1c3d4e5f6789abcde1234567890abcdef1234567890abcdef1234",
  "depositNetwork": "EthereumMainnet",
  "payoutCryptoCurrency": "USDT",
  "payoutNetwork": "Polygon"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'access-token' => '',
  ],
]);

echo $response->getBody();
```

```csharp Success
using RestSharp;

var client = new RestClient("https://api-stg.transak.com/partners/api/v2/business/create-order");
var request = new RestRequest(Method.POST);
request.AddHeader("access-token", "");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"depositTxHash\": \"0x8f2a559490b1c3d4e5f6789abcde1234567890abcdef1234567890abcdef1234\",\n  \"depositNetwork\": \"EthereumMainnet\",\n  \"payoutCryptoCurrency\": \"USDT\",\n  \"payoutNetwork\": \"Polygon\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Success
import Foundation

let headers = [
  "access-token": "",
  "Content-Type": "application/json"
]
let parameters = [
  "depositTxHash": "0x8f2a559490b1c3d4e5f6789abcde1234567890abcdef1234567890abcdef1234",
  "depositNetwork": "EthereumMainnet",
  "payoutCryptoCurrency": "USDT",
  "payoutNetwork": "Polygon"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-stg.transak.com/partners/api/v2/business/create-order")! 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()
```