APIAPIs and integrationsShardX APIGeneral

General

General operations (profile, orders, reference data)

Create and pay for an order

POSThttps://user-api.shardx.com/user/api/orders/purchase

Purchase by product name, location, and cycle. For Datacenter/ISP, location is required. For Standart Residential Proxy, location is not required.

Send an Idempotency-Key header to make retries safe: without it, a retry after a timeout may charge the wallet and issue proxies twice.

Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Header parameters
Idempotency-Keystring· max length: 128· pattern: ^[A-Za-z0-9_.:-]+$optional

Optional. A unique identifier of the logical operation (1-128 characters of [A-Za-z0-9_.:-]), for example a UUID. Send the SAME key when retrying a request whose outcome you do not know (timeout, dropped connection): a request that already completed is NOT executed again, its original response is returned.

Accepted on EVERY mutating endpoint (POST/PUT/PATCH/DELETE) of this API: purchase, renewal, bandwidth top-up, add-ons and any endpoint added later; it is listed explicitly on the money-moving ones.

All endpoints except sub-user operations: the stored response is replayed with the `Idempotency-Replayed: true` header for 7 days. `409`: a request with this key is still running (`idempotency_state: in_progress`) or never completed and its outcome must be verified manually (`idempotency_state: unknown`; it is never re-executed). `422`: the key was already used with a different request. A `429` from the rate limiter does not consume the key, so retry with the same one. Sub-user endpoints (create, data/add, data/subtract): the key is forwarded to the proxy provider, and a retry within 24 hours cannot change the quota twice. 409: the operation is still in progress or the key was used with a different payload.

Without the header, requests run as usual, without these guarantees.

Body
application/json
Responses
200Successapplication/json
successbooleanrequired
messagestringrequired
order_idintegerrequired
400Validation/balance error/insufficient stockapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Unauthorizedapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

403This billing cycle is not available for your accountapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

409A request with this Idempotency-Key is still running (idempotency_state: in_progress), or it never completed and its outcome must be checked manually (idempotency_state: unknown)application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

422The Idempotency-Key was already used with a different requestapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

429More than one request per 3 seconds from the account. The body is plain text (Too many requests, retry in <N>s), and the x-ratelimit-after header has the wait in seconds. The Idempotency-Key is not consumed: retry with the same one.text/plain
500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

502Stock check failed, or the proxies could not be issued after payment; then order_id and refunded tell whether the payment was returnedapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

