squiggli Get a free API key
Reference

Chesterman's apps

How Kiewa Trades, Patch and Kiewa send documents for a business, billed to that business.

Chesterman's own software calls the same API under /v1/platform/organisations/{businessId}/..., with the Kiewa business id in the path and a platform credential instead of a client key. The routes, bodies and responses are identical to /v1.

bash
curl https://squiggli.billy-965.workers.dev/v1/platform/organisations/{kiewaBusinessId}/envelopes \
  -H "Authorization: Bearer $SQUIGGLI_PLATFORM_KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: job-J-1042-signoff" \
  -d '{ "title": "Job sign-off J-1042", "template_id": "tpl_signoff", "variables": { "job": "J-1042" },
        "signers": [{ "name": "Ava Chen", "email": "ava@example.com" }], "metadata": { "job_id": "J-1042" }, "send": true }'
  • Each app has one credential (sqp_...), made by Chesterman staff and stored as SQUIGGLI_PLATFORM_KEY.
  • Envelopes are billed to the business in the path, with their source (kiewa-trades, patch or kiewa) on the usage.
  • A business without squiggli in Kiewa is refused with 403 squiggli_not_enabled: it never sends free. Add Squiggli in Kiewa, or ask Chesterman to add it in CTForce.
  • Webhooks registered on the platform route get only that app's envelopes.
  • The typed client in the squiggli repository (clients/squiggli.ts) takes businessId and does all of this, plus webhook checking.