Getting started

Create an API key, make your first request and create your first product with the Wafle API.

This guide takes about five minutes. You will create an API key, read your products and create a new one.

What you need

  • A Wafle account with at least one store. If you do not have one yet, see Create your Wafle account.
  • Your store slug, the short identifier in your store address. For your-store.wafle.click the slug is your-store.
  • A tool that can send HTTP requests, such as curl, or any programming language.

1. Create an API key

  1. Sign in to your dashboard and open your account settings.
  2. Go to API keys and choose Create key.
  3. Give the key a name that says what it is for, choose the permissions it needs and create it.
  4. Copy the key now. For security, it is shown only once.

Keep keys secret and give each integration its own key. Read more in Authentication.

2. Make your first request

All requests go to the API base URL, and send the key in the X-Wafle-Store-Key header. List the products in your store:

curl "https://wafle.click/api/v1/stores/your-store/v2/products?per_page=5" \
  -H "X-Wafle-Store-Key: $WAFLE_KEY"

A successful request returns HTTP 200 and a JSON body. A missing or invalid key returns 401, and a key without the right permission returns 403. See Errors and rate limits.

3. Create a product

curl -X POST "https://wafle.click/api/v1/stores/your-store/v2/products" \
  -H "X-Wafle-Store-Key: $WAFLE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sku": "CANDLE-8OZ",
    "name": "Classic Candle, 8 oz",
    "price": 24,
    "stock": 50,
    "description": "Hand-poured soy wax candle.",
    "images": ["https://example.com/images/candle.jpg"],
    "status": "draft"
  }'

The product is created as a draft, so it does not appear in your store until you set it to active. If the SKU already exists, the request fails with HTTP 409 and nothing is changed.

4. Use JavaScript or Python

const res = await fetch(
  `${process.env.WAFLE_API}/stores/your-store/v2/products?per_page=5`,
  { headers: { 'X-Wafle-Store-Key': process.env.WAFLE_KEY } },
);
if (!res.ok) throw new Error(`Wafle API error ${res.status}`);
console.log(await res.json());
import os, requests

r = requests.get(
    f"{os.environ['WAFLE_API']}/stores/your-store/v2/products",
    params={"per_page": 5},
    headers={"X-Wafle-Store-Key": os.environ["WAFLE_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json())

Set WAFLE_API to the API base URL shown at the top of the API overview.

Next steps

Was this helpful?

Need help with an integration? Contact support.