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.
Code Example - Fixed Order
cURL NodeJS - Axios PHP - cURL
Copy <?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;
Copy const axios = require('axios');
let data = JSON.stringify({
"contacts": [
"example@gmail.com"
],
"title": "Order title",
"description": "Order description"
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.giftoin.org/api/v1/gcm/reseller/campaign/<your-campaign-id>/order',
headers: {
'x-gft_api_key': '<your-api-key>',
'Content-Type': 'application/json'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Copy <?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 NodeJS - Axios PHP - cURL
Copy 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"
}'
Copy const axios = require('axios');
let data = JSON.stringify({
"contacts": [
"example@gmail.com"
],
"coins": [
{
"id": 1,
"valueInUSD": 1
}
],
"title": "Order title",
"description": "Order description"
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.giftoin.org/api/v1/gcm/reseller/campaign/<your-campaign-id>/order',
headers: {
'x-gft_api_key': '<your-api-key>',
'Content-Type': 'application/json'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Copy <?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"
],
"coins": [
{
"id": 1,
"valueInUSD": 1
}
],
"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;