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.

Overview

When invoice sync is enabled, every finalized Flexprice invoice is automatically pushed to Whop. Whop generates a hosted payment page and Flexprice stores the payment-link directly on the invoice. Key Points:
  • Only finalized invoices are synced - drafts are not pushed
  • The same invoice is never created twice in Whop (idempotent)
  • Every invoice type that finalizes is synced - including topup (credit purchase) invoices
  • The customer must have an email address in Flexprice - Whop requires it to create an invoice

When an Invoice Syncs

Flexprice syncs an invoice to Whop when all three conditions are met:
  1. Invoice status transitions to finalized
  2. Whop connection is active
  3. Invoice Sync (outbound) is enabled on the connection

What Gets Created in Whop

For each synced invoice, Flexprice creates a Whop invoice with:
FieldValue
ProductFrom connection config, or auto-created Flexprice Billing Product
Plan typeone_time
AmountInvoice amount_due, rounded to 2 decimal places
Collection methodsend_invoice
Due dateInvoice due date if in the future - otherwise defaults to 30 days from now
Customer nameCustomer name from Flexprice
EmailCustomer email from Flexprice
Internal notesFlexprice invoice ID (inv_...) - stored for reference

Product Handling

Every Whop invoice must belong to a product. Flexprice handles this automatically:
  • Product ID set on connection → Flexprice verifies it exists in Whop and uses it
  • No Product ID → Flexprice creates Flexprice Billing Product (visibility: quick_link, not listed in the Whop marketplace) and saves the ID back to the connection for all future invoices

Checkout URL

After the Whop invoice is created, Flexprice fetches the checkout URL from the associated Whop plan and saves it on the Flexprice invoice:
invoice.metadata["whop_checkout_url"] = "https://whop.com/checkout/..."
You can share this link with your customer for payment.

Payment Reconciliation

When the invoice is paid through Whop:
  1. Whop fires an invoice.paid webhook to Flexprice
  2. Flexprice identifies the corresponding invoice
  3. If already paid - skipped (idempotent)
  4. Flexprice marks the invoice as paid
If Flexprice marks the invoice paid first (e.g., manual reconciliation), Flexprice automatically calls Whop to mark the Whop invoice as paid too.

Troubleshooting

IssueCauseSolution
Invoice not syncingInvoice sync toggle offEnable outbound sync in connection settings
Sync fails - customer errorCustomer has no email addressAdd an email to the customer in Flexprice
No whop_checkout_url on invoicePlan fetch failed after invoice creationCheck worker logs for the warning - re-trigger by contacting support
Invoice created in Whop but sync retryingEntity mapping write failedCheck integration logs; mapping is written after invoice creation