REST API

API Reference

Full documentation for all Apex POS REST API endpoints. Authenticate with your API key and start integrating.

Last updated: April 2026

Authentication

All requests to the Apex POS REST API must include your API key in the request header.

Base URL https://api.apex-pos.com/rest_api/v1/

API Key Header

X-API-Key: apx_xxxxxxxxxxxxxxxxxxxxxxxx

Your API key always starts with apx_

// Add to every request
const headers = {
  'X-API-Key': 'apx_your_key_here',
  'Content-Type': 'application/json'
};

const res = await fetch('https://api.apex-pos.com/rest_api/v1/products', { headers });
const data = await res.json();
// Using cURL in PHP
$ch = curl_init('https://api.apex-pos.com/rest_api/v1/products');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'X-API-Key: apx_your_key_here',
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests

HEADERS = {
    'X-API-Key': 'apx_your_key_here',
    'Content-Type': 'application/json'
}
BASE = 'https://api.apex-pos.com/rest_api/v1'

res = requests.get(f'{BASE}/products', headers=HEADERS)
data = res.json()

Authentication Errors

  • 401 Unauthorized — Missing or invalid API key.
  • 403 Forbidden — Key exists but lacks permission for this endpoint.

Keep your API key secret. Never expose it in client-side code or public repositories.

Products

Manage your product catalog. List all products, create new ones, and update existing products.

GET /products
Returns a paginated list of all products for your business.

Query Parameters

Parameter Type Description
page integer Optional Page number for pagination
limit integer Optional Number of results per page (max 100)
category_id integer Optional Filter by category ID
const res = await fetch(
  'https://api.apex-pos.com/rest_api/v1/products?page=1&limit=50',
  { headers: { 'X-API-Key': 'apx_your_key' } }
);
const { data, total, page } = await res.json();
$ch = curl_init('https://api.apex-pos.com/rest_api/v1/products?page=1&limit=50');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: apx_your_key']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = json_decode(curl_exec($ch), true);
res = requests.get(
    'https://api.apex-pos.com/rest_api/v1/products',
    params={'page': 1, 'limit': 50},
    headers={'X-API-Key': 'apx_your_key'}
)
data = res.json()
Response 200 OK
{
  "success": true,
  "data": [
    {
      "id": 1,
      "name": "Espresso",
      "name_ar": "إسبريسو",
      "price": 3.50,
      "cost": 1.20,
      "barcode": "8901234567890",
      "category_id": 2,
      "tax_rate": 15,
      "stock": 100
    }
  ],
  "total": 84,
  "page": 1,
  "limit": 50
}
POST /products
Creates a new product in your Apex POS catalog.

Request Body

Parameter Type Description
name string Required Product name
name_ar string Optional Product name in Arabic
price number Required Selling price
cost number Optional Cost price
barcode string Optional Product barcode
category_id integer Optional Category ID
tax_rate number Optional Tax rate percentage
stock integer Optional Initial stock quantity
const res = await fetch('https://api.apex-pos.com/rest_api/v1/products', {
  method: 'POST',
  headers: { 'X-API-Key': 'apx_your_key', 'Content-Type': 'application/json' },
  body: JSON.stringify({
    name: 'Latte', name_ar: 'لاتيه',
    price: 4.50, cost: 1.80,
    category_id: 2, tax_rate: 15, stock: 200
  })
});
const { success, product_id } = await res.json();
$payload = json_encode([
    'name' => 'Latte', 'name_ar' => 'لاتيه',
    'price' => 4.50, 'cost' => 1.80,
    'category_id' => 2, 'stock' => 200
]);
$ch = curl_init('https://api.apex-pos.com/rest_api/v1/products');
curl_setopt_array($ch, [
    CURLOPT_POST => true, CURLOPT_POSTFIELDS => $payload,
    CURLOPT_HTTPHEADER => ['X-API-Key: apx_your_key', 'Content-Type: application/json'],
    CURLOPT_RETURNTRANSFER => true
]);
$res = json_decode(curl_exec($ch), true);
res = requests.post(
    'https://api.apex-pos.com/rest_api/v1/products',
    json={'name': 'Latte', 'name_ar': 'لاتيه', 'price': 4.50, 'stock': 200},
    headers={'X-API-Key': 'apx_your_key'}
)
print(res.json())
Response201 Created
{ "success": true, "product_id": 42, "message": "Product created" }
PUT /products/{id}
Updates an existing product by its ID.

Request Body

Send only the fields you want to update. All fields are optional.

