cURL
curl --request POST \
--url https://sandbox.onconsul.com/v1/payouts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"items": [
{
"amount": "<string>",
"email": "jsmith@example.com",
"recipient_id": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
items: [{amount: '<string>', email: 'jsmith@example.com', recipient_id: '<string>'}]
})
};
fetch('https://sandbox.onconsul.com/v1/payouts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.onconsul.com/v1/payouts"
payload := strings.NewReader("{\n \"items\": [\n {\n \"amount\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"recipient_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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))
}import requests
url = "https://sandbox.onconsul.com/v1/payouts"
payload = { "items": [
{
"amount": "<string>",
"email": "jsmith@example.com",
"recipient_id": "<string>"
}
] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"created_at": "2023-11-07T05:31:56Z",
"currency": "USDC",
"id": "<string>",
"item_breakdown": {
"cancelled": 123,
"completed": 123,
"failed": 123,
"pending_claim": 123,
"processing": 123
},
"status": "processing",
"total_amount": "<string>",
"total_items": 123,
"completed_at": "2023-11-07T05:31:56Z",
"failure_reason": "<string>"
}{
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Payouts
Create a Payout
POST
/
payouts
cURL
curl --request POST \
--url https://sandbox.onconsul.com/v1/payouts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"items": [
{
"amount": "<string>",
"email": "jsmith@example.com",
"recipient_id": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
items: [{amount: '<string>', email: 'jsmith@example.com', recipient_id: '<string>'}]
})
};
fetch('https://sandbox.onconsul.com/v1/payouts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.onconsul.com/v1/payouts"
payload := strings.NewReader("{\n \"items\": [\n {\n \"amount\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"recipient_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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))
}import requests
url = "https://sandbox.onconsul.com/v1/payouts"
payload = { "items": [
{
"amount": "<string>",
"email": "jsmith@example.com",
"recipient_id": "<string>"
}
] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"created_at": "2023-11-07T05:31:56Z",
"currency": "USDC",
"id": "<string>",
"item_breakdown": {
"cancelled": 123,
"completed": 123,
"failed": 123,
"pending_claim": 123,
"processing": 123
},
"status": "processing",
"total_amount": "<string>",
"total_items": 123,
"completed_at": "2023-11-07T05:31:56Z",
"failure_reason": "<string>"
}{
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Send USDC from your Consul wallet to one or more
recipients. Each item in the payout specifies an amount
and a target: either an email address or a
recipient_id.
Supports an Idempotency-Key header to safely retry
without creating duplicate payouts.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
application/json
Required array length:
1 - 100 elementsShow child attributes
Show child attributes
Response
OK
Available options:
USDC, USDT, USD, BRL, ARS, COP, MXN, CAD, EUR Show child attributes
Show child attributes
Available options:
processing, completed, failed, cancelled 
