Admin API

Read and manage products, inventory, orders and customers of one business from an OAuth app, with scoped access tokens.

Availability

Rolling out gradually; it may not be active for your business yet

The Admin API and OAuth apps are enabled per business. If a call answers feature_disabled, the business does not have them yet.

What it is

The Admin API lets an OAuth app work on one business that installed it: list and edit products, adjust stock, read and fulfil orders, and manage customers. Everything lives under /api/v1/admin and speaks camelCase JSON.

Authentication

Send the access token you got from the install flow as a Bearer token. Access tokens start with nmat_, last 1 hour and are renewed with the refresh token.

Example request
curl "https://<your-nimlio-host>/api/v1/admin/products?limit=20" \
-H "Authorization: Bearer nmat_…"

A missing or expired token answers 401 (missing_token or invalid_token). A token only ever reaches the business that installed the app.

Scopes

Each endpoint requires one scope. The effective scopes of a call are the scopes of the token intersected with the scopes of the installation, so a merchant who reduces an installation's scopes takes effect immediately. A missing scope answers 403 insufficient_scope with details.required. Write scopes do not imply read scopes.

ScopeAllows
products:read / products:writeList, read, create and update products
inventory:read / inventory:writeRead stock levels; adjust or set stock
orders:read / orders:writeList and read orders; edit tags and note; move fulfillment
customers:read / customers:writeList, read, create and update customers
customer_data:readInclude protected personal data (buyer and customer contact details) in order and customer responses
checkout_rules:read / checkout_rules:writeList and read the app's own checkout rules; register, update and delete them
Personal data is opt-in

Without customer_data:read, the personal fields of orders and customers are left out of the response. Request that scope only if your app needs them.

Conventions

  • Bodies are strict. An unknown key in a write body is rejected with 400; it is never ignored silently.
  • Pagination. Lists return data and meta: { nextCursor, hasMore, limit }. Pass limit (1–100, default 50) and cursor (the previous nextCursor). A page can be short or empty while hasMore is true (a filtered order list also sets meta.truncated: true then): keep following nextCursor until hasMore is false.
  • Idempotency. Inventory writes and order fulfillment require an Idempotency-Key header (1–128 characters). Retrying with the same key replays the original result instead of applying it twice.
  • Rate limits. Reads and writes have separate buckets per installation. Slow down when you are rate limited.
  • Money is an integer in COP centavos.
Error envelope
{
"ok": false,
"error": {
"code": "insufficient_scope",
"message": "The access token lacks the scope this endpoint requires",
"details": { "required": "products:write" },
"requestId": "…"
}
}

error can also carry reason and fieldErrors. Quote requestId when you contact support.

A write (any method other than GET, HEAD or OPTIONS) for a business whose subscription has lapsed answers 402 subscription_required and changes nothing. Reads keep working. The merchant subscribes again to restore writes. The check runs again inside the write's own transaction: if the subscription lapses while a write runs, the write still answers 402 and changes nothing. A renewal or plan change that keeps the business entitled never refuses a write.

Products

Method and pathScopeNotes
GET /productsproducts:readQuery: limit, cursor, status (draft, active, archived)
POST /productsproducts:writeReturns 201 with the new id. Body: name (required, 1–160), description, priceAmount, currency, sku, inventoryQuantity, status and more
GET /products/:idproducts:readOne product
PATCH /products/:idproducts:writeSend only the fields to change
Create a product
curl -X POST "https://<your-nimlio-host>/api/v1/admin/products" \
-H "Authorization: Bearer nmat_…" \
-H "Content-Type: application/json" \
-d '{"name":"Ceramic mug","priceAmount":4500000,"currency":"COP","status":"draft"}'

Inventory

Method and pathScopeNotes
GET /inventory?variantId=…inventory:readStock of a variant, in total and per location
POST /inventory/adjustmentsinventory:writeAdd or remove a delta. Body: productId, variantId?, delta, reason (manual, restock, correction), note?. Idempotency-Key required
PUT /inventory/levelsinventory:writeSet the stock with compare-and-set. Body: variantId, expectedQuantity, quantity, reason?, note?. Idempotency-Key required

PUT /inventory/levels only applies when the current quantity equals expectedQuantity; otherwise read the level again and retry, so two writers never overwrite each other.

Orders

Method and pathScopeNotes
GET /ordersorders:readQuery: limit, cursor, order (asc, desc), status (pending, paid, failed, expired, refunded), fulfillmentStatus, from, to, updatedSince (ISO instants)
GET /orders/:idorders:readOne order
PATCH /orders/:idorders:writeOnly tags (up to 10) and note (up to 2000 characters). Payment and fulfillment fields are not editable here. Sending tags requires expectedTags, the tag set you last read (breaking for integrations that send tags alone: they now get 400); if the order's tags differ at commit time nothing is written and the answer is 409 order_tags_conflict with details.current
POST /orders/:id/fulfillmentorders:writeMoves fulfillment and may notify the buyer. Idempotency-Key required

The fulfillment body takes status and expectedStatus (each one of unfulfilled, shipped, out_for_delivery, delivered, ready_for_pickup, fulfilled, cancelled), plus optional notify, trackingCourier, trackingNumber, trackingUrl (https) or trackingEntries. trackingEntries replaces every tracking entry and requires trackingRevision, the order's trackingRevision you read; if it is missing or the tracking changed since, the call fails with 409 tracking_conflict and nothing is replaced. The call fails if the order is no longer in expectedStatus.

Customers

Method and pathScopeNotes
GET /customerscustomers:readQuery: limit, cursor, search, tag
POST /customerscustomers:writeReturns 201. Body: name (required), phone, email, address, city
GET /customers/:idcustomers:readOne customer
PATCH /customers/:idcustomers:writenotes, tags, marketingOptOut, birthMonth, birthDay

Checkout rules

Method and pathScopeNotes
GET /checkout-rulescheckout_rules:readThe rules your installation registered, in the merchant's order
POST /checkout-rulescheckout_rules:writeReturns 201. Body: document (the rule document; its kind and name become the rule's). New rules start disabled until the merchant enables them
GET /checkout-rules/:idcheckout_rules:readOne rule
PATCH /checkout-rules/:idcheckout_rules:writeReplace the document. Body: document, revision (compare-and-set; a stale revision answers 409 revision_conflict). The enabled switch is kept
DELETE /checkout-rules/:idcheckout_rules:writeRemove the rule

An invalid document answers 400 invalid_input with reason invalid_rule_document and details: { code, path, message }. A business holds at most 20 rules (409 limit_reached, reason rule_limit_reached). Rules of other installations answer 404. See Checkout rules for the document format.