Skip to content

Voucher Issuance

Use this endpoint to issue a voucher for a recipient.

Flow

Endpoint

POST /vouchers/issue

Headers

HeaderRequiredDescription
X-API-KeyYesPartner API key.
X-TimestampYesISO timestamp used in signature verification.
X-SignatureYesBase64 Ed25519 signature for the request.
Idempotency-KeyYesUnique retry-safe operation key.
User-AgentNoOptional client identifier.

Request Body

FieldTypeRequiredRules
denominationIdnumberYesMinimum 1.
merchantIdnumberYesMinimum 1.
recipientPhonestringYesMax 32 chars.
recipientNamestringNoMax 255 chars; nullable.
isRestrictedbooleanYesRestricts redemption to the originating merchant when true.
originatingCountrystringYesSender country (code or name), max 255 chars. Example: US.
foreignCurrencyAmountnumberYesSending amount in USD, must be greater than 0.
exchangeRatenumberYesUSD to ETB exchange rate, must be greater than 0.

Voucher Code Format

Partner issuance returns two identifiers:

FieldFormatPurpose
voucherCodeExactly 16 decimal digits (09), no separatorsBearer credential the recipient uses for merchant redemption. Generated with cryptographically secure randomness (~53 bits of entropy).
serialNumberVCH-YYYYMMDD- plus 16 uppercase hex charactersPlatform audit/support reference. Not a redemption code.

Rules for voucherCode:

  • Always 16 characters, numeric only, stored and returned without dashes or spaces.
  • Partners may display the code to recipients grouped for readability (for example 9876-5432-1098-7654), but the API value is the plain 16-digit string.
  • Merchant redemption accepts the plain 16-digit code; hyphen separators in user input are stripped before validation.

Example Request

bash
curl -X POST "$API_BASE_URL/vouchers/issue" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $PARTNER_API_KEY" \
  -H "X-Timestamp: 2026-04-29T12:00:00.000Z" \
  -H "X-Signature: $PARTNER_SIGNATURE" \
  -H "Idempotency-Key: a3f0f55a-80f4-44d1-93dd-61035d4e6b72" \
  -d '{
    "denominationId": 4,
    "merchantId": 12,
    "recipientPhone": "+251911234567",
    "recipientName": "Abebe Kebede",
    "isRestricted": true,
    "originatingCountry": "US",
    "foreignCurrencyAmount": 8.85,
    "exchangeRate": 56.5
  }'
json
{
  "denominationId": 4,
  "merchantId": 12,
  "recipientPhone": "+251911234567",
  "recipientName": "Abebe Kebede",
  "isRestricted": true,
  "originatingCountry": "US",
  "foreignCurrencyAmount": 8.85,
  "exchangeRate": 56.5
}

Example Response

json
{
  "voucherCode": "9876543210987654",
  "denominationAmountEtb": 500,
  "expirationDate": "2026-07-27T23:59:59.000Z",
  "serialNumber": "VCH-20260427-A1B2C3D4E5F67890",
  "merchantName": "Abyssinia Market",
  "isRestricted": true
}

Response Codes

CodeMeaning
200Voucher issuance request processed.
400Invalid request or missing idempotency key.
401Missing or invalid API key, timestamp, or signature.
403Access is forbidden.
404Referenced resource not found (for example merchant or denomination).
409Idempotency conflict or insufficient partner wallet balance.
422Business-rule rejection—for example account not enabled for Gift Cards, or partner limit exceeded.
502Upstream provider failure while processing the request.
503Service temporarily unavailable.
504Upstream provider timeout.
500Unexpected processing error.

Integration Notes

  • Your account must be enabled for Gift Cards before calling this endpoint. If it is not, the API returns 422 with message: "Partner is not entitled to purchase Gift Cards". Contact your ODM account contact to enable product lines.
  • Store both voucherCode and serialNumber. Use voucherCode for redemption and serialNumber for support/audit workflows.
  • Reuse the same Idempotency-Key only for retries of the same request payload.
  • Treat voucherCode as a secret bearer credential and avoid exposing it in logs.
  • Handle transactionStatus: "FINALIZATION_PENDING" as delivered with pending local reconciliation, not as failure.