NAV Navbar
shell php javascript

Before Starting

Before Starting Inegrating with Jocker Game Cards Merchant API:

Access your integration account

You have to make sure, that you get access to your integration account. You can contact [email protected] to get your integration account.

Once you have your account ready, we will provide you with authorization credientials that must be used with every request.


Paramter Description
langId 1 for english, 2 for arabic

The response of any request will have response property where its value is either 1 or 0

In case the response value equals 1 response will contain another key data that contains the useful data.

In case the response value equals 0 response will contain another key message that contains the error message.

Check Balance

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.jokercodes.com/online/check_balance/",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => array(
    'deviceId' => '***************************',
    'email' => '[email protected]',
    'password' => '***************************',
    'securityCode' => '***************************',
    'langId' => '1'),
  CURLOPT_HTTPHEADER => array(
    "Content-Type: multipart/form-data"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
curl --location --request POST 'https://api.jokercodes.com/online/check_balance/' \
--header 'Content-Type: multipart/form-data' \
--form 'deviceId=***************************' \
--form '[email protected]' \
--form 'password=***************************' \
--form 'securityCode=***************************' \
--form 'langId=1'
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.jokercodes.com/online/check_balance/',
  'headers': {
    'Content-Type': 'multipart/form-data'
  },
  formData: {
    'deviceId': '***************************',
    'email': '[email protected]',
    'password': '***************************',
    'securityCode': '***************************',
    'langId': '1'
  }
};
request(options, function (error, response) { 
  if (error) throw new Error(error);
  console.log(response.body);
});

Response Example

{
    "response": 1,
    "userId": "191004",
    "balance": "53174.868512898",
    "currency": "SAR"
}

Operation that help the merchant to get his balance and user Id.

Check Balance URL

https://api.jokercodes.com/online/check_balance

Request Parameters

Response

Parameter Description
response 1 for success, 0 for failure
userId merchant account identifier
balance merchant account balance
currency

Categories

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.jokercodes.com/online/categories",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => array(
    'deviceId' => '***************************',
    'email' => '[email protected]',
    'password' => '***************************',
    'securityCode' => '***************************',
    'langId' => '1'
  ),
  CURLOPT_HTTPHEADER => array(
    "Content-Type: multipart/form-data"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
curl --location --request POST 'https://api.jokercodes.com/online/categories' \
--header 'Content-Type: multipart/form-data' \
--form 'deviceId=***************************' \
--form '[email protected]' \
--form 'password=***************************' \
--form 'securityCode=***************************' \
--form 'langId=1'
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.jokercodes.com/online/categories',
  'headers': {
    'Content-Type': 'multipart/form-data'
  },
  formData: {
    'deviceId': '***************************',
    'email': '[email protected]',
    'password': '***************************',
    'securityCode': '***************************',
    'langId': '1'
  }
};
request(options, function (error, response) { 
  if (error) throw new Error(error);
  console.log(response.body);
});

Response Example

{
  "response": 1,
  "data": [
      {
          "id": "59",
          "categoryParentId": "0",
          "categoryName": "iTunes",
          "amazonImage": "https://jokercodes-space.fra1.digitaloceanspaces.com/categories/f33b9-it.png",
          "childs": [
              {
                  "id": "151",
                  "categoryParentId": "59",
                  "categoryName": "British iTunes",
                  "amazonImage": "https://jokercodes-space.fra1.digitaloceanspaces.com/categories/bb24a-bcd74-netherland.jpg",
                  "childs": [ ... ]
              },
              ...,
              ...,
              ...
          ]

      },
      ...,
      ...,
      ...
  ]
}

Operation to get all categories available for this merchant.

all categories should be cached and fetching check availabilty every 5 hours.

Request URL

https://api.jokercodes.com/online/categories

Request Parameters

Response

Property Description
response 1 for success, 0 for failure
data array of objects, each object represents a category, and every category have a property childs that represents an array of subcategories.
In case childs was empty that means this category doesn't have any subcategories, and the merchant can get products of this category immediately using its id.

