LJNDI Coupon API
Use these endpoints from connected payment portals or approved external sites. Send the API key in the `x-ljndi-key` header. The key is configured in `.env` as `LJNDI_COUPON_API_KEY`.
Validate Coupon
Checks if a coupon is active, unexpired, unused, and optionally matches the selected target.
POST https://josephnwauda.com/api/ljndi/v1/coupon/validate
Header: x-ljndi-key: YOUR_API_KEY
{
"code": "J17-LJNDI-2026-ABCD123",
"target_type": "service",
"target_key": "AI & Automation"
}
{
"ok": true,
"valid": true,
"target_type": "service",
"target_key": "AI & Automation",
"discount_type": "percent",
"discount_value": 20,
"expires_at": "2026-01-17T23:59:59+01:00",
"code_mask": "J17-LJNDI-2026-****"
}
Redeem Coupon
Marks an active coupon as redeemed after a successful checkout, invoice, or payment confirmation.
POST https://josephnwauda.com/api/ljndi/v1/coupon/redeem
Header: x-ljndi-key: YOUR_API_KEY
{
"code": "J17-LJNDI-2026-ABCD123",
"ref": "PAYMENT-REFERENCE-123",
"target_type": "service",
"target_key": "AI & Automation"
}
{
"ok": true,
"redeemed": true
}
Portal Notes
If a payment portal cannot call the redeem endpoint after checkout, enable Auto-Redeem on Validate in the admin coupon settings. That burns the coupon immediately when validation succeeds.
Invalid responses use clear reasons such as `revoked`, `redeemed`, `expired`, `used`, or `target_mismatch`.