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.
Before you start
Section titled “Before you start”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.
Base URL
Section titled “Base URL”https://api.petanqueai.comAll Storefront routes live under /api/website.
Your first request
Section titled “Your first request”- Create an API key in Petanque AI.
- Store it on your server, for example as the environment variable
PETANQUE_STOREFRONT_KEY. - List your products:
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.