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., 2026-01-30) |
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_methodallowancerisk_signalsmetadatabilling_addressPOST /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 data models used in the Delegate Payment API.
DelegatePaymentRequest
payment_methodallowancebilling_addressrisk_signalsmetadata{
"payment_method": {
"type": "card",
"card_number_type": "fpan",
"number": "4242424242424242",
"exp_month": "11",
"exp_year": "2026",
"name": "Jane Doe",
"cvc": "223",
"checks_performed": [
"avs",
"cvv"
],
"iin": "424242",
"display_card_funding_type": "credit",
"display_brand": "visa",
"display_last4": "4242",
"metadata": {}
},
"allowance": {
"reason": "one_time",
"max_amount": 5000,
"currency": "usd",
"checkout_session_id": "cs_01HV3P3ABC123",
"merchant_id": "acme_corp",
"expires_at": "2026-02-13T12:00:00Z"
},
"billing_address": {
"name": "Jane Doe",
"line_one": "185 Berry Street",
"line_two": "Suite 550",
"city": "San Francisco",
"state": "CA",
"country": "US",
"postal_code": "94107"
},
"risk_signals": [
{
"type": "card_testing",
"score": 5,
"action": "authorized"
}
],
"metadata": {
"session_id": "sess_abc123",
"user_agent": "ChatGPT/2.0"
}
}
PaymentMethodCard
type| Possible values |
|---|
card |
card_number_type| Possible values |
|---|
fpan |
network_token |
numberexp_monthexp_yearnamecvccryptogrameci_valuechecks_performediindisplay_card_funding_type| Possible values |
|---|
credit |
debit |
prepaid |
display_wallet_typedisplay_branddisplay_last4metadatavirtual{
"type": "card",
"card_number_type": "fpan",
"number": "4242424242424242",
"exp_month": "12",
"exp_year": "2027",
"name": "John Smith",
"cvc": "123",
"checks_performed": [
"avs",
"cvv"
],
"iin": "424242",
"display_card_funding_type": "credit",
"display_brand": "visa",
"display_last4": "4242",
"metadata": {
"card_origin": "manual_entry"
}
}
Address
nameline_oneline_twocitystatecountrypostal_code{
"name": "John Smith",
"line_one": "555 Golden Gate Avenue",
"line_two": "Apt 401",
"city": "San Francisco",
"state": "CA",
"country": "US",
"postal_code": "94102"
}
Allowance
reason| Possible values |
|---|
one_time |
max_amountcurrencycheckout_session_idmerchant_idexpires_at{
"reason": "one_time",
"max_amount": 100000,
"currency": "usd",
"checkout_session_id": "csn_01HV3P3XYZ789",
"merchant_id": "merchant_12345",
"expires_at": "2026-02-15T18:30:00Z"
}
RiskSignal
type| Possible values |
|---|
card_testing |
scoreaction| Possible values |
|---|
blocked |
manual_review |
authorized |
{
"type": "card_testing",
"score": 15,
"action": "manual_review"
}
DelegatePaymentResponse
idcreatedmetadata{
"id": "vt_01J8Z3WXYZ9ABC123",
"created": "2026-02-12T14:30:00Z",
"metadata": {
"source": "agent_checkout",
"merchant_id": "acme_corp",
"idempotency_key": "idem_xyz789"
}
}
Error
type| Possible values |
|---|
invalid_request |
rate_limit_exceeded |
processing_error |
service_unavailable |
code| Possible values |
|---|
invalid_card |
duplicate_request |
idempotency_conflict |
too_many_requests |
messageparam{
"type": "invalid_request",
"code": "invalid_card",
"message": "Invalid card expiration year",
"param": "$.payment_method.exp_year"
}