🪙Cashback

Good to know: The order type is based on the campaign. You can easily know the type of your campaign by entering the campaign details page on the management dashboard.

There are generally two types of orders:

  1. The amount of the coins are fixed. For example, each one of the orders will send a giftoin that contain X amount of the coin.

  2. The amount of the coins are dynamic. Can be used for cashback campaigns. For example, each one of the order will send a giftoin that potentially can have different amount of the coin. For order #1 the amount of the coin will be X and for order #2 it can be Y.

Creating orders

Code Example - Fixed Order

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.giftoin.org/api/v1/gcm/reseller/campaign/<your-campaign-id>/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 =>'{
    "contacts": [
        "example@gmail.com"
    ],
    "title": "Order title",
    "description": "Order description"
}',
  CURLOPT_HTTPHEADER => array(
    'x-gft_api_key: <your-api-key>',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Code Example - Dynamic Order (Cashback)

curl --location 'https://api.giftoin.org/api/v1/gcm/reseller/campaign/<your-campaign-id>/order' \
--header 'x-gft_api_key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "contacts": [
        "example@gmail.com"
    ],
    "coins": [
        {
            "id": 1,
            "valueInUSD": 1
        }
    ],
    "title": "Order title",
    "description": "Order description"
}'

Last updated