Developers guide
The Naamaa API
Connect your own software, or an AI assistant, to your business on Naamaa.
Quick start
From nothing to your first call in three steps.
- 1
Create a credential in the portal
- 2
Call GET /me with it
- 3
Read your products and orders
curl -s https://www.naamaa.in/api/v1/ext/naamaa/v1/me \
-H "X-Api-Key: nmk_live_xxxxxxxx" \
-H "X-Api-Secret: nms_xxxxxxxx"
curl -s "https://www.naamaa.in/api/v1/ext/naamaa/v1/products" \
-H "X-Api-Key: nmk_live_xxxxxxxx" \
-H "X-Api-Secret: nms_xxxxxxxx"What the API is
The API gives your software access to one business: its products, stock and orders, and, with the right permissions, its storefront and customer bookings. A credential belongs to one business and can only ever see and change that business’s own data.
Every call follows the same rules as the enterprise portal: the same price checks, stock movements and order status rules. It is a paid add-on that the platform switches on per business type. If you cannot find API & MCP (AI) in your portal, ask the Naamaa team.

Get a credential
A credential is a pair: a key id and a secret. You need both on every call.
- Open the enterprise portal and choose API & MCP (AI).
- Create a credential: give it a name, choose live or sandbox, and tick only the scopes it needs.
- Copy the key id and the secret. The secret is shown once and nobody can read it back. If you lose it, rotate the credential.
- 1API & MCP (AI)Enterprise portal
- 2Create credentialName · live/sandbox · scopes
- 3Copy key + secretnmk_… / nms_… shown once
- 4Rotate or revoke1–72 h grace, or at once

