Home/Developer API

Developer API

Connect an external website to InstantRefill. Send the API key on every request to list products, check the wallet, create an order, and read its status.

Base URL: https://instantrefill.online/api/v1/

The base URL is only a prefix. Call /products or /balance with your key.

Header: X-Api-Key

Also send Accept: application/json. Use HTTPS.

Authentication

X-Api-Key: your-api-key
Accept: application/json

Keys are created in the admin under Users → API clients. The key is shown once. It spends that customer’s wallet balance. You can limit a key to specific IP addresses.

GET /balance

Wallet balance for the API key’s customer.

{"balance": 100.5, "currency": "USD"}

GET /products

Products the shop can sell. Optional query: category (game slug), page, per_page. price is the smallest amount that product can be bought for. min_quantity and max_quantity are the allowed quantity.

{"data": [{"id": 832, "name": "...", "category_name": "...", "price": 10.0, "available": true, "min_quantity": 1, "max_quantity": 1}]}

POST /orders

Creates an order and deducts the wallet. recipient is the player ID. external_reference is your own id; sending the same one again returns the original order.

{"product_id": "832", "recipient": "player_id", "quantity": 1, "external_reference": "optional-ref-123"}

GET /orders/{id}

Order details. id can be the numeric id or the order number. Status is pending, processing, completed, or failed.

Errors

401 API key missing or invalid. 402 insufficient wallet balance. 403 the IP is not allowed. 404 product or order not found. 422 missing or invalid fields.