Integrate Veltor
Call Veltor from your backend when a customer requests a limited benefit. Your application enforces the result and delivers the benefit once.
1. Create and publish a test benefit
Create an account, open Benefits, and choose a starting policy. Save and publish it in the test environment. Create a server key in Developers with decisions:create, decisions:read, and outcomes:write permissions.
2. Evaluate a stable claim
Use the same claim ID for one logical award. Supply the real customer IP from your trusted proxy chain. Use one idempotency key for each evaluation attempt and reuse it after timeouts or lost responses.
curl https://veltor.tech/v1/decisions \
-H "Authorization: Bearer $VELTOR_SECRET_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: attempt_customer_123" \
--data '{
"benefit": "signup_credits",
"claim_id": "signup_customer_123",
"subject": {"external_id": "customer_123", "email": "alex@example.com"},
"context": {"ip": "192.0.2.1"}
}'3. Enforce the result
A successful decision body contains only its ID and allow or deny. Technical failures are structured errors with a request ID. Never interpret an unavailable service or rate limit as a policy denial.
{"id":"decision-uuid","decision":"allow"}4. Deliver once
Deduplicate the grant in your own database using a unique claim ID. Commit the benefit and an outcome-delivery outbox in the same transaction. A network timeout cannot tell you whether either service committed. Recover the original result and reconcile your own grant ledger before retrying delivery.
5. Choose outage behavior
Choose locally whether to allow, deny, or throw on a technical outage. Invalid credentials and malformed requests always throw in the Node SDK. If you allow during an outage, retain a durable external grant ID and backfill the actual grant through Imports.
6. Move to live
Create a live benefit and publish its policy with a permitted account. Import existing grants into live before enabling enforcement. Replace your test server key with a live key in your backend secret store.