Products

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.jokercodes.com/online/products",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => array(
    'deviceId' => '***************************',
    'email' => '[email protected]',
    'password' => '***************************',
    'securityCode' => '***************************',
    'langId' => '1',
    'ids[]' => '693'
  ),
  CURLOPT_HTTPHEADER => array(
    "Content-Type: multipart/form-data"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
curl --location --request POST 'https://api.jokercodes.com/online/products' \
--header 'Content-Type: multipart/form-data' \
--form 'deviceId=***************************' \
--form '[email protected]' \
--form 'password=***************************' \
--form 'securityCode=***************************' \
--form 'langId=1' \
--form 'ids[]=693'
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.jokercodes.com/online/products',
  'headers': {
    'Content-Type': 'multipart/form-data'
  },
  formData: {
    'deviceId': '***************************',
    'email': '[email protected]',
    'password': '***************************',
    'securityCode': '***************************',
    'langId': '1',
    'ids[]': '693'
  }
};
request(options, function (error, response) { 
  if (error) throw new Error(error);
  console.log(response.body);
});

Response Example

{
  "response": 1,
  "data": [
    {
      "productId": "693",
      "categoryId": "267",
      "productName": "mobilyTest",
      "productPrice": 0.02,
      "productImage": "https://jokercodes-space.fra1.digitaloceanspaces.com/products/066ce-x50.jpg",
      "productCurrency": "SAR",
      "optionalFieldsExist": 1,
      "productOptionalFields": [
        {
          "id": 332,
          "required": "1",
          "defaultValue": "",
          "hint": "USER ID",
          "label": "USER ID",
          "fieldTypeId": "10",
          "fieldCode": "userid",
          "optionalFieldID": "14",
          "options": []
        }
      ],
      "sellPrice": "0.02",
      "available": true,
      "vatPercentage": 0
    },
    {
      "productId": "113",
      "categoryId": "121",
      "productName": "iTunesTest",
      "productImage": "https://jokercodes-space.fra1.digitaloceanspaces.com/products/066ce-x50.jpg",
      "productCurrency": "SAR",
      "optionalFieldsExist": 0,
      "productOptionalFields": [],
      "minSellPriceValue": "50",
      "minSellPriceValue": "2500",
      "productPricePercentage": 80.5
      "available": true,
    }
  ]
}

Operation to get all products availbe either by a selected category id, or by an array of products identifiers.

all products should be cached and fetching check availabilty every 2 minutes.

Request URL

https://api.jokercodes.com/online/products

Essential Request Parameters

Additional Request Parameters

Paramter Description
categoryId selected category id
ids[] selected product id (can be repeated for each product id)

To get products of some category you can use categoryId in the request paramters.

To get products list known by their identifiers you can send the ids[] paramter in request which represent the product id you want, and it can be repeated to select many products at once.

Response

Property Description
response 1 for success, 0 for failure
data array of objects, each object represents a product

Every product has

Property Description
productPrice (if fixed price) that represents the product price including vat that the merchant paid for product
productPricePercentage (if variable product) that represents the percentage of the product price that will be deducted from the balance including vat that the merchant paid for product
sellPrice (if fixed price) that represents the price the customer pays for the product to the merchant.
minSellPriceValue (if variable product) that represents the minimum price the customer pays for the product to the merchant.
maxnSellPriceValue (if variable product) that represents the maximum price the customer pays for the product to the merchant.
available determines if stock for this product is available or not.
optionalFieldsExist 1 optional fields required, 0 there are no required optional fields.
productOptionalFields array of optional fields where

each optional field has

Property Description
id identifier of the optional field
required '1' means it's required, '0' means it's optional and not required
defaultValue default value for this field
hint placeholder for this field
label label displayed on top of this field on UI
fieldTypeId 1 plaintext ,7 email address, 10 phone number ,other number plaintext
fieldCode
options array of choices in case option is multichoice field

Orders

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.jokercodes.com/online/orders",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => array(
    'deviceId' => '***************************',
    'email' => '[email protected]',
    'password' => '***************************',
    'securityCode' => '***************************',
    'langId' => '1'
  ),
  CURLOPT_HTTPHEADER => array(
    "Content-Type: multipart/form-data"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
curl --location --request POST 'https://api.jokercodes.com/online/orders' \
--header 'Content-Type: multipart/form-data' \
--form 'deviceId=***************************' \
--form '[email protected]' \
--form 'password=***************************' \
--form 'securityCode=***************************' \
--form 'langId=1'
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.jokercodes.com/online/orders',
  'headers': {
    'Content-Type': 'multipart/form-data'
  },
  formData: {
    'deviceId': '***************************',
    'email': '[email protected]',
    'password': '***************************',
    'securityCode': '***************************',
    'langId': '1'
  }
};
request(options, function (error, response) { 
  if (error) throw new Error(error);
  console.log(response.body);
});

Response Example

