Skip to content
Coursey CreativeSign in

POST /checkout/cash

/api/store/[slug]/checkout/cash

Creates a cash (pay-in-person) order directly in the database, bypassing Stripe - records order items, decrements inventory, notifies the business, and emails the customer a confirmation.

Public; optional customer bearer token links the order to the customerRate limit 20 requests per 60 seconds per client IP + slugHow authentication works

Path parameters

slugstringrequired

Business (store) slug; the business must have cash_orders_enabled or the request is rejected with 403

Body parameters

itemsarrayrequired

Cart lines; array of objects { variant_id: UUID string, quantity: positive integer }. At least 1 item required.

shipping_optionenumoptional

Shipping choice; flat_rate adds the business's flat shipping fee to the total when the cart has physical products.

One of pickup, flat_rate

customer_namestringrequired

Customer's name (trimmed, min 1 char).

customer_emailstringrequired

Customer's email address (must be a valid email).

customer_phonestringoptional

Optional customer phone number (trimmed string).

pickup_datestringoptional

Pickup date in YYYY-MM-DD format. Only valid when shipping_option is 'pickup' (schema refine rejects otherwise).

service_chargesarrayoptional

Optional add-on charges; array of objects { service_charge_id: UUID, variant_id: UUID, quantity: positive integer }. Each charge must belong to the business and be associated with the variant's product. Service charge prices are stored in cents and converted to dollars.

Responses

201

The resource was created.

400

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

403

The credential is valid but is not allowed to do this.

404

No such store, or no such record inside it.

429

Too many requests. Back off and retry after the window in the response.

500

Something failed on our side. The response carries no detail; retry is safe on a GET.

What comes back

201 with { order_id, status: 'confirmed' }. Errors: 403 when cash orders disabled, 400/404/429/500 as { error, details? }. CORS-enabled; OPTIONS preflight supported.