Skip to content
Coursey CreativeSign in

POST /form-order-webhook

/api/store/[slug]/form-order-webhook

Receives form submission webhooks (order requests) from a website's form, such as a Coursey Studio order form, emails the business owner and optionally the customer a confirmation (with vacation-mode messaging), and files the submission into the admin Messages workspace.

Per-business shared webhook token (x-ccp-webhook-token header or token query param)How authentication works

Path parameters

slugstringrequired

Business (store) slug the form webhook is configured for

Query parameters

tokenstringoptional

Webhook token alternative to the x-ccp-webhook-token header; one of the two must match the business's configured form_webhook_token.

Body parameters

(entire body)objectrequired

Free-form JSON form-submission payload (no fixed schema). Fields are heuristically summarized (customer name/email/phone, line items, grouped selections (a Studio form sends them as _sections: each section's questions, picks and notes; otherwise flavors/shapes are read from field names), requested date, allergies, special requests, timezone). A discoverable customer email field is REQUIRED - 400 'Customer email is required in webhook payload' otherwise. Optional headers 'x-ccp-timezone' or 'x-vercel-ip-timezone' (or a timezone field in the payload) set the displayed submission timestamp timezone.

Responses

200

The request succeeded.

400

A field failed validation. The response names the fields that failed, not just the first.

401

The key or customer token is missing, malformed, or no longer valid.

404

No such store, or no such record inside it.

What comes back

200 with { ok: true, status, delivery: { clientNotification, customerConfirmation } } where status is one of 'sent', 'client_notified', 'queued_for_retry', or 'processed', and delivery values describe email outcomes ('sent', 'queued_for_retry', 'disabled', 'skipped_no_contact_email', 'skipped_invalid_contact_email'). customerConfirmation is set to 'pending' internally but is always overwritten with 'sent' or 'queued_for_retry' before the response, so 'pending' is never observable. Errors: 400/401/404 as { error }. CORS-enabled; OPTIONS preflight supported.