Skip to main content
The official plugin uses the Socket.IO /plugin namespace on the public app/API origin. The game server always initiates the connection and exposes no inbound port.
The legacy REST polling endpoints GET /orders/plugin/.../pending and POST /orders/plugin/.../complete have been retired. They could not provide a safe atomic claim across multiple instances or protect the ambiguous crash window. Use the current plugin and protocol below.

Authentication

The namespace handshake sends:
The backend accepts only an active plugin key with orders:write. The key is shop-bound, serverId must belong to that shop, and the key owner must still have shop access. Any invalid connection gets the same unauthorized error without revealing which check failed.

Protocol v1 events

The backend replays all outstanding deliveries on every connection and pushes after payment or status changes. Duplicate order:deliver events are expected: execution authority comes from the atomic claim and local journal, not from merely receiving an event.

Safety states

  1. paid or disputeprocessing: only one instance wins the conditional database transition.
  2. The plugin writes and fsyncs EXECUTING before the first command.
  3. After the final command it writes and fsyncs AWAITING_ACK.
  4. order:complete changes the order to completed; only its ACK removes the local entry.
  5. A restart with AWAITING_ACK retries only the ACK. A restart with EXECUTING never replays commands and starts manual review.
Do not delete the journal to “unstick” an order. Check the actual player/server state and resolve it in the panel. retry clears the server-side claim and allows a new push; complete accepts the delivery without replaying commands.

Command formatting

The API formats product commands before returning the claim winner’s fresh snapshot: Math expressions use a restricted parser and are never evaluated as code. quantityTiers, the command variant, and package bonuses are resolved by the API. The plugin additionally rejects any command whose first word appears in blockedCommands. If a product requires the player online, an instance executes only after seeing the exact nickname on an allowed server. A locally parked delivery is checked through order:verify so an order cancelled or refunded in the meantime cannot run from a stale event.