1
Estimate the credit cost
Ask Stigg how many credits the usage would consume, without reporting it. The response includes, per credit currency, the estimated cost, the current balance, the balance after the estimate, and whether the usage would overdraft the balance.
2
Check the credit entitlement (optional)
The estimate already tells you whether the customer has enough credits, so this step isn’t required. To check against the balance directly, pass the estimated cost as
requestedUsage. hasAccess is true only when the remaining balance covers it.3
Perform the operation
Run the operation in your application.
4
Report usage of the metered feature
Report usage against the feature, not the credit currency. Stigg applies the consumption mapping and deducts the matching amount of credits. For credit-backed features, the response includes a
credit object with the credits this call deducted and the updated total consumption.