Programmatic and interactive checkout
Programmatic checkout runs with no human. Interactive checkout turns on escalation with options.allowInteraction.
CartAI runs every order through the same checkout API. You choose how the order behaves when the merchant asks for something it does not have.
The two modes
Programmatic checkout means your platform sends everything up front and the order runs start to finish with no human.
Interactive checkout is the same order with escalation turned on. If the agent hits a login code or missing information, it pauses, asks the customer and then completes.
| Mode | options.allowInteraction | What happens when the merchant asks for input |
|---|---|---|
| Programmatic | false (default) | The agent does not pause to ask anyone for input. |
| Interactive | true | The agent pauses, CartAI sends you a webhook with a requiredInputs array, and the order completes once you send the input back. |
The setting that turns escalation on
Escalation is controlled by one boolean in the options object of the checkout request:
| Field | Type | Default | Description |
|---|---|---|---|
options.allowInteraction | boolean | false | Enables the interactive flow instead of fire and forget. The agent can request additional input if it needs it. |
It is accepted on both Create Checkout Task (POST /checkout) and Create Search Checkout Task (POST /search-checkout). Leave it out, or set it to false, for programmatic checkout.
With options.allowInteraction set to true, CartAI escalates whenever the checkout needs something it does not have. This includes login and verification codes, shipping and billing addresses, payment details, shipping method and any other choice the merchant asks for. CartAI pauses the order, asks the customer, and finishes the checkout once the answer is provided.
{
"customer": { "...": "..." },
"tasks": [ { "url": "https://www.example.com/products/example", "quantity": 1 } ],
"options": {
"allowInteraction": true
}
}How an interactive checkout completes
- Create the task with
options.allowInteractionset totrue. If the agent should sign in with the customer's saved merchant login, also setuseSavedCredentialToLogintotrue. - The agent pauses when the checkout needs something it does not have. CartAI sends a checkout task webhook with a
requiredInputsarray describing what it needs. - Ask the customer. Use CartAI's hosted screen or your own UI.
- Send the answer back. The hosted screen submits it for you, or send it from your own UI with Send Interactive Inputs (
POST /checkout/{taskId}/{intent}). - The agent completes the order and you receive the
COMPLETEDwebhook.
For a worked example with payloads and the hosted screen, using a login code, see Handling MFA with Interactive Checkout.
Which one to use
- Programmatic when your platform already has everything the order needs, such as guest checkout with full address and payment details.
- Interactive when the order may need something your platform does not send up front, such as a login or verification code, an address, payment details or a shipping choice.
Updated 7 days ago