Yoyo Logo

Gift Card Issuing

Issue gift cards for 100+ South African brands

How vouchers, coupons and gift cards differ
ProductWhat it doesRedemptionsIssued via
VoucherMoney off the whole basket — a fixed amount or a percentage. Not tied to particular products. e.g. R50 off your shopOncePOST /coupons
CouponMoney off specific products. Only applies if those products are in the basket. e.g. R5 off any 250g coffeeOncePOST /coupons
Gift cardThis guideA balance the customer spends like money, across more than one visit until it runs out. e.g. R200 to spendUntil the balance is usedPOST /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 Start

Yoyo handles delivery - just provide a mobile number

How it works

  1. 1Call the Issue Gift Card API with campaign ID, balance, and mobile number
  2. 2Yoyo creates the gift card and generates a unique wiCode
  3. 3Yoyo automatically delivers the gift card via SMS or WhatsApp
  4. 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
}'
Example Response
{
  "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

  1. 1Call the Issue Gift Card API with campaignId, balance, userRef, and stateId
  2. 2Receive the wiCode and gift card ID in the response
  3. 3Display the gift card in your app with balance information
  4. 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 code
  • balance - Remaining value in cents
  • id - 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. 1

    Partial redemption happens

    Yoyo POSTs a redemption notification to your configured webhook URL.

  2. 2

    Read the payload

    Use redemption[].processedAmount, storeId, userRef, and redemption[].itemId (the gift card id when type is GIFTCARD). See Redemption Callback.

  3. 3

    Check what’s left on the card

    GET /giftcards/{giftcardId}

  4. 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. 5

    Fetch the new wiCode and balance

    Call GET /giftcards/{giftcardId} again and read wicode and balance.

  6. 6

    Send it to the customer

    Share the new wiCode and remaining balance via your channel (SMS, WhatsApp, or in-app).

  7. 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}"
Example GET response after reissue (balance remaining)
{
  "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}"
Example Response
{
  "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}"
Example Response
{
  "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}"
Example Response
{
  "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}"
Example Response
{
  "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}"
Example Response
{
  "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.

POST to your webhook URL
{
  "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"
    }
  ]
}
Redemption callback root fields
FieldTypeDescription
idIntegerUnique identifier of the redemption callback
userRefStringCustomer reference the item was issued against
basketIdStringBasket / order reference from the redeeming store
storeIdIntegerStore where the redemption happened (Yoyo store id)
totalProcessedAmountIntegerSum of processedAmount across all redemptions in the transaction (cents)
createDateStringTransaction create timestamp
wiCodeStringwiCode presented at redemption
wiTrxIdStringwiCode platform transaction id
interfaceIssuerIdStringChannel that issued the wiCode

redemption[] object

Redemption line fields
FieldTypeDescription
idIntegerUnique identifier of this redemption line
processedAmountIntegerValue redeemed on this line (cents)
createDateStringRedemption timestamp
typeStringCOUPON, VOUCHER, or GIFTCARD
itemIdIntegerCoupon / voucher / gift card id that was redeemed
campaignIdIntegerCampaign the item was issued from
wiCodeStringwiCode 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.