/plugin on the public API origin. The game server always initiates the connection — it exposes no inbound port.
Authentication
The namespace handshake sends:- the key is active, of type
pluginand hasorders:write; - the key is bound to a shop and
serverIdbelongs to the same shop; - the key’s creator still has access to the shop.
unauthorized — without revealing which condition failed. Create the key in the panel (preset Minecraft plugin), see API with a key.
Events (protocol v1)
The backend sends a full backlog replay after every connection and a push when an order is paid or changes status. A repeated
order:deliver is normal — the right to execute is decided by the atomic claim and the local journal, not by receiving the event.
Safety states
The plugin must keep a local journal written withfsync:
1
Claim
order:claim moves the order from paid or dispute to processing. Only one instance wins the conditional database update.2
EXECUTING
Write and sync
EXECUTING before the first command.3
AWAITING_ACK
After the last command, write and sync
AWAITING_ACK.4
Complete
order:complete moves the order to completed. Remove the local entry only after the ACK.- an
AWAITING_ACKentry → retry onlyorder:complete, not the commands; - an
EXECUTINGentry → don’t repeat the commands; sendorder:uncertain, which starts a manual review.
Don’t delete the journal to “unblock” an order. Check the player’s actual state in the panel and resolve the entry manually:
retry clears the claim on the app side and allows a new push, complete accepts the delivery without repeating commands.Commands and placeholders
The API formats product commands before sending the fresh snapshot to the claim winner. The plugin receives ready commands — it substitutes nothing itself.
Expressions are evaluated by a restricted parser — never executed as code.
quantityTiers thresholds, the command variant and the package bonus are resolved by the API. The plugin should additionally reject commands whose first word is in blockedCommands.
Player online
WhenrequireOnline is set, run the commands only after the correct nickname is detected on an allowed server. A local copy that waited a long time must be checked with order:verify, so a cancelled or refunded order isn’t executed from a stale event. If the delivery condition isn’t met after claiming, give the claim back with order:release.
Next
Plugin on your server
Install and configure the official plugin.
Orders
Order statuses and manual review in the panel.
API with a key
plugin keys and their scope.Errors and limits
REST limits and retries.