API for Production

Create Campaign:

Description

This request allows creating a new campaign in the system using the provided parameters.

Method: POST

Request Parameters:

store_name (string)
A string containing the name of the store. Minimum of 1 characters, maximum of 150.
product_name (string)
A string containing the product name. Minimum of 60 characters, maximum of 150.
company_registration_number (string)
A string containing the campaign registration number. Minimum of 4 characters, maximum of 256.
country_of_registration (string)
A string containing the name of the country (country code).
countries_approved_for_product_sales (array)
A string containing the countries for which the sale is available (the array contains the country code)
product_link (string)
A string containing a link to the product.
product_type (integer)
Parameter indicating what type of product the product belongs to parameter (1 - Digital products, 2- Physical products)
product_refund_period_duration (integer)
Number of days, duration of the return period (1 - Digital products, 2- Physical products)
date_approved (string)
Optional string containing the date of confirmation (date format: Y-m-d H:i:s)

Request example:

use GuzzleHttp\Client;

$apiKey = "your_api_key";
$url = "https://prod.a.bitads.ai/api/create-campaign";

$data = [
    "store_name" => "",
    "product_name" => "",
    "company_registration_number" => "",
    "country_of_registration" => "",
    "countries_approved_for_product_sales" => [],
    "product_link" => "",
    "date_approved" => "",
    "product_type" => "",
    "product_refund_period_duration" => "",
];

$client = new Client();
$response = $client->request("POST", $url, [
    "headers" => [
        "Accept" => "application/json",
        "API-KEY" => $apiKey
    ],
    "json" => $data,
]);

$body = $response->getBody();
$content = $body->getContents();

$data = json_decode($content, true);
import requests

apiKey = "your_api_key"
url = f"https://prod.a.bitads.ai/api/product/create"

data = {
    "store_name" : "",
    "product_name" :"",
    "company_registration_number" : "",
    "country_of_registration" : "",
    "countries_approved_for_product_sales" : [],
    "product_link" : "",
    "date_approved" : "",
    "product_type" : "",
    "product_refund_period_duration" : "",
}

headers = {
    "Accept": "application/json",
    "API-KEY" : apiKey
}

response = requests.post(url, json=data, headers=headers)
response_data = response.json()

print(response_data)
const axios = require('axios');

const apiKey = "your_api_key";
const url = `https://prod.a.bitads.ai/api/product/create`;

const data = {
    "store_name" : "",
    "product_name" :"",
    "company_registration_number" : "",
    "country_of_registration" : "",
    "countries_approved_for_product_sales" : [],
    "product_link" : "",
    "date_approved" : "",
    "product_type" : "",
    "product_refund_period_duration" : "",
};

axios.post(url, data, {
    headers: {
        'Accept': 'application/json',
        'API-KEY' : apiKey
    }
})
.then(response => {
    const responseData = response.data;
    console.log(responseData);
})
.catch(error => {
    console.error('Error:', error);
});

Response example:

{
    "statusCode": 200,
    "data": {
        "status": "created",
        "product_id": "m0dsryqm6gvkz",
        "product": {
            "store_name": "Alibaba",
            "product_name": "Chase the Horizon: Your Perfect Pair Awaits",
            "company_registration_number": "32352352352352",
            "product_link": "https://example.com/product/1",
            "country_of_registration": "Ro",
            "countries_approved_for_product_sales": "[\"IT\",\"EE\"]",
            "date_approved": "2024-02-12 21:23:22",
            "product_unique_id": "m0dsryqm6gvkz",
            "validator_id": 6,
            "id": "86a5e4f1-ea02-49cc-90ee-b453a2e52411",
            "type": 1,
            "created_at": "2024-08-28 11:53:24",
            "updated_at": "2024-08-28 11:53:24",
            "date_started": "2024-08-28 11:53:24",
            "product_link_domain": "example.com",
            "status": 1
        }
    },
    "errors": [],
    "ok": true
}

Statistics Campaign:

Description

This request retrieves full statistics about the campaign by its unique identifier.

Method: POST

Request Parameters:

product_unique_id (string)
The unique identifier of the product.

Request example:

use GuzzleHttp\Client;

$apiKey = "your_api_key";
$url = "https://prod.a.bitads.ai/api/statistics-campaign";
$data = [
    "product_unique_id" => "",
];

$client = new Client();
$response = $client->request("POST", $url, [
    "headers" => [
        "Accept" => "application/json",
        "API-KEY" => $apiKey
    ],
    "json" => $data,
]);

$body = $response->getBody();
$content = $body->getContents();

$data = json_decode($content, true);
import requests

apiKey = "your_api_key"
url = f"https://prod.a.bitads.ai/api/statistics-campaign"

