Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Create Voucher

POST {api-url}/createVoucher?ns={community}

Issue a voucher to the specified user. The value is sent from your merchant account that is linked via the StoreID. Please note that users can automatically be created via this endpoint, subject to the following rules:

  • If the user does not exist, a valid MSISDN must be placed into the Username field of the payload.
  • If the user does not exist, they will be created and will receive an SMS with voucher number, voucher balance, new username & password.
  • If the user exists in another community, they will automatically be added to ?ns={community} used in the endpoint and will receive an SMS with voucher number & voucher balance.
  • If the user exists in the ?ns={community}, they will receive an SMS with voucher number & voucher balance.
FieldTypeRequirementDescription
UsernameStringOptional**A unique username of the recipient.
VoucherTypeStringRequiredA voucher type is a pocket of value that can be controlled with various parameters to control spend & withdrawal behaviour.
AmountStringRequiredTransaction amount in cents (e.g., 2000 for R20.00).
CurrencyStringRequiredDefault is currency of merchant (e.g., ZAR).
StoreIDStringRequiredA unique identifier provided to the funder that will act as the source of funds.
ReferenceStringOptional*A unique transaction reference number given by the issuer.
MetadataStringOptionalAny other detail that the issuer wishes to store on this transaction.

*Reference numbers must be unique on the platform otherwise an error will be returned.

**If Username is not provided, the voucher will be sent to your own funding account that is linked via the StoreID.

{
"Username": "27648302057",
"VoucherType": "168Cash",
"Amount": "2000",
"Currency": "ZAR",
"StoreID": "Store1",
"Reference": "101",
"Metadata": "{\"ActorUserIDs\": \"547828938941114\"}"
}
Terminal window
curl -X POST '{api-url}/createVoucher?ns={community}' \
-H 'Authorization: bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"Username":"27648302057","VoucherType":"168Cash","Amount":"2000","Currency":"ZAR","StoreID":"Store1","Reference":"101","Metadata":"{\"ActorUserIDs\": \"547828938941114\"}"}'