PlandalfDocsSign inStart free trial

API and webhooks

Products

Keep Plandalf's products in step with your own system. Each product has a lookup_key you choose, so you can send the same call whenever the product changes. Products made through the API are marked source: external. Add prices to them with Prices.

Example

curl -X POST https://admin.plandalf.dev/api/v1/products \
  -H "Authorization: Bearer $PLANDALF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"lookup_key": "gold-membership", "name": "Gold membership", "description": "Every class, every week", "status": "active"}'

Sending gold-membership again updates that product. Without a lookup_key, Plandalf makes a new product with a generated key; keep the key from the response to update it later.

Endpoint

Create or update a product

POST /api/v1/products

Upserts by lookup_key: sending a key that already exists updates that product, so it's safe to call whenever the product changes in your system. Without a lookup_key a new product is created with a generated key; store the returned lookup_key to update it later. Products created here are marked source: external.

Body

FieldTypeWhat it is
namestring
description optionalstring | null
lookup_key optionalstring | null
status optional"active" | "archived" | "draft"
bindings optionalarray | null
curl -X POST https://admin.plandalf.dev/api/v1/products \
  -H "Authorization: Bearer $PLANDALF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","description":"string","lookup_key":"string","status":"active","bindings":null}'

Response

{
  "id": "string",
  "uuid": "string",
  "lookup_key": "string",
  "name": "string",
  "description": "string",
  "status": "string",
  "source": "string",
  "created_at": "string"
}

Errors

StatusWhen
401The API key or OAuth token is missing or invalid.
422The request failed validation; errors lists the problems by field.