Base URLhttps://ottla.ai/api/v1

Getting started

Test your integration

There is no sandbox environment. All API keys are live. Here’s how you can test safely.

Updated 5 min read

On this page
Checking the answers

Ask questions in the Playground

The Playground under AI assistant → Playground allows you to ask the assistant questions just like your customers will, against your real catalogue. You can select a website and, if you like, a product and a page type, so you can test a question like “Will this fit my 15-inch laptop?” on the product page it would really be asked on.

  • Questions asked in the Playground do not count towards your monthly answered questions.
  • You can ask up to 50 test questions a day per workspace.
  • Members, Admins and Owners can use the Playground. Viewers do not have access.
  • Any question in AI assistant → Questions log has Try in Playground. This is useful if you’ve updated a product description and want to test a real shopper’s question again.

You can see what sources were used to answer a question in the Questions log. This is a quick way to debug why your assistant gave an answer.

Playground in the Ottla console answering a test question with product cards and the sources it used Example data

Show the widget only to yourself

Testing on your live store is always best. You can use a widget’s IP allow-list to show your assistant to your team only.

  1. Add your addresses

    Open the widget in Storefront → Widgets, go to the Widget tab and find Visibility. Under IP allow-list, enter one IP address or CIDR range per line, IPv4 or IPv6, for example 203.0.113.5.

  2. Publish to your live store

    Add the placement in Magento, or paste the snippet into your live pages. Shoppers outside the list see nothing, and a call to /ask that names this widget from any other address is refused with 403 ip_not_allowed.

  3. Open it to everyone

    Once you’re happy, remove your IP addresses from the allow list and save. An empty allow list shows your widget to everyone.

Widget settings with an IP allow-list so only the store team sees the assistant Example data

Test on a copy of your storefront

For a headless storefront on a laptop or a preview host, add the copy’s address to the key’s Allowed origins (see API keys and allowed origins). http:// works for localhost, 127.0.0.1, [::1] and names ending in .test or .localhost; anything else needs https://.

Magento copies need more care, because a copy of the production database carries the live connection. Clone protection stops a copy from syncing, and overwriting your live catalogue, when the environment looks non-production: Magento in developer mode; a storefront host on a local or test domain such as .test, .local or .localhost; an IP address or localhost; or a host with a whole label such as dev, staging, stage, stg, uat, qa, test, preprod or sandbox. A copy that does sync from a different store address is refused with 409 store_url_mismatch until someone re-authorises it.

To let a real, separate environment sync, set this in that environment’s app/etc/env.php. It is read only from the file, never from the database, so it cannot travel with a database copy:

app/etc/env.php
// app/etc/env.php
return [
    // ...
    'ottla' => [
        'allow_non_production_sync' => true,
    ],
];

If you connect your copy separately, it is added to your workspace as a website of its own. If you’re not sure which set-up is best for your team, contact us. The Magento guide has the full rules.

Check the connection

On Magento, you can use the Test connection button in the module’s Connection settings. This checks both API keys, this store’s address, clone protection, cron and cache types. You can also run the diagnostics command, which runs the same checks and more from the command line:

Shell
bin/magento ottla:doctor
bin/magento ottla:doctor --json   # machine-readable, for CI or monitoring

On a headless store, GET /health confirms you can reach the API, and polling /ingest/acks with the ack_id from a sync request confirms each batch was processed.

Test webhooks

Open a webhook in Storefront → Webhooks and click Send test event. Ottla sends a webhook.test event whose data is {"test": true, "endpoint_id": ..., "message": ...}, signed like any other delivery, so it tests your signature check too. Replay resends an earlier delivery with the same event id, which is a good way to prove your code drops duplicates. Tests and replays are limited to 10 a minute per webhook. See Receive and verify webhooks.

What a test still costs

Testing and your plan
What you do Uses answered questions?
Questions in the Playground No
/ask from a test page or script Yes, like any other answer
Search, recommendations and product questions No
Events, feedback and handoffs No
Webhook tests and replays No

FAQ

Frequently asked questions

Is there a test mode?

No. Use the Playground to test your assistant’s answers, and show your widget to your team only, using an IP allow-list.

Will my staging Magento overwrite my live catalogue?

Not by accident. Clone protection blocks sync on hosts that look non-production unless you allow it in that environment’s app/etc/env.php.

Do Playground questions count towards my allowance?

No. They do not use your answered questions, and you can ask up to 50 test questions a day per workspace.

How do I test webhooks without real events?

Click Send test event on your webhook’s page in Storefront → Webhooks.

Can I test a headless storefront on my laptop?

Yes. Add http://localhost:3000 (with your own port) to the key’s Allowed origins.