Redeem Integration Guide

Overview

The Playtem platform gives the ability for publishers to redeem the users’ cards from their own website by calling a couple of very simple web services. This documentation describes all the steps to integrate a redeem form in your own website.

How does it work?

  1. A user buys a Playtem card in an official retailer,
  2. The user fills his secret card number in a form on your website,
  3. You call our web services to know if the secret code is valid and to redeem it.

Getting started

Getting started with the remote redeem platform is quick and easy. The following diagram illustrates how the integration works:

../_images/diagram0.png

In order to redeem Playtem cards from your website you have to complete these 3 following steps:

Step 1: Create a form on your website

Create an HTML form on your website where the user will be able to fill his secret code.

Step 2: Get the card status

In order to get the status of a card, Playtem provides a web service:

https://www.playtem.com/API/Cards/GetStatus?Code=VV&Key=WW&Secret=XX&IdOnGame=YY&TransactionId=ZZ

Parameters Description
Code

This parameter contains the secret code of the card of which you want to know the status. All codes start with ‘PT’ and have 14 characters Allowed characters are:

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789

Example Value: PTMP000PWL53CL

IdOnGame

This parameter contains the user id in your game.

Example Value: DOF2014-58

TransactionId

This parameter contains a unique transaction id generated by your server. This transaction is useful in complex support requests.

Example Value: DO464JG7688

Key

Specifies the application key supplied by our technical team.

Example Value: epfplafptp7u1rfeg04gfg23toe42

Secret

Specifies your application secret code supplied by our technical team. This secret code is required in order to secure the communication between our servers.

Example Value: s53espch83

If no error occurred, we issue an HTTP 200 status code, the card status is returned in the message body in JSON format as described below:

{
        "Status" : Success,
        "Price" : 10
}

If an error occurred, we issue an HTTP 500 status code and fill the Status field in the JSON response with one of the values listed below:

Status Description
Success Returns the Success status when the card is well activated and not redeemed yet. You will find the card price in the response
InvalidCode Returns the InvalidCode status when the code is not found in our database
AlreadyApplied Returns the AlreadyApplied status when the code has already been redeemed in the past
NotActivated Returns the NotActivated status when the card linked with requested code is not activated yet
InternalError Returns the InternalError status when an internal error occurred

Step 3: Redeem

Whenever a user enters a card number on your web site you have to call the Redeem API. This call will definitely “burn” the card and the secret code sent will be marked as disabled and applied in our database.

Be careful, Playtem is able to generate prepaid codes with any prices. So please, be sure to check the price amount if you are not able to redeem all possible prices.

In order to redeem a card you need to call a web service:

https://www.playtem.com/API/Cards/Redeem?Code=VV&Key=WW&Secret=XX&IdOnGame=YY&TransactionId=ZZ

Parameters Description
Code

This parameter contains the secret code of the card you want to redeem. All codes start with ‘PT’ and have 14 characters. Allowed characters are:

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789

Example Value: PTMP000PWL53CL

IdOnGame

This parameter contains the user id in your game.

Example Value: DOF2014-58

TransactionId

This parameter contains a unique transaction id generated by your server. This transaction is useful in complex support requests.

Example Value: DO464JG7688

Key

Specifies the application key supplied by our technical team.

Example Value: epfplafptp7u1rfeg04gfg23toe42

Secret

Specifies your application secret code supplied by our technical team. This secret code is required in order to secure the communication between our servers.

Example Value: s53espch83

The result of this web service is the same as the GetStatus one (see step 2).