Delegate payment
The Delegate Payment API enables merchants to tokenize payment credentials with controlled usage constraints through an allowance framework. This creates secure, time-limited tokens that restrict how payment methods can be used.
Overview
The Delegate Payment API provides:
- Payment tokenization: Securely store payment credentials and receive a vault token
- Allowance constraints: Control maximum amounts, expiration times, and usage scope
- Risk screening: Integrate fraud signals before tokenization
- Idempotency: Safely retry requests without duplicate token creation
All API endpoints use HTTPS and return JSON. The merchant maintains full control over how delegated payment tokens are used within the specified constraints.
Authentication
All API requests must be authenticated using a bearer token in the Authorization header:
Authorization: Bearer YOUR_API_KEY
The bearer token should be issued by the merchant and validated on each request to ensure authorized access to payment delegation operations.
Headers
Required headers
All API requests must include these headers:
| Header | Description |
|---|---|
Authorization | Bearer token for API authentication (e.g., Bearer sk_live_123) |
Content-Type | Must be application/json |
API-Version | API version date in format YYYY-MM-DD (e.g., 2025-09-29) |
Optional headers
These headers provide additional functionality:
| Header | Description |
|---|---|
Idempotency-Key | Unique key to safely retry requests without duplicate token creation |
Request-Id | Unique identifier for request tracking and debugging |
Accept-Language | Preferred language for response messages (e.g., en-US) |
User-Agent | Client application identifier |
Signature | Detached JSON signature for request verification |
Timestamp | ISO 8601 timestamp for request timing validation |
Endpoints
Create delegated payment token
Creates a new delegated payment token with allowance constraints.
This endpoint tokenizes payment credentials and returns a vault token that can be used within the specified allowance constraints. The token enforces temporal and monetary limits on payment usage.
payment_methodPaymentMethodCardCard payment method details including card number, expiration, and display information.
allowanceAllowanceUsage constraints including maximum amount, currency, expiration time, and scope.
risk_signalsRiskSignal[]Array of risk assessment signals. Must include at least 1 signal.
metadataobjectKey-value pairs of string metadata for tracking and correlation.
billing_addressAddressOptional billing address associated with the payment method.
POST /agentic_commerce/delegate_payment
{
"payment_method": {
"type": "card",
"card_number_type": "network_token",
"number": "4242424242424242",
"display_card_funding_type": "credit",
"metadata": {}
},
"allowance": {
"reason": "one_time",
"max_amount": 10000,
"currency": "usd",
"checkout_session_id": "cs_123",
"merchant_id": "acme_corp",
"expires_at": "2025-12-31T23:59:59Z"
},
"risk_signals": [
{ "type": "card_testing", "score": 10, "action": "authorized" }
],
"metadata": { "source": "agent_checkout" }
}
Status Codes:
201 Created- Delegated payment token successfully created400 Bad Request- Invalid request parameters or malformed data401 Unauthorized- Missing or invalid authentication credentials409 Conflict- Idempotency conflict (same key with different parameters)422 Unprocessable Entity- Semantic validation failure (e.g., invalid expiration date)429 Too Many Requests- Rate limit exceeded500 Internal Server Error- Server processing error503 Service Unavailable- Service temporarily unavailable
Schema objects
Below are the canonical JSON Schemas for Delegate Payment objects.
PaymentMethodCard
typestringcard_number_typestringnumberstringexp_monthstringexp_yearstringnamestringcvcstringchecks_performedstring[]iinstringdisplay_card_funding_typestringdisplay_brandstringdisplay_last4stringmetadataobject{
"type": "card",
"card_number_type": "network_token",
"number": "4242424242424242",
"exp_month": "12",
"exp_year": "2027",
"name": "Ada Lovelace",
"cvc": "123",
"display_card_funding_type": "credit",
"display_brand": "visa",
"display_last4": "4242",
"metadata": {}
}
Allowance
reasonstringmax_amountintegercurrencystringcheckout_session_idstringmerchant_idstringexpires_atstring{
"reason": "one_time",
"max_amount": 10000,
"currency": "usd",
"checkout_session_id": "cs_123",
"merchant_id": "acme_corp",
"expires_at": "2025-12-31T23:59:59Z"
}
RiskSignal
typestringscoreintegeractionstring{
"type": "card_testing",
"score": 10,
"action": "authorized"
}
Address
namestringline_onestringline_twostringcitystringstatestringcountrystringpostal_codestring{
"name": "Ada Lovelace",
"line_one": "123 Market St",
"line_two": "Apt 4B",
"city": "San Francisco",
"state": "CA",
"country": "US",
"postal_code": "94103"
}
DelegatePaymentRequest
payment_methodPaymentMethodCardallowanceAllowancerisk_signalsRiskSignal[]metadataobjectbilling_addressAddress{
"payment_method": {
"type": "card",
"card_number_type": "fpan",
"number": "4242424242424242",
"display_card_funding_type": "credit",
"metadata": {}
},
"allowance": {
"reason": "one_time",
"max_amount": 5000,
"currency": "usd",
"checkout_session_id": "cs_456",
"merchant_id": "merchant_123",
"expires_at": "2025-06-30T23:59:59Z"
},
"risk_signals": [
{
"type": "card_testing",
"score": 5,
"action": "authorized"
}
],
"metadata": {
"source": "web_checkout"
}
}
DelegatePaymentResponse
idstringcreatedstringmetadataobject{
"id": "vt_01J8Z3WXYZ9ABC",
"created": "2025-09-29T11:00:00Z",
"metadata": {
"source": "agent_checkout",
"merchant_id": "acme_corp",
"idempotency_key": "idem_abc123"
}
}
Error
errorobjecterror.typestringerror.codestringerror.messagestringerror.paramstring{
"error": {
"type": "invalid_request",
"code": "invalid_card",
"message": "The card number provided is invalid",
"param": "$.payment_method.number"
}
}