{
    "response": 1,
    "data": [
        {
            "orderNumber": "12637610",
            "orderFinalTotal": "1.05",
            "currencySymbol": "SAR",
            "orderCreateDate": "2020/01/06 12:07",
            "orderCurrentStatus": "completed",
            "orderPaymentMethod": "Pocket"
        },
        ...,
        ...,
        ...,
    ]
}

Operation to get all orders made by this merchant.

Request URL

https://api.jokercodes.com/online/orders

Request Parameters

Optional Request Paramters for filtering

Paramter Description
page page number(default is 1), where page size is fixed value of 100 order per page
orderType desc or asc, arranged by order create date orderCreateDate
fromUnixTime get all orders with create date bigger than this timestamp
toUnixTime get all orders with create date less than this timestamp

Response

Paramter Description
response 1 for success, 0 for failure
data array of objects(each represent an order)

each order object has orderFinalTotal which represent the price the merchant will pay for Jocker Game Cards for this order

Orders details

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.jokercodes.com/online/orders/details",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => array(
    'deviceId' => '***************************',
    'email' => '[email protected]',
    'password' => '***************************',
    'securityCode' => '***************************',
    'langId' => '1',
    'orderId' => '12319604'
  ),
  CURLOPT_HTTPHEADER => array(
    "Content-Type: multipart/form-data"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
curl --location --request POST 'https://api.jokercodes.com/online/orders/details' \
--header 'Content-Type: multipart/form-data' \
--form 'deviceId=***************************' \
--form '[email protected]' \
--form 'password=***************************' \
--form 'securityCode=***************************' \
--form 'langId=1' \
--form 'orderId=12319604'
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.jokercodes.com/online/orders/details',
  'headers': {
    'Content-Type': 'multipart/form-data'
  },
  formData: {
    'deviceId': '***************************',
    'email': '[email protected]',
    'password': '***************************',
    'securityCode': '***************************',
    'langId': '1',
    'orderId': '12319604'
  }
};
request(options, function (error, response) { 
  if (error) throw new Error(error);
  console.log(response.body);
});
// decrypting the `serialCode` in php

function decryptSerial($encrypted_txt){    
  $secret_key = 't-3zafRa';    
  $secret_iv = 'St@cE4eZ';
  $encrypt_method = 'AES-256-CBC';                
  $key = hash('sha256', $secret_key);        

  //iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning          
  $iv = substr(hash('sha256', $secret_iv), 0, 16);        

  return openssl_decrypt(base64_decode($encrypted_txt), $encrypt_method, $key, 0, $iv);        
}

echo decryptSerial('bnY0UEc2NFcySHgwRTIyNFU1NU5pUT09');  //output is MXeaSFSUj4az
// decrypting the `serialCode` in php

function decryptSerial($encrypted_txt){    
  $secret_key = 't-3zafRa';    
  $secret_iv = 'St@cE4eZ';
  $encrypt_method = 'AES-256-CBC';                
  $key = hash('sha256', $secret_key);        

  //iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning          
  $iv = substr(hash('sha256', $secret_iv), 0, 16);        

  return openssl_decrypt(base64_decode($encrypted_txt), $encrypt_method, $key, 0, $iv);        
}

echo decryptSerial('bnY0UEc2NFcySHgwRTIyNFU1NU5pUT09');  //output is MXeaSFSUj4az
// decrypting the `serialCode` in php

function decryptSerial($encrypted_txt){    
  $secret_key = 't-3zafRa';    
  $secret_iv = 'St@cE4eZ';
  $encrypt_method = 'AES-256-CBC';                
  $key = hash('sha256', $secret_key);        

  //iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning          
  $iv = substr(hash('sha256', $secret_iv), 0, 16);        

  return openssl_decrypt(base64_decode($encrypted_txt), $encrypt_method, $key, 0, $iv);        
}

echo decryptSerial('bnY0UEc2NFcySHgwRTIyNFU1NU5pUT09');  //output is MXeaSFSUj4az

Response Example

{
    "response": 1,
    "orderNumber": "12319604",
    "orderFinalTotal": "100",
    "currencySymbol": "SAR",
    "orderCreateDate": "2019-12-25 06:57",
    "orderPaymentMethod": "Pocket",
    "orderCurrentStatus": "completed",
    "serials": [
        {
            "productId": "376",
            "productName": "test-itunes1",
            "productImage": "https://jokercodes-space.fra1.digitaloceanspaces.com/products/4b09d-5656b-buy-one-get-one-2.png",
            "serialId": "11562121",
            "serialCode": "U0IycUdUWktsL25UaGhOc2JBMmtTUT09",
            "serialNumber": "",
            "validTo": "25/03/2020"
        }
    ]
}

