Partner Voucher API · v1

Build on the AfghanBasket grocery-voucher network.

A closed-loop API for resellers, wallets, remittance providers and marketplaces to sell AfghanBasket grocery vouchers to their own customers — issued, redeemed and reconciled in real time.

Base URL
https://afghanbasket.shop/api/partner/v1

Real-time voucher issuance

Issue and activate a closed-loop grocery voucher the moment your buyer pays — one API call, unique code returned instantly.

Idempotent & reliable

Every issue and redeem is idempotent on your own reference, so retries never double-charge or double-issue.

Signed webhooks

Receive HMAC-SHA256 signed events on every status change, with GET /transactions as a reconciliation fallback.

Full lifecycle control

Issue, look up, redeem and cancel vouchers — with a clear state machine and predictable error codes.

Quickstart

Issue your first voucher in two calls

Authenticate with your x-api-key, confirm connectivity, then issue an activated voucher once your buyer has paid.

1. Check connectivity

GET /ping
curl -s https://afghanbasket.shop/api/partner/v1/ping \
  -H "x-api-key: $AFGHANBASKET_KEY"

2. Issue & activate a voucher

POST /vouchers
curl -s -X POST https://afghanbasket.shop/api/partner/v1/vouchers \
  -H "x-api-key: $AFGHANBASKET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "partner_reference": "partner-txn-abc123",
    "amount": 50,
    "recipient": { "name": "Bibi Haji", "city": "Kabul" }
  }'
API Reference

Seven endpoints, one base URL

Full reference
GET/pingConnectivity & API-key check.
GET/catalogDenominations, commission and net amounts.
POST/vouchersIssue & activate a voucher (idempotent).
GET/vouchers/{code}Look up a voucher by code.
POST/vouchers/{code}/redeemRedeem against fulfilment.
POST/vouchers/{code}/cancelVoid a voucher before redemption.
GET/transactionsFiltered, paginated reconciliation feed.