Amba

Stores

Store definitions with segment-scoped listings, overrides, and availability windows.

A store is a curated view onto the catalog — optionally segment-scoped. Listings pin catalog items into a store with sort order, per-store price overrides, availability windows, and per-user purchase caps.

Source: apps/api/src/routes/admin/stores.ts.

Endpoints

MethodPathDescription
POST/admin/projects/:projectId/storesCreate a store.
GET/admin/projects/:projectId/storesList stores.
PATCH/admin/projects/:projectId/stores/:storeIdPartial update.
DELETE/admin/projects/:projectId/stores/:storeIdDelete.
POST/admin/projects/:projectId/stores/:storeId/listingsAdd a listing.
GET/admin/projects/:projectId/stores/:storeId/listingsList listings with catalog item detail.
PATCH/admin/projects/:projectId/stores/:storeId/listings/:listingIdUpdate a listing (scoped by storeId).
DELETE/admin/projects/:projectId/stores/:storeId/listings/:listingIdRemove a listing.

POST /admin/projects/:projectId/stores

Request

FieldTypeRequired
namestringyes
descriptionstringno
segment_iduuidno

Response 201

{ "data": { "id": "…", "name": "…", "segment_id": null, "is_active": true } }

Try it:

POST/admin/projects/%7B%7BprojectId%7D%7D/stores
developer auth
curl -X POST 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/stores'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X POST '${BASE_URL}/admin/projects/{projectId}/stores' \
  -H 'Authorization: Bearer ${DEV_TOKEN}' \
  -H 'Content-Type: application/json' \
  -d '{}'

GET /admin/projects/:projectId/stores

{ "data": [{ "id": "…", "name": "…", "is_active": true }] }

Try it:

GET/admin/projects/%7B%7BprojectId%7D%7D/stores
developer auth
curl -X GET 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/stores'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X GET '${BASE_URL}/admin/projects/{projectId}/stores' \
  -H 'Authorization: Bearer ${DEV_TOKEN}'

PATCH /admin/projects/:projectId/stores/:storeId

Allowed fields: name, description, is_active, segment_id.

Try it:

PATCH/admin/projects/%7B%7BprojectId%7D%7D/stores/%7B%7BstoreId%7D%7D
developer auth
curl -X PATCH 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/stores/%7B%7BstoreId%7D%7D'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X PATCH '${BASE_URL}/admin/projects/{projectId}/stores/{storeId}' \
  -H 'Authorization: Bearer ${DEV_TOKEN}' \
  -H 'Content-Type: application/json' \
  -d '{}'

DELETE /admin/projects/:projectId/stores/:storeId

{ "data": { "deleted": true } }

Try it:

DELETE/admin/projects/%7B%7BprojectId%7D%7D/stores/%7B%7BstoreId%7D%7D
developer auth
curl -X DELETE 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/stores/%7B%7BstoreId%7D%7D'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X DELETE '${BASE_URL}/admin/projects/{projectId}/stores/{storeId}' \
  -H 'Authorization: Bearer ${DEV_TOKEN}'

POST /admin/projects/:projectId/stores/:storeId/listings

Request (AddStoreListingInput)

FieldTypeRequiredDefault
catalog_item_iduuidyes
override_pricesobjectnonull
sort_ordernumberno0
available_fromISO-8601nonull
available_untilISO-8601nonull
max_purchases_per_usernumbernonull

Response 201

{ "data": { "id": "…", "store_id": "…", "catalog_item_id": "…", "sort_order": 0 } }

Errors

  • 500 ADD_LISTING_FAILED.

Try it:

POST/admin/projects/%7B%7BprojectId%7D%7D/stores/%7B%7BstoreId%7D%7D/listings
developer auth
curl -X POST 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/stores/%7B%7BstoreId%7D%7D/listings'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X POST '${BASE_URL}/admin/projects/{projectId}/stores/{storeId}/listings' \
  -H 'Authorization: Bearer ${DEV_TOKEN}' \
  -H 'Content-Type: application/json' \
  -d '{}'

GET /admin/projects/:projectId/stores/:storeId/listings

Listings joined to catalog_items for display, ordered by sort_order.

Response 200

{
  "data": [
    {
      "id": "…",
      "store_id": "…",
      "catalog_item_id": "…",
      "sort_order": 0,
      "override_prices": null,
      "catalog_items": {
        "key": "gems_100",
        "name": "100 Gems",
        "icon_url": "…",
        "item_type": "consumable"
      }
    }
  ]
}

Try it:

GET/admin/projects/%7B%7BprojectId%7D%7D/stores/%7B%7BstoreId%7D%7D/listings
developer auth
curl -X GET 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/stores/%7B%7BstoreId%7D%7D/listings'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X GET '${BASE_URL}/admin/projects/{projectId}/stores/{storeId}/listings' \
  -H 'Authorization: Bearer ${DEV_TOKEN}'

PATCH /admin/projects/:projectId/stores/:storeId/listings/:listingId

Allowed fields: override_prices, sort_order, available_from, available_until, max_purchases_per_user. Scoped by both listingId and storeId so a listing from another store can't be mutated through the wrong URL.

Errors

  • 404 NOT_FOUND.

Try it:

PATCH/admin/projects/%7B%7BprojectId%7D%7D/stores/%7B%7BstoreId%7D%7D/listings/%7B%7BlistingId%7D%7D
developer auth
curl -X PATCH 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/stores/%7B%7BstoreId%7D%7D/listings/%7B%7BlistingId%7D%7D'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X PATCH '${BASE_URL}/admin/projects/{projectId}/stores/{storeId}/listings/{listingId}' \
  -H 'Authorization: Bearer ${DEV_TOKEN}' \
  -H 'Content-Type: application/json' \
  -d '{}'

DELETE /admin/projects/:projectId/stores/:storeId/listings/:listingId

{ "data": { "deleted": true } }

Try it:

DELETE/admin/projects/%7B%7BprojectId%7D%7D/stores/%7B%7BstoreId%7D%7D/listings/%7B%7BlistingId%7D%7D
developer auth
curl -X DELETE 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/stores/%7B%7BstoreId%7D%7D/listings/%7B%7BlistingId%7D%7D'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X DELETE '${BASE_URL}/admin/projects/{projectId}/stores/{storeId}/listings/{listingId}' \
  -H 'Authorization: Bearer ${DEV_TOKEN}'