Skip to content

Request a wallet payout or owner approval

POST
/v1/agent/payouts
curl --request POST \
--url https://api.xaalis.org/v1/agent/payouts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: example' \
--data '{ "amount": 15000, "currency": "XOF", "recipient": { "phone": "+221771234567", "name": "example" }, "action_id": "example" }'

Returns 201 for an admitted payout, or 202 for an approval proposal when the test-only policy enables owner approval above soft limits. Pending, declined and expired approvals reserve nothing. Retrying an owner-admitted action returns its payout, including a failed reservation; inspect the payout status. Ordinary payout admission still returns 422 for insufficient funds. The provider comes from the wallet policy. The recipient must be on the wallet’s allowlist. Reuse action_id for retries of the same business payout, even when the Idempotency-Key changes.

idempotency-key
required

Required retry-safe key; reuse it only for the same operation and request body

string
>= 1 characters <= 255 characters

Required retry-safe key; reuse it only for the same operation and request body

Media typeapplication/json
object
amount
required

Integer XOF

integer
>= 1 <= 100000000
Example
15000
currency
string
default: XOF
Allowed values: XOF
recipient
required
object
phone
required
string
/^\+2217[0-9]{8}$/
Example
+221771234567
name
string
<= 100 characters
action_id
required

Stable business action ID, unique within this agent wallet. Reuse it when retrying the same payout.

string
>= 1 characters <= 100 characters

Agent payout

Media typeapplication/json
object
id
required
string
object
required
string
Allowed values: payout
agent_wallet_id
required
string | null
livemode
required
boolean
amount
required
integer
fee
required
integer
currency
required
string
provider
required
string
Allowed values: wave orange_money mock stripe
status
required
string
Allowed values: pending processing succeeded failed
recipient
required
object
phone
required
string
name
required
string | null
client_reference
required
string | null
failure_reason
required
string | null
created_at
required
string
updated_at
required
string
Example
{
"object": "payout",
"provider": "wave",
"status": "pending"
}
RateLimit-Policy
string

Present after quota evaluation: structured list of policy labels with q=request allowance and w=rolling-window seconds (IETF draft-ietf-httpapi-ratelimit-headers-11).

RateLimit
string

Present after quota evaluation: matching policy labels with r=remaining requests and t=effective-window seconds. Snapshot, not a guarantee; omitted when no quota was evaluated.

Waiting for owner approval or terminal approval result

Media typeapplication/json
object
object
required
string
Allowed values: agent_payout_approval
id
required
string
wallet_id
required
string
livemode
required
boolean
status
required
string
Allowed values: pending approved declined expired
amount
required
integer
fee
required
integer
currency
required
string
Allowed values: XOF
provider
required
string
Allowed values: wave orange_money
recipient
required
object
phone
required

Masked phone; not a provider-confirmed identity

string
action_id
required
string
expires_at
required
string
payout_id
required
string | null
created_at
required
string
Example
{
"object": "agent_payout_approval",
"status": "pending",
"currency": "XOF",
"provider": "wave"
}
RateLimit-Policy
string

Present after quota evaluation: structured list of policy labels with q=request allowance and w=rolling-window seconds (IETF draft-ietf-httpapi-ratelimit-headers-11).

RateLimit
string

Present after quota evaluation: matching policy labels with r=remaining requests and t=effective-window seconds. Snapshot, not a guarantee; omitted when no quota was evaluated.

Validation error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": "example"
}
}
RateLimit-Policy
string

Present after quota evaluation: structured list of policy labels with q=request allowance and w=rolling-window seconds (IETF draft-ietf-httpapi-ratelimit-headers-11).

RateLimit
string

Present after quota evaluation: matching policy labels with r=remaining requests and t=effective-window seconds. Snapshot, not a guarantee; omitted when no quota was evaluated.

Authentication error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": "example"
}
}
RateLimit-Policy
string

Present after quota evaluation: structured list of policy labels with q=request allowance and w=rolling-window seconds (IETF draft-ietf-httpapi-ratelimit-headers-11).

RateLimit
string

Present after quota evaluation: matching policy labels with r=remaining requests and t=effective-window seconds. Snapshot, not a guarantee; omitted when no quota was evaluated.

Forbidden

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": "example"
}
}
RateLimit-Policy
string

Present after quota evaluation: structured list of policy labels with q=request allowance and w=rolling-window seconds (IETF draft-ietf-httpapi-ratelimit-headers-11).

RateLimit
string

Present after quota evaluation: matching policy labels with r=remaining requests and t=effective-window seconds. Snapshot, not a guarantee; omitted when no quota was evaluated.

Not found

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": "example"
}
}
RateLimit-Policy
string

Present after quota evaluation: structured list of policy labels with q=request allowance and w=rolling-window seconds (IETF draft-ietf-httpapi-ratelimit-headers-11).

RateLimit
string

Present after quota evaluation: matching policy labels with r=remaining requests and t=effective-window seconds. Snapshot, not a guarantee; omitted when no quota was evaluated.

Idempotency conflict or invalid state

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": "example"
}
}
RateLimit-Policy
string

Present after quota evaluation: structured list of policy labels with q=request allowance and w=rolling-window seconds (IETF draft-ietf-httpapi-ratelimit-headers-11).

RateLimit
string

Present after quota evaluation: matching policy labels with r=remaining requests and t=effective-window seconds. Snapshot, not a guarantee; omitted when no quota was evaluated.

Insufficient funds or policy violation

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": "example"
}
}
RateLimit-Policy
string

Present after quota evaluation: structured list of policy labels with q=request allowance and w=rolling-window seconds (IETF draft-ietf-httpapi-ratelimit-headers-11).

RateLimit
string

Present after quota evaluation: matching policy labels with r=remaining requests and t=effective-window seconds. Snapshot, not a guarantee; omitted when no quota was evaluated.

Rate limited; see Retry-After response header

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": "example"
}
}
RateLimit-Policy
string

Present after quota evaluation: structured list of policy labels with q=request allowance and w=rolling-window seconds (IETF draft-ietf-httpapi-ratelimit-headers-11).

RateLimit
string

Present after quota evaluation: matching policy labels with r=remaining requests and t=effective-window seconds. Snapshot, not a guarantee; omitted when no quota was evaluated.

Retry-After
string

Minimum seconds to wait before retrying. Takes precedence over the quota snapshot.