Skip to main content
POST
/
payouts
Create payout
curl --request POST \
  --url https://{subdomain}.truust.io/2.0/payouts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "order_id": 25955,
  "type": "WALLET",
  "wallet_id": 28751
}
'
import requests

url = "https://{subdomain}.truust.io/2.0/payouts"

payload = {
"order_id": 25955,
"type": "WALLET",
"wallet_id": 28751
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({order_id: 25955, type: 'WALLET', wallet_id: 28751})
};

fetch('https://{subdomain}.truust.io/2.0/payouts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{subdomain}.truust.io/2.0/payouts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'order_id' => 25955,
'type' => 'WALLET',
'wallet_id' => 28751
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://{subdomain}.truust.io/2.0/payouts"

payload := strings.NewReader("{\n \"order_id\": 25955,\n \"type\": \"WALLET\",\n \"wallet_id\": 28751\n}")

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

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://{subdomain}.truust.io/2.0/payouts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order_id\": 25955,\n \"type\": \"WALLET\",\n \"wallet_id\": 28751\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{subdomain}.truust.io/2.0/payouts")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"order_id\": 25955,\n \"type\": \"WALLET\",\n \"wallet_id\": 28751\n}"

response = http.request(request)
puts response.read_body
{
  "id": 123,
  "self": "/2.0/payouts/789",
  "reference": "<string>",
  "type": "<string>",
  "provider": {},
  "created_at": "2023-11-07T05:31:56Z",
  "confirmed_at": "2023-11-07T05:31:56Z",
  "denied_at": "2023-11-07T05:31:56Z",
  "connections": {}
}
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
]
}
}

Authorizations

Authorization
string
header
required

Use your account's Secret Key as the Bearer token.

Body

application/json
order_id
integer
required

ID of the order to pay out.

Example:

25955

type
enum<string>
required

Payout method type.

Available options:
WALLET,
ACCOUNT,
BANKWIRE
Example:

"WALLET"

wallet_id
integer

Destination wallet ID. Required when type is WALLET.

bankaccount_id
integer

Destination bank account ID. Required for ACCOUNT type.

bankwire_ref
string

Custom reference for bank wire payouts.

Maximum string length: 140
azupay_id
string

AzuPay destination ID. Required for AzuPay payouts.

azupay_type
string

AzuPay account type.

azupay_bsb
string

AzuPay BSB number (Australian bank routing number).

azupay_account
string

AzuPay bank account number.

Response

Payout created

id
integer
self
string
Example:

"/2.0/payouts/789"

reference
string | null
type
string

Payout method type (e.g. WALLET, ACCOUNT, BANKWIRE).

status
enum<string>
Available options:
CREATED,
CONFIRMED,
DENIED,
CANCELLED
provider
object | null
created_at
string<date-time> | null
confirmed_at
string<date-time> | null
denied_at
string<date-time> | null
connections
object

Hypermedia links to related resources.