API Documentation

Bayilerimiz için hazırlanan API entegrasyon rehberi. İsteklerinizi POST ve GET metodları ile iletebilirsiniz.

POST GET

Service List

ParametersDescription
keyYour API Key
actionservices

Successful Response

[
    {
        "service": 1,
        "name": "Instagram Takipçi",
        "type": "Default",
        "category": "Instagram",
        "rate": "12.50",
        "min": 100,
        "max": 10000,
        "refill": true,
        "cancel": true
    }
]
POST GET

Add Order

ParametersDescription
keyYour API Key
actionadd
serviceService ID
linkLink
quantityQuantity
runsRuns (Optional)
intervalInterval (Minutes - Optional)

Successful Response

{ "order": 23501 }
POST

Bulk Add Order

Used to create multiple orders at once. Maximum 100 orders can be sent.

ParametersDescription
keyYour API Key
actionadd_bulk
ordersJSON array of orders (max 100 orders). Her sipariş için: service, link, quantity

Example Request (JSON Body)

POST /api/v2
Content-Type: application/json

{
    "key": "your_api_key",
    "action": "add_bulk",
    "orders": [
        {
            "service": 1,
            "link": "https://instagram.com/test1",
            "quantity": 100
        },
        {
            "service": 2,
            "link": "https://instagram.com/test2",
            "quantity": 200
        }
    ]
}

Example Request (Form Data)

POST /api/v2
Content-Type: application/x-www-form-urlencoded

key=your_api_key&action=add_bulk&orders=[{"service":1,"link":"https://instagram.com/test1","quantity":100}]

Successful Response

{
    "0": { "order": 23501 },
    "1": { "order": 23502 }
}

Partial Success Response (Some orders failed)

{
    "0": { "error": "Order 1: Service not found" },
    "1": { "order": 23502 },
    "2": { "error": "Order 3: Quantity must be at least 100" }
}

Error Response (Insufficient Balance)

{ "error": "Insufficient balance. Required: 15.500000, Available: 10.000000" }

Note Toplu sipariş oluşturma işlemi atomik değildir. Bazı siparişler başarılı olurken bazıları başarısız olabilir. Her sipariş için ayrı yanıt döner.

POST GET

Order Status

ParametersDescription
keyYour API Key
actionstatus
orderOrder ID

Successful Response

{
    "charge": "0.27819",
    "start_count": "3572",
    "status": "Partial",
    "remains": "157",
    "currency": "TRY"
}
POST GET

Multiple Order Status

ParametersDescription
keyYour API Key
actionstatus
ordersOrder IDs (Comma-separated, max 100)

Successful Response

{
    "1": {
        "charge": "0.27819",
        "start_count": "3572",
        "status": "Partial",
        "remains": "157",
        "currency": "TRY"
    },
    "10": {
        "error": "Incorrect order ID"
    }
}
POST GET

Create Refill

Creates a refill request for a completed or partially completed order. Order status must be "Completed" or "Partial".

ParametersDescription
keyAPI Anahtarınız (zorunlu)
actionrefill (zorunlu)
orderOrder ID (required)

Example Request (GET)

GET /api/v2?key=your_api_key&action=refill&order=12345

Example Request (POST)

POST /api/v2
Content-Type: application/x-www-form-urlencoded

key=your_api_key&action=refill&order=12345

# veya

POST /api
Content-Type: application/x-www-form-urlencoded

key=your_api_key&action=refill&order=12345

Successful Response

{ "refill": "23", "status": "completed" }

Not: Refill başarıyla oluşturulduğunda "completed", reddedildiğinde "rejected" döner.

Error Responses

// Order not found
{ "refill": null, "status": "rejected" }

// Unauthorized
{ "refill": null, "status": "rejected" }

// Order status is not suitable (Pending, Processing, Cancelled)
{ "refill": null, "status": "rejected" }

// Service doesn't support refill
{ "refill": null, "status": "rejected" }

Note Aynı endpoint formatı hem /api/v2 hem de /api için geçerlidir.

PHP Example Code

api_key = 'your_api_key';

// Create refill for a single order
$result = $api->refill(12345);
if (isset($result->refill)) {
    echo "Refill ID: " . $result->refill;
} else {
    echo Error . $result->error;
}
?>

cURL Example Code

curl -X POST "https://roketbayim.com/api/v2" \
  -d "key=your_api_key" \
  -d "action=refill" \
  -d "order=12345"