data = {
    "product_unique_id" : "",
}

headers = {
    "Accept": "application/json",
    "API-KEY" : apiKey
}

response = requests.post(url, json=data, headers=headers)
data = response.json()

print(data)
const axios = require('axios');

const apiKey = "your_api_key";
const url = `https://prod.a.bitads.ai/api/statistics-campaign`;

const data = {
    "product_unique_id" : "",
};

axios.post(url, data, {
    headers: {
        'Accept': 'application/json',
        'API-KEY' : apiKey
    }
})
.then(response => {
    const responseData = response.data;
    console.log(responseData);
})
.catch(error => {
    console.error('Error:', error);
});

Response example:

{
    "statusCode": 200,
    "data": [
        {
            "sale_panding": 5,
            "sales": 20,
            "refund": 3,
            "amount_sale": 0,
            "amount_refund": 4524.209999999999,
            "amount_pending": 4900.21,
            "product_unique_id": "xxxxxxxxxxxxx",
            "device_desktop": 10,
            "device_mobile": 0,
            "referers": "{}",
            "date": "2024-08-21",
            "visits": 10,
            "unique": 8,
            "country_codes": "{\"USD\":1}"
        },
        {
            "sale_panding": 0,
            "sales": 0,
            "refund": 0,
            "amount_sale": 0,
            "amount_refund": 0,
            "amount_pending": 0,
            "product_unique_id": "xxxxxxxxxxxxx",
            "device_desktop": 1,
            "device_mobile": 0,
            "referers": "{}",
            "date": "2024-08-21",
            "visits": 1,
            "unique": 1,
            "country_codes": "{\"USD\":1}"
        }
    ],
    "errors": [],
    "ok": false
}
                        

Transactions Campaign:

Description

This query retrieves full information about the campaign's transactions by its unique ID.

Method: POST

Request Parameters:

product_unique_id (string)
The unique identifier of the product.

Request example:

use GuzzleHttp\Client;

$apiKey = "your_api_key";
$url = "https://prod.a.bitads.ai/api/transactions-campaign";
$data = [
    "product_unique_id" => "",
];

$client = new Client();
$response = $client->request("POST", $url, [
    "headers" => [
        "Accept" => "application/json",
        "API-KEY" => $apiKey
    ],
    "json" => $data,
]);

$body = $response->getBody();
$content = $body->getContents();

$data = json_decode($content, true);
import requests

apiKey = "your_api_key"
url = f"https://prod.a.bitads.ai/api/transactions-campaign"

data = {
    "product_unique_id" : "",
}

headers = {
    "Accept": "application/json",
    "API-KEY" : apiKey
}

response = requests.post(url, json=data, headers=headers)
data = response.json()

print(data)
const axios = require('axios');

const apiKey = "your_api_key";
const url = `https://prod.a.bitads.ai/api/transactions-campaign`;

const data = {
    "product_unique_id" : "",
};

axios.post(url, data, {
    headers: {
        'Accept': 'application/json',
        'API-KEY' : apiKey
    }
})
.then(response => {
    const responseData = response.data;
    console.log(responseData);
})
.catch(error => {
    console.error('Error:', error);
});

Response example:

{
    "statusCode": 200,
    "data": [
        {
            "created_at": "2024-08-22T09:39:18.161485",
            "updated_at": "2024-08-22T09:40:12.037023",
            "items": [
                {
                    "name": "Nicholson, Jennings and Robertson",
                    "price": "449.75",
                    "quantity": 3,
                    "discount": "16.91",
                    "gift_card": false,
                    "currency": "AED"
                },
                {
                    "name": "Stewart-Torres",
                    "price": "413.15",
                    "quantity": 3,
                    "discount": "31.66",
                    "gift_card": true,
                    "currency": "CUC"
                },
                {
                    "name": "Williams-Thompson",
                    "price": "315.16",
                    "quantity": 4,
                    "discount": "19.59",
                    "gift_card": true,
                    "currency": "BIF"
                }
            ],
            "transaction_amount": 117.806,
            "transaction_type": "credit",
            "order_amount": 1178.06,
            "transaction_id": "80b1719a-676b-45d2-bea7-9ec67804d7e9"
        },
        {
            "created_at": "2024-08-22T09:36:18.445570",
            "updated_at": "2024-08-22T09:40:12.037025",
            "items": [
                {
                    "name": "Silva, Stark and Alexander",
                    "price": "336.07",
                    "quantity": 1,
                    "discount": "3.62",
                    "gift_card": false,
                    "currency": "MUR"
                }
            ],
            "transaction_amount": 107.39500000000001,
            "transaction_type": "debit",
            "order_amount": 1073.95,
            "transaction_id": "63c3be1f-466b-4696-aad2-9f2174384a7a"
        },
        {
            "created_at": "2024-08-22T09:35:46.324537",
            "updated_at": "2024-08-22T09:40:12.036109",
            "items": [
                {
                    "name": "Davis-Moore",
                    "price": "42.95",
                    "quantity": 2,
                    "discount": "34.48",
                    "gift_card": true,
                    "currency": "BBD"
                },
                {
                    "name": "Mata, Sullivan and Duncan",
                    "price": "353.33",
                    "quantity": 4,
                    "discount": "25.87",
                    "gift_card": false,
                    "currency": "XCD"
                }
            ],
            "transaction_amount": 39.628,
            "transaction_type": "credit",
            "order_amount": 396.28,
            "transaction_id": "b3d462b3-966c-4c0a-8a1c-a8c16cd24df2"
        },
        {
            "created_at": "2024-08-22T09:36:51.372462",
            "updated_at": "2024-08-22T09:40:12.036106",
            "items": [
                {
                    "name": "Harrison-Lambert",
                    "price": "121.53",
                    "quantity": 1,
                    "discount": "7.73",
                    "gift_card": false,
                    "currency": "RUB"
                }
            ],
            "transaction_amount": 230.61599999999999,
            "transaction_type": "debit",
            "order_amount": 2306.16,
            "transaction_id": "e4eee5aa-51b6-4699-a6de-242b8d119c57"
        }
    ],
    "errors": [],
    "ok": false
}
                    

