API Documentation

Connect your own site, bot or store through the API and let stock, pricing and delivery flow automatically. This page covers everything you need for an integration, from authentication to webhooks.

Last updated:

Overview

The Tedarik API is a REST API that speaks JSON. All requests go over HTTPS to this base URL:

https://tedarik.lol/api/v1
  • Request and response bodies are application/json, encoded as UTF-8.
  • Dates use ISO 8601 (2026-11-20T14:02:11Z).
  • Amounts are decimals in US dollars (currency: USD).

API access is available to reseller accounts. Create your key under Dashboard › API & reseller. Not a reseller yet? Apply on the wholesale page.

Authentication

Every request must carry your API key in the Authorization header:

curl https://tedarik.lol/api/v1/products \
  -H "Authorization: Bearer $TEDARIK_API_KEY"

There are two kinds of keys:

Key Prefix What it does
Live tedarik_live_ Creates real orders and charges your balance.
Test tedarik_test_ Delivers no real accounts and charges nothing. For trying out your integration.

The full key is only shown once, when it is created. Never put a key in browser code, a mobile app or a public repository; keep it on your own server in an environment variable. Revoke any key you think has leaked from the dashboard right away.

Products and stock

Returns the products on sale with current prices and stock levels.

GET /products
Parameter Type Description
category string Optional. game, social or other.
in_stock boolean Optional. When true, only products in stock are returned.
{
  "data": [
    {
      "sku": "BS-RND",
      "name": "Brawl Stars Random Account",
      "type": "random",
      "category": "game",
      "subcategory": "random",
      "price": 1.19,
      "tiers": [
        { "min": 1, "max": 9, "unit_price": 1.19 },
        { "min": 10, "max": 49, "unit_price": 1.07 },
        { "min": 50, "max": 199, "unit_price": 1.01 }
      ],
      "currency": "USD",
      "stock": 1240
    },
    {
      "sku": "BS-MAIL",
      "name": "Brawl Stars Full-Access Account",
      "type": "mail-change",
      "category": "game",
      "subcategory": "mail-degisen",
      "price": 4.49,
      "tiers": [
        { "min": 1, "max": 9, "unit_price": 4.49 },
        { "min": 10, "max": 49, "unit_price": 4.04 },
        { "min": 50, "max": 199, "unit_price": 3.82 }
      ],
      "currency": "USD",
      "stock": 86
    }
  ]
}

price is the list price (1 account). subcategory is the product’s subcategory (e.g. random, mail-degisen; null if none). tiers gives the unit price by quantity; some products have their own tier prices that differ from the general rates, so use tiers for calculations. Discounts are applied to the order automatically; 200+ accounts need a custom quote.

Products sold by value (e.g. Brawl Stars trophies): these come with a metric object: { "name": "Trophies", "step": 1000, "step_price": 0.18, "min_available": 1240, "max_available": 98400 }. Each account is priced by its value (5,120 trophies = 5 steps × step_price); price is the cheapest account currently in stock. When ordering, pick a range with min and max: { "sku": "BS-RND", "quantity": 3, "min": 5000, "max": 6000 }. The lowest-value accounts in the range are delivered; without a range you get the lowest in all stock. For other products metric is null.

Creating an order

Payment is taken from your balance and the accounts are delivered in the same response.

POST /orders
Field Type Description
sku string Required. Product code (GET /products).
quantity integer Required. Between 1 and 1000.
reference string Optional. Your own order number; echoed back in responses and webhooks.
curl -X POST https://tedarik.lol/api/v1/orders \
  -H "Authorization: Bearer $TEDARIK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c2a9e-1042" \
  -d '{ "sku": "BS-RND", "quantity": 50, "reference": "1042" }'
{
  "id": "ord_48213",
  "status": "delivered",
  "sku": "BS-RND",
  "quantity": 50,
  "unit_price": 1.01,
  "discount": 0.15,
  "total": 50.58,
  "currency": "USD",
  "reference": "1042",
  "created_at": "2026-11-20T14:02:11Z",
  "accounts": [
    { "login": "k•••••@outlook.com", "password": "••••••••" },
    { "login": "m•••••@gmail.com", "password": "••••••••" }
  ]
}
  • Wholesale discount: for orders of 10 accounts or more, the tier discount is reflected in unit_price and total; you don’t need to send anything extra.
  • Retries: if the connection drops, resend the same request with the same Idempotency-Key header. The order is not created twice; the original response is returned.
  • Statuses: delivered, review (accounts are being prepared; you’ll get a webhook when they’re ready) and refunded.

Retrieving an order

Fetch an order you created earlier, including the delivered accounts.

GET /orders/{id}

The response has the same shape as the order creation response, plus the order lines in an items field. Use GET /orders to list your orders; filter with the status (delivered, review, refunded) and limit (up to 100) parameters.

Webhooks

If you set a webhook URL in the dashboard, we send a POST request to it for these events:

Event When
order.delivered The accounts of an order in review have been delivered.
order.refunded An order has been partly or fully refunded.
stock.updated The stock level of a product you follow has changed.
{
  "id": "evt_90311",
  "type": "order.delivered",
  "created_at": "2026-11-20T14:05:40Z",
  "data": {
    "id": "ord_48176",
    "status": "delivered",
    "reference": "1038"
  }
}

Every notification carries an HMAC-SHA256 signature of the body, made with your webhook secret, in the X-Tedarik-Signature header. Verify it before processing the notification:

import crypto from 'node:crypto';

export function isValidSignature(rawBody, signature, secret) {
  const expected = crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
  return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
}

If your server doesn’t respond with a 2xx within 10 seconds, the notification is retried 3 more times: after 1, 5 and 30 minutes. The same event may arrive more than once; use the id field to skip duplicates.

Errors

Failed requests return a suitable HTTP status code and a body like this:

{
  "error": {
    "code": "out_of_stock",
    "message": "Not enough stock for BS-MAIL. Available: 12."
  }
}
Status Code Meaning
400 invalid_request A field is missing or invalid. message says which one.
401 unauthorized The key is missing, wrong or revoked.
402 insufficient_balance Your balance doesn’t cover the order.
404 not_found Product or order not found.
409 out_of_stock Not enough stock for the requested quantity.
429 rate_limited Rate limit exceeded.
500 server_error Something went wrong on our side; try again later.

Rate limits

Each key can send 120 requests per minute. Your remaining allowance is in the X-RateLimit-Limit and X-RateLimit-Remaining headers of every response. If you go over the limit you get a 429, and the Retry-After header tells you how many seconds to wait.

Test mode

Requests made with a test key (tedarik_test_) use the same URLs and return the same response shapes as live mode, with these differences:

  • Nothing is charged and no real accounts are delivered; the account details in responses are samples.
  • Orders with a quantity of 999 return an out_of_stock error, so you can test your error handling.
  • Webhooks are sent for test orders too. You can also trigger a single event with “Send test event” in the dashboard.

Support

Send integration questions to destek@example.com or through the contact page. Including the X-Request-Id header from the response in question helps us help you faster.