POS Android API

API documentation for the Android POS app. No login or authentication required.

Base URL: https://gmexperteng.com

1. POS setup

Call once when opening the POS screen. Returns warehouses, clients, categories, brands, payment methods, and default warehouse/client.

GET https://gmexperteng.com/pos_data.php Try →

Response (example):

{
  "stripe_key": "",
  "brands": [{"id": 1, "name": "Brand A"}],
  "defaultWarehouse": 1,
  "defaultClient": 2,
  "default_client_name": "Walk-in",
  "clients": [{"id": 1, "name": "Customer A"}, {"id": 2, "name": "Walk-in"}],
  "warehouses": [{"id": 1, "name": "Main Store"}],
  "categories": [{"id": 1, "name": "Category A"}],
  "accounts": [{"id": 1, "account_name": "Cash Account"}],
  "payment_methods": [{"id": 1, "name": "Cash"}, {"id": 2, "name": "Credit Card"}],
  "products_per_page": 28
}

2. Products

Products available for sale in a warehouse (paginated).

GET https://gmexperteng.com/products.php?warehouse_id=1&page=1 Try →

ParameterRequiredDescription
warehouse_idYesWarehouse ID (from pos_data)
pageNoPage number (default 1)
category_idNoFilter by category
brand_idNoFilter by brand
stockNo1 = only in-stock
product_comboNo1 = include combos
product_serviceNo1 = include services

Response (example):

{
  "products": [
    {
      "id": 10,
      "product_variant_id": null,
      "code": "PRD-001",
      "name": "Product Name",
      "barcode": "PRD-001",
      "image": "products/image.jpg",
      "qte_sale": 100,
      "qte": 100,
      "unitSale": "pcs",
      "product_type": "is_single",
      "Net_price": 25.50
    }
  ],
  "totalRows": 42
}

3. Clients

List clients

GET https://gmexperteng.com/clients.php Try →

Returns [{"id": 1, "name": "Customer A"}, ...]

Create client

POST https://gmexperteng.com/clients.php

Headers: Content-Type: application/json

Body (JSON): Only name is required. Others optional: phone, email, adresse, country, city, tax_number.

{
  "name": "New Customer Name",
  "phone": "+220 123 4567",
  "email": "customer@example.com"
}

Response: {"success": true}

4. Create sale

POST https://gmexperteng.com/create_sale.php

Headers: Content-Type: application/json

Body (JSON): client_id, warehouse_id, details[], payments[], GrandTotal are required.

{
  "client_id": 2,
  "warehouse_id": 1,
  "tax_rate": 0,
  "TaxNet": 0,
  "discount": 0,
  "shipping": 0,
  "GrandTotal": 150.00,
  "notes": "",
  "po_number": "",
  "account_id": null,
  "payment_note": null,
  "details": [
    {
      "product_id": 10,
      "product_variant_id": null,
      "sale_unit_id": 1,
      "quantity": 2,
      "Unit_price": 25.50,
      "subtotal": 51.00,
      "tax_percent": 0,
      "tax_method": "1",
      "discount": 0,
      "discount_Method": "2",
      "imei_number": null,
      "name": "Product Name"
    }
  ],
  "payments": [
    { "payment_method_id": 1, "amount": 150.00 }
  ]
}

Response: {"success": true, "id": 123}id is the new sale ID.

With one payment, if amount > GrandTotal, change is calculated automatically. With multiple payments, total paid must not exceed GrandTotal.

5. Drafts

List drafts

GET https://gmexperteng.com/drafts.php?limit=10&page=1 Try →

Query: limit, page. Response: {"totalRows": N, "draft_sales": [...]}

Get one draft (resume)

GET https://gmexperteng.com/drafts.php?id=5

Returns full draft with details, clients, warehouses, payment_methods, etc.

Create draft

POST https://gmexperteng.com/drafts.php

Same body as create sale but without payments. Response: {"success": true}

Submit draft as sale

POST https://gmexperteng.com/drafts.php

{
  "draft_sale_id": 5,
  "amount": 85.50,
  "payment": {
    "payment_method_id": 1,
    "amount": 85.50,
    "change": 0,
    "notes": null,
    "account_id": null
  }
}

Response: {"success": true, "id": 124}. Draft is deleted on the server.

Delete draft

DELETE https://gmexperteng.com/drafts.php?id=5

Response: {"success": true}

6. Sales

List sales

GET https://gmexperteng.com/sales.php?limit=10&page=1 Try →

Query: limit, page, search, SortField (id, date, Ref, GrandTotal, etc.), SortType (asc, desc).

Today’s summary

GET https://gmexperteng.com/sales.php?today=1 Try →

Response: today, total_sales_amount, total_amount_paid, total_cash, total_credit_card, total_cheque.

Sale line items (receipt)

GET https://gmexperteng.com/sales.php?products=123

Replace 123 with sale ID. Returns sale + details[].

Sale payments

GET https://gmexperteng.com/sales.php?payments=123

Replace 123 with sale ID. Returns sale + payments[].

Quick reference

WhatMethodEndpoint
POS setup dataGETpos_data.php
ProductsGETproducts.php?warehouse_id=1&page=1
List clientsGETclients.php
Create clientPOSTclients.php
Create salePOSTcreate_sale.php
List draftsGETdrafts.php?limit=10&page=1
Get draftGETdrafts.php?id=5
Create draftPOSTdrafts.php
Submit draftPOSTdrafts.php (body: draft_sale_id, payment, amount)
Delete draftDELETEdrafts.php?id=5
List salesGETsales.php?limit=10&page=1
Today summaryGETsales.php?today=1
Sale line itemsGETsales.php?products=123
Sale paymentsGETsales.php?payments=123
Android usage: Use the Base URL above as your API base. All responses are JSON. No Authorization header needed. For POST/DELETE, set Content-Type: application/json and send JSON body where required.