Fulfill Orders
Learn how to fulfill orders after a customer pays via checkout or payment links.
After you integrate with Flex Checkout or create a Payment Link to take your customers to a payment form, you need a notification to fulfill their order after a successful payment.
In this guide, you’ll learn how to use webhooks to fulfill orders after a payment.
Fulfillment guide
Select webhook events
Choose the webhook events that are relevant to your checkout session.
- customer.created — When a customer record is created in Flex.
- payment_intent.created — As soon as the customer begins entering payment info.
- payment_intent.succeeded — After a successful payment (fires twice on split carts).
- customer.subscription.created — For subscription sessions, when a subscription is first created.
- customer.subscription.updated — For subscription sessions, when status changes (e.g., incomplete → active).
- checkout_session.completed — Sent after a checkout session has fully completed.
Create an event handler
Set up an HTTP endpoint to receive and log incoming events. For local testing, use ngrok or webhook.site.
Create a webhook endpoint
Register your handler’s public URL in Flex. Here we listen for checkout.session.completed
:
Create a checkout session
Trigger a session to confirm your handler receives events:
Then go through checkout:
- Enter contact info
- Fill any intake form
- Use card number
4242 4242 4242 4242
, future expiry, any CVV, and postal code 90210 - Click Pay
You should see an event payload like:
Verify events came from Flex
Confirm the signature on incoming requests before processing. See Verifying webhooks.
Fulfill order
Handle checkout.session.completed
to:
- Save the order to your database
- Send a receipt email
- Update inventory via the Line Items API:
Go live in production
Once deployed, register your production webhook URL in Flex.