POST/user/api/orders/purchase
POST /user/api/orders/purchase HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Idempotency-Key: text
Content-Type: application/json
Accept: */*

{
  "product": "Datacenter Proxy",
  "location": "text",
  "cycle": "text",
  "quantity": 1,
  "promo_code": "text",
  "auto_renewal": false,
  "addons": [
    {
      "addon_key": "p0f_slots",
      "qty": 1
    }
  ]
}
curl -X POST 'https://user-api.shardx.com/user/api/orders/purchase' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  -H 'Idempotency-Key: text' \
  -H 'Content-Type: application/json' \
  -d '{"product":"Datacenter Proxy","location":"text","cycle":"text","quantity":1,"promo_code":"text","auto_renewal":false,"addons":[{"addon_key":"p0f_slots","qty":1}]}'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/orders/purchase"
headers = {
    "Authorization": f"Bearer {token}",
    "Idempotency-Key": "text",
}
payload = {
    "product": "Datacenter Proxy",
    "location": "text",
    "cycle": "text",
    "quantity": 1,
    "promo_code": "text",
    "auto_renewal": False,
    "addons": [
        {
            "addon_key": "p0f_slots",
            "qty": 1,
        },
    ],
}

response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/orders/purchase";
const payload = {
  "product": "Datacenter Proxy",
  "location": "text",
  "cycle": "text",
  "quantity": 1,
  "promo_code": "text",
  "auto_renewal": false,
  "addons": [
    {
      "addon_key": "p0f_slots",
      "qty": 1
    }
  ]
};

const response = await fetch(url, {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${token}`,
    "Idempotency-Key": "text",
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload),
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"bytes"
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/orders/purchase"
	body := bytes.NewBufferString(`{
  "product": "Datacenter Proxy",
  "location": "text",
  "cycle": "text",
  "quantity": 1,
  "promo_code": "text",
  "auto_renewal": false,
  "addons": [
    {
      "addon_key": "p0f_slots",
      "qty": 1
    }
  ]
}`)

	req, err := http.NewRequest("POST", url, body)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)
	req.Header.Set("Idempotency-Key", "text")
	req.Header.Set("Content-Type", "application/json")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }, serde_json = "1"

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .post("https://user-api.shardx.com/user/api/orders/purchase")
        .header("Authorization", format!("Bearer {token}"))
        .header("Idempotency-Key", "text")
        .json(&serde_json::json!({
          "product": "Datacenter Proxy",
          "location": "text",
          "cycle": "text",
          "quantity": 1,
          "promo_code": "text",
          "auto_renewal": false,
          "addons": [
            {
              "addon_key": "p0f_slots",
              "qty": 1
            }
          ]
        }))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Post, "https://user-api.shardx.com/user/api/orders/purchase");
        request.Headers.Add("Idempotency-Key", "text");
        request.Content = new StringContent("""
            {
              "product": "Datacenter Proxy",
              "location": "text",
              "cycle": "text",
              "quantity": 1,
              "promo_code": "text",
              "auto_renewal": false,
              "addons": [
                {
                  "addon_key": "p0f_slots",
                  "qty": 1
                }
              ]
            }
            """, Encoding.UTF8, "application/json");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
    headers = curl_slist_append(headers, "Idempotency-Key: text");
    headers = curl_slist_append(headers, "Content-Type: application/json");

    const std::string body = R"json({
  "product": "Datacenter Proxy",
  "location": "text",
  "cycle": "text",
  "quantity": 1,
  "promo_code": "text",
  "auto_renewal": false,
  "addons": [
    {
      "addon_key": "p0f_slots",
      "qty": 1
    }
  ]
})json";

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/orders/purchase");
    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
    curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(body.size()));
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "success": true,
  "message": "text",
  "order_id": 1
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
"Too many requests, retry in 2s"
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Calculate order cost

GEThttps://user-api.shardx.com/user/api/orders/calculate

Calculates price by product name, cycle name and quantity. Uses the same validation rules as purchase (allowed billing cycles, promo rules).

Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Query parameters
productstringrequired
locationstring· nullableoptional
cyclestring· nullableoptional
quantityinteger· nullableoptional
promo_codestring· nullableoptional
addons_jsonstring· nullableoptional

URL-encoded JSON array of add-ons, e.g. [{"addon_key":"p0f_slots","qty":5}]

Responses
200Successapplication/json
original_priceintegeroptional
final_priceintegeroptional
discount_percentintegeroptional
addons_priceintegeroptional

Add-ons total, minor units

total_with_addonsintegeroptional

final_price + addons_price

400Validation errorapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Unauthorizedapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

403This billing cycle is not available for your accountapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

GET/user/api/orders/calculate?product=text
GET /user/api/orders/calculate?product=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.shardx.com/user/api/orders/calculate?product=text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/orders/calculate"
params = {
    "product": "text",
}
headers = {
    "Authorization": f"Bearer {token}",
}

response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/orders/calculate?product=text";

const response = await fetch(url, {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/orders/calculate?product=text"

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .get("https://user-api.shardx.com/user/api/orders/calculate?product=text")
        .header("Authorization", format!("Bearer {token}"))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/orders/calculate?product=text");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/orders/calculate?product=text");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "original_price": 1,
  "final_price": 1,
  "discount_percent": 1,
  "addons_price": 1,
  "total_with_addons": 1
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Change the order billing cycle

POSThttps://user-api.shardx.com/user/api/orders/change-billing-cycle/{order_id}

Changes the billing cycle by cycle name. Only for Datacenter & ISP proxies. If the promo code is not available for the selected cycle, it will be automatically reset.

Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
order_idintegerrequired
Body
application/json
cyclestringrequired
Responses
200Successapplication/json
successbooleanoptional
messagestringoptional
order_idintegeroptional
original_priceintegeroptional
final_priceintegeroptional
discount_percentintegeroptional
400Invalid product or cycleapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Unauthorizedapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

403Cycle is not available for this userapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

POST/user/api/orders/change-billing-cycle/1
POST /user/api/orders/change-billing-cycle/1 HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*

{
  "cycle": "text"
}
curl -X POST 'https://user-api.shardx.com/user/api/orders/change-billing-cycle/1' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"cycle":"text"}'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/orders/change-billing-cycle/1"
headers = {
    "Authorization": f"Bearer {token}",
}
payload = {
    "cycle": "text",
}

response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/orders/change-billing-cycle/1";
const payload = {
  "cycle": "text"
};

const response = await fetch(url, {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${token}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload),
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"bytes"
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/orders/change-billing-cycle/1"
	body := bytes.NewBufferString(`{
  "cycle": "text"
}`)

	req, err := http.NewRequest("POST", url, body)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)
	req.Header.Set("Content-Type", "application/json")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }, serde_json = "1"

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .post("https://user-api.shardx.com/user/api/orders/change-billing-cycle/1")
        .header("Authorization", format!("Bearer {token}"))
        .json(&serde_json::json!({
          "cycle": "text"
        }))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Post, "https://user-api.shardx.com/user/api/orders/change-billing-cycle/1");
        request.Content = new StringContent("""
            {
              "cycle": "text"
            }
            """, Encoding.UTF8, "application/json");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
    headers = curl_slist_append(headers, "Content-Type: application/json");

    const std::string body = R"json({
  "cycle": "text"
})json";

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/orders/change-billing-cycle/1");
    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
    curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(body.size()));
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "success": true,
  "message": "text",
  "order_id": 1,
  "original_price": 1,
  "final_price": 1,
  "discount_percent": 1
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Change order auto-renewal

POSThttps://user-api.shardx.com/user/api/orders/edit-auto-renewal/{order_id}

Enable/disable auto-renewal. Only for Datacenter & ISP proxies.

Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
order_idintegerrequired
Query parameters
auto_renewalbooleanrequired
Responses
200Successapplication/json
successbooleanoptional
messagestringoptional
400Invalid product for this operationapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Unauthorizedapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

POST/user/api/orders/edit-auto-renewal/1?auto_renewal=true
POST /user/api/orders/edit-auto-renewal/1?auto_renewal=true HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X POST 'https://user-api.shardx.com/user/api/orders/edit-auto-renewal/1?auto_renewal=true' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/orders/edit-auto-renewal/1"
params = {
    "auto_renewal": "true",
}
headers = {
    "Authorization": f"Bearer {token}",
}

response = requests.post(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/orders/edit-auto-renewal/1?auto_renewal=true";

const response = await fetch(url, {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/orders/edit-auto-renewal/1?auto_renewal=true"

	req, err := http.NewRequest("POST", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .post("https://user-api.shardx.com/user/api/orders/edit-auto-renewal/1?auto_renewal=true")
        .header("Authorization", format!("Bearer {token}"))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Post, "https://user-api.shardx.com/user/api/orders/edit-auto-renewal/1?auto_renewal=true");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/orders/edit-auto-renewal/1?auto_renewal=true");
    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "success": true,
  "message": "text"
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Get products and their cycles

GEThttps://user-api.shardx.com/user/api/proxies/products

Returns API products with the names of available cycles.

Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Responses
200Product listapplication/json
successbooleanrequired
productsobject · ProductWithCycles[]required
Show propertiesHide properties
namestringrequired
descriptionstring· nullableoptional
locationstring· nullableoptional
cyclesstring[]required
401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

GET/user/api/proxies/products
GET /user/api/proxies/products HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.shardx.com/user/api/proxies/products' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/proxies/products"
headers = {
    "Authorization": f"Bearer {token}",
}

response = requests.get(url, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/proxies/products";

const response = await fetch(url, {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/proxies/products"

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .get("https://user-api.shardx.com/user/api/proxies/products")
        .header("Authorization", format!("Bearer {token}"))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/proxies/products");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/products");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "success": true,
  "products": [
    {
      "name": "text",
      "description": "text",
      "location": "text",
      "cycles": [
        "text"
      ]
    }
  ]
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Get available proxy count

GEThttps://user-api.shardx.com/user/api/proxies/available-count

Returns the total available quantity for all products.

Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Responses
200Successapplication/json
countrystringrequired
productstringrequired
amountintegerrequired
401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

502The proxy provider failed or answered with an error (Upstream error: <status>)application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

GET/user/api/proxies/available-count
GET /user/api/proxies/available-count HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.shardx.com/user/api/proxies/available-count' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/proxies/available-count"
headers = {
    "Authorization": f"Bearer {token}",
}

response = requests.get(url, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/proxies/available-count";

const response = await fetch(url, {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/proxies/available-count"

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .get("https://user-api.shardx.com/user/api/proxies/available-count")
        .header("Authorization", format!("Bearer {token}"))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/proxies/available-count");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/proxies/available-count");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
[
  {
    "country": "text",
    "product": "text",
    "amount": 1
  }
]
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

User information

GEThttps://user-api.shardx.com/user/api/me
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Responses
200Profile dataapplication/json
emailstringrequired
active_ordersintegerrequired
wallet_balanceintegerrequired

in cents

401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

GET/user/api/me
GET /user/api/me HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.shardx.com/user/api/me' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/me"
headers = {
    "Authorization": f"Bearer {token}",
}

response = requests.get(url, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/me";

const response = await fetch(url, {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/me"

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .get("https://user-api.shardx.com/user/api/me")
        .header("Authorization", format!("Bearer {token}"))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/me");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/me");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "email": "text",
  "active_orders": 1,
  "wallet_balance": 1
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Order list

GEThttps://user-api.shardx.com/user/api/orders
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Query parameters
statusstringrequired

active | on-hold | cancelled | all

offsetinteger· min: 0optional

Result offset (default 0)

limitinteger· min: 1· max: 100optional

Page size (1..100, default 20)

Responses
200Order listapplication/json
successbooleanrequired
ordersobject[]required
Show propertiesHide properties
order_idintegerrequired
product_idintegerrequired
product_namestringrequired
cycle_idintegerrequired
cycle_namestringrequired
expires_atstring· nullableoptional

ISO8601 expiration time

auto_renewalboolean· nullableoptional
tagstring· nullableoptional
countintegeroptional

Number of orders in the current result set

prevstring· nullableoptional

Previous page URI

nextstring· nullableoptional

Next page URI

401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

GET/user/api/orders?status=text
GET /user/api/orders?status=text HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.shardx.com/user/api/orders?status=text' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/orders"
params = {
    "status": "text",
}
headers = {
    "Authorization": f"Bearer {token}",
}

response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/orders?status=text";

const response = await fetch(url, {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/orders?status=text"

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .get("https://user-api.shardx.com/user/api/orders?status=text")
        .header("Authorization", format!("Bearer {token}"))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/orders?status=text");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/orders?status=text");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "success": true,
  "orders": [
    {
      "order_id": 1,
      "product_id": 1,
      "product_name": "text",
      "cycle_id": 1,
      "cycle_name": "text",
      "expires_at": "text",
      "auto_renewal": true,
      "tag": "text"
    }
  ],
  "count": 1,
  "prev": "text",
  "next": "text"
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Get order information

GEThttps://user-api.shardx.com/user/api/orders/{id}
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
idintegerrequired
Responses
200Order informationapplication/json
successbooleanrequired
orderobjectrequired
Show propertiesHide properties
order_idintegeroptional
product_namestringoptional
cycle_namestringoptional
quantityintegeroptional
price_paidintegeroptional

Base subscription price in cents

addons_price_paidintegeroptional

Total add-on cost in cents

addonsobject · AddonLine[]optional

Add-on lines attached to this order

Show propertiesHide properties
addon_keystringoptional
catalog_idintegeroptional
qtyintegeroptional

Units active in the current period

price_per_unitintegeroptional

Unit price in cents at purchase time

pendingobject· nullableoptional

Change scheduled for the next renewal, or null

Show propertiesHide properties
actionstring · enumoptional
Possible values:canceldowngrade
next_qtyintegeroptional

Target quantity after downgrade

p0f_slots_availableintegeroptional

Active p0f signature slots (from add-ons)

p0f_slots_usedintegeroptional

Slots currently occupied by signed proxies

p0f_slots_nextintegeroptional

Slots that will be active after the next renewal (capped by renewal_quantity)

renewal_quantityintegeroptional

Proxies in the next period (less than quantity if some are marked with del-np)

renewal_priceintegeroptional

What the next renewal will charge, in cents (renewal_base_price + renewal_addons_price)

renewal_base_priceintegeroptional

Proxies part of the next renewal, in cents (proportional share of price_paid)

renewal_addons_priceintegeroptional

Add-ons part of the next renewal, in cents (pending changes applied)

statusstringoptional
created_atstring· nullableoptional
expires_atstring· nullableoptional
promo_codestring· nullableoptional
auto_renewalboolean· nullableoptional
tagstring· nullableoptional
401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

GET/user/api/orders/1
GET /user/api/orders/1 HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -X GET 'https://user-api.shardx.com/user/api/orders/1' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/orders/1"
headers = {
    "Authorization": f"Bearer {token}",
}

response = requests.get(url, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/orders/1";

const response = await fetch(url, {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${token}`,
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/orders/1"

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .get("https://user-api.shardx.com/user/api/orders/1")
        .header("Authorization", format!("Bearer {token}"))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.shardx.com/user/api/orders/1");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/orders/1");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "success": true,
  "order": {
    "order_id": 1,
    "product_name": "text",
    "cycle_name": "text",
    "quantity": 1,
    "price_paid": 1,
    "addons_price_paid": 1,
    "addons": [
      {
        "addon_key": "text",
        "catalog_id": 1,
        "qty": 1,
        "price_per_unit": 1,
        "pending": {
          "action": "cancel",
          "next_qty": 1
        }
      }
    ],
    "p0f_slots_available": 1,
    "p0f_slots_used": 1,
    "p0f_slots_next": 1,
    "renewal_quantity": 1,
    "renewal_price": 1,
    "renewal_base_price": 1,
    "renewal_addons_price": 1,
    "status": "text",
    "created_at": "text",
    "expires_at": "text",
    "promo_code": "text",
    "auto_renewal": true,
    "tag": "text"
  }
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Renew order

POSThttps://user-api.shardx.com/user/api/orders/{id}/renew

Renewal is available only when order status is on-hold. A repeated request for an order that is already renewed answers 200 with Order already renewed. Send an Idempotency-Key header to make retries safe (the wallet is charged).

Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
idintegerrequired
Header parameters
Idempotency-Keystring· max length: 128· pattern: ^[A-Za-z0-9_.:-]+$optional

Optional. A unique identifier of the logical operation (1-128 characters of [A-Za-z0-9_.:-]), for example a UUID. Send the SAME key when retrying a request whose outcome you do not know (timeout, dropped connection): a request that already completed is NOT executed again, its original response is returned.

Accepted on EVERY mutating endpoint (POST/PUT/PATCH/DELETE) of this API: purchase, renewal, bandwidth top-up, add-ons and any endpoint added later; it is listed explicitly on the money-moving ones.

All endpoints except sub-user operations: the stored response is replayed with the `Idempotency-Replayed: true` header for 7 days. `409`: a request with this key is still running (`idempotency_state: in_progress`) or never completed and its outcome must be verified manually (`idempotency_state: unknown`; it is never re-executed). `422`: the key was already used with a different request. A `429` from the rate limiter does not consume the key, so retry with the same one. Sub-user endpoints (create, data/add, data/subtract): the key is forwarded to the proxy provider, and a retry within 24 hours cannot change the quota twice. 409: the operation is still in progress or the key was used with a different payload.

Without the header, requests run as usual, without these guarantees.

Responses
200Successapplication/json
successbooleanrequired
messagestringrequired
400Insufficient balance/validationapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

409The order is already paid for the current period, it changed while renewing (retry), or a request with this Idempotency-Key is in progressapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

422The Idempotency-Key was already used with a different requestapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

POST/user/api/orders/1/renew
POST /user/api/orders/1/renew HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Idempotency-Key: text
Accept: */*
curl -X POST 'https://user-api.shardx.com/user/api/orders/1/renew' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  -H 'Idempotency-Key: text'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/orders/1/renew"
headers = {
    "Authorization": f"Bearer {token}",
    "Idempotency-Key": "text",
}

