Declare a purchase; request owner approval above automatic caps
const url = 'https://api.xaalis.org/v1/agent/purchase_intents';const options = { method: 'POST', headers: { 'idempotency-key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"card_id":"example","merchant_name":"example","max_amount":1,"reason":"example","action_id":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.xaalis.org/v1/agent/purchase_intents \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'idempotency-key: example' \ --data '{ "card_id": "example", "merchant_name": "example", "max_amount": 1, "reason": "example", "action_id": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters”Required retry-safe key; reuse it only for the same operation and request body
Required retry-safe key; reuse it only for the same operation and request body
Request Bodyrequired
Section titled “Request Bodyrequired”object
Declared merchant for owner display only; the card enforces merchant restrictions
Examplegenerated
{ "card_id": "example", "merchant_name": "example", "max_amount": 1, "reason": "example", "action_id": "example"}Responses
Section titled “ Responses ”Intent
object
Example
{ "object": "agent_purchase_intent", "currency": "USD", "status": "approved"}Headers
Section titled “Headers”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).
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
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": "example" }}Headers
Section titled “Headers”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).
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 required
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": "example" }}Headers
Section titled “Headers”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).
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
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": "example" }}Headers
Section titled “Headers”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).
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
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": "example" }}Headers
Section titled “Headers”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).
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
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": "example" }}Headers
Section titled “Headers”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).
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.
Policy limit or insufficient funds
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": "example" }}Headers
Section titled “Headers”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).
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
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": "example" }}Headers
Section titled “Headers”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).
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.
Minimum seconds to wait before retrying. Takes precedence over the quota snapshot.
Service unavailable
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": "example" }}Headers
Section titled “Headers”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).
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.