Перейти к содержимому
Создать аккаунт

Документация API

Подключите магазин к своему сайту или к игровому серверу, который не находится в нашей панели.

The key

Every request carries your store's key in the Authorization header. Make the key in your store's dashboard on the Developers tab; it is shown once. It is a secret of your server: never put it into a page or an app that runs on a buyer's device.

Authorization: Bearer sn_store_…

Answers are JSON. An error is { "error": "<code>" } with status 401 (unknown key), 404 (not found), 422 (the request cannot be done, the code says why) or 429 (too many requests). Prices are in US cents.

Your own site

List the products

GET https://steadnode.com/api/store/v1/products

{
  "store": { "address": "sky-legends", "name": "Sky Legends", "selling": true, "sale": null },
  "products": [
    { "id": "cm…", "name": "VIP rank", "summary": "…", "category": "Ranks",
      "listPriceCents": 500, "priceCents": 500, "currency": "USD",
      "billing": "ONCE", "periodDays": 30, "needsPlayer": true, "left": null, "image": null }
  ]
}

Start a checkout

Send the product, the buyer's e-mail address and, when the product needs one, the player name. Send the buyer to checkoutUrl. After the payment the buyer lands on returnUrl (an https address of yours) or, without one, on the order's page in your store.

POST https://steadnode.com/api/store/v1/checkouts
Content-Type: application/json

{ "productId": "cm…", "email": "buyer@example.com", "player": "Steve_1",
  "coupon": "WELCOME10", "returnUrl": "https://example.com/thanks", "locale": "en" }

{ "orderId": "…", "checkoutUrl": "https://…", "priceCents": 450, "currency": "USD", "couponCode": "WELCOME10" }

Ask how far an order is

GET https://steadnode.com/api/store/v1/orders/<orderId>

{ "id": "…", "status": "DELIVERED", "product": { "id": "cm…", "name": "VIP rank" }, "player": "Steve_1",
  "email": "buyer@example.com", "priceCents": 450, "currency": "USD", "billing": "ONCE",
  "paidAt": "2026-11-21T10:00:00.000Z", "deliveredAt": "2026-11-21T10:00:20.000Z", "expiresAt": "2026-12-21T10:00:00.000Z" }

status is PENDING (not paid), PAID (paid, not handed over yet), DELIVERED, FAILED (the hand-over gave up), ENDED (its time is over), REFUNDED or DISPUTED.

A game server that is not on our panel

Install the plugin (Developers tab) and choose "Commands run by the plugin" for a product. The plugin asks every half minute for the commands that wait, runs them in the console and confirms them. You can do the same from a program of your own:

GET https://steadnode.com/api/store/v1/commands

{ "commands": [
  { "id": "<order>:give", "kind": "give", "order": "…", "product": "VIP rank", "player": "Steve_1",
    "commands": ["lp user Steve_1 parent add vip"] }
] }

POST https://steadnode.com/api/store/v1/commands/done
Content-Type: application/json

{ "ids": ["<order>:give"] }

give hands a paid purchase over; take takes it back when its time is over or it was refunded or disputed (the product's revoke commands). A command that is not confirmed is offered again: keep the ids you have run, so that nothing is handed over twice.

The purchase signal

Enter an https address of your server on the Developers tab. We send one POST for each event: order.paid, order.ended, order.refunded, order.disputed. Answer with a 2xx status when you have taken it; anything else is tried again, with the same id.

POST https://example.com/steadnode
webhook-id: <order id>.order.paid
webhook-timestamp: 1795000000
webhook-signature: v1,<base64>

{ "event": "order.paid", "store": "sky-legends",
  "order": { "id": "…", "status": "PAID", "product": { "id": "cm…", "name": "VIP rank" },
             "player": "Steve_1", "email": "buyer@example.com", "priceCents": 450, … } }

The signature follows Standard Webhooks: base64 of HMAC-SHA256 over `${id}.${timestamp}.${body}`, keyed with the bytes of your secret after the whsec_ prefix (base64). Check it, and refuse a timestamp older than five minutes.

import { createHmac, timingSafeEqual } from "node:crypto";

function verified(secret, id, timestamp, body, header) {
  const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
  const expected = createHmac("sha256", key).update(`${id}.${timestamp}.${body}`).digest("base64");
  return header.split(" ").some((part) => {
    const given = Buffer.from(part.replace(/^v1,/, ""));
    return given.length === expected.length && timingSafeEqual(given, Buffer.from(expected));
  });
}