Menu
For resellers & developers

Reseller API

Sell our products on your own website or bot. You place the order with one API call, the price is taken from your wallet balance and we deliver the product.

How it works

  1. 1Create an account and open API access to create your key.
  2. 2Add money to your wallet (every API order is paid from this balance).
  3. 3Call POST /orders from your website. We deliver, and the order also shows in your orders on our site.
  4. 4If an order is cancelled, the price goes back to your wallet automatically.

Basics

Base URL
https://test.oentrix.com/api/v1
Authentication
Send your key in the header X-API-Key: YOUR_KEY (or Authorization: Bearer YOUR_KEY).
Limit
60 requests per minute per key.

Every answer is JSON:

Response format
{ "success": true, "data": ... }

{ "success": false,
  "error": { "code": "insufficient_balance", "message": "..." } }
401missing_key, invalid_key
402insufficient_balance - add money to your wallet
403ip_not_allowed, account_disabled
404not_found, unknown_endpoint
422invalid_request, out_of_stock, order_failed
429rate_limited - wait a minute

GET /balance

Your current wallet balance.

cURL
curl -H "X-API-Key: KEY" https://test.oentrix.com/api/v1/balance

{"success":true,"data":{"balance":25.5,"currency":"৳","discount_percent":0}}

GET /products

List products. Prices already include your discount (retail_price is the shop price).

category_idonly this category
qsearch in the title
page, per_pagepaging (per_page max 100)

Also: GET /products/{id} (one product with description) and GET /categories. Subscription products list their plans and the fields you must send when ordering.

cURL
curl -H "X-API-Key: KEY" "https://test.oentrix.com/api/v1/products?category_id=2"

{"success":true,"data":{"items":[{
  "id":12,"title":"Example","type":"digital",
  "in_stock":true,"price":9.5,"retail_price":10
}],"page":1,"per_page":50,"total":1}}

POST /orders

Buy a product with your balance.

product_idrequired
planplan name - for subscription products
fieldsobject label → value - for subscription products
referenceyour own unique order number. Sending the same reference twice never creates or charges a second order.
cURL
curl -X POST https://test.oentrix.com/api/v1/orders \
  -H "X-API-Key: KEY" \
  -H "Content-Type: application/json" \
  -d '{"product_id":12,"reference":"shop-1001"}'

{"success":true,"data":{
  "order":{"id":345,"reference":"shop-1001",
    "status":"delivered","price":9.5,
    "delivery":{"type":"file",
      "download":"https://test.oentrix.com/api/v1/orders/345/download"}},
  "balance":16}}

Order status: pending, processing, delivered, active, cancelled, refunded.

GET /orders · GET /orders/{id}

List your API orders (page, per_page, status) or read one. A delivered order contains delivery: text (for example account details), url, or download - call GET /orders/{id}/download with your key to get the file.

Callback (optional)

Set a callback URL in API access. When an order changes we send a POST with {"event":"order.updated","order":{...}} and the header X-Oentrix-Signature = HMAC-SHA256 of the raw body. Or simply poll GET /orders/{id}.

PHP example

PHP
$ch = curl_init('https://test.oentrix.com/api/v1/orders');
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'X-API-Key: KEY',
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => json_encode([
    'product_id' => 12,
    'reference'  => 'shop-1001',
  ]),
]);
$res = json_decode(curl_exec($ch), true);
Need help? Open a ticket in our Support Center. You can also order and top up inside our Telegram store bot.