Override Billing Details
Introduction
You can override the billing details for a payment by including the billing_details
field in your payment creation request. This allows you to specify custom billing information that differs from the payment method's default billing details.
Billing Details Behavior
- If
billing_details
is provided and contains data, those details will be used for the payment - If
billing_details
is provided but empty ({}
), no billing details will be sent - If
billing_details
is not included in the request, the payment method's default billing details will be used
Example Request
curl --location 'https://<api-host>/payment_intents/pi_2SG6ibTHTo4N6Sdx6Oh66IGg3o3/payments' \
--header 'x-account-id: acct_2PbifDOE5oaNLyy0oKzXMmHzCeK' \
--header 'Content-Type: application/json' \
--header 'x-api-key: key_123456789' \
--data '{
"payment_method_id": "pm_2SXKvZzhPgZJ4nbcVq8UB9eT1B7",
"billing_details": {
"name": "John Doe",
"email": "john.doe@example.com",
"phone": "+1234567890",
"address": {
"address_line1": "123 Main St",
"address_line2": "Apt 4B",
"city": "New York",
"state": "NY",
"postal_code": "10001",
"country": "US"
}
}
}'
Billing Details Schema
{
address?: {
city?: string,
country?: string,
state?: string,
address_line1?: string,
address_line2?: string,
postal_code?: string,
},
email?: string,
name?: string,
phone?: string,
}
Important Notes
The billing details used for each payment are recorded and available in payment reports for tracking and compliance purposes.
For more information about creating payments, refer to the Accept Payments guide.