Flexible pricing
Let a customer choose how much to pay within a range, and grant wallet credits in proportion to the amount paid. Built for self-service wallet top-ups.
Why this matters
Not every charge has a fixed price. Sometimes the customer decides the amount: topping up a wallet with any value between a minimum and a maximum, and receiving credits in return. FLEXIBLE pricing models exactly this: a pay-what-you-choose, one-off charge bounded by a range, that converts the paid amount into wallet credits.
A typical use case is a prepaid wallet: the customer pays anything from $20 to $100 and receives a matching number of credits, which they then draw down through usage.
How it works
FLEXIBLE is a pricing type set on the pricing item config of a one-off product item. It is always charged through the on-demand flow, so the customer triggers it when they want to top up rather than it recurring on a schedule.
You configure:
- A single band with a
minimum_amountand amaximum_amount(same currency). The amount the customer pays must fall within this range. - One or more
wallet_grantsthat define how the paid amount converts to wallet credits, referencing the wallet type to grant into.
At charge time you pass the customer’s chosen amount as flexible_amount, and Solvimon grants the corresponding credits.
FLEXIBLE has a few hard constraints, enforced on create and update:
Configuring a flexible pricing item
Add the pricing item config to a pricing plan version (or directly to a schedule). The wallet_grants.credits_grant.conversion.rate is the number of credits granted per unit of the paid currency:
With the config above, a customer who pays $40 receives 40 × 2.5 = 100 credits of the referenced credit type. Paying the maximum $100 would grant 250 credits.
Charging a flexible item
Charge the item through the on-demand endpoint, passing flexible_amount for the chosen amount:
Set preview to false (or omit it) to create the invoice and grant the credits. See On-demand charges for the full set of charge options such as finalize_immediately and payment_method_id.
Edge cases
- A
flexible_amountoutside the band’sminimum_amount–maximum_amountrange is rejected with a validation error. - The
flexible_amountcurrency must match the band currency. - Only one-off, on-demand items can be
FLEXIBLE; the config is rejected on any other model type or whenon_demandis nottrue.