Skip to content

Quickstart

The Storefront API connects your own web site to Petanque AI. Your site keeps its own design and hosting; Petanque AI supplies the catalogue, customer accounts, orders and payments behind it.

You need:

  • A Petanque AI account for your company, with a user who can manage the web site settings.
  • A server that calls the API. The API is called from your back end (Next.js server code, PHP, Node.js and so on), never from JavaScript running in the shopper’s browser.
https://api.petanqueai.com

All Storefront routes live under /api/website.

  1. Create an API key in Petanque AI.
  2. Store it on your server, for example as the environment variable PETANQUE_STOREFRONT_KEY.
  3. List your products:
Terminal window
curl https://api.petanqueai.com/api/website/products \
-H "x-storefront-token: $PETANQUE_STOREFRONT_KEY"

Every route, its parameters and its answers are listed in the API reference.