Skip to Content
devhelp shopDocs

Admin — Inventory & Locations

Track stock levels across locations and record stock adjustments.

List locations

GET
/admin/v1/locations

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Query Parameters

limit?number
Default24
cursor?string

Response Body

OK

application/json
  1. response
items*array<>
nextCursor*string|null
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/locations'
Example Response
{  "items": [    {      "id": "string",      "name": "string",      "isDefault": true,      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "nextCursor": "string"}

Create a location

POST
/admin/v1/locations

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Request Body

application/json
  1. body
name*string
isDefault?boolean
Defaultfalse

Response Body

OK

application/json
  1. response
id*string
name*string
isDefault*boolean
createdAt*string
Formatdate-time
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/locations' \  -H 'Content-Type: application/json' \  -d '{  "name": "string"}'
Example Response
{  "id": "string",  "name": "string",  "isDefault": true,  "createdAt": "2019-08-24T14:15:22Z"}

Update a location

PATCH
/admin/v1/locations/{id}

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
name?string
isDefault?boolean

Response Body

OK

application/json
  1. response
id*string
name*string
isDefault*boolean
createdAt*string
Formatdate-time
Example Request
curl -X PATCH 'https://api.devhelp.pk/admin/v1/locations/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "id": "string",  "name": "string",  "isDefault": true,  "createdAt": "2019-08-24T14:15:22Z"}

List stock levels

GET
/admin/v1/inventory

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Query Parameters

limit?number
Default24
cursor?string
locationId?string
stock?string
Value in"out""low""in"
threshold?number
Default5
sort?string
Default"oldest"
Value in"oldest""quantity-asc""quantity-desc"
variantId?string
productId?string
q?string

Response Body

OK

application/json
  1. response
items*array<>
nextCursor*string|null
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/inventory'
Example Response
{  "items": [    {      "variantId": "string",      "productId": "string",      "productTitle": "string",      "variantTitle": "string",      "sku": "string",      "locationId": "string",      "locationName": "string",      "onHand": 0,      "available": 0    }  ],  "nextCursor": "string"}
GET
/admin/v1/inventory/unstocked

Variants appear in GET /inventory once stock is first adjusted. These are the ones that have never been: a new product's variants, waiting for their first units.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Query Parameters

limit?number
Default24
cursor?string
q?string

Response Body

OK

application/json
  1. response
items*array<>
nextCursor*string|null
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/inventory/unstocked'
Example Response
{  "items": [    {      "variantId": "string",      "productId": "string",      "productTitle": "string",      "variantTitle": "string",      "sku": "string"    }  ],  "nextCursor": "string"}

Adjust stock

POST
/admin/v1/inventory/adjust

Writes a ledger entry and updates the level in one transaction. Use mode: "adjust" for a delta and mode: "set" for a stocktake — two people counting at once must not overwrite each other.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Request Body

application/json
  1. body
variantId*string
locationId?string
quantity*number
mode?string
Default"adjust"
Value in"adjust""set"
reason*string
Value in"received""sold""returned""damaged""lost""recount""correction"
note?string

Response Body

OK

application/json
  1. response
variantId*string
productId*string
productTitle*string
variantTitle*string|null
sku*string|null
locationId*string
locationName*string
onHand*number
available*number
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/inventory/adjust' \  -H 'Content-Type: application/json' \  -d '{  "variantId": "string",  "quantity": 0,  "reason": "received"}'
Example Response
{  "variantId": "string",  "productId": "string",  "productTitle": "string",  "variantTitle": "string",  "sku": "string",  "locationId": "string",  "locationName": "string",  "onHand": 0,  "available": 0}
POST
/admin/v1/inventory/adjust-many

One transaction, one reason and note applied to every line — a stocktake across a whole product, or setting opening quantities. Locks level rows in the platform's standard order (variant, then location) so this cannot deadlock against a concurrent single adjustment or checkout.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Request Body

application/json
  1. body
reason*string
Value in"received""sold""returned""damaged""lost""recount""correction"
note?string
adjustments*array<>

Response Body

OK

application/json
  1. response
levels*array<>
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/inventory/adjust-many' \  -H 'Content-Type: application/json' \  -d '{  "reason": "received",  "adjustments": [    {      "variantId": "string",      "quantity": 0    }  ]}'
Example Response
{  "levels": [    {      "variantId": "string",      "productId": "string",      "productTitle": "string",      "variantTitle": "string",      "sku": "string",      "locationId": "string",      "locationName": "string",      "onHand": 0,      "available": 0    }  ]}

List stock movements

GET
/admin/v1/inventory/adjustments

The append-only ledger. Entries are never edited or removed.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Query Parameters

limit?number
Default24
cursor?string
variantId?string

Response Body

OK

application/json
  1. response
items*array<>
nextCursor*string|null
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/inventory/adjustments'
Example Response
{  "items": [    {      "id": "string",      "variantId": "string",      "locationId": "string",      "delta": 0,      "resultingOnHand": 0,      "reason": "received",      "note": "string",      "actorId": "string",      "actorName": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "nextCursor": "string"}

On this page