Payout batches
3 operations under payout-batches. Examples read $API and $KEY from your shell.
POST /v1/payout-batches
Send an Idempotency-Key header on every POST so a retry never repeats the request.
Request body
application/json, required
one of
Variant 1:
objectsourceobject requiredtypestring required one offiat_balancecurrencystring required
assetstring requiredcsvstring optionalrowsarray optionalEach item:
counterparty_idstring requiredamountdecimal string requiredreferencestring optionaladdressstring optional
metadataobject optional
Variant 2:
objectretry_ofstring requiredmetadataobject optional
Responses
201 Default Response
object
idstring requiredobjectstring required one ofpayout_batchstatusstring requiredstatus_reasonstring required (nullable)assetstring requiredcurrencystring requiredtotal_amountdecimal string requiredcountsobject requiredtotalinteger requiredreadyinteger requiredinvalidinteger requiredpendinginteger requiredsuccessinteger requiredfailedinteger requiredcanceledinteger required
retry_ofstring required (nullable)stellar_tx_hashstring required (nullable)versioninteger requiredcreated_atstring requiredcompleted_atstring required (nullable)metadataobject requireditemsarray requiredEach item:
rowinteger requiredlineinteger required (nullable)counterparty_idstring required (nullable)counterparty_refstring requiredaddressstring requiredamountdecimal string requiredreferencestring required (nullable)statusstring requiredstatus_reasonstring required (nullable)stellar_tx_hashstring required (nullable)ledger_sequenceinteger required (nullable)retry_ofobject required (nullable)batch_idstring requiredrowinteger required
retried_byobject required (nullable)batch_idstring requiredrowinteger required
202 Default Response
object
idstring requiredobjectstring required one ofpayout_batchstatusstring requiredstatus_reasonstring required (nullable)assetstring requiredcurrencystring requiredtotal_amountdecimal string requiredcountsobject requiredtotalinteger requiredreadyinteger requiredinvalidinteger requiredpendinginteger requiredsuccessinteger requiredfailedinteger requiredcanceledinteger required
retry_ofstring required (nullable)stellar_tx_hashstring required (nullable)versioninteger requiredcreated_atstring requiredcompleted_atstring required (nullable)metadataobject requireditemsarray requiredEach item:
rowinteger requiredlineinteger required (nullable)counterparty_idstring required (nullable)counterparty_refstring requiredaddressstring requiredamountdecimal string requiredreferencestring required (nullable)statusstring requiredstatus_reasonstring required (nullable)stellar_tx_hashstring required (nullable)ledger_sequenceinteger required (nullable)retry_ofobject required (nullable)batch_idstring requiredrowinteger required
retried_byobject required (nullable)batch_idstring requiredrowinteger required
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
-X POST \
"$API/v1/payout-batches" \
-H "authorization: Bearer $KEY" \
-H "idempotency-key: $(uuidgen)" \
-H "content-type: application/json" \
-d '{"source":{"type":"fiat_balance","currency":"<currency>"},"asset":"<asset>"}'SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key and an Idempotency-Key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.POST("/v1/payout-batches", {
body: {
"source": {
"type": "fiat_balance",
"currency": "<currency>"
},
"asset": "<asset>"
},
});GET /v1/payout-batches/{id}
Parameters
idstring required in path
Responses
200 Default Response
object
idstring requiredobjectstring required one ofpayout_batchstatusstring requiredstatus_reasonstring required (nullable)assetstring requiredcurrencystring requiredtotal_amountdecimal string requiredcountsobject requiredtotalinteger requiredreadyinteger requiredinvalidinteger requiredpendinginteger requiredsuccessinteger requiredfailedinteger requiredcanceledinteger required
retry_ofstring required (nullable)stellar_tx_hashstring required (nullable)versioninteger requiredcreated_atstring requiredcompleted_atstring required (nullable)metadataobject required
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
"$API/v1/payout-batches/$ID" \
-H "authorization: Bearer $KEY"SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.GET("/v1/payout-batches/{id}", {
params: { path: { id: "<id>" } },
});GET /v1/payout-batches/{id}/items
Parameters
limitinteger required in querystarting_afterinteger optional in queryidstring required in path
Responses
200 Default Response
object
dataarray requiredEach item:
rowinteger requiredlineinteger required (nullable)counterparty_idstring required (nullable)counterparty_refstring requiredaddressstring requiredamountdecimal string requiredreferencestring required (nullable)statusstring requiredstatus_reasonstring required (nullable)stellar_tx_hashstring required (nullable)ledger_sequenceinteger required (nullable)retry_ofobject required (nullable)batch_idstring requiredrowinteger required
retried_byobject required (nullable)batch_idstring requiredrowinteger required
has_moreboolean required
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
"$API/v1/payout-batches/$ID/items?limit=1" \
-H "authorization: Bearer $KEY"SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.GET("/v1/payout-batches/{id}/items", {
params: { path: { id: "<id>" }, query: { limit: 1 } },
});