Operation to get one order details by its id.

To get an order details you can use one of two order identifier, the first one is orderId from Jocker Game Cards, and the other is referenceId for order in merchant system, we recommend to use referenceId,

Request URL

https://api.jokercodes.com/online/orders/details

Essential Request Parameters

Additional Request Parameters

Response

Paramter Description
response 1 for success, 0 for failure
serials array of objects, each object represent a purchased product details.

each serial object has

Paramter Description
serialCode is the encrypted serial given to customer to be used
serialNumber is the card manufacturing No
validTo is the validation time for card

Create Order (Fixed value product)

<?php

  $curl = curl_init();
  
  curl_setopt_array($curl, array(
    CURLOPT_URL => "https://api.jokercodes.com/online/create_order",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => array(
      'deviceId' => '***************************',
      'email' => '[email protected]',
      'password' => '***************************',
      'securityCode' => '***************************',
      'langId' => '1',
      'productId' => '987'
      'referenceId' => 'Merchant_12467'
    ),
  ));
  
  $response = curl_exec($curl);
  
  curl_close($curl);
  echo $response;
  ?>
  
curl --location --request POST 'https://api.jokercodes.com/online/create_order' \
  --form 'deviceId=***************************' \
  --form '[email protected]' \
  --form 'password=***************************' \
  --form 'securityCode=***************************' \
  --form 'langId=1' \
  --form 'productId=987'
  --form 'referenceId=Merchant_12467'
  
var request = require('request');
  var options = {
    'method': 'POST',
    'url': 'https://api.jokercodes.com/online/create_order',
    'headers': {
    },
    formData: {
      'deviceId': '***************************',
      'email': '[email protected]',
      'password': '***************************',
      'securityCode': '***************************',
      'langId': '1',
      'productId': '987'
      'referenceId': 'Merchant_12467'
    }
  };
  request(options, function (error, response) { 
    if (error) throw new Error(error);
    console.log(response.body);
  });
  
// Example to generate sha256 hash based on a given timestamp in php
  function generateHash($time){
    $email = strtolower('[email protected]');
    $phone = '966577753100';
    $key = '8Tyr4EDw!2sN';
    return hash('sha256',$time.$email.$phone.$key);
  }
  
  echo generateHash('1576704145');
  
// Example to generate sha256 hash based on a given timestamp in php
  function generateHash($time){
    $email = strtolower('[email protected]');
    $phone = '966577753100';
    $key = '8Tyr4EDw!2sN';
    return hash('sha256',$time.$email.$phone.$key);
  }
  
  echo generateHash('1576704145');
  
// Example to generate sha256 hash based on a given timestamp in php
  function generateHash($time){
    $email = strtolower('[email protected]');
    $phone = '966577753100';
    $key = '8Tyr4EDw!2sN';
    return hash('sha256',$time.$email.$phone.$key);
  }
  
  echo generateHash('1576704145');
  

Response Example

{
        "response": 1,
        "orderId": "12319604",
        "orderPrice": "100",
        "orderPriceWithoutVat": "100",
        "orderDate": "2019-12-25 06:57",
        "vatAmount": "0",
        "vatPercentage": "0%",
        "productName": "test-itunes1",
        "productImage": "https://jokercodes-space.fra1.digitaloceanspaces.com/products/4b09d-5656b-buy-one-get-one-2.png",
        
        "serials": [
            {
               "serialId": "11562121",
                "serialCode": "U0IycUdUWktsL25UaGhOc2JBMmtTUT09",
                "serialNumber": "",
                "validTo": "25/03/2020"
            }
        ]
    }
    

Request URL

https://api.jokercodes.com/online/create_order

Essential Request Parameters

Additional Request Parameters

Paramter Description
time current timestamp
hash current timestamp hash generated by the function generateHash
referenceId merchant reference (Required and must be unique)
productId product identifier
quantity always 1
optionalFields contains:
optionId: option identifier
optionalFieldID: the optional field id in optional field object in product
value: option value

Response

Paramter Description
response 1 for success, 0 for failure
orderId Jocker Game Cards order identifier
orderPrice order price with wat
orderPriceWithoutVat order price with out vat
vatAmount vat amount
vatPercentage vat vatPercentage of order price
serials array of objects, each object represent a purchased product details.

