Skip to main content

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.

The Flexprice–Whop integration is bidirectional and fully asynchronous. Invoice creation and finalization in Flexprice are never blocked by Whop sync.
  • Whop to Flexprice: When a customer pays through Whop, Flexprice is notified and marks the invoice paid automatically.
  • Flexprice to Whop: Finalized invoices are pushed to Whop with one of two collection methods:
    • Send Invoice (default): Customer receives a hosted checkout link and pays on their own timeline.
    • Charge Automatically: After the first payment, subsequent invoices are charged automatically using the saved payment method.

Pushing Invoices to Whop

Every finalized Flexprice invoice is automatically pushed to Whop. This applies to all invoice types: subscription billing, one-off invoices, and credit topup invoices. Conditions for sync:
  1. Invoice status transitions to finalized
  2. Whop connection is active
  3. Invoice Sync toggle is enabled on the connection
What gets created in Whop:
FieldValue
ProductFrom connection config, or auto-created Flexprice Billing Product
Plan typeone_time
AmountInvoice amount_due, rounded to 2 decimal places
Collection methodsend_invoice or charge_automatically (see Charge Automatically)
Payment methodOnly set when using charge_automatically; omitted otherwise
Due dateInvoice due date if in the future; defaults to 30 days from now
Customer nameCustomer name from Flexprice
EmailCustomer email from Flexprice
After the Whop invoice is created, Flexprice fetches the hosted checkout URL and stores it under invoice.metadata["whop_checkout_url"]. Share this link with your customer for payment.
Product handling: If no product ID is configured on the connection, Flexprice auto-creates a Flexprice Billing Product (visibility: quick_link). Its ID is stored on the connection and reused for all future invoices.

Charge Automatically

For returning customers, Flexprice skips the checkout link and charges their saved payment method directly. First invoice: Customer receives a hosted checkout link and pays through Whop. All subsequent invoices: Whop charges the saved payment method automatically. No action required from the customer. If no saved payment method is found (e.g. customer has not paid through Whop before), the invoice falls back to a hosted checkout link.

Reconciling Payments from Whop

On payment through Whop, an invoice.paid webhook is fired to Flexprice. Flexprice identifies the corresponding invoice and, if not already paid, marks the payment status as succeeded. For credit topup invoices, the customer’s wallet is credited immediately on reconciliation.
Without the webhook configured in Whop, payments will not automatically reconcile in Flexprice and Charge Automatically will not activate. See Connection Setup for instructions.

Marking an Invoice Paid Offline

When a Flexprice invoice is marked paid via an admin action or an offline payment, Flexprice automatically marks the corresponding Whop invoice as paid. If the Whop invoice is already paid, the call is skipped.

Troubleshooting

ScenarioBehavior
No Whop connection configuredSync skipped silently
Invoice sync toggle offSync skipped silently
Customer has no email addressSync fails immediately. Add an email to the customer and re-sync
Invoice already synced to WhopSkipped; duplicate creation is prevented
Whop invoice already paidSkipped; duplicate mark-paid call is prevented
First-time customer with no Whop payment historyFalls back to hosted checkout link
Customer has no saved payment methodsFalls back to hosted checkout link
Payment method fetch failsFalls back to hosted checkout link; Whop API errors are retried with backoff
Whop API temporarily unavailableRetried automatically with backoff
Whop sync failures never block invoice creation or finalization in Flexprice. All sync happens asynchronously.