What It Is

HxCheckout is the bridge between commerce and case management. An external site (or HxStorefront) hands Velaris a finished basket; Velaris creates an Order case and drives it through Payment → Fulfilment → Delivery → Post-Delivery. Payment runs inline through the existing HxConnect Stripe connector, and returns and complaints open as linked sub-cases.

It's a Marketplace app, not a built-in feature. HxCheckout ships in the Velaris image but stays dark (404) until the package velaris/hxcheckout is installed from the Marketplace. Installing only flips a per-tenant gate — no code is downloaded.

How an Order Flows

  1. Your storefront POSTs a basket to /orders with a service token. An Idempotency-Key guarantees a retried request never double-charges.

  2. Velaris creates the Order case and, if Stripe is configured, returns a payment_url. With no payment provider it degrades gracefully to invoice / cash-on-delivery and proceeds straight to fulfilment.

  3. The order advances through fulfilment and delivery as a normal case — staff use the full workflow, SLA, and audit machinery.

  4. The customer holds a random tracking token that lets them raise a return or complaint, which opens a linked sub-case.

Authentication

CallerCredentialUsed for
External siteService token (X-Velaris-Token: vsk_<mode>_<keyid>_<secret>)Create / read / cancel orders. Only the bcrypt hash is stored; a per-token rate limit auto-suspends on a spike.
Platform webhookHMAC (X-Velaris-HMAC-SHA256)Verified on the raw body before deserialization; mismatch → 401, logged.
CustomerTracking token (128-bit)Raise a return / complaint (rate-limited per IP).
StaffOperator JWTStudio management — tokens, integrations, order board, analytics.

Endpoints

Base path /api/v1/checkout:

MethodPathAuth
POST/ordersservice token (Idempotency-Key supported)
GET/orders/{id}service token
POST/orders/{id}/cancelservice token (pre-dispatch)
POST/orders/{id}/returns · /complaintstracking token
POST/webhook/{integration_id}HMAC
GET/orders · /analytics/summaryadmin
GET/POST/DELETE/tokensadmin
GET/POST/PUT/DELETE/integrationsadmin

Payment

When PAYMENT_PROVIDER = stripe, payment is taken inline through the existing HxConnect Stripe connector — no separate integration. With no connector configured, HxCheckout degrades to invoice / COD: the payment_url is null and the order proceeds to fulfilment unblocked.

Capabilities

🛒
Basket → Case
Any external basket becomes a fully tracked Order case with workflow, SLA, and audit.
💳
Inline Payment
Stripe via the existing HxConnect connector, or graceful invoice / COD fallback.
📦
Returns & Complaints
Customers raise them with a tracking token; each opens a linked sub-case.
🔑
Idempotent & Signed
Idempotency keys stop double-charges; HMAC webhooks verified before parsing.

Uninstall

Uninstalling either revokes the package (keeps data) or revokes and deletes data. A data delete removes the tenant's checkout_* rows, but the Order, Return, and Complaint cases stay — they are core records, linked by a nullable reference that is simply cleared.