Checkout API
Initiate checkout
Section titled “Initiate checkout”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 destinationtax_breakdown— tax calculation detailssubtotal,shipping_total,tax_total,totalairwallex_client_id,airwallex_env— for client-side payment
Select shipping
Section titled “Select shipping”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 }}Complete checkout
Section titled “Complete checkout”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 orderclient_secret— for client-side payment confirmationpayment_intent_id— payment intent identifierrequires_confirmation— whether client-side confirmation is needed
Confirm checkout
Section titled “Confirm checkout”POST /api/v1/checkout/confirm{ "order_id": "uuid", "payment_intent_id": "pi_xxx", "cart_id": "uuid"}Finalizes the order after client-side payment succeeds.