Skip to main content
POST
Set Billing Info

Overview

Sets customer billing information for the cart. This endpoint is typically used when the billing address differs from the shipping address. The billing information is used for payment processing and invoice generation.
If billing address is the same as shipping address, you may skip this endpoint and the shipping address will be used for billing by default.

Request Body

string
required
Customer’s first name for billing
string
required
Customer’s last name for billing
string
required
Primary billing address line
string
Secondary billing address line (apartment, suite, etc.)
string
required
Billing city name
string
required
Billing state or province code (e.g., “CA”, “NY”) or full name
string
required
Billing ZIP or postal code
string
required
Billing country code in ISO 3166-1 alpha-2 format (e.g., “US”, “CA”)
string
required
Billing contact phone number
string
required
Billing contact email address

Response

Returns a complete ShoppingCart object with updated billing information. The cart totals remain unchanged as billing address doesn’t affect shipping or tax calculations.

When to Use Billing Info

Common Scenarios

  1. Different Billing Address: Customer’s credit card billing address differs from shipping
  2. Gift Orders: Shipping to recipient but billing to purchaser
  3. Business Orders: Shipping to office but billing to headquarters
  4. Digital Products: No shipping address but billing address required

Default Behavior

If this endpoint is not called:
  • Shipping address is used as billing address
  • Both addresses must match for payment processing

Code Examples

Response Example

Billing Address Validation

Similar to shipping address, the billing address undergoes validation:
  1. Country Support: Verifies billing country is supported
  2. State/Province: Validates state/province for the country
  3. Required Fields: Ensures all required fields are present
  4. Email Format: Validates email address format
Billing address validation is primarily for data integrity. Payment processors may perform additional address verification (AVS) during payment processing.

Billing Address Behavior

  1. Independent from Shipping: Billing info can be set independently of shipping
  2. No Tax Impact: Billing address doesn’t affect tax calculations (taxes based on shipping destination)
  3. Schema Compatibility: Uses the same address schema as shipping for consistency
  4. Session Storage: Billing info is stored in the cart session

Error Responses

Common Errors

Checkout Flow Integration

The typical checkout flow sequence:
  1. Add Items to Cart - Build the cart
  2. Set Shipping Info - Add shipping address
  3. Set Billing Info - Add billing address (this endpoint)
  4. Set Consents - Handle consent management
  5. Complete Order - Complete the purchase