Capabilities

💳
Payment Request
Generates a Stripe Checkout link for a specific amount and currency. Agent copies the link and shares it with the customer. When the customer completes payment, Stripe fires a webhook and the case auto-advances.
💸
Payment Disbursement
Records an outbound payment to a customer (e.g. insurance payout, refund cheque). Agent enters the amount, currency, and bank reference. A confirmation dialog prevents accidental submission. The record is logged against the case.
↩️
Refunds
Initiate full or partial refunds against any captured payment request. Accessible from Studio > HxConnect > Payments or via the API. Refund events are logged with the originating payment_request ID.
🔓
Webhook Audit Trail
Every Stripe event is HMAC-SHA256 verified using STRIPE_WEBHOOK_SECRET before processing. Raw payload, verification status, and processing outcome are stored in payment_webhook_events for compliance and debugging.

Step Types

The Stripe integration exposes two step types. Add either to any stage in your case type via the Case Type Editor.

Step Type Work Center Panel Panel Contents Auto-Advance Trigger DB Table
payment_request PaymentRequestPanel Amount field, currency selector, Generate Link button, copy-to-clipboard, payment status badge Stripe webhook fires checkout.session.completed payment_requests
payment_disbursement PaymentDisbursementPanel Amount field, currency selector, bank reference field, Confirm Disbursement button (confirmation dialog) Agent confirms disbursement (synchronous — no webhook) payment_disbursements

Configuration

Follow these steps to connect Stripe to Velaris. Completing all steps is required for webhooks to work — skipping step 3 means payments will collect but cases will not auto-advance.

  1. Get your Stripe API key. Log in to the Stripe Dashboard > Developers > API Keys. Copy the Secret key — it begins with sk_live_ in production or sk_test_ in test mode. Never use the publishable key (pk_) for server-side calls.

  2. Create the Stripe webhook endpoint. In the Stripe Dashboard, go to Developers > Webhooks > Add endpoint. Set the endpoint URL to:

    https://your-domain.com/api/payments/webhooks/stripe

    Under Events to listen to, select checkout.session.completed. After saving, click the endpoint and copy the Signing secret — it begins with whsec_.

  3. Set environment variables. Add the following to your deployment environment and restart the case-service:

    STRIPE_SECRET_KEY=sk_live_your_key_here
    STRIPE_WEBHOOK_SECRET=whsec_your_signing_secret_here
  4. Add the connector in Studio. Navigate to Studio > HxConnect > Payments and click Add Connector. Set the fields as follows:

    • Connector Name: Any label (e.g., StripeProduction)
    • Secret Key: {{env.STRIPE_SECRET_KEY}}
    • Webhook Secret: {{env.STRIPE_WEBHOOK_SECRET}}
    • Default Currency: GBP, USD, or EUR

    Save. Velaris pings https://api.stripe.com/v1/balance to verify the key — a green tick confirms connectivity.

  5. Add a step to your case type. Open the Case Type Editor for the target case type. Select the stage where payment collection should occur. Add a step, set Step Type to payment_request, select the connector you just created, and configure the default amount field mapping (e.g., map to case.data.claim_amount). Publish the case type.

API Reference

Method Endpoint Description Auth
POST /api/payments/cases/{id}/charge Creates a Stripe Checkout session for the case. Returns checkout_url, session_id, amount, currency. JWT
POST /api/payments/requests/{id}/refund Issues a full or partial refund against a captured payment request. Body: {"amount": 5000} (in pence/cents; omit for full refund). JWT (Admin/Manager)
POST /api/payments/webhooks/stripe Inbound Stripe webhook receiver. Verifies HMAC-SHA256 signature. Processes checkout.session.completed and advances the case. HMAC (no JWT)
GET /api/payments/connectors Lists all configured StripeConnector instances with health status. Secret fields are redacted. JWT (Admin)
GET /api/payments/webhooks Returns the webhook event log from payment_webhook_events. Supports ?case_id= and ?status= filters. JWT (Admin/Manager)

Example: Create a Charge

Use this request to generate a Stripe Checkout link for case c_01HZ... programmatically. The response checkout_url is the link the customer visits to pay.

curl -s -X POST https://your-domain.com/api/payments/cases/c_01HZ.../charge \
  -H "Authorization: Bearer $VELARIS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 15000,
    "currency": "GBP",
    "description": "Application processing fee — Case #REF-2024-0087"
  }'

Example response:

{
  "checkout_url": "https://checkout.stripe.com/c/pay/cs_live_...",
  "session_id": "cs_live_a1b2c3...",
  "amount": 15000,
  "currency": "GBP",
  "payment_request_id": "pr_01HZ...",
  "status": "pending"
}

Test Mode

Test mode setup: Set STRIPE_SECRET_KEY=sk_test_... and use a test webhook secret. In the PaymentRequestPanel, generated links point to Stripe's test Checkout page. Use Stripe's test card 4242 4242 4242 4242 (any future expiry, any CVC) to simulate a successful payment. The webhook fires exactly as in production and the case auto-advances. Test events are labelled [TEST] in the payment_webhook_events table.

Security Notes

Rotate secrets via environment variables, not the UI. When a Stripe key or webhook secret needs rotation: update the value in your environment configuration (Kubernetes secret, AWS Parameter Store, etc.), restart the case-service, and verify connectivity in Studio > HxConnect > Payments. Do not paste new keys into the Studio connector form — the form stores only the {{env.VAR}} reference, not the resolved value.
HMAC verification is mandatory. The /api/payments/webhooks/stripe endpoint rejects any request that fails HMAC-SHA256 verification. Never disable signature verification even in development. Use Stripe's CLI (stripe listen --forward-to localhost:8200/api/payments/webhooks/stripe) to replay signed test events locally.