Gift Card Issuing
Issue gift cards for 100+ South African brands
| Product | What it does | Redemptions | Issued via |
|---|---|---|---|
| Voucher | Money off the whole basket — a fixed amount or a percentage. Not tied to particular products. e.g. R50 off your shop | Once | POST /coupons |
| Coupon | Money off specific products. Only applies if those products are in the basket. e.g. R5 off any 250g coffee | Once | POST /coupons |
| Gift cardThis guide | A balance the customer spends like money, across more than one visit until it runs out. e.g. R200 to spend | Until the balance is used | POST /giftcards |
Coupons and vouchers are the same integration. Which one you are issuing is set by the campaign owner, not by your code — the request and the redemption flow are identical. Gift cards are a separate resource.
Issue Gift Card via SMS/WhatsApp
Quick StartYoyo handles delivery - just provide a mobile number
How it works
- 1Call the Issue Gift Card API with campaign ID, balance, and mobile number
- 2Yoyo creates the gift card and generates a unique wiCode
- 3Yoyo automatically delivers the gift card via SMS or WhatsApp
- 4Customer receives the wiCode and can redeem at any integrated merchant
# Issue Gift Card and send via configured channel (SMS or WhatsApp)
curl -X POST "https://za-vsp-int.wigroup.co/cvs-issuer/rest/giftcards?issueWiCode=true" \
-H "apiId: {apiId}" \
-H "apiPassword: {apiPassword}" \
-H "Content-Type: application/json" \
-d '{
"campaignId": 9000,
"balance": 10000,
"userRef": "your_customer_reference_number",
"mobileNumber": "+27821234567",
"smsMessage": "Your gift card code is ready!",
"sendSMS": true
}'{
"giftcard": {
"id": 20,
"campaignId": 9000,
"interfaceIssuerId": "TestChannel",
"issuerId": 94,
"userRef": "VSP_User_Id_001",
"mobileNumber": "string",
"sendSMS": true,
"sendFollowUpSMS": false,
"issuedAmount": 2000,
"redeemedAmount": 0,
"expiredAmount": 0,
"balance": 2000,
"createDate": "2015-03-13T15:10:07+0200",
"expiryDate": "2018-03-12T23:59:59+0200",
"campaignName": "VSPTestGiftCardCampaign",
"campaignType": "GIFTCARD",
"description": "Gift Card worth R20.00",
"imageURL": "http://goo.gl/Zodst9",
"termsAndConditions": "VSP T&Cs",
"stateId": "A",
"wicode": "123456789999"
},
"responseCode": "-1",
"responseDesc": "Success"
}Note: The communication channel (SMS or WhatsApp) is configured at the system level, not per-request. Set sendSMS: true to trigger delivery via your configured channel. WhatsApp requires additional META configuration. The userRef field is mandatory for tracking.
Distribute and View in Your Own App
Get the wiCode, display the balance, and track usage
How it works
- 1Call the Issue Gift Card API with campaignId, balance, userRef, and stateId
- 2Receive the wiCode and gift card ID in the response
- 3Display the gift card in your app with balance information
- 4Use the Get Gift Card API to check remaining balance
# Issue wiCode only — no message sent
curl -X POST "https://za-vsp-int.wigroup.co/cvs-issuer/rest/giftcards?issueWiCode=true" \
-H "apiId: {apiId}" \
-H "apiPassword: {apiPassword}" \
-H "Content-Type: application/json" \
-d '{
"campaignId": "9000",
"balance": "2000",
"userRef": "VSP_User_Id_001",
"stateId": "A"
}'Use Cases
- Display balance in your mobile app
- Corporate gift card programs
- Reward and incentive platforms
Response Fields
wicode- The redemption codebalance- Remaining value in centsid- Gift card ID
Partial redemption — issue a follow-up wiCode
Gift cards support partial spend. When a customer uses only part of the balance, the wiCode presented at the till is consumed. If you distribute gift cards in your own channel (not Yoyo SMS), listen for the redemption callback and issue a new wiCode for whatever is left — then send that code and balance to the customer.
Sequence
- 1
Partial redemption happens
Yoyo POSTs a redemption notification to your configured webhook URL.
- 2
Read the payload
Use
redemption[].processedAmount,storeId,userRef, andredemption[].itemId(the gift card id whentypeis GIFTCARD). See Redemption Callback. - 3
Check what’s left on the card
GET /giftcards/{giftcardId} - 4
If balance is greater than zero, issue a new wiCode
The previous wiCode has been used, so call
POST /giftcards/{giftcardId}/wicode. A wiCode is only issued when the gift card has none linked. - 5
Fetch the new wiCode and balance
Call
GET /giftcards/{giftcardId}again and readwicodeandbalance. - 6
Send it to the customer
Share the new wiCode and remaining balance via your channel (SMS, WhatsApp, or in-app).
- 7
If balance is zero, stop
The card is fully used — no further wiCode is needed.
curl -X GET "https://za-vsp-int.wigroup.co/cvs-issuer/rest/giftcards/{giftcardId}" \
-H "apiId: {apiId}" \
-H "apiPassword: {apiPassword}"# Issue a new wiCode against a gift card that has no linked wiCode (e.g. after a partial redemption)
curl -X POST "https://za-vsp-int.wigroup.co/cvs-issuer/rest/giftcards/{giftcardId}/wicode" \
-H "apiId: {apiId}" \
-H "apiPassword: {apiPassword}"{
"giftcard": {
"id": 615,
"campaignId": 9000,
"userRef": "your_customer_reference_number",
"issuedAmount": 10000,
"redeemedAmount": 6000,
"expiredAmount": 0,
"balance": 4000,
"stateId": "A",
"wicode": "987654321000"
},
"responseCode": "-1",
"responseDesc": "Success"
}Own-channel only: If Yoyo SMS/WhatsApp delivery is configured on the campaign, follow-up messaging may already be handled for you. This sequence is for integrators who display or message the wiCode themselves.
Get Available Campaigns
Retrieve a list of active gift card campaigns available to your channel. Use this to display available gift card options to your users.
curl -X GET "https://za-vsp-int.wigroup.co/cvs-issuer/rest/giftcardcampaigns" \
-H "apiId: {apiId}" \
-H "apiPassword: {apiPassword}"{
"giftcardCampaigns": [{
"minValueAllowedToIssue": 500,
"maxValueAllowedToIssue": 500,
"totalAmountIssued": 500,
"totalAmountRedeemed": 6000,
"id": 4420,
"name": "Gift Card R5",
"description": "Gift Card R5",
"termsAndConditions": "VSP T&Cs",
"imageURL": "http://goo.gl/Zodst9",
"createDate": "2015-05-21T07:14:01+0200",
"requireUserRef": false,
"allowedUsersRestricted": false,
"maxNumberPerUser": 0,
"maxLivePerUser": 0,
"campaignType": "GIFTCARD",
"minRank": 2,
"categories": [{ "name": "All", "id": 807, "rank": 3 }],
"totalLive": 1,
"totalRedeemed": 6000,
"totalExpired": 1,
"totalIssued": 14,
"stateId": "A",
"allowExpiryDateOverride": false,
"expiryDays": 1095
}],
"paging": {
"pageSize": 20,
"pageOffset": 0,
"numItemsOnPage": 1,
"numItemsInTotal": 1,
"numPages": 1
},
"responseCode": "-1",
"responseDesc": "Success"
}Get Gift Card Details
Retrieve details of a specific gift card including current balance, redeemed amount, and expiry date.
curl -X GET "https://za-vsp-int.wigroup.co/cvs-issuer/rest/giftcards/{giftcardId}" \
-H "apiId: {apiId}" \
-H "apiPassword: {apiPassword}"{
"giftcard": {
"id": 615,
"campaignId": 4455,
"interfaceIssuerId": "SnapAndSaveIssuer",
"issuerId": 146,
"userRef": "string",
"mobileNumber": "string",
"issuedAmount": 500,
"redeemedAmount": 500,
"expiredAmount": 0,
"balance": 0,
"createDate": "2015-05-25T11:41:51+0200",
"expiryDate": "2015-05-25T23:59:59+0200",
"campaignName": "Snap and Save Gift Card",
"campaignType": "GIFTCARD",
"description": "Snap and Save Gift Card",
"termsAndConditions": "Snap and Save Gift Card",
"stateId": "R",
"wicode": "1234567"
},
"responseCode": "-1",
"responseDesc": "Success"
}Get User's Gift Cards
Retrieve all gift cards linked to a specific user reference.
curl -X GET "https://za-vsp-int.wigroup.co/cvs-issuer/rest/users/{userRef}/giftcards" \
-H "apiId: {apiId}" \
-H "apiPassword: {apiPassword}"{
"responseCode": "-1",
"responseDesc": "Success",
"httpStatusCode": 200,
"giftcardList": [{
"id": 288647,
"campaignId": 4455,
"interfaceIssuerId": "paytecSnapAndSaveIssuertest",
"issuerId": 856,
"userRef": "SnapAndSave",
"issuedAmount": 6000,
"redeemedAmount": 2200,
"expiredAmount": 0,
"balance": 3800,
"breakageValue": 0,
"createDate": "2024-01-30T15:36:03+0200",
"expiryDate": "2027-02-22T23:59:59+0200",
"campaignName": "SnapAndSave gift card campaign",
"campaignType": "GIFTCARD",
"description": "SnapAndSave gift card campaign",
"imageUrl": "0",
"termsAndConditions": "SnapAndSave gift card campaign",
"stateId": "D",
"redeemFromTime": "00:00",
"redeemToTime": "00:00",
"isRedeemableOnSundays": true,
"isRedeemableOnMondays": true,
"isRedeemableOnTuesdays": true,
"isRedeemableOnWednesdays": true,
"isRedeemableOnThursdays": true,
"isRedeemableOnFridays": true,
"isRedeemableOnSaturdays": true
}],
"paging": {
"orderBy": "ID",
"orderDirection": "DESC",
"pageSize": 20,
"pageOffset": 0,
"numItemsOnPage": 1,
"numItemsInTotal": 1,
"numPages": 1
}
}Get Transaction History
Retrieve all transactions related to a specific gift card for reporting and reconciliation.
curl -X GET "https://za-vsp-int.wigroup.co/cvs-issuer/rest/giftcardtransactions?giftcardId={id}" \
-H "apiId: {apiId}" \
-H "apiPassword: {apiPassword}"{
"giftcardTransactions": [{
"id": 123499,
"transactionId": 101694,
"giftcardId": 183980,
"userRef": "VSP_User_Id_001",
"merchantId": 1050,
"merchantName": "Test Merchant",
"retailerId": 10,
"retailerName": "YourRetailer",
"processedAmount": 2500,
"transactionDate": "2015-07-23T14:07:24+0200",
"interfaceIssuerId": "AAIssuer",
"issuerId": 128,
"stateId": "S"
}],
"paging": {
"pageSize": 20,
"pageOffset": 0,
"numItemsOnPage": 1,
"numItemsInTotal": 1,
"numPages": 1
},
"responseCode": "-1",
"responseDesc": "Success"
}Expire/Delete Gift Card
Expire a gift card and return any remaining balance to the campaign float.
curl -X DELETE "https://za-vsp-int.wigroup.co/cvs-issuer/rest/giftcards/{giftcardId}" \
-H "apiId: {apiId}" \
-H "apiPassword: {apiPassword}"{
"responseCode": "-1",
"responseDesc": "Success"
}Redemption Callback
Yoyo sends a POST to your webhook URL whenever a redemption completes. This is an outbound notification from Yoyo, not an endpoint you call. For gift cards distributed in your own channel, use it to detect partial spends and decide whether to issue a follow-up wiCode.
Webhook URL: One callback URL is configured per VSP. Contact your Yoyo integration manager to set or change it. The URL must use a third-party signed SSL certificate.
{
"id": 115796,
"userRef": "your_customer_reference_number",
"basketId": "order-000123",
"storeId": 1050,
"totalProcessedAmount": 5000,
"createDate": "2024-01-18T14:05:58+0200",
"wiCode": "123456789999",
"interfaceIssuerId": "your_channel",
"wiTrxId": "431711",
"redemption": [
{
"id": 173610,
"processedAmount": 5000,
"createDate": "2024-01-18T14:05:58+0200",
"type": "GIFTCARD",
"itemId": 615,
"campaignId": 9000,
"wiCode": "123456789999"
}
]
}| Field | Type | Description |
|---|---|---|
id | Integer | Unique identifier of the redemption callback |
userRef | String | Customer reference the item was issued against |
basketId | String | Basket / order reference from the redeeming store |
storeId | Integer | Store where the redemption happened (Yoyo store id) |
totalProcessedAmount | Integer | Sum of processedAmount across all redemptions in the transaction (cents) |
createDate | String | Transaction create timestamp |
wiCode | String | wiCode presented at redemption |
wiTrxId | String | wiCode platform transaction id |
interfaceIssuerId | String | Channel that issued the wiCode |
redemption[] object
| Field | Type | Description |
|---|---|---|
id | Integer | Unique identifier of this redemption line |
processedAmount | Integer | Value redeemed on this line (cents) |
createDate | String | Redemption timestamp |
type | String | COUPON, VOUCHER, or GIFTCARD |
itemId | Integer | Coupon / voucher / gift card id that was redeemed |
campaignId | Integer | Campaign the item was issued from |
wiCode | String | wiCode for this redemption line |
For gift cards, redemption[].itemId is the gift card id. Use it with the partial redemption sequence under Distribute and View in Your Own App.
Acknowledge every callback: Respond with 200 OK. If no response is received, Yoyo retries up to 10 times before giving up — after that the notification is not resent, so reconcile any gaps from your own transaction records.
