Execute Payout
curl --request POST \
--url 'https://share-ddn.formless.xyz/v1#payouts' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "payouts",
"params": {
"idempotency_key": "unique-payout-key-123",
"recipient_type": "smart_contract",
"recipient_id": "7a2ab0d5-27d8-482f-becf-0ac3217e0b1a",
"amount": {
"value": 10,
"currency": "USD"
}
}
}
'import requests
url = "https://share-ddn.formless.xyz/v1#payouts"
payload = {
"jsonrpc": "2.0",
"id": "1",
"method": "payouts",
"params": {
"idempotency_key": "unique-payout-key-123",
"recipient_type": "smart_contract",
"recipient_id": "7a2ab0d5-27d8-482f-becf-0ac3217e0b1a",
"amount": {
"value": 10,
"currency": "USD"
}
}
}
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({
jsonrpc: '2.0',
id: '1',
method: 'payouts',
params: {
idempotency_key: 'unique-payout-key-123',
recipient_type: 'smart_contract',
recipient_id: '7a2ab0d5-27d8-482f-becf-0ac3217e0b1a',
amount: {value: 10, currency: 'USD'}
}
})
};
fetch('https://share-ddn.formless.xyz/v1#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://share-ddn.formless.xyz/v1#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([
'jsonrpc' => '2.0',
'id' => '1',
'method' => 'payouts',
'params' => [
'idempotency_key' => 'unique-payout-key-123',
'recipient_type' => 'smart_contract',
'recipient_id' => '7a2ab0d5-27d8-482f-becf-0ac3217e0b1a',
'amount' => [
'value' => 10,
'currency' => 'USD'
]
]
]),
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://share-ddn.formless.xyz/v1#payouts"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"payouts\",\n \"params\": {\n \"idempotency_key\": \"unique-payout-key-123\",\n \"recipient_type\": \"smart_contract\",\n \"recipient_id\": \"7a2ab0d5-27d8-482f-becf-0ac3217e0b1a\",\n \"amount\": {\n \"value\": 10,\n \"currency\": \"USD\"\n }\n }\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://share-ddn.formless.xyz/v1#payouts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"payouts\",\n \"params\": {\n \"idempotency_key\": \"unique-payout-key-123\",\n \"recipient_type\": \"smart_contract\",\n \"recipient_id\": \"7a2ab0d5-27d8-482f-becf-0ac3217e0b1a\",\n \"amount\": {\n \"value\": 10,\n \"currency\": \"USD\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://share-ddn.formless.xyz/v1#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 \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"payouts\",\n \"params\": {\n \"idempotency_key\": \"unique-payout-key-123\",\n \"recipient_type\": \"smart_contract\",\n \"recipient_id\": \"7a2ab0d5-27d8-482f-becf-0ac3217e0b1a\",\n \"amount\": {\n \"value\": 10,\n \"currency\": \"USD\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": "<string>",
"result": {
"batch_id": "<string>",
"status": "pending",
"message": "<string>"
}
}Payouts
Execute Payout
Execute a payout to a smart contract based recipient
POST
/
v1#payouts
Execute Payout
curl --request POST \
--url 'https://share-ddn.formless.xyz/v1#payouts' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "payouts",
"params": {
"idempotency_key": "unique-payout-key-123",
"recipient_type": "smart_contract",
"recipient_id": "7a2ab0d5-27d8-482f-becf-0ac3217e0b1a",
"amount": {
"value": 10,
"currency": "USD"
}
}
}
'import requests
url = "https://share-ddn.formless.xyz/v1#payouts"
payload = {
"jsonrpc": "2.0",
"id": "1",
"method": "payouts",
"params": {
"idempotency_key": "unique-payout-key-123",
"recipient_type": "smart_contract",
"recipient_id": "7a2ab0d5-27d8-482f-becf-0ac3217e0b1a",
"amount": {
"value": 10,
"currency": "USD"
}
}
}
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({
jsonrpc: '2.0',
id: '1',
method: 'payouts',
params: {
idempotency_key: 'unique-payout-key-123',
recipient_type: 'smart_contract',
recipient_id: '7a2ab0d5-27d8-482f-becf-0ac3217e0b1a',
amount: {value: 10, currency: 'USD'}
}
})
};
fetch('https://share-ddn.formless.xyz/v1#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://share-ddn.formless.xyz/v1#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([
'jsonrpc' => '2.0',
'id' => '1',
'method' => 'payouts',
'params' => [
'idempotency_key' => 'unique-payout-key-123',
'recipient_type' => 'smart_contract',
'recipient_id' => '7a2ab0d5-27d8-482f-becf-0ac3217e0b1a',
'amount' => [
'value' => 10,
'currency' => 'USD'
]
]
]),
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://share-ddn.formless.xyz/v1#payouts"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"payouts\",\n \"params\": {\n \"idempotency_key\": \"unique-payout-key-123\",\n \"recipient_type\": \"smart_contract\",\n \"recipient_id\": \"7a2ab0d5-27d8-482f-becf-0ac3217e0b1a\",\n \"amount\": {\n \"value\": 10,\n \"currency\": \"USD\"\n }\n }\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://share-ddn.formless.xyz/v1#payouts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"payouts\",\n \"params\": {\n \"idempotency_key\": \"unique-payout-key-123\",\n \"recipient_type\": \"smart_contract\",\n \"recipient_id\": \"7a2ab0d5-27d8-482f-becf-0ac3217e0b1a\",\n \"amount\": {\n \"value\": 10,\n \"currency\": \"USD\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://share-ddn.formless.xyz/v1#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 \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"payouts\",\n \"params\": {\n \"idempotency_key\": \"unique-payout-key-123\",\n \"recipient_type\": \"smart_contract\",\n \"recipient_id\": \"7a2ab0d5-27d8-482f-becf-0ac3217e0b1a\",\n \"amount\": {\n \"value\": 10,\n \"currency\": \"USD\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": "<string>",
"result": {
"batch_id": "<string>",
"status": "pending",
"message": "<string>"
}
}Execute a payout to distribute revenue to a smart contract recipient. Use idempotency keys to prevent duplicate payouts.
Authorizations
JWT token with Unique ID identification
Body
application/json
⌘I