each serial object has

Paramter Description
serialCode is the encrypted serial given to customer to be used
serialNumber is the card manufacturing No
validTo is the validation time for card

Create Order (Variable value product)

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.jokercodes.com/online/create_order",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => array(
    'deviceId' => '***************************',
    'email' => '[email protected]',
    'password' => '***************************',
    'securityCode' => '***************************',
    'langId' => '1',
    'productId' => '987'
    'referenceId' => 'Merchant_12467'
    'variableAmount' => '50'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
curl --location --request POST 'https://api.jokercodes.com/online/create_order' \
--form 'deviceId=***************************' \
--form '[email protected]' \
--form 'password=***************************' \
--form 'securityCode=***************************' \
--form 'langId=1' \
--form 'productId=987'  \
--form 'referenceId=Merchant_12467' \
--form 'variableAmount=50'
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.jokercodes.com/online/create_order',
  'headers': {
  },
  formData: {
    'deviceId': '***************************',
    'email': '[email protected]',
    'password': '***************************',
    'securityCode': '***************************',
    'langId': '1',
    'productId': '987'
    'referenceId': 'Merchant_12467'
    'variableAmount': '50'
  }
};
request(options, function (error, response) { 
  if (error) throw new Error(error);
  console.log(response.body);
});
// Example to generate sha256 hash based on a given timestamp in php
function generateHash($time){
  $email = strtolower('[email protected]');
  $phone = '966577753100';
  $key = '8Tyr4EDw!2sN';
  return hash('sha256',$time.$email.$phone.$key);
}

echo generateHash('1576704145');
// Example to generate sha256 hash based on a given timestamp in php
function generateHash($time){
  $email = strtolower('[email protected]');
  $phone = '966577753100';
  $key = '8Tyr4EDw!2sN';
  return hash('sha256',$time.$email.$phone.$key);
}

echo generateHash('1576704145');
// Example to generate sha256 hash based on a given timestamp in php
function generateHash($time){
  $email = strtolower('[email protected]');
  $phone = '966577753100';
  $key = '8Tyr4EDw!2sN';
  return hash('sha256',$time.$email.$phone.$key);
}

echo generateHash('1576704145');

Response Example

{
      "response": 1,
      "orderId": "12319604",
      "orderPrice": "100",
      "orderPriceWithoutVat": "100",
      "orderDate": "2019-12-25 06:57",
      "vatAmount": "0",
      "vatPercentage": "0%",
      "productName": "test-itunes1",
      "productImage": "https://jokercodes-space.fra1.digitaloceanspaces.com/products/4b09d-5656b-buy-one-get-one-2.png",
      "variableAmount": "50",
      
      "serials": [
          {
             "serialId": "11562121",
              "serialCode": "U0IycUdUWktsL25UaGhOc2JBMmtTUT09",
              "serialNumber": "",
              "validTo": "25/03/2020"
          }
      ]
  }
  

Request URL

https://api.jokercodes.com/online/create_order

Essential Request Parameters

Additional Request Parameters

Paramter Description
time current timestamp
hash current timestamp hash generated by the function generateHash
referenceId merchant reference (Required and must be unique)
productId product identifier
quantity always 1
variableAmount must be between the minSellPriceValue and the maxSellPriceValue related to the productId set to the order
optionalFields contains:
optionId: option identifier
optionalFieldID: the optional field id in optional field object in product
value: option value

Response

Paramter Description
response 1 for success, 0 for failure
orderId Jocker Game Cards order identifier
orderPrice order price with wat
orderPriceWithoutVat order price with out vat
vatAmount vat amount
vatPercentage vat vatPercentage of order price
variableAmount The variable amount set to this order
serials array of objects, each object represent a purchased product details.

each serial object has

Paramter Description
serialCode is the encrypted serial given to customer to be used
serialNumber is the card manufacturing No
validTo is the validation time for card

Create Order Timeout Error & How to Solve

<?php
    
  

In case create order api return Timeout error

Merchant have to implement the following advised solution to solve the timeout issue:

Merchant shall retry to send order details request for the same order for 6 times (10 seconds between each attempt) using the referenceId for created order.

If Merchant still get timeout, we advised to hold all market and navigate to the second step.

In the second step, Merchant shall stop all orders to Jocker Game Cards and continue attempting for the same order as health check every 60 seconds till Jocker Game Cards responds, at this moment merchant can resume send create orders.