response = requests.post(url, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/orders/1/renew";

const response = await fetch(url, {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${token}`,
    "Idempotency-Key": "text",
  },
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/orders/1/renew"

	req, err := http.NewRequest("POST", url, nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)
	req.Header.Set("Idempotency-Key", "text")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .post("https://user-api.shardx.com/user/api/orders/1/renew")
        .header("Authorization", format!("Bearer {token}"))
        .header("Idempotency-Key", "text")
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Post, "https://user-api.shardx.com/user/api/orders/1/renew");
        request.Headers.Add("Idempotency-Key", "text");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
    headers = curl_slist_append(headers, "Idempotency-Key: text");

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/orders/1/renew");
    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "success": true,
  "message": "Order renewed successfully"
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Change order tag

POSThttps://user-api.shardx.com/user/api/orders/{id}/tag
Authorizations
bearerAuth
Authorizationstringrequired

Bearer authentication header of the form Bearer <token>.

Path parameters
idintegerrequired
Body
application/json
tagstringrequired
Responses
200Successapplication/json
successbooleanrequired
messagestringrequired
401Missing or invalid API key: Missing or invalid Authorization header, Invalid API key, API key mismatchapplication/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

500Internal error. The API also answers 500 when the order (or another record it needs) is not found or does not belong to your account; message names it, for example Order not found.application/json
successbooleanrequired
messagestringrequired
rejectedbooleanoptional

Sub-user operations: true when the provider rejected the operation and nothing changed

idempotency_statestring · enumoptional

Only in a 409 from the Idempotency-Key check

Possible values:in_progressunknown
order_idintegeroptional

Only in a 502 from purchase and add-bandwidth: the order that was paid for

refundedbooleanoptional

Only in a 502 from purchase and add-bandwidth: true means the payment was returned to the wallet, false means the refund is pending, contact support

POST/user/api/orders/1/tag
POST /user/api/orders/1/tag HTTP/1.1
Host: user-api.shardx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*

{
  "tag": "text"
}
curl -X POST 'https://user-api.shardx.com/user/api/orders/1/tag' \
  -H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"tag":"text"}'
import requests

# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"

url = "https://user-api.shardx.com/user/api/orders/1/tag"
headers = {
    "Authorization": f"Bearer {token}",
}
payload = {
    "tag": "text",
}

response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)
// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";

const url = "https://user-api.shardx.com/user/api/orders/1/tag";
const payload = {
  "tag": "text"
};

const response = await fetch(url, {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${token}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload),
});

console.log(response.status);
console.log(await response.text());
package main

import (
	"bytes"
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	// API token — see Authorizations above.
	token := "YOUR_SECRET_TOKEN"

	url := "https://user-api.shardx.com/user/api/orders/1/tag"
	body := bytes.NewBufferString(`{
  "tag": "text"
}`)

	req, err := http.NewRequest("POST", url, body)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+token)
	req.Header.Set("Content-Type", "application/json")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	out, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(out))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }, serde_json = "1"

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // API token — see Authorizations above.
    let token = "YOUR_SECRET_TOKEN";

    let client = reqwest::Client::new();
    let response = client
        .post("https://user-api.shardx.com/user/api/orders/1/tag")
        .header("Authorization", format!("Bearer {token}"))
        .json(&serde_json::json!({
          "tag": "text"
        }))
        .send()
        .await?;

    println!("{}", response.status());
    println!("{}", response.text().await?);
    Ok(())
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // API token — see Authorizations above.
        var token = "YOUR_SECRET_TOKEN";

        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

        var request = new HttpRequestMessage(HttpMethod.Post, "https://user-api.shardx.com/user/api/orders/1/tag");
        request.Content = new StringContent("""
            {
              "tag": "text"
            }
            """, Encoding.UTF8, "application/json");

        var response = await client.SendAsync(request);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>

#include <iostream>
#include <string>

static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
    static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
    return size * nmemb;
}

int main() {
    // API token — see Authorizations above.
    const std::string token = "YOUR_SECRET_TOKEN";

    curl_global_init(CURL_GLOBAL_DEFAULT);
    CURL *curl = curl_easy_init();
    if (!curl) {
        std::cerr << "curl_easy_init failed\n";
        curl_global_cleanup();
        return 1;
    }

    struct curl_slist *headers = nullptr;
    headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
    headers = curl_slist_append(headers, "Content-Type: application/json");

    const std::string body = R"json({
  "tag": "text"
})json";

    std::string response;
    curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.shardx.com/user/api/orders/1/tag");
    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
    curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(body.size()));
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

    const CURLcode rc = curl_easy_perform(curl);
    if (rc != CURLE_OK) {
        std::cerr << curl_easy_strerror(rc) << "\n";
    } else {
        long status = 0;
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
        std::cout << status << "\n" << response << "\n";
    }

    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    curl_global_cleanup();
    return rc == CURLE_OK ? 0 : 1;
}
{
  "success": true,
  "message": "Order tag updated"
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}
{
  "success": true,
  "message": "text",
  "rejected": true,
  "idempotency_state": "in_progress",
  "order_id": 1,
  "refunded": true
}

Last updated on

On this page