Vananam Processor and API
This page describes the Vananam integration for operations and customer-service teams. It explains asynchronous URL fulfilment, the provider calls, the states that control retry, and the records to compare when an order is delayed or fails.
What Vananam does
Vananam is an asynchronous, SKU-per-product processor. The application submits an order, stores the Vananam order id, and retrieves the order until a voucher claim URL is available. The integration is configured for third-party URL delivery; the processor test documentation explicitly notes that code delivery is not supported.
| Property | Behaviour |
|---|---|
| Processor type | SKU per product |
| Processing | Asynchronous order creation followed by order retrieval |
| Delivery | Third-party gift-card URL; application URL handling can then expose it to the buyer |
| Balance lookup | No Vananam-specific balance operation is implemented |
| Cancellation | No Vananam-specific cancellation operation is implemented |
| Immediate order result | PENDING leaves the sale requested; DELIVERED can complete the sale |
| Completion rule | Valid JSON with an id, a status, and, for delivery, a first voucher with claim_url and an expire_date key |
Order lifecycle
- A partner requests a digital URL gift card for a Vananam brand and denomination.
- The processor reads the brand's
vananam-skuattribute. - The application sends
POST orderswith the product ID, denomination, sale UUID asreference_code, andquantity: 1. - The response
idbecomes the processor reference. APENDINGresponse leaves the card in the requested state and requires a later retrieval. - Retrieval sends
GET orders/{id}. APENDINGresponse is retryable; aDELIVEREDresponse is checked for voucher data. - The first voucher's
claim_urlbecomes the card's third-party URL. A non-emptyexpire_dateis converted to the card expiration date. - The application completes the card only after the delivered response passes validation. The existing application URL is retained or generated according to the asynchronous sale flow.
Example API order flow
The client uses the configured base URI, HTTP basic authentication, and JSON headers. The values below are illustrative and contain no credentials or live claim URL.
Create an order
POST ${VANANAM_BASE_URI}/orders
Authorization: Basic [REDACTED]
Content-Type: application/json
Accept: application/json
{
"product_id": "product-sku-example",
"denomination": 100.00,
"reference_code": "sale-uuid-example",
"quantity": 1
}
An accepted order can return a pending response:
{
"id": 12345,
"reference_number": "sale-uuid-example",
"product_id": "product-sku-example",
"status": "PENDING",
"amount": 100.00,
"vouchers": [],
"message": "Order accepted; vouchers will be available later."
}
Retrieve an order
GET ${VANANAM_BASE_URI}/orders/12345
Authorization: Basic [REDACTED]
Accept: application/json
A completed response has the shape used by the response mapper:
{
"id": 12345,
"reference_number": "sale-uuid-example",
"product_id": "product-sku-example",
"status": "DELIVERED",
"vouchers": [
{
"card_number": null,
"pin_code": null,
"claim_url": "https://[REDACTED]/claim/[REDACTED]",
"expire_date": "2027-10-01T12:00:00.000Z"
}
],
"message": "Order successfully placed."
}
Response mapping and validation
The processor first requires a valid JSON response, a non-empty id, and a non-empty status. It stores the id as processor_reference.
| Provider data | Application result |
|---|---|
status: PENDING | Card remains requested; create-order handling waits for retrieval |
status: DELIVERED | First voucher is validated and can complete the card |
vouchers[0].claim_url | Required for a delivered card and mapped to third_party_url |
Presence of vouchers[0].expire_date | Required for a delivered card; null or empty means no expiration is set |
card_number, pin_code, and other product fields | Not used by the response mapper |
| Any other status | Fails with an unusable-status error; it is not treated as successful delivery |
The expire_date property must exist even when its value is null. A missing property is a validation failure, not an indication of a card without an expiry date.
Provider states and retry behaviour
| Condition | Processor result | Operational consequence |
|---|---|---|
Create response is PENDING | Requested card, no retry exception | Keep the original provider reference and allow retrieval to run |
Retrieve response is PENDING | Repeat-request error 606060 | Retrieval is retried automatically |
Provider returns a server-side 5xx error | Repeat-request error 606060 | Retry the same workflow; do not create a replacement manually |
Provider error message is exactly Too many requests | Repeat-request error 606060 | Wait for throttling to clear and retry |
| Other client or transport error | Processor error without the repeat code | Investigate the audit before deciding on a further action |
Invalid JSON, missing id/status, missing claim_url, or missing expire_date key | Processor validation error | Do not treat the order as fulfilled |
The create call is a POST. If a server error occurs after Vananam has accepted the order but before the response is observed, an automatic retry can risk a duplicate order. Check the original sale UUID and interaction audit before any manual re-order.
The configured client throttling defaults to enabled, with 60 requests per 60 seconds. The values come from VANANAM_THROTTLING_ENABLED, VANANAM_THROTTLING_RATE_LIMIT, and VANANAM_THROTTLING_RATE_PERIOD; the application also classifies the provider's exact Too many requests message as retryable.
Audit comparison fields
Vananam uses the shared AuditProcessor record for the sale and enables request/response interaction auditing on the Vananam client. Compare the following evidence in order:
- The sale UUID, client request ID, brand, denomination, and request version.
- The create request payload:
product_id,denomination,reference_code, andquantity. - The create response
id,reference_number, andstatus. - Any retrieval request path, especially
orders/{id}, and its returnedstatus. - For delivery, the presence of
vouchers[0].claim_urlandexpire_datewithout copying the claim URL into an escalation. - The
AuditProcessorstatus:REQUESTEDfor an accepted or pending order,SUCCESSonly after a delivered voucher is mapped, orERRORfor validation/provider failures. - The processor interaction audit entries for the ordered request/response sequence. These entries are keyed by the sale UUID and are redacted by the application audit model when a redactor is supplied.
The provider id is the primary Vananam reference. The sale UUID is also sent as reference_code, so the two values should be compared rather than treated as interchangeable.
Settings
Processor settings
The settings are read from config/vananam.php:
| Setting | Environment variable | Purpose |
|---|---|---|
| Base URI | VANANAM_BASE_URI | Base URL for orders and products calls |
| API username | VANANAM_API_USER_NAME | First HTTP basic-auth value |
| API secret | VANANAM_API_SECRET | Second HTTP basic-auth value |
| Request timeout | VANANAM_REQUEST_TIMEOUT | Guzzle request timeout |
| Throttling enabled | VANANAM_THROTTLING_ENABLED | Enables processor request throttling; default true |
| Throttling limit | VANANAM_THROTTLING_RATE_LIMIT | Request count in the configured period; default 60 |
| Throttling period | VANANAM_THROTTLING_RATE_PERIOD | Period in seconds; default 60 |
The client sends Content-Type: application/json and Accept: application/json on each provider request.
Brand settings
Each enabled brand needs the vananam-sku brand attribute. The value is sent as product_id; it is not derived from the face value. The provider catalogue collector stores product IDs as catalogue product_sku values and exposes URL delivery only.
The collector maps only products whose delivery_type is REALTIME. It maps provider country, category, currency, denominations, discount, redemption type, description, terms, validity, and image data into the cached Vananam catalogue. Fixed denominations use the provider min values; a single range becomes an open-value product.
API operations
| Operation | Method and path | Use |
|---|---|---|
| Create order | POST orders | Submit one product and denomination for a sale |
| Retrieve order | GET orders/{order_id} | Check a pending order and obtain the delivered voucher URL |
| Products | GET products?limit=10000 | Retrieve the provider catalogue for VananamCollector |
VananamCollector is a queued job with one attempt. It keeps the previous cached catalogue when the provider response is invalid, empty, or produces no valid products. No Vananam-specific console command is defined in the inspected application tree.
Customer-service investigation
For a pending or failed order:
- Confirm the sale UUID, client request ID, brand, currency, denomination, and delivery method.
- Confirm the brand's
vananam-skuvalue and compare it withproduct_idin the create request. - Find the provider
idfrom the create response or the stored card processor reference. Use that ID for retrieval; do not submit a new order first. - Compare the create and retrieve interaction audits. Check the HTTP outcome, response JSON validity,
status, and thereference_number/reference_codevalues. - For
PENDING, allow the retry path to retrieve the original order. ForToo many requestsor5xx, note the repeat code606060and avoid parallel manual retries. - For
DELIVERED, verify that the response contains the first voucher'sclaim_urlandexpire_datekey. Do not paste a claim URL or any voucher data into a ticket. - If the order is marked
ERROR, compare the exact validation or provider message with the request/response audit before escalation.
Limitations and support contacts
The Vananam processor does not implement a provider balance lookup or cancellation call. It also does not map card numbers or PIN codes into the returned card; the tested integration is for third-party URL delivery.
Escalations should include the internal sale UUID, client request ID, provider order ID, timestamps, status, and redacted audit evidence. Do not include credentials, claim URLs, card numbers, or PINs.
Related code
app/Processors/Vananam/VananamProcessor.php— asynchronous request creation, retrieval, response validation, mapping, and retry classification.app/Http/Clients/Vananam/VananamApi.php— authenticated HTTP client and provider paths.app/Http/Clients/Vananam/Requests/OrderRequestData.php— create-order payload.app/Http/Clients/Vananam/Requests/RetrieveOrderRequestData.php— retrieval order ID.app/Http/Clients/Vananam/Responses/RawVananamResponseData.php— raw response wrapper.app/CatalogueService/Jobs/VananamCollector.php— catalogue retrieval and mapping.config/vananam.php— URI, authentication, timeout, and throttling settings.database/migrations/2024_05_03_133334_r_c_c-14248-create-vananam-data-issuer-record.php— issuer type and onboarding contacts.tests/Unit/Processors/VananamProcessorTest.php— pending, delivered, validation, retry, throttling, and URL-delivery scenarios.tests/Unit/App/Http/Clients/Vananam/VananamApiTest.php— client paths, headers, payload, and transport failures.