Gift Card
Last updated
Last updated
Access your application on
On Monetization side menu, check if you have Gift Card already configured. In case it's not configured, you can add it through the "New Platform" button. Gift Card Platform supports iOS, Android and WEB applications.
Gift Card platform doesn't need to configure any platform properties. You can just save it to have it available at the list of monetization platforms.
Click "Save" to complete this part of the process.
On the platform listing, click on "SKU Configuration" on the actions column for Gift Card.
Create a new SKU configuration, by clicking on "New Configuration"
Fill the SKU name with a meaningful name of the corresponding Gift Card campaign.
Set Share Type to SHARE_ACROSS_PRODUCT.
Select the renew period.
Select if the SKU has a trial period and enter the trial period in days.
Select the currency code for this SKU and enter the price.
Gift Card platform offers a "payload" field, which a given app loads custom settings, in JSON format. This field is optional, in case it's needed to fulfill this field, it needs to be under JSON format.
Click save to complete the process.
Right After the SKU action, there are two new buttons under the "Actions" column. Generate Gift Cards and List Gift Cards.
Click on the Generate Gift Cards Button
A window will appears with the following information:
Quantity: Number of gift cards limits up to 5 millions gift cards per batch. Default Value is 1.
Reserve All Gift Cards: Set all Gift Cards as Available or reserved. Default value is "No", which means all Gift cards generates with the status AVAILABLE. Otherwise, it's set as RESERVED.
Expires At: Gift Cards expiration date. Default is NEVER. Otherwise, a date time can be set.
Click Save to send a message to trigger the gift cards generation.
Right After this process, a batch process will be responsible for generate the gift cards. After that, it sends an email to the requester, containing the generation id and a attached zip file.
After the end of Gift Cards generation, an email will arrive with the following format:
from: noreply@kwsdk.io
to: your company email
Subject: [Kiwi - Gift Cards request is completed. Sku: sku name]
Message Body: You can find attached the Gift Cards you have requested. Feel free to talk to the Kiwi team for any assistance you may need. Generation Id: UUID value
An email Attachment, under the format: sku_sku name_Generation UUID_generated.csv.zip
Inside the zipped file, the csv file has the following format:
Gift card Code, AVAILABLE or RESERVED
After the Gift Card processing is done, the generated gift cards can be listed at the "List Gift Card Button.
Click at the List Gift Card Button
A table will be shown with all Gift Cards Generated to the selected SKU. Each gift card item can be inspected / edited through the "Edit" button.
Click on the "Edit" button at any generated gift card
A window is opened, containing all Gift Card specific information. At this window it's possible to set a Gift Card as AVAILABLE or RESERVED and set an expiration date after the gift card is generated.
Click "Save" to persist any gift card edition.
Every time a gift cars is generated, it supports the following set of statuses:
AVAILABLE, status = 0
RESERVED, status = 1
REDEEMED, status = 2
EXPIRED, status = 3
PROCESSING, status = 4
AVAILABLE: It's the first gift card status. It's useful to generate a gift card and set it on demands as needed. From a business perspective, it's way from Customer Happiness to mark a Gift Card as RESERVED when a given end-user needs a Gift Card to be Redeemed.
RESERVED: A gift card only can be redeemed if a Gift Card is set to Reserved. It can be done at the beginning of the generation process, setting "Reserve All Gift Cards" before generated them, or editing each gift card manually after the gift card generation is performed.
REDEEMED: When a gift card is set to RESERVED, it can be Redeemed by the end user through WEB / iOS / Android platforms. After a end-user Redeems a gift card, the status is set to REDEEMED and a subscription will be created to this user after the gift card redeem process.
EXPIRED: When a Gift Card has an expiration date associated with its generation or when someone manually edits its expiration time, before the REDEEM process it's checked if the gift card is expired or not. It so, the gift card is set to EXPIRED and can't be used to create a subscription anymore.
PROCESSING: Intermediary status, present between RESERVED / REDEEM status. Useful to mark a gift card is processed, in order to ensure the purchase will be atomically generated by the register process and important if the process crashes at the middle of the process, stating the flow was roughly interrupted.
In order to redeem a gitcard, a POST request must be made to Kiwi Webservice Purchase Giftcard endpoint. The gift card redeem process needs the following input (bold fields are mandatory).
User Id: user identification (UUID format)
App Install Id: Installation Id (UUID format)
Account Id: Account Identification (UUID Format) (sent when is desired that the subscription created is linked to an account)
Gift Card Code: Code that will be sent by the end-user (udner the format xxx-xxx-xxx, alphanumeric)
Session Media Info: Optional field, in order to identify media campaigns.
Example of complete input:
Example of minimal input in order to have a valid subscription:
Note: the Account Id is optional, but it will generate different SUCCESS statuses, as explained below at the statuses Ids:
From this input, we will have the following output:
Status: Gift Card Subscription Status
Message: Meaninful Message Explaining the status
Subscription: Subscription Information, when the status is SUCCESS or SUCCESS_NOT_LINKED.
SUCCESS(0): Means that the subscription process was successful, linking the current logged account with the created subscription.
SUCCESS_NOT_LINKED(1): Means that the subscription process was successful, but the current subscription couldn't be linked with an Account Id, probably because the end-user redeemed the Gift Card without any account information (e.g. not signed-in during the Redeem process).
INVALID_PARAMETERS(2): Means the mandatory parameters are invalid, not following the defined format (e.g. invalid user or app install id format)
ERROR_INVALID_GIFTCARD(3): Means the gift card somehow is invalid. It can be due several reasons, e.g. invalid gift card format, invalid gift card because it's not present at the database, etc. For each separated case if needed, Kiwi Team can investigate for each reason separetely.
ERROR_REGISTERING_SUBSCRIPTION_ON_KIWI(4): Means the input values are under the given format, but the content is somehow not present at Kiwi Platform, e.g. user Id or account Id is under UUID format but isn't found, etc.
ERROR_GIFTCARD_NOT_RESERVED(5): Means the end-user is trying to redeem a Gift card which is not under the RESERVED state (possibly under AVAILABLE state). It needs to contact customer happiness ind er to set up the gift card to RESERVED state.
ERROR_GIFTCARD_ALREADY_EXPIRED: Means someone is trying to redeem an already expired gift card more than once. Useful to identify multiple useless gift card redeem tries.
ERROR_GIFTCARD_EXPIRED(7): Means someone tries to redeem a Reserved gift Card and this gift card reaches its expiration date at the first time. The gift card is set to Expire and returns a specific status about it.
ERROR_GIFTCARD_ALREADY_REDEEMED(8): Means someone is trying to redeem a gift card which was already redeemed. A gift card can be redeemed just one time, creating a valid subscription.
ERROR_UNKNOWN(9): Status for unexpected Errors, which wasn't coverered by no one of the status above, mostly for unexpected exceptions.
Example of a successful output:
Example of a unsuccessful output:
If, by any reason, you decide to create gift cards upon request (e.g., to distribute gift cards when an user subscribes with an external partner), you can use on-demand gift card creation, via requests to a specific API.
In order to do so, you first need to enable on-demand creation and setup an authorization secret for your app, which Kiwi will use to authenticate the request.
Gift cards can only be created with status RESERVED using this API.
On Kiwi Admin, navigate to Monetization, head to the GIFTCARD item on the table and click on the edit icon (the last one)
Enable / disable the usage of the API with the yes/no switch and configure the authorization password on the text input. We recommend using a strong password, given that the usage of this API can generate gift cards freely.
Click on save, and you're all set =)
To create the gift card, you just need to call our Tools Webservice with the following data:
Method: POST
Endpoint: https://tools.kwsdk.io/api/1.0/subscription/giftcard/create
Headers
Request body
The sku
field is mandatory and it's validated against the SKUs configured on Kiwi for the application. The expiresAt
is optional: if missing, the gift card can be redeemed at any time.
Response
If the operation fails, by any reason, the giftCard
field won't be sent.
The statuses are the following:
HTTP Status
Status
Status Code
Possible causes
500
UNKNOWN
-1
it didn't work
200
SUCCESS
0
it worked
403
ERROR_DISABLED
1
on-demand is disabled for the app on Kiwi Admin
401
ERROR_INVALID_CREDENTIALS
2
missing app key or secret, inexistent app key or wrong secret
422
ERROR_MISSING_GIFTCARD_CONFIGURATION
3
missing configuration for gift cards on Kiwi Admin
422
ERROR_INVALID_EXPIRATION
4
the requested expiration date is on the past
422
ERROR_INVALID_SKU
5
missing SKU or the SKU is not configured on Kiwi Admin
Gift Card Purchases are available under WEB / iOS / Android Platforms.
Can be integrated through landing pages and following the JSON format as input, explained here at this documentation.
Both iOS / Android releases contains test applications explaining how to redeem a gift card:
Kiwi has a gateway implementing only the redemption method of the BHNUMS platform. The platform itself is responsible to handle transaction reversal in case of soft declines. The retry interval is hard-coded to 15 minutes.
In order to use this integration, besides the commercial agreement with BH, you need to open a ticket to the Kiwi team, asking for the configuration of BH's parameters on our platform.
The gateway is implemented according to the spec 4.3E (43).
This API merely checks for a card existence on Kiwi's database, not relying on BH's balance inquiry API.
Method: GET
Endpoint:https://purchase.kwsdk.io/api/1.0/subscription/blackhawk/giftcard/validate?pinCode=<pincode to check>
Headers:
Response:
The statuses are the following:
Status Code
Status
Message
0
UNKNOWN
An unknown error has happened
1
OK
Card can be redeemed (note: this only checks for a card existence, the success of the redeem operation depends upon card activation at PoS)
2
ALREADY_REDEEMED
The card has already been redeemed
3
INVALID
The card is invalid
4
NOT_FOUND
Card not found
To redeem a gift card distributed by BlackHawk, you just need to call our Purchase Webservice with the following data:
Method: POST
Endpoint: https://purchase.kwsdk.io/api/1.0/subscription/blackhawk/giftcard/redeem
Headers:
Request body:
Response:
If the operation fails, the subscription
object is not returned.
The statuses are the following:
Status Code
Status
Message
0
UNKNOWN
An unknown error has happened
1
SUCCESS
The redeem at BH was successful, the subscription was registered at Kiwi and linked to the given account
2
SUCCESS_REDEEM_BUT_REGISTER_SUBSCRIPTION_FAILED
The giftcard was redeemed at BH but no subscription was created at Kiwi
3
SUCCESS_REDEEM_BUT_ACCOUNT_LINK_FAILED
The giftcard was redeemed at BH and a subscription has been created at Kiwi, but the platform failed to link it to an account. This status will also be returned if the field account_uuid was not specified on the request
4
FAILED
General failure
For details on BlackHawk's status codes, please refer to the BHNUMS documentation.