Authentication
Always use HTTPS. Send the key id and the secret in either of these two ways.
https://www.naamaa.in/api/v1/ext/naamaa/v1X-Api-Key: nmk_live_xxxxxxxx
X-Api-Secret: nms_xxxxxxxxThe key id starts with nmk_live_ or nmk_test_. The secret starts with nms_. Keep it on your server: never put it in a web page or a mobile app. If a credential lists allowed browser origins, calls from other origins are refused.
Live and sandbox
The prefix of the key id tells you which one you hold.
nmk_live_…works on your real business.nmk_test_…works on a separate sample copy of your business. Every route behaves as live, writes included, but nothing real happens: no messages are sent, no real payment is taken and live data is never touched. A sandbox payment link opens a test page where you choose paid, failed or cancelled. Reset the sandbox any time from the portal.
Scopes
A scope is one permission. Give a credential the smallest set it needs.
Back office
| Scope | What it allows |
|---|---|
catalog:read | Read products, services, prices and variants. |
catalog:write | Change a product’s name, prices or visibility. Changes data. |
inventory:read | Read stock levels. |
inventory:write | Set stock to an exact number. Changes data. |
orders:read | Read orders and their status. |
orders:write | Move an order to a new status; the customer is told. Changes data. |
orders:cancel | Cancel an order. Changes data. |
customers:read | Show customer phone, email and address on orders. Without it you get names only. |
reports:read | Read sales summaries for a date range. |
Customer-facing agents
| Scope | What it allows |
|---|---|
storefront:read | Read what a customer sees: live items, prices as charged, availability and delivery coverage. |
bookings:create | Place an order or booking for a customer. Changes data. |
payments:create | Create a payment link for an order you placed and read its payment status. |
The platform decides which scopes your business type may grant. A credential gets only the scopes that both you and the platform allow; GET /me shows the ones in force.
Errors
Every error has the same shape, and the HTTP status tells you the class of problem.
{
"success": false,
"code": "SCOPE_MISSING",
"message": "This credential does not hold the scope orders:write."
}| Status | Code | Meaning |
|---|---|---|
401 | CREDENTIALS_INVALID | The key or secret is wrong, revoked or expired. The answer is the same for all three, on purpose. |
403 | API_NOT_ENABLED | The API is not switched on for this business. |
403 | SCOPE_MISSING | The credential does not hold the scope this route needs. |
403 | ORIGIN_NOT_ALLOWED | A browser call came from an origin the credential does not list. |
404 | NOT_FOUND | It does not exist, or it belongs to another business. |
409 | PRICE_CHANGED, OUT_OF_STOCK … | A business rule refused the request, for example the price changed or the item is out of stock. |
429 | RATE_LIMITED | Too many calls. Wait the number of seconds in the Retry-After header, then try again. |
Rate limits
Each credential has its own per-minute limit. The platform sets it per business type (typically 600 a minute live and 120 sandbox). Past it you get 429 RATE_LIMITED with a Retry-After header in seconds. Wait that long, then retry; do not retry at once in a loop.
Pagination
Orders come in pages: page (from 0) and size (up to 100). The response carries totalPages and hasNext; ask for the next page while hasNext is true. Products and stock come in one list.
curl -s "https://www.naamaa.in/api/v1/ext/naamaa/v1/orders?page=0&size=50" \
-H "Authorization: Bearer nmk_live_xxxxxxxx.nms_xxxxxxxx"
# { "content": [ … ], "currentPage": 0, "totalPages": 4, "hasNext": true }
curl -s "https://www.naamaa.in/api/v1/ext/naamaa/v1/orders?page=1&size=50" \
-H "Authorization: Bearer nmk_live_xxxxxxxx.nms_xxxxxxxx"Examples
Replace the key and the secret with yours. All three examples read the business and its first products.
curl -s https://www.naamaa.in/api/v1/ext/naamaa/v1/me \
-H "X-Api-Key: nmk_live_xxxxxxxx" \
-H "X-Api-Secret: nms_xxxxxxxx"
curl -s "https://www.naamaa.in/api/v1/ext/naamaa/v1/products" \
-H "X-Api-Key: nmk_live_xxxxxxxx" \
-H "X-Api-Secret: nms_xxxxxxxx"Set stock to exactly 24 (needs inventory:write):
curl -s -X PUT https://www.naamaa.in/api/v1/ext/naamaa/v1/inventory/<product id> \
-H "Authorization: Bearer nmk_live_xxxxxxxx.nms_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"availableQuantity": 24}'Booking and payment for a customer
Credentials with storefront:read, bookings:create and payments:create let an app or an agent sell for the business, through the same checkout as the Naamaa storefront. The API never accepts, sees or stores card, UPI or bank details: the customer pays on a hosted payment page.
- 1POST /checkoutcustomer phone + items
- 2POST /orders/{id}/payment-linkhosted gateway page
- 3Customer paysconfirmed by the gateway
- 4GET /orders/{id}/paymentPAID · FAILED · EXPIRED
- Read what the customer sees with
GET /storefront/products, then/storefront/products/{id}/availabilityand/storefront/delivery-checkwhere they apply. - If the business confirms customers by one-time code (OTP first), call
POST /customers/otp/send, thenPOST /customers/otp/verifywith the code. You get acustomerProof, valid for 10 minutes. - Place the order with
POST /checkout: the customer’s phone, the items and theexpectedUnitPriceyou showed. If the price moved you get409 PRICE_CHANGED. On success the order is held, awaiting payment. - Create the link with
POST /orders/{id}/payment-link. It is sent to the customer’s phone and also returned (url,expiresAt). - Read
GET /orders/{id}/payment: AWAITING, PAID, FAILED or EXPIRED. Only the payment gateway confirms a payment, never you. An unpaid order is released after the hold time. After FAILED or EXPIRED, create a new link.
Two modes exist per business type. Pay to confirm (the default): the order is confirmed when the customer pays the link. OTP first: the customer must also confirm by code before an order can be placed. Cash on delivery works only if the business already offers it on its storefront.
Place an order (pay to confirm):
curl -s -X POST https://www.naamaa.in/api/v1/ext/naamaa/v1/checkout \
-H "Authorization: Bearer nmk_live_xxxxxxxx.nms_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"customer": { "phone": "9000000001", "name": "Asha" },
"items": [{ "serviceId": "<service id>", "quantity": 1, "expectedUnitPrice": 450 }],
"fulfillment": "PICKUP",
"paymentMethod": "ONLINE"
}'
# then, with the order id from the response:
curl -s -X POST https://www.naamaa.in/api/v1/ext/naamaa/v1/orders/<order id>/payment-link \
-H "Authorization: Bearer nmk_live_xxxxxxxx.nms_xxxxxxxx"
curl -s https://www.naamaa.in/api/v1/ext/naamaa/v1/orders/<order id>/payment \
-H "Authorization: Bearer nmk_live_xxxxxxxx.nms_xxxxxxxx"

