Guides
Handling denials
Turn Valqio deny decisions into clear product responses without running billable work.
A deny decision is a product response, not an exception. Your app should stop before billable work starts and return a clear next step.
Basic pattern
if (!decision.allowed) {
return {
status: 402,
body: {
reasonCode: decision.reasonCode,
requestId,
},
}
}Keep the customer-facing message in your app. Keep the Valqio reason code in logs and support context.
Suggested responses
| Reason code | Product response |
|---|---|
HARD_CAP | Explain the usage limit and link to plan management. |
INSUFFICIENT_CREDITS | Ask the customer to top up or wait for renewal. |
RATE_LIMITED | Ask the customer to retry later. |
ENTITLEMENT_MISSING | Explain that the feature is not included. |
METER_NOT_FOUND | Return a generic unavailable message and alert engineering. |
INVALID_REQUEST | Return a generic unavailable message and inspect integration logs. |
Keep evidence
Log:
- request ID
- subject type and key
- meter or product action
- reason code
- idempotency key
That gives support and engineering a shared handle for Decisions → History.