How your customers will create subscriptions or purchases for your products.
targetSubscriptionId
is provided when creating the session, the newly added payment method will automatically become the default payment method for that specific subscription.
Invoice
s. This is particularly useful for one-off transactions, add-ons, or scenarios where the exact amount due isn’t known until the invoice is raised.
It allows customers to pay invoices that might not be tied to a predefined product or subscription.
useBilling()
hook in your frontend application.
useBilling()
HookcreateCheckoutSession
method provided by the useBilling()
hook is the primary way to create ProductCheckoutSession
s or PurchaseCheckoutSession
s.
Here’s an example of how you might use it in a React component:
successUrl
and a cancelUrl
. The customer will be redirected to the successUrl
after a successful payment or to the cancelUrl
if they abandon the session. If no successUrl
is provided, Flowglad will redirect the user to a Flowglad-hosted success page.
AddPaymentMethod
CheckoutSessions
specifically, you can utilize the createAddPaymentMethodCheckoutSession
function available through the useBilling
hook. This function is tailored for scenarios where the primary goal is to securely capture and store a customer’s payment details.
customerExternalId
when creating a checkout session, especially if Flowglad is integrated as the payment layer within your application.
Associating a checkout session with an existing customer record ensures that all billing activities are correctly attributed and avoids potential data discrepancies or the creation of duplicate customer profiles.
While anonymous checkouts are possible (typically through hosted product/price pages), linking checkouts to existing customer records via customerExternalId
is more robust, and is required for API-first integrations.