Skip to content

Provision after a sale

When a customer buys or renews, your server tells LaaSio. Two calls cover it: assign a SKU to a client, and renew the client’s term.

Your organization has one provisioning key (lzk_…), shown in LaaSio → Settings. Send it as the X-API-Key header. It acts for your organization and can only call these two endpoints, plus the activation key calls for keys you sell.

POST /api/v1/clients/assign gives a client a SKU with a fresh term.

Field Required Description
client_id yes Your ID for the client. Created if it doesn’t exist yet.
sku yes The SKU’s code.
name no A label for the client, used only when the client is created.
start no Term start. Defaults to now.
end no Term end. Defaults to start plus the SKU’s duration. Must be in the future and after start. Not allowed for a perpetual SKU.

If the client already holds a SKU of the same application, it is replaced with the new SKU and a fresh term. The response is the client with all its assignments: 201 when the client was created, 200 otherwise.

Terminal window
curl -X POST 'https://laasio.functual.com/api/v1/clients/assign' \
-H "X-API-Key: $LAASIO_PROVISIONING_KEY" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"client_id":"PC-123","sku":"AV-ANNUAL-25","name":"Acme HQ"}'

POST /api/v1/clients/renew extends the client’s current term for a SKU it holds.

Field Required Description
client_id yes Your ID for the client.
sku yes The code of the SKU the client holds.
end no The new end. Must be later than the current end. Without it, the end moves forward by one SKU duration, even if the term has lapsed.

Renewing a client that doesn’t hold the SKU, or a perpetual SKU, returns 422. To start over after a long lapse, call assign instead.

Terminal window
curl -X POST 'https://laasio.functual.com/api/v1/clients/renew' \
-H "X-API-Key: $LAASIO_PROVISIONING_KEY" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"client_id":"PC-123","sku":"AV-ANNUAL-25"}'

If you bill by calendar period (Stripe, Paddle and most stores do), pass the billing period’s end as end on both assign and renew. Fixed-day durations drift from calendar periods: a 31-day SKU outlasts February and a 30-day one lapses in 31-day months. An explicit end always matches what the customer paid for.

A common pattern with a subscription billing system:

  • Checkout completed: assign the SKU with end = the period end.
  • Renewal paid: renew with end = the new period end.
  • Plan changed: assign the new SKU with end = the period end.
  • Cancelled: do nothing; the term ends on its own.
Status Meaning
401 Missing or invalid X-API-Key.
404 No SKU with that code in your organization.
422 Invalid fields, a renewal for a SKU the client doesn’t hold, or an end that isn’t later. The body lists each problem.
403 plan_limit Your organization’s growth is frozen after going over the plan, and this call would add an active client. See Plans and limits. Renewing or changing clients that are already active still works.