execute_checkout
Execute checkout for a cart to create an order. Requires a buyer delegation token (from user auth) and a shipping address. The order is created UNPAID (status "pending"). IMPORTANT — do NOT stop here or just hand the user the payment_url. Immediately continue the in-chat payment flow: call get_payment_methods for the returned order_id, present the available channels to the buyer, and ask which they want to use; then drive initiate_payment → (submit_payment_otp if needed) → poll get_payment_status until the order is paid. The payment_url in the response is only a manual fallback if the buyer declines in-chat payment. Always offer to collect payment in the chat first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | No | Optional order notes | |
| cart_id | Yes | Cart ID to checkout | |
| site_id | Yes | Registered site ID | |
| customer_name | Yes | Full name of the customer placing the order | |
| shipping_city | Yes | Shipping city | |
| shipping_name | Yes | Recipient full name | |
| customer_email | Yes | Email address of the customer placing the order | |
| customer_phone | Yes | Customer contact / billing phone number (E.164 preferred, e.g. +233201234567) | |
| shipping_line1 | Yes | Shipping address line 1 (street) | |
| shipping_line2 | No | Shipping address line 2 (apt/suite) [optional] | |
| shipping_phone | No | Recipient phone for the shipping address (E.164 preferred); defaults to customer_phone if omitted | |
| shipping_state | Yes | Shipping state or province | |
| shipping_country | Yes | ISO 3166-1 alpha-2 country code (e.g., "US", "GB") | |
| shipping_postal_code | Yes | Shipping postal code | |
| buyer_delegation_token | Yes | Delegation token from buyer (OAuth-like flow) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | No | ||
| total | No | ||
| status | No | ||
| order_id | No | ||
| created_at | No |