Documentation Index
Fetch the complete documentation index at: https://docs.flexprice.io/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Flexprice–Whop integration is bidirectional:- Whop → Flexprice - When an invoice is paid through Whop, Flexprice is notified and marks the invoice paid automatically.
- Flexprice → Whop - Finalized invoices are pushed to Whop. A hosted checkout link is generated for each invoice.
Inbound (Whop → Flexprice)
Triggered when payment is followed through on a Whop invoice.Payment is followed through on Whop
The checkout URL from the Flexprice invoice is used and payment is completed on Whop.
Whop fires invoice.paid webhook
Whop sends a Flexprice acknowledges the webhook and processes the payment update asynchronously.
POST to your registered webhook URL:Flexprice identifies the invoice
Using the
whopInvoiceID from the webhook, Flexprice identifies the corresponding Flexprice invoice.Outbound (Flexprice → Whop)
Invoice Sync
Triggered every time a Flexprice invoice is finalized.Invoice is finalized in Flexprice
The invoice status transitions to
finalized. This applies to all invoice types - subscription billing, one-off invoices, and credit topup invoices.Flexprice checks if Whop sync should run
Before starting any workflow, Flexprice verifies:
- A Whop connection exists and is active
Invoice outbound syncis enabled on the connection
WhopInvoiceSyncWorkflow starts
A Temporal workflow is queued with a short delay to allow the invoice to fully commit. The workflow runs asynchronously - it does not block the invoice finalization response.
SyncInvoiceToWhop activity runs
The activity performs the full sync:
- Idempotency check - if this invoice was already synced to Whop, returns immediately
- Product - uses the configured product, or creates
Flexprice Billing Productif none exists - Customer - resolves customer name and email. If no email is found, the workflow fails and does not retry
- Creates Whop invoice -
POST /v1/invoiceswith the invoice amount, due date, customer details, and Flexprice invoice ID inplan.internal_notes - Fetches checkout URL -
GET /v1/plans/:idto retrieve thepurchase_urlfrom Whop - Stores checkout URL - saves
purchase_urltoinvoice.metadata["whop_checkout_url"] - Saves mapping - records
flexpriceInvoiceID ↔ whopInvoiceIDin entity integration mapping
whop_checkout_url you can share with your customer.
Mark Paid
Triggered when a Flexprice invoice is marked paid directly - for example, via an admin action or an offline payment recorded in Flexprice.Invoice payment recorded in Flexprice
Payment status on the Flexprice invoice transitions to
succeeded.WhopInvoiceMarkPaidWorkflow starts
Flexprice queues a Temporal workflow to mirror the payment status in Whop.
MarkWhopInvoicePaid activity runs
- Looks up the Whop invoice ID from entity integration mapping - if no mapping exists (invoice was never synced to Whop), the activity exits silently
- Calls
GET /v1/invoices/:whopInvoiceIDto check current status in Whop - If Whop invoice is already
paid- skips the mark_paid call - Otherwise calls
POST /v1/invoices/:whopInvoiceID/mark_paid
Error Handling
| Scenario | Behavior |
|---|---|
| No Whop connection configured | Workflow fails immediately - non-retryable |
| Customer has no email address | Workflow fails immediately - non-retryable. Fix the customer data and re-finalize |
| Invoice already synced to Whop | Skipped - idempotency check prevents duplicate creation |
| Whop invoice already paid | Skipped - status check before mark_paid prevents the duplicate call |
| Invoice due date is in the past | Flexprice automatically uses 30 days from now instead |
| Whop API temporarily unavailable | Temporal retries with backoff automatically |
Whop sync failures never block invoice creation or finalization in Flexprice. All sync happens asynchronously.
Related Documentation
- Connection Setup - Set up your Whop connection
- Invoice Sync - How individual invoices are synced