const res = await fetch('https://api.apex-pos.com/rest_api/v1/products/42', {
  method: 'PUT',
  headers: { 'X-API-Key': 'apx_your_key', 'Content-Type': 'application/json' },
  body: JSON.stringify({ price: 5.00, tax_rate: 10 })
});
const data = await res.json();
$ch = curl_init('https://api.apex-pos.com/rest_api/v1/products/42');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_POSTFIELDS => json_encode(['price' => 5.00]),
    CURLOPT_HTTPHEADER => ['X-API-Key: apx_your_key', 'Content-Type: application/json'],
    CURLOPT_RETURNTRANSFER => true
]);
$res = json_decode(curl_exec($ch), true);
res = requests.put(
    'https://api.apex-pos.com/rest_api/v1/products/42',
    json={'price': 5.00, 'tax_rate': 10},
    headers={'X-API-Key': 'apx_your_key'}
)
print(res.json())
Response200 OK
{ "success": true, "message": "Product updated" }

Inventory

Check and update stock levels across your warehouses.

GET /inventory
Returns current stock levels for all products across all warehouses.

Query Parameters

Parameter Type Description
warehouse_id integer Optional Filter by warehouse ID
const res = await fetch(
  'https://api.apex-pos.com/rest_api/v1/inventory?warehouse_id=1',
  { headers: { 'X-API-Key': 'apx_your_key' } }
);
const { data } = await res.json();
$ch = curl_init('https://api.apex-pos.com/rest_api/v1/inventory?warehouse_id=1');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: apx_your_key']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = json_decode(curl_exec($ch), true);
res = requests.get(
    'https://api.apex-pos.com/rest_api/v1/inventory',
    params={'warehouse_id': 1},
    headers={'X-API-Key': 'apx_your_key'}
)
Response200 OK
{
  "success": true,
  "data": [
    { "product_id": 1, "product_name": "Espresso", "warehouse_id": 1, "warehouse_name": "Main", "quantity": 84 }
  ]
}
PATCH /inventory/{id}
Updates the stock quantity for a specific product in a specific warehouse.

Request Body

Parameter Type Description
product_id integer Required Product ID
warehouse_id integer Required Warehouse ID
quantity integer Required New stock quantity
notes string Optional Adjustment notes
const res = await fetch('https://api.apex-pos.com/rest_api/v1/inventory/1', {
  method: 'PATCH',
  headers: { 'X-API-Key': 'apx_your_key', 'Content-Type': 'application/json' },
  body: JSON.stringify({ product_id: 1, warehouse_id: 1, quantity: 150, notes: 'Restock' })
});
$ch = curl_init('https://api.apex-pos.com/rest_api/v1/inventory/1');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PATCH',
    CURLOPT_POSTFIELDS => json_encode(['product_id'=>1,'warehouse_id'=>1,'quantity'=>150]),
    CURLOPT_HTTPHEADER => ['X-API-Key: apx_your_key','Content-Type: application/json'],
    CURLOPT_RETURNTRANSFER => true
]);
res = requests.patch(
    'https://api.apex-pos.com/rest_api/v1/inventory/1',
    json={'product_id':1, 'warehouse_id':1, 'quantity':150, 'notes':'Restock'},
    headers={'X-API-Key': 'apx_your_key'}
)
Response200 OK
{ "success": true, "message": "Stock updated", "new_quantity": 150 }

Invoices

Create and retrieve sales invoices (orders).

POST /invoices
Creates a new sales invoice/order. Automatically deducts stock from the default warehouse.

Request Body

Parameter Type Description
customer_id integer Optional Customer ID
items array Required Array of order items
payment_method string Optional cash, card, bank
account_id integer Optional Account to credit
notes string Optional Invoice notes
const res = await fetch('https://api.apex-pos.com/rest_api/v1/invoices', {
  method: 'POST',
  headers: { 'X-API-Key': 'apx_your_key', 'Content-Type': 'application/json' },
  body: JSON.stringify({
    customer_id: 5,
    payment_method: 'card',
    account_id: 2,
    items: [
      { product_id: 1, quantity: 2, price: 3.50 },
      { product_id: 3, quantity: 1, price: 12.00 }
    ]
  })
});
const { success, invoice_id } = await res.json();
$payload = json_encode([
    'customer_id' => 5, 'payment_method' => 'card',
    'items' => [
        ['product_id'=>1,'quantity'=>2,'price'=>3.50],
        ['product_id'=>3,'quantity'=>1,'price'=>12.00]
    ]
]);
$ch = curl_init('https://api.apex-pos.com/rest_api/v1/invoices');
curl_setopt_array($ch,[CURLOPT_POST=>true,CURLOPT_POSTFIELDS=>$payload,CURLOPT_HTTPHEADER=>['X-API-Key: apx_your_key','Content-Type: application/json'],CURLOPT_RETURNTRANSFER=>true]);
res = requests.post(
    'https://api.apex-pos.com/rest_api/v1/invoices',
    json={
        'customer_id': 5, 'payment_method': 'card',
        'items': [
            {'product_id':1, 'quantity':2, 'price':3.50},
            {'product_id':3, 'quantity':1, 'price':12.00}
        ]
    },
    headers={'X-API-Key': 'apx_your_key'}
)
Response201 Created
{ "success": true, "invoice_id": 1084, "total": 19.00, "status": "paid" }
GET /invoices
Returns a list of invoices with optional filters.

