Getting Started

Your First API Call in 5 Minutes

The PosNova REST API gives you programmatic access to your store — products, categories, brands, customers and orders — over plain HTTPS with JSON responses. This guide takes you from zero to your first created order.

1 · Generate an API key

01
Open your dashboard and go to Settings → Developer API.
02
Click Generate New API Key and pick the Test environment first.
03
Copy the key immediately — it is shown only once and stored as a SHA-256 hash.
Development
pn_test_…

Safe for local development and CI — iterate without touching production metrics.

Production
pn_live_…

Reads and writes live store data. Keep it server-side, never in browser code.

2 · List your products

Every request carries your key in the Authorization header. The store is resolved from the key — no store ID needed.

Request Example

cURL
curl "https://api.posnova.store/v1/products?limit=5&in_stock=true" \
  -H "Authorization: Bearer pn_live_YourSecretKey"
JavaScript
const res = await fetch("https://api.posnova.store/v1/products?limit=5&in_stock=true", {
  headers: { Authorization: `Bearer ${process.env.POSNOVA_API_KEY}` },
});
const { data, pagination } = await res.json();

3 · Read the response

All endpoints return the same envelope: success, a data payload, and — for list endpoints — a pagination object.

{
  "success": true,
  "data": [
    {
      "id": 101,
      "name": "Wireless Noise-Canceling Headphones",
      "slug": "wireless-headphones",
      "price": 199.99,
      "quantity": 105,
      "status": "ACTIVE"
    }
  ],
  "pagination": { "total": 37, "page": 1, "limit": 5 }
}

4 · Create your first order

Send product IDs and quantities — never prices. The server re-prices every line from the live catalog, runs fraud analysis and inventory updates, and the order appears in your dashboard instantly.

Request Example

cURL
curl -X POST "https://api.posnova.store/v1/orders" \
  -H "Authorization: Bearer pn_live_YourSecretKey" \
  -H "Content-Type: application/json" \
  -d '{
  "items": [{ "product_id": 101, "quantity": 2 }],
  "customer": { "name": "Rahim Uddin", "phone": "01700000000", "city": "Dhaka" },
  "payment_method": "COD"
}'
JavaScript
const res = await fetch("https://api.posnova.store/v1/orders", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POSNOVA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "items": [{ "product_id": 101, "quantity": 2 }],
  "customer": { "name": "Rahim Uddin", "phone": "01700000000", "city": "Dhaka" },
  "payment_method": "COD"
}),
});
const { data } = await res.json();
// 201 Created
{
  "success": true,
  "data": {
    "order_id": "0d9c1f4e-…",
    "receipt_number": "R-000124",
    "total": 399.98,
    "payment_method": "COD"
  }
}

Conventions at a glance

Base URL https://api.posnova.store · auth via Authorization: Bearer · list endpoints paginate with limit (max 100) and page · errors always include an error string. Full details in Errors & Conventions.

Where to go next

Status: Operational

Errors & Conventions