Bayon Store

🛒 Reseller API

Buy BayonStore products programmatically against your funded wallet — from any HTTP client, script, or bot.

📎 Looking for the AI model proxy (Cursor / Claude Code / Cline)? That's a different product — see the API Usage Guide.

📌 General Information

Base URLhttps://bayonstore.com/api/v1
Auth headerx-api-token: rsk_xxxxxxxxxxxxxxxxxxxxxxxx
Alt authOr append ?api_key=rsk_xxxxxxxxxxxxxxxxxxxxxxxx to the URL (header is preferred).
Rate limit120 requests / minute per key
PricingPrices are net of your key's discount. Compare price (what you pay) with listPrice (public price).
Getting a keySelf-service from /buyer?tab=apikeys. See below.

🔑 How do I get an API key?

Any logged-in user can generate their own key — no signup or approval needed. To get access:

  1. Sign in, then open the API Keys tab from your buyer account at /buyer?tab=apikeys.
  2. Click Generate new key to create an rsk_... token on the spot.
  3. The token is shown only once at creation. Copy it immediately and store it somewhere secure (a secrets manager or environment variable) — it can't be retrieved again.
  4. Fund your wallet from the same account so you can place orders.
🔄 Lost or leaked a key? Revoke it from the API Keys tab and generate a fresh one — a revoked key returns 401. Re-creating a key is how you rotate it.
💸 Pricing: self-service keys bill at list price (0% discount). Discounted reseller pricing is arranged separately with the store admin.

📚 Endpoint Reference

Every endpoint requires the x-api-token header. Pick an endpoint to see its parameters, a copy-paste curl, and a sample response.

GET/products

List active listings. Prices are already net of your discount (see price vs listPrice).

Parameters

  • categoryOptional. Filter by category.
  • pageOptional. 1-based page number (default 1).
  • limitOptional. Items per page, 1–100 (default 50).

Request

curl "https://bayonstore.com/api/v1/products?category=streaming&page=1&limit=50" \
  -H "x-api-token: rsk_xxxxxxxxxxxxxxxxxxxxxxxx"

Sample response

{
  "products": [
    {
      "id": "cl_abc123",
      "title": "Example Product",
      "category": "streaming",
      "subcategory": null,
      "listPrice": 10.00,
      "price": 8.50,
      "currency": "USD",
      "stock": 42,
      "deliveryType": "instant",
      "imageUrl": null
    }
  ],
  "page": 1,
  "limit": 50,
  "total": 1,
  "pages": 1,
  "discountPercent": 15
}

♻️ Safe Retries (Idempotency)

Network hiccups happen. To make POST /orders safe to retry, pass a unique idempotencyKey with each purchase.

  • Use a fresh, unique value per intended purchase (e.g. a UUID or your own order number).
  • If a request times out, retry with the same key — you get the original order back, never a second charge.
  • The response field idempotent: true means a prior order was replayed.

🚦 Error Codes

  • 401Missing, invalid, or revoked API token.
  • 402Insufficient wallet balance. The response includes your current balance.
  • 403Account suspended, or the account is not a reseller.
  • 404Product or order not found (orders are scoped to your own key).
  • 409Insufficient stock for the requested quantity.
  • 429Rate limited (over 120 req/min per key). Respect the Retry-After: 60 header.

🧑‍💻 Integration Examples

The API is plain HTTP + JSON, so it works from anything. Below: raw curl, a Node fetch flow, and a minimal Telegram bot.

📌 This is your own integration. These examples show you, the reseller, building your own bot/app against this public API using your x-api-token. It is completely separate from the store's internal Official Store bot, which talks to the database directly and is not part of the reseller API.
# GET /products
curl "https://bayonstore.com/api/v1/products?category=streaming&page=1&limit=50" \
  -H "x-api-token: rsk_xxxxxxxxxxxxxxxxxxxxxxxx"

# GET /products/info/{id}
curl "https://bayonstore.com/api/v1/products/info/cl_abc123" \
  -H "x-api-token: rsk_xxxxxxxxxxxxxxxxxxxxxxxx"

# GET /balance
curl "https://bayonstore.com/api/v1/balance" \
  -H "x-api-token: rsk_xxxxxxxxxxxxxxxxxxxxxxxx"

# POST /orders
curl -X POST "https://bayonstore.com/api/v1/orders" \
  -H "x-api-token: rsk_xxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "productId": "cl_abc123",
    "quantity": 1,
    "idempotencyKey": "buy-2026-07-04-0001"
  }'

# GET /orders/{id}
curl "https://bayonstore.com/api/v1/orders/ord_xyz789" \
  -H "x-api-token: rsk_xxxxxxxxxxxxxxxxxxxxxxxx"

📉 Known Limitations

Being upfront so nothing surprises you mid-integration:

  • No "list my orders" endpoint. You can fetch an order by id (GET /orders/{id}) but there's no endpoint that lists all your orders — track the order IDs you create yourself.
  • No delivery webhook. For non-instant products, poll GET /orders/{id} until status becomes delivered and productData is populated.