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.

Modeoptions.allowInteractionWhat happens when the merchant asks for input
Programmaticfalse (default)The agent does not pause to ask anyone for input.
InteractivetrueThe 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:

FieldTypeDefaultDescription
options.allowInteractionbooleanfalseEnables 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

  1. Create the task with options.allowInteraction set to true. If the agent should sign in with the customer's saved merchant login, also set useSavedCredentialToLogin to true.
  2. The agent pauses when the checkout needs something it does not have. CartAI sends a checkout task webhook with a requiredInputs array describing what it needs.
  3. Ask the customer. Use CartAI's hosted screen or your own UI.
  4. 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}).
  5. The agent completes the order and you receive the COMPLETED webhook.

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.

Did this page help you?