Reactivation Campaign:

Description

This request is used to reactivate a campaign that belongs to a campaign that has already concluded.

Method: POST

Request Parameters:

product_unique_id (string)
The unique identifier of the product.

Request example:

use GuzzleHttp\Client;

$apiKey = "your_api_key";
$url = "https://prod.a.bitads.ai/api/reactivation-campaign";
$data = [
    "product_unique_id" => "",
];

$client = new Client();
$response = $client->request("POST", $url, [
    "headers" => [
        "Accept" => "application/json",
        "API-KEY" => $apiKey
    ],
    "json" => $data,
]);

$body = $response->getBody();
$content = $body->getContents();

$data = json_decode($content, true);
import requests

apiKey = "your_api_key"
url = f"https://prod.a.bitads.ai/api/reactivation-campaign"

data = {
    "product_unique_id" : "",
}

headers = {
    "Accept": "application/json",
    "API-KEY" : apiKey
}

response = requests.post(url, json=data, headers=headers)
data = response.json()

print(data)
const axios = require('axios');

const apiKey = "your_api_key";
const url = `https://prod.a.bitads.ai/api/reactivation-campaign`;

const data = {
    "product_unique_id" : "",
};

axios.post(url, data, {
    headers: {
        'Accept': 'application/json',
        'API-KEY' : apiKey
    }
})
.then(response => {
    const responseData = response.data;
    console.log(responseData);
})
.catch(error => {
    console.error('Error:', error);
});

Response example:

{
    "statusCode": 200,
    "data": [],
    "errors": [],
    "ok": true
}

Stop Campaign:

Description

This request is used to stop a campaign that was active

Method: POST

Request Parameters:

product_unique_id (string)
The unique identifier of the product.
status (integer)
This parameter indicates who stopped this campaign (13 - automatically, 15 - admin, 16 - client)

Request example:

use GuzzleHttp\Client;

$apiKey = "your_api_key";
$url = "https://prod.a.bitads.ai/api/stop-campaign";
$data = [
    "product_unique_id" => "",
    "status" => "13"
];

$client = new Client();
$response = $client->request("POST", $url, [
    "headers" => [
        "Accept" => "application/json",
        "API-KEY" => $apiKey
    ],
    "json" => $data,
]);

$body = $response->getBody();
$content = $body->getContents();

$data = json_decode($content, true);
import requests

apiKey = "your_api_key"
url = f"https://prod.a.bitads.ai/api/stop-campaign"

data = {
    "product_unique_id" : "",
    "status" : 13
}

headers = {
    "Accept": "application/json",
    "API-KEY" : apiKey
}

response = requests.post(url, json=data, headers=headers)
data = response.json()

print(data)
const axios = require('axios');

const apiKey = "your_api_key";
const url = `https://prod.a.bitads.ai/api/stop-campaign`;

const data = {
    "product_unique_id" : "",
    "status" : 13
};

axios.post(url, data, {
    headers: {
        'Accept': 'application/json',
        'API-KEY' : apiKey
    }
})
.then(response => {
    const responseData = response.data;
    console.log(responseData);
})
.catch(error => {
    console.error('Error:', error);
});

Response example:

{
    "statusCode": 200,
    "data": [],
    "errors": [],
    "ok": true
}