Query Parameters

Parameter Type Description
status string Optional paid, partial, unpaid
date_from string Optional Start date (YYYY-MM-DD)
date_to string Optional End date (YYYY-MM-DD)
page integer Optional Page number
const res = await fetch(
  'https://api.apex-pos.com/rest_api/v1/invoices?status=paid&date_from=2026-01-01&date_to=2026-01-31',
  { headers: { 'X-API-Key': 'apx_your_key' } }
);
$url = 'https://api.apex-pos.com/rest_api/v1/invoices?status=paid&date_from=2026-01-01';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: apx_your_key']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
res = requests.get(
    'https://api.apex-pos.com/rest_api/v1/invoices',
    params={'status':'paid','date_from':'2026-01-01','date_to':'2026-01-31'},
    headers={'X-API-Key': 'apx_your_key'}
)

Customers

Manage your customer database.

GET /customers
Returns a list of all customers.

Query Parameters

Parameter Type Description
search string Optional Search by name, phone, email
page integer Optional Page number
const res = await fetch(
  'https://api.apex-pos.com/rest_api/v1/customers?search=ahmed',
  { headers: { 'X-API-Key': 'apx_your_key' } }
);
const { data } = await res.json();
$ch = curl_init('https://api.apex-pos.com/rest_api/v1/customers?search=ahmed');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: apx_your_key']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
res = requests.get(
    'https://api.apex-pos.com/rest_api/v1/customers',
    params={'search': 'ahmed'},
    headers={'X-API-Key': 'apx_your_key'}
)
Response200 OK
{
  "success": true,
  "data": [
    { "id": 5, "name": "Ahmed Al-Amin", "phone": "+966501234567", "email": "[email protected]", "balance": 0 }
  ]
}
POST /customers
Creates a new customer record.

Request Body

Parameter Type Description
name string Required Customer full name
phone string Optional Phone number
email string Optional Email address
address string Optional Address
credit_limit number Optional Credit limit
const res = await fetch('https://api.apex-pos.com/rest_api/v1/customers', {
  method: 'POST',
  headers: { 'X-API-Key': 'apx_your_key', 'Content-Type': 'application/json' },
  body: JSON.stringify({ name: 'Sara Ali', phone: '+966509876543', email: '[email protected]' })
});
const { success, customer_id } = await res.json();
$ch = curl_init('https://api.apex-pos.com/rest_api/v1/customers');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => json_encode(['name'=>'Sara Ali','phone'=>'+966509876543']),
    CURLOPT_HTTPHEADER => ['X-API-Key: apx_your_key','Content-Type: application/json'],
    CURLOPT_RETURNTRANSFER => true
]);
res = requests.post(
    'https://api.apex-pos.com/rest_api/v1/customers',
    json={'name':'Sara Ali','phone':'+966509876543','email':'[email protected]'},
    headers={'X-API-Key':'apx_your_key'}
)
Response201 Created
{ "success": true, "customer_id": 31, "message": "Customer created" }

Health Check

Use the health endpoint to verify your API key and test your connection to Apex POS.

GET /health
Returns the server status and confirms your API key is valid.
const res = await fetch(
  'https://api.apex-pos.com/rest_api/v1/health',
  { headers: { 'X-API-Key': 'apx_your_key' } }
);
const data = await res.json();
// { "status": "ok", "business": "My Store", "timestamp": "..." }
$ch = curl_init('https://api.apex-pos.com/rest_api/v1/health');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: apx_your_key']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = json_decode(curl_exec($ch), true);
// $res['status'] === 'ok'
res = requests.get(
    'https://api.apex-pos.com/rest_api/v1/health',
    headers={'X-API-Key': 'apx_your_key'}
)
print(res.json())  # {'status': 'ok', 'business': 'My Store'}
Response200 OK
{ "status": "ok", "business": "My Store", "timestamp": "2026-04-24T10:32:00Z" }

This endpoint has no rate limit and is safe to poll periodically to check connectivity.