Skip to main content
POST
Set Shipping Info

Overview

Sets customer shipping information for cart delivery. This endpoint validates the address, calculates shipping costs based on available shipping methods, and updates cart totals. This endpoint supports multi-shipment scenarios where different items may ship from different locations.
Both POST and PUT methods are supported for this endpoint, providing flexibility for different client implementations.

Request Body

string
required
Customer’s first name
string
required
Customer’s last name
string
required
Primary address line (street address)
string
Secondary address line (apartment, suite, unit, etc.)
string
required
City name
string
required
State or province code (e.g., “CA”, “NY”) or full name
string
required
ZIP or postal code
string
required
Country code in ISO 3166-1 alpha-2 format (e.g., “US”, “CA”)
string
required
Contact phone number for delivery
string
required
Contact email address

Response

Returns a complete ShoppingCart object with:
  • Updated shipping information
  • Calculated shipping costs per shipment
  • Updated tax calculations based on shipping address
  • Recalculated cart totals

Multi-Shipment Behavior

The shipping address applies to all shipments in the cart. Key behaviors:
  1. Address Application: The provided address is used for all shipments
  2. Shipping Calculation: Each shipment’s shipping cost is calculated independently
  3. Tax Calculation: Taxes are recalculated based on the shipping destination
  4. Validation: Address is validated against merchant’s supported regions

Code Examples

Response Example

Address Validation

The endpoint performs several validations:
  1. Country Support: Verifies the country is supported by the merchant
  2. State/Province: Validates state/province code for the given country
  3. Required Fields: Ensures all required fields are provided
  4. Email Format: Validates email address format
  5. Postal Code: Basic format validation for the country

Shipping Calculation Process

  1. Address Validation: Verify address is valid and supported
  2. Shipping Methods: Retrieve available shipping methods for the destination
  3. Cost Calculation: Calculate shipping cost for each shipment
  4. Tax Recalculation: Update taxes based on shipping destination
  5. Total Update: Recalculate cart totals with shipping and tax

Error Responses

Common Errors

After setting shipping information, typical next steps include: