Skip to content

Checkout API

POST /api/v1/checkout/initiate
{
"cart_id": "uuid",
"shipping_address": {
"first_name": "John",
"last_name": "Doe",
"address1": "123 Main St",
"city": "New York",
"state": "NY",
"country": "US",
"zip": "10001",
"phone": "+12125551234"
},
"currency": "USD"
}

Response includes:

  • available_shipping_rates — calculated rates based on weight and destination
  • tax_breakdown — tax calculation details
  • subtotal, shipping_total, tax_total, total
  • airwallex_client_id, airwallex_env — for client-side payment
POST /api/v1/checkout/shipping
{
"cart_id": "uuid",
"shipping_address": { ... },
"shipping_rate": {
"provider_id": "weight_based",
"carrier": "88 Wheel Co",
"service_code": "weight_standard",
"service_name": "Standard Shipping (United States)",
"total_cost": 50.00
}
}
POST /api/v1/checkout/complete
{
"cart_id": "uuid",
"shipping_address": { ... },
"payment_method": { "type": "stripe_elements" },
"customer_email": "john@example.com",
"selected_shipping_rate": { ... }
}

Response includes:

  • order — created order
  • client_secret — for client-side payment confirmation
  • payment_intent_id — payment intent identifier
  • requires_confirmation — whether client-side confirmation is needed
POST /api/v1/checkout/confirm
{
"order_id": "uuid",
"payment_intent_id": "pi_xxx",
"cart_id": "uuid"
}

Finalizes the order after client-side payment succeeds.