1. Show Available Add-ons
Fetch the add-ons this customer can buy: those compatible with their current plan, priced in their subscription’s currency. Call it with the public key from your frontend, or the secret key from your backend.amount is in the currency’s normal unit: 15 means 15.00. If the customer’s plan overrides the add-on’s price, amount is the override. current_balance is what the customer already has in that pool, useful for showing “you have X left”.
2. Initiate a Purchase
Call this from your backend with the secret key. It returns acheckoutUrl where the customer pays.
checkoutUrl. The credits are granted once the payment is confirmed. Crovver also sends an addon.purchased webhook.
A free add-on, priced at 0, needs no payment. The response has requiresPayment: false and checkoutUrl: null, and the credits are already granted.
For an add-on priced per unit, pass qty with the number of units, within the add-on’s min_qty and max_qty.
3. Check Active Add-on Credits
Fetch the customer’s remaining add-on credits, not counting the plan’s allowance. The public key works here too.Currency Matching
A customer can only buy an add-on in the same currency as their subscription. Pass thatcurrency in the purchase request. Any other currency returns 422.