KXR API
API Tester ↗
REST API · JSON

KXR Digital API

Use the KXR Digital API to retrieve products, create orders using your reseller balance, and check order status. All endpoints return JSON.

Base URL: https://api.kxrdigital.shop/
Important: POST /order.php creates a real provider order and uses reseller balance when accepted. Do not test with invalid product or player details.

Authentication

Each reseller has a unique API key. Send it in the request header for every endpoint that requires authentication.

X-API-Key: YOUR_RESELLER_API_KEY Accept: application/json Content-Type: application/json

Never expose your API key in public frontend code or screenshots. If it is compromised, regenerate it in Settings.

Account information

GET/account.php

Returns the reseller ID, username, email, role and balance.

{ "success": true, "account": { "id": 42, "username": "reseller01", "email": "reseller@example.com", "role": "reseller", "balance": 100.00 } }

Products

GET/products.php

Returns active products. Use the product id as product_id when creating an order. The API uses reseller_price when set; otherwise, it uses customer_price.

GET https://api.kxrdigital.shop/products.php X-API-Key: YOUR_RESELLER_API_KEY

Example response

{ "success": true, "products": [ { "id": 501, "name": "Mobile Legends 86 Diamonds", "provider_product_id": "PROVIDER_PRODUCT_ID", "customer_price": "5.00", "reseller_price": "4.50", "game": "Mobile Legends" } ] }

Create an order

POST/order.php

Send a JSON body. user_id is the player's in-game account ID, not the reseller ID. For games that require a zone or server, include zone_id.

FieldRequiredDescription
product_idYesProduct ID from /products.php.
user_idYesPlayer's in-game account ID.
zone_idBy gamePlayer zone/server; the endpoint also accepts server_id.
nicknameNoPlayer nickname, if available.

Example request

POST https://api.kxrdigital.shop/order.php X-API-Key: YOUR_RESELLER_API_KEY Content-Type: application/json { "product_id": 501, "user_id": "123456789", "zone_id": "1234", "nickname": "Player" }

Contoh berjaya

{ "success": true, "order": { "invoice": "KXRAPI20261030123456A1B2C3", "provider_invoice": "KXR-KXRAPI20261030123456A1B2C3", "status": "Pending", "amount": 4.5 } }

Save order.invoice to check the order status. Status values depend on the provider response.

Check order status

POST/order-status.php
{ "invoice": "KXRAPI20261030123456A1B2C3" }

Orders can only be checked by the reseller that created them.

Check MLBB nickname

POST/check-nickname.php
{ "user_id": "123456789", "zone_id": "1234" }

This endpoint calls an external nickname lookup service. If that service is unavailable, the API returns HTTP 502.

Callback acknowledgement

POST/callback.php
This endpoint only checks that an invoice exists and returns an acknowledgement. It does not update the order status or verify a callback signature. Do not use it as the provider callback URL. The website's existing provider callback URL is https://kxrdigital.shop/callback/topup.php.
{ "reference": "KXRAPI20261030123456A1B2C3", "status": "success" }

HTTP status codes and errors

HTTPCommon meaning
200Request succeeded.
401Missing or invalid API key, or the account is not a reseller.
404Product or order not found.
422A required field is missing or the input is incomplete.
400Provider rejected the order, balance is insufficient, or order creation failed.
502The nickname/provider service returned an unusable response.

PowerShell example

$key = "YOUR_RESELLER_API_KEY" Invoke-RestMethod ` -Uri "https://api.kxrdigital.shop/products.php" ` -Method Get ` -Headers @{"X-API-Key"=$key}
KXR Digital · Keep your API key secure.