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>",
"status": "CREATED",
"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."
]
}
}Payouts
Create Payout
Creates a payout to transfer funds from a paid order to the seller.
Requires the order to not yet be released. The destination is either a wallet_id or a bankaccount_id.
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>",
"status": "CREATED",
"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
Use your account's Secret Key as the Bearer token.
Body
application/json
ID of the order to pay out.
Example:
25955
Payout method type.
Available options:
WALLET, ACCOUNT, BANKWIRE Example:
"WALLET"
Destination wallet ID. Required when type is WALLET.
Destination bank account ID. Required for ACCOUNT type.
Custom reference for bank wire payouts.
Maximum string length:
140AzuPay destination ID. Required for AzuPay payouts.
AzuPay account type.
AzuPay BSB number (Australian bank routing number).
AzuPay bank account number.
Response
Payout created
Example:
"/2.0/payouts/789"
Payout method type (e.g. WALLET, ACCOUNT, BANKWIRE).
Available options:
CREATED, CONFIRMED, DENIED, CANCELLED Hypermedia links to related resources.
Show child attributes
Show child attributes