POST GET

Create Multiple Refill

Creates refill requests for multiple orders at once. Returns a separate refill ID for each order.

ParametersDescription
keyYour API Key (required)
actionrefill (required)
ordersOrder IDs (Comma-separated, e.g.: "12345,12346,12347")

Example Request (GET)

GET /api/v2?key=your_api_key&action=refill&orders=12345,12346,12347
GET /api?key=your_api_key&action=refill&orders=12345,12346,12347

Example Request (POST)

POST /api/v2
Content-Type: application/x-www-form-urlencoded

key=your_api_key&action=refill&orders=12345,12346,12347

Successful Response

[
    { "refill": "1", "status": "completed" },
    { "refill": "2", "status": "completed" },
    { "refill": "3", "status": "completed" }
]

Partial Success Response (Some orders failed)

[
    { "refill"1", "status": "success" },
    { "refill": null, "status": "rejected" },
    { "refill": null, "status": "rejected" }
]

PHP Example Code

api_key = 'your_api_key';

// Create refill for multiple orders
$orderIds = [12345, 12346, 12347];
$results = $api->multiRefill($orderIds);

foreach ($results as $result) {
    if (isset($result['refill']) && is_numeric($result['refill'])) {
        echo "Order {$result['order']}: Refill ID = {$result['refill']}\n";
    } else {
        echo "Order {$result['order']}: Error - " . $result['refill']['error'] . "\n";
    }
}
?>

cURL Example Code

curl -X POST "https://roketbayim.com/api/v2" \
  -d "key=your_api_key" \
  -d "action=refill" \
  -d "orders=12345,12346,12347"
POST GET

Refill Status

Queries the status of refill requests you created. You can query for a single refill or multiple refills.

ParametersDescription
keyYour API Key (required)
actionrefill_status (required)
refillRefill ID (For single query, e.g.: "1")
refillsRefill IDs (For multiple queries, comma-separated, e.g.: "1,2,3")

Note refill veya refills parametrelerinden birini kullanmalısınız. İkisini birlikte kullanırsanız refills önceliklidir.

Single Refill Status - Example Request (GET)

GET /api/v2?key=your_api_key&action=refill_status&refill=1
GET /api?key=your_api_key&action=refill_status&refill=1

Single Refill Status - Example Request (POST)

POST /api/v2
Content-Type: application/x-www-form-urlencoded

key=your_api_key&action=refill_status&refill=1

# veya

POST /api
Content-Type: application/x-www-form-urlencoded

key=your_api_key&action=refill_status&refill=1

Single Refill Status - Successful Response

{ "refill": "23", "status": "completed" }

Single Refill Status - Possible Status Values

  • completed - Completed
  • pending - Pending
  • rejected - Rejected

Multiple Refill Status - Example Request (GET)

GET /api/v2?key=your_api_key&action=refill_status&refills=1,2,3
GET /api?key=your_api_key&action=refill_status&refills=1,2,3

Multiple Refill Status - Example Request (POST)

POST /api/v2
Content-Type: application/x-www-form-urlencoded

key=your_api_key&action=refill_status&refills=1,2,3

# veya

POST /api
Content-Type: application/x-www-form-urlencoded

key=your_api_key&action=refill_status&refills=1,2,3

Multiple Refill Status - Successful Response

[
    { "refill": "1", "status": "completed" },
    { "refill": "2", "status": "pending" },
    { "refill": "3", "status": "rejected" }
]

Error Responses

// Refill not found (Single)
{ "error": "Refill not found" }

// Refill not found (Multiple)
[
    { "refill": "1", "status": "completed" },
    { "refill": "2", "error": "Refill not found" }
]

// Unauthorized
{ "error": "Unauthorized" }

// Invalid refill ID
{ "error": "Invalid refill ID" }

PHP Example Code

api_key = 'your_api_key';

// Query single refill status
$result = $api->refillStatus(1);
if (isset($result->status)) {
    echo Refill Status: . $result->status;
} else {
    echo Error . $result->error;
}

// Query multiple refill status
$refillIds = [1, 2, 3];
$results = $api->multiRefillStatus($refillIds);

foreach ($results as $result) {
    if (isset($result['status'])) {
        echo "Refill {$result['refill']}: {$result['status']}\n";
    } else {
        echo "Refill {$result['refill']}: Error - " . $result['error'] . "\n";
    }
}
?>

cURL Example Code

# Single refill status
curl -X GET "https://roketbayim.com/api/v2?key=your_api_key&action=refill_status&refill=1"

# Multiple refill status
curl -X POST "https://roketbayim.com/api/v2" \
  -d "key=your_api_key" \
  -d "action=refill_status" \
  -d "refills=1,2,3"

JavaScript (Fetch API) Example Code

// Single refill status
async function getRefillStatus(refillId) {
    const response = await fetch(
        `https://roketbayim.com/api/v2?key=your_api_key&action=refill_status&refill=${refillId}`
    );
    const data = await response.json();
    return data;
}

// Multiple refill status
async function getMultipleRefillStatus(refillIds) {
    const formData = new FormData();
    formData.append('key', 'your_api_key');
    formData.append('action', 'refill_status');
    formData.append('refills', refillIds.join(','));
    
    const response = await fetch('https://roketbayim.com/api/v2', {
        method: 'POST',
        body: formData
    });
    const data = await response.json();
    return data;
}

// Usage
getRefillStatus(1).then(result => {
    console.log(Refill Status:, result.status);
});

getMultipleRefillStatus([1, 2, 3]).then(results => {
    results.forEach(result => {
        console.log(`Refill ${result.refill}: ${result.status}`);
    });
});
POST GET

Cancel Orders

ParametersDescription
keyYour API Key
actioncancel
ordersOrder IDs (Comma-separated)

Successful Response

[
    { "order": 9, "cancel": { "error": "Incorrect order ID" } },
    { "order": 2, "cancel": 1 }
]
POST GET

Balance Query

ParametersDescription
keyYour API Key
actionbalance

Successful Response

{ "balance": "100.84", "currency": "USD" }

PHP Example Code

You can quickly connect to the API using this class.

 $this->api_key, 'action' => 'add'], $data);
        return json_decode((string)$this->connect($post));
    }

    public function bulkOrder($orders) {
        $post = [
            'key' => $this->api_key,
            'action' => 'add_bulk',
            'orders' => json_encode($orders)
        ];
        return json_decode((string)$this->connect($post), true);
    }

    public function status($order_id) {
        return json_decode($this->connect([
            'key' => $this->api_key,
            'action' => 'status',
            'order' => $order_id
        ]));
    }

    public function multiStatus($order_ids) {
        return json_decode($this->connect([
            'key' => $this->api_key,
            'action' => 'status',
            'orders' => implode(",", (array)$order_ids)
        ]));
    }

    public function services() {
        return json_decode($this->connect([
            'key' => $this->api_key,
            'action' => 'services',
        ]));
    }

    public function refill(int $orderId) {
        return json_decode($this->connect([
            'key' => $this->api_key,
            'action' => 'refill',
            'order' => $orderId,
        ]));
    }

    public function multiRefill(array $orderIds) {
        return json_decode($this->connect([
            'key' => $this->api_key,
            'action' => 'refill',
            'orders' => implode(',', $orderIds),
        ]), true);
    }

    public function refillStatus(int $refillId) {
         return json_decode($this->connect([
            'key' => $this->api_key,
            'action' => 'refill_status',
            'refill' => $refillId,
        ]));
    }

    public function multiRefillStatus(array $refillIds) {
         return json_decode($this->connect([
            'key' => $this->api_key,
            'action' => 'refill_status',
            'refills' => implode(',', $refillIds),
        ]), true);
    }

    public function cancel(array $orderIds) {
        return json_decode($this->connect([
            'key' => $this->api_key,
            'action' => 'cancel',
            'orders' => implode(',', $orderIds),
        ]), true);
    }

    public function balance() {
        return json_decode($this->connect([
            'key' => $this->api_key,
            'action' => 'balance',
        ]));
    }

    private function connect($post) {
        $_post = [];
        if (is_array($post)) {
            foreach ($post as $name => $value) {
                $_post[] = $name . '=' . urlencode($value);
            }
        }
        $ch = curl_init($this->api_url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
        if (is_array($post)) {
            curl_setopt($ch, CURLOPT_POSTFIELDS, join('&', $_post));
        }
        curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
        $result = curl_exec($ch);
        if (curl_errno($ch) != 0 && empty($result)) {
            $result = false;
        }
        curl_close($ch);
        return $result;
    }
}
?>
Yeni Services Siparişler Bakiye API Destek