Nano Store - Ecommerce Docs
Developer Resourcesb2b-second-inventory

B2B Second Inventory Catalog API Reference

Endpoint reference for the bb phase 2 admin catalog API — categories, brands, series, tags, products, variants, options, bulk actions and import/export jobs — with contracts and error codes.

B2B Second Inventory (bb) — Catalog API Reference

Audience: Admin engineers integrating with the bb phase 2 backend. Phase 2 has no storefront or public endpoint.

All endpoints are prefixed with /api, need a JWT, and need the listed permission. Superadmin passes every permission check.

Throttles per IP: reads ADMIN_READ (30 per 60 s), writes ADMIN_WRITE (10 per 60 s), bulk delete, restore and active ADMIN_BULK_WRITE (5 per 60 s), reorder ADMIN_REORDER (30 per 60 s).

Each POST that creates a record requires an Idempotency-Key header; without it the response is 400 IDEMPOTENCY_KEY_REQUIRED.

Every route below is mounted by BbAdminAggregateModule, and the bb_catalog worker that runs import and export jobs is registered by BbModule.


Route Surfaces

SurfaceBase PathAuth
Categories/api/admin/bb/categoriesJWT + BB_Categories_*
Brands/api/admin/bb/brandsJWT + BB_Brands_*
Brand series/api/admin/bb/brand-seriesJWT + BB_BrandSeries_*
Tags/api/admin/bb/tagsJWT + BB_Tags_*
Products/api/admin/bb/productsJWT + BB_Products_*
Variants/api/admin/bb/products/:productPublicId/variantsJWT + BB_Products_*
Options/api/admin/bb/products/:productPublicId/optionsJWT + BB_Products_*
Jobs/api/admin/bb/jobs/{categories,brands,brand-series,products}JWT + BB_Catalog_* plus the entity code

Every :publicId is a UUID. Every response uses the ResponseDto envelope.

{
  "message": "Bb brand fetched successfully",
  "errorCode": null,
  "data": { }
}

A paginated list adds count, currentPage and totalPage beside data.


Endpoint Reference

Categories

MethodPathAuthDescription
GET/api/admin/bb/categoriesBB_Categories_READPaginated live list. Query: page, size (max 100), sort (displayOrder, name, updatedAt), order, search (max 100), parentPublicId, rootOnly. rootOnly with parentPublicId is 400 VALIDATION_FAILED
GET/api/admin/bb/categories/treeBB_Categories_READWhole live tree: { roots, truncated }, at most 5,000 rows
GET/api/admin/bb/categories/deletedBB_Categories_RESTOREPaginated soft-deleted list, newest deletion first
GET/api/admin/bb/categories/:publicIdBB_Categories_READOne live category
POST/api/admin/bb/categoriesBB_Categories_CREATECreate. Needs Idempotency-Key. Returns 201 { publicId }
PATCH/api/admin/bb/categories/:publicIdBB_Categories_UPDATEUpdate name, description, displayOrder, imageKey
PATCH/api/admin/bb/categories/:publicId/moveBB_Categories_UPDATEMove under a new parent, or to the root with null
DELETE/api/admin/bb/categories/:publicIdBB_Categories_DELETESoft delete. Returns 200
POST/api/admin/bb/categories/:publicId/restoreBB_Categories_RESTORERestore. Returns 200
POST/api/admin/bb/categories/bulk/deleteBB_Categories_DELETEBulk soft delete, up to 100 ids. Returns 200
POST/api/admin/bb/categories/bulk/restoreBB_Categories_RESTOREBulk restore, up to 100 ids. Returns 200
PATCH/api/admin/bb/categories/reorderBB_Categories_UPDATESet the order of one parent's whole live child set. Returns 200

Brands

MethodPathAuthDescription
GET/api/admin/bb/brandsBB_Brands_READPaginated live list. Query: page, size, sort (displayOrder, name, updatedAt), order, search
GET/api/admin/bb/brands/deletedBB_Brands_RESTOREPaginated soft-deleted list
GET/api/admin/bb/brands/:publicIdBB_Brands_READOne live brand
POST/api/admin/bb/brandsBB_Brands_CREATECreate. Needs Idempotency-Key. Returns 201
PATCH/api/admin/bb/brands/:publicIdBB_Brands_UPDATEUpdate name, description, displayOrder, logoKey
DELETE/api/admin/bb/brands/:publicIdBB_Brands_DELETESoft delete. Returns 200
POST/api/admin/bb/brands/:publicId/restoreBB_Brands_RESTORERestore. Returns 200
POST/api/admin/bb/brands/bulk/deleteBB_Brands_DELETEBulk soft delete
POST/api/admin/bb/brands/bulk/restoreBB_Brands_RESTOREBulk restore
PATCH/api/admin/bb/brands/reorderBB_Brands_UPDATEReorder the whole live brand list

Brand series

MethodPathAuthDescription
GET/api/admin/bb/brand-seriesBB_BrandSeries_READPaginated live list. Query: page, size, brandPublicId, sort, order, search
GET/api/admin/bb/brand-series/deletedBB_BrandSeries_RESTOREPaginated soft-deleted list
GET/api/admin/bb/brand-series/:publicIdBB_BrandSeries_READOne live series
POST/api/admin/bb/brand-seriesBB_BrandSeries_CREATECreate under a brand. Needs Idempotency-Key. Returns 201
PATCH/api/admin/bb/brand-series/:publicIdBB_BrandSeries_UPDATEUpdate name, description, displayOrder. The brand cannot change
DELETE/api/admin/bb/brand-series/:publicIdBB_BrandSeries_DELETESoft delete. Returns 200
POST/api/admin/bb/brand-series/:publicId/restoreBB_BrandSeries_RESTORERestore. Returns 200
POST/api/admin/bb/brand-series/bulk/deleteBB_BrandSeries_DELETEBulk soft delete
POST/api/admin/bb/brand-series/bulk/restoreBB_BrandSeries_RESTOREBulk restore
PATCH/api/admin/bb/brand-series/reorderBB_BrandSeries_UPDATEReorder one brand's whole live series set

Tags

MethodPathAuthDescription
GET/api/admin/bb/tagsBB_Tags_READPaginated live list. Query: page, size, sort (name, updatedAt; default name), order, search
GET/api/admin/bb/tags/deletedBB_Tags_RESTOREPaginated soft-deleted list
GET/api/admin/bb/tags/:publicIdBB_Tags_READOne live tag
POST/api/admin/bb/tagsBB_Tags_CREATECreate. Needs Idempotency-Key. Returns 201
PATCH/api/admin/bb/tags/:publicIdBB_Tags_UPDATERename. name is required
DELETE/api/admin/bb/tags/:publicIdBB_Tags_DELETESoft delete. Returns 200
POST/api/admin/bb/tags/:publicId/restoreBB_Tags_RESTORERestore. Returns 200

Tags have no bulk or reorder route.

Products

MethodPathAuthDescription
GET/api/admin/bb/productsBB_Products_READPaginated live list. Query: page, size, search, categoryPublicId, includeSubcategories, brandPublicId, brandSeriesPublicId, tagPublicId, isActive, sort (updatedAt, createdAt, name; default updatedAt), order (default desc). includeSubcategories without categoryPublicId is 400 VALIDATION_FAILED
GET/api/admin/bb/products/deletedBB_Products_RESTOREPaginated soft-deleted list
GET/api/admin/bb/products/:publicIdBB_Products_READOne live product with variants, options, tags and gallery. Takes no query keys
POST/api/admin/bb/productsBB_Products_CREATECreate a product with its variants. Needs Idempotency-Key. Returns 201 { publicId }
PATCH/api/admin/bb/products/:publicIdBB_Products_UPDATEUpdate; null clears a nullable field
PUT/api/admin/bb/products/:publicId/tagsBB_Products_UPDATEReplace the tag set
DELETE/api/admin/bb/products/:publicIdBB_Products_DELETESoft delete. Optional query version
POST/api/admin/bb/products/:publicId/restoreBB_Products_RESTORERestore. Returns 200
POST/api/admin/bb/products/bulk/deleteBB_Products_DELETEBulk soft delete
POST/api/admin/bb/products/bulk/restoreBB_Products_RESTOREBulk restore
POST/api/admin/bb/products/bulk/activeBB_Products_UPDATEBulk set isActive

Variants

MethodPathAuthDescription
POST/api/admin/bb/products/:productPublicId/variantsBB_Products_CREATEAdd a variant. Needs Idempotency-Key. Returns 201
PATCH/api/admin/bb/products/:productPublicId/variants/:publicIdBB_Products_UPDATEUpdate. isDefault accepts only true
DELETE/api/admin/bb/products/:productPublicId/variants/:publicIdBB_Products_DELETESoft delete. Optional query version

Options

MethodPathAuthDescription
GET/api/admin/bb/products/:productPublicId/optionsBB_Products_READList axes with values and the current productVersion
POST/api/admin/bb/products/:productPublicId/optionsBB_Products_CREATEAdd an axis with 1 to 50 values. Needs Idempotency-Key and productVersion. Returns 201
PATCH/api/admin/bb/products/:productPublicId/options/:optionPublicIdBB_Products_UPDATERename or reposition. Needs productVersion
DELETE/api/admin/bb/products/:productPublicId/options/:optionPublicIdBB_Products_DELETEDelete an axis. Needs query productVersion
POST/api/admin/bb/products/:productPublicId/options/:optionPublicId/valuesBB_Products_CREATEAdd a value. Needs Idempotency-Key and productVersion
PATCH/api/admin/bb/products/:productPublicId/options/:optionPublicId/values/:valuePublicIdBB_Products_UPDATEUpdate a value. Needs productVersion
DELETE/api/admin/bb/products/:productPublicId/options/:optionPublicId/values/:valuePublicIdBB_Products_DELETEDelete a value. Needs query productVersion

Jobs

The same seven routes exist under each of /api/admin/bb/jobs/categories, /brands, /brand-series and /products. <E> below is the entity module: Categories, Brands, BrandSeries, Products.

MethodPathAuthDescription
POST/api/admin/bb/jobs/<entity>/importBB_Catalog_CREATE + BB_<E>_CREATE + BB_<E>_UPDATESubmit an import. Multipart field file (.csv or .xlsx), header Idempotency-Key (required, max 200). Returns 201 { publicId }
POST/api/admin/bb/jobs/<entity>/exportBB_Catalog_READ + BB_<E>_READSubmit an export. Body { includeDeleted?, search? }. Needs Idempotency-Key. Returns 201 { publicId }
POST/api/admin/bb/jobs/<entity>/:publicId/cancelBB_Catalog_UPDATE + BB_<E>_UPDATECancel a queued or processing job. Returns 200 with the job, including errors
GET/api/admin/bb/jobs/<entity>BB_Catalog_READ + BB_<E>_READPaginated job list, newest first. Query: page, size (max 100)
GET/api/admin/bb/jobs/<entity>/import-templateBB_Catalog_READ + BB_<E>_READCSV with the header row only
GET/api/admin/bb/jobs/<entity>/:publicId/resultBB_Catalog_READ + BB_<E>_READDownload a completed export CSV
GET/api/admin/bb/jobs/<entity>/:publicIdBB_Catalog_READ + BB_<E>_READOne job, with errors

A caller needs every listed code (import needs all three). A job created with includeDeleted: true also needs BB_<E>_RESTORE to be fetched by id or downloaded. The list route does not apply that check.

Job lists and reads are scoped to the entity in the path, not to the requester.

Import and export files

The rules for each column, the all-or-nothing behavior and the carriage-return limit are in the feature page. This section is the contract an integrator needs.

Import header. Download GET .../import-template and keep its header. The set of names must match exactly. Column order is free. deletedAt is the only extra name allowed, and it is ignored.

EntityHeader
CategorypublicId,name,parentPublicId,description,displayOrder
BrandpublicId,name,description,displayOrder
Brand seriespublicId,brandPublicId,name,description,displayOrder
Productsku,name,categoryPublicId,brandPublicId,brandSeriesPublicId,mrpPaisa,sellingPricePaisa,description,isActive
  • Prices are whole paisa digits: mrpPaisa and sellingPricePaisa accept 1 to 15 digits, at most 1,000,000,000,000, with no sign, decimal point or separator. The selling price may not exceed the MRP.
  • A blank publicId creates a taxonomy row, and a publicId of a live row updates it. A product is matched by sku, case-insensitively.
  • Limits: 5,000 data rows, 50 columns, 25 MiB. An XLSX file reads its first sheet and may not expand past 100 MiB. A violation fails the job with a row-0 BB_JOB_FILE_TOO_LARGE.
  • The import is all or nothing. If any row has an error, nothing is written, the job is failed, and errors[] lists every bad cell.
  • The uploaded file is deleted when the job ends. Upload it again to retry under a new Idempotency-Key.

Row errors. Each entry is { row, column, errorCode, message }. row counts data rows from 1. row: 0 is an error about the whole file and has no column. message is a fixed sentence and never repeats a cell value. At most 500 entries are kept, and failedRows holds the true count.

errorCodecolumnRaised for
BB_IMPORT_ROW_INVALIDthe offending columnMissing required value, bad UUID, name or description too long, bad displayOrder, bad sku, bad paisa, selling price above MRP, isActive not true or false, series without a brand, file not UTF-8, description empty after cleaning, category parent at maximum depth, series brand change
BB_IMPORT_ROW_DUPLICATEname, publicId or skuThe later row of a repeated key. Names are scoped to the parent category or the brand, and SKUs compare case-insensitively
BB_IMPORT_ROW_CONFLICTa constraint name, or skuA database uniqueness, reference or check rule rejected the row, or the SKU's product is deleted or changed during the run
BB_IMPORT_ROW_REFERENT_INVALIDcategoryPublicId, brandPublicId, brandSeriesPublicId, parentPublicId or publicIdThe value does not refer to a live row
BB_IMPORT_ROW_MOVE_INVALIDparentPublicIdThe move would form a cycle or pass the maximum depth
BB_IMPORT_ROW_SKU_NOT_DEFAULTskuThe SKU belongs to a variant that is not its product's default

A file-level failure ends the job with one row-0 entry: BB_JOB_FILE_INVALID for an empty or unreadable file, a file that is not a workbook, a wrong header (the message lists the Missing:, Unexpected: and Duplicate: names) or an unclosed quote, and BB_JOB_FILE_TOO_LARGE for the limits above. A lock timeout, deadlock or serialization failure while writing is retried and is never a row error.

Export file. text/csv. The header is the import header of the entity, plus deletedAt last when includeDeleted is true. A product row carries its default live variant's sku, mrpPaisa and sellingPricePaisa in paisa (blank when it has none) and the stored HTML description. A cell starting with =, +, -, @, TAB, CR or ' is prefixed with ', and an import removes exactly one such prefix. Re-importing an export returns every cell unchanged except that a CR inside a cell comes back as LF and unguarded edge whitespace is trimmed.

The export file is kept: it has no expiry. .../result answers 410 BB_JOB_RESULT_GONE only when the file is already missing from the API host.


Key Contracts

JSON below is illustrative. Field names come from the DTOs; values are made up.

POST /api/admin/bb/categories

Request. name is required (max 150, trimmed). description max 2,000. displayOrder 0 to 100,000. parentPublicId and imageKey are optional.

{
  "name": "Laptops",
  "description": "Refurbished laptops",
  "parentPublicId": "0193a5c0-6d6c-7b0e-8a39-1f2f6f7a9c11",
  "displayOrder": 0
}

Response 201:

{
  "message": "Bb category created successfully",
  "errorCode": null,
  "data": { "publicId": "0193a5c1-2e4b-7c10-9d21-5a3b7c8d9e01" }
}

GET /api/admin/bb/categories/tree

{
  "message": "Bb category tree fetched successfully",
  "errorCode": null,
  "data": {
    "roots": [
      {
        "publicId": "0193a5c0-6d6c-7b0e-8a39-1f2f6f7a9c11",
        "name": "Computers",
        "depth": 0,
        "displayOrder": 0,
        "children": [
          {
            "publicId": "0193a5c1-2e4b-7c10-9d21-5a3b7c8d9e01",
            "name": "Laptops",
            "depth": 1,
            "displayOrder": 0,
            "children": []
          }
        ]
      }
    ],
    "truncated": false
  }
}

POST /api/admin/bb/categories/bulk/delete

Request: publicIds is a non-empty array of UUIDs, at most 100.

{
  "publicIds": [
    "0193a5c1-2e4b-7c10-9d21-5a3b7c8d9e01",
    "0193a5c0-6d6c-7b0e-8a39-1f2f6f7a9c11"
  ]
}

Response 200. HTTP 200 does not mean every id succeeded. Read failed.

{
  "message": "Bulk delete processed.",
  "errorCode": null,
  "data": {
    "succeeded": ["0193a5c1-2e4b-7c10-9d21-5a3b7c8d9e01"],
    "failed": [
      {
        "publicId": "0193a5c0-6d6c-7b0e-8a39-1f2f6f7a9c11",
        "errorCode": "BB_CATEGORY_HAS_PRODUCTS",
        "message": "<fixed sentence from the single-row path>"
      }
    ]
  }
}

Ids come back lower-cased. An id that does not exist or is already deleted lands in failed with BB_CATEGORY_NOT_FOUND (the same path as a missing id).

PATCH /api/admin/bb/categories/reorder

Request: the full, ordered list of one parent's live children. At most 1,000 ids. Not de-duplicated.

{
  "publicIds": [
    "0193a5c1-2e4b-7c10-9d21-5a3b7c8d9e01",
    "0193a5c2-0a1b-7d33-8e44-6b5c7d8e9f02"
  ]
}

Response 200 (changedCount is how many rows moved):

{
  "message": "Order saved.",
  "errorCode": null,
  "data": { "changedCount": 2 }
}

Refusal, 400:

{
  "message": "The list must contain exactly the current live siblings; refresh and try again.",
  "errorCode": "BB_REORDER_INVALID_ITEM",
  "details": { "reason": "incomplete_set" }
}

POST /api/admin/bb/products

Header Idempotency-Key is required.

Request. name 1 to 255. categoryPublicId is required. variants has 1 to 20 items. Prices are integer paisa, 0 to 1,000,000,000,000. gallery has at most 20 items. tagPublicIds at most 30, unique. optionValuePublicIds at most 5 per variant.

{
  "name": "ThinkPad T14 Gen 2",
  "description": "<p>14 inch, 16 GB RAM.</p>",
  "categoryPublicId": "0193a5c1-2e4b-7c10-9d21-5a3b7c8d9e01",
  "brandPublicId": "0193a5c3-1b2c-7e44-9f55-7c6d8e9fa003",
  "thumbnailKey": "public/thumbnail/t14.jpg",
  "gallery": [
    { "kind": "image", "key": "public/thumbnail/t14-front.jpg", "alt": "Front view" },
    { "kind": "video", "key": "public/product-video/t14.mp4", "posterKey": "public/thumbnail/t14-front.jpg" }
  ],
  "tagPublicIds": [],
  "isActive": true,
  "variants": [
    {
      "sku": "T14-G2-16-512",
      "mrpPaisa": 9500000,
      "sellingPricePaisa": 8900000,
      "isDefault": true,
      "isActive": true
    }
  ]
}

Response 201:

{
  "message": "Bb product created successfully",
  "errorCode": null,
  "data": { "publicId": "0193a5c4-3c4d-7f55-8a66-8d7e9fa0b104" }
}

PATCH /api/admin/bb/products/:publicId

version is optional. A stale value answers 409 BB_PRODUCT_VERSION_CONFLICT.

{
  "version": 3,
  "name": "ThinkPad T14 Gen 2 (refurbished)",
  "brandSeriesPublicId": null
}

Response 200 returns the full product: publicId, name, description, category, brand, brandSeries, isActive, version, thumbnailKey, thumbnailUrl, gallery, tags, options, variants, createdAt, updatedAt.

Each variant: publicId, name, displayName, sku, mrpPaisa, sellingPricePaisa, thumbnailKey, thumbnailUrl, position, isDefault, isActive, version, optionValues, createdAt, updatedAt.

POST /api/admin/bb/products/:productPublicId/options

{
  "name": "RAM",
  "values": ["8 GB", "16 GB"],
  "productVersion": 3
}

Response 201 returns the new axis and the bumped product version:

{
  "message": "Bb product option created successfully",
  "errorCode": null,
  "data": {
    "publicId": "0193a5c5-4d5e-7066-9b77-9e8fa0b1c205",
    "productVersion": 4
  }
}

POST /api/admin/bb/jobs/products/export

Header Idempotency-Key is required. search matches the name (max 200). includeDeleted: true needs BB_Products_RESTORE.

{
  "includeDeleted": false,
  "search": "thinkpad"
}

Response 201:

{
  "message": "Bb product export job submitted",
  "errorCode": null,
  "data": { "publicId": "0193a5c6-5e6f-7177-8c88-af90b1c2d306" }
}

A matching row count over 50,000 answers 400 BB_JOB_EXPORT_TOO_LARGE before the job is created.

GET /api/admin/bb/jobs/products/:publicId

{
  "message": "Bb product job fetched successfully",
  "errorCode": null,
  "data": {
    "publicId": "0193a5c6-5e6f-7177-8c88-af90b1c2d306",
    "kind": "export",
    "entity": "product",
    "status": "queued",
    "totalRows": null,
    "processedRows": 0,
    "failedRows": 0,
    "attemptsMade": 0,
    "lastError": null,
    "requestedBy": { "id": "0193a5b0-1111-7222-8333-444455556666", "name": "Asha Rai" },
    "startedAt": null,
    "finishedAt": null,
    "createdAt": "2026-11-02T09:00:00.000Z",
    "hasResult": false,
    "isStalled": false,
    "filters": { "includeDeleted": false, "search": "thinkpad" },
    "errors": null
  }
}

isStalled is true for a processing job older than 15 minutes, or a queued job older than 30 minutes.

lastError is a fixed sentence, never raw error text. A job that failed on its rows reads, for example:

{
  "message": "Bb product job fetched successfully",
  "errorCode": null,
  "data": {
    "publicId": "0193a5c7-6f70-7288-9d99-b0a1c2d3e407",
    "kind": "import",
    "entity": "product",
    "status": "failed",
    "totalRows": 3,
    "processedRows": 3,
    "failedRows": 2,
    "attemptsMade": 1,
    "lastError": "Import rejected: 2 row(s) have errors; nothing was written.",
    "requestedBy": { "id": "0193a5b0-1111-7222-8333-444455556666", "name": "Asha Rai" },
    "startedAt": "2026-11-02T09:01:02.000Z",
    "finishedAt": "2026-11-02T09:01:03.000Z",
    "createdAt": "2026-11-02T09:01:00.000Z",
    "hasResult": false,
    "isStalled": false,
    "filters": {},
    "errors": [
      { "row": 2, "column": "sellingPricePaisa", "errorCode": "BB_IMPORT_ROW_INVALID", "message": "sellingPricePaisa is above mrpPaisa." },
      { "row": 3, "column": "sku", "errorCode": "BB_IMPORT_ROW_DUPLICATE", "message": "sku appears earlier in the file." }
    ]
  }
}

A wrong header fails the job before any row is read, with a single entry whose row is 0 and which has no column:

{
  "row": 0,
  "errorCode": "BB_JOB_FILE_INVALID",
  "message": "The header must contain exactly these columns: sku, name, categoryPublicId, brandPublicId, brandSeriesPublicId, mrpPaisa, sellingPricePaisa, description, isActive. Missing: sku."
}

POST /api/admin/bb/jobs/products/import

multipart/form-data with one file field named file, and the Idempotency-Key header.

curl -X POST "$API/api/admin/bb/jobs/products/import" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: import-2026-11-02-001" \
  -F "file=@products.csv;type=text/csv"

Response 201: { "publicId": "..." } under data. Replaying the same key with the same file returns the same publicId. A different file under the same key is 409 BB_JOB_IDEMPOTENCY_CONFLICT.

Accepted types: .csv or .xlsx with MIME text/csv, application/csv, application/vnd.ms-excel, application/octet-stream or the XLSX type. At most 25 MiB.

GET /api/admin/bb/jobs/products/:publicId/result

Returns text/csv; charset=utf-8 with Content-Disposition: attachment; filename="bb-product-export-<publicId>.csv". The file stays on the API host; if it is gone the response is 410 BB_JOB_RESULT_GONE.

Error body

{
  "message": "A variant with this SKU already exists.",
  "errorCode": "BB_VARIANT_SKU_TAKEN",
  "details": { "sku": "T14-G2-16-512" }
}

Error Reference

Status codes come from the comment on each constant in ErrorCodes. A comment gives the usual HTTP status; some codes have a second status noted below.

CodeStatusMeaning
BB_CATALOG_BUSY409Lock wait over 5 s (55P03) on any catalog write. A deadlock (40P01) or serialization failure (40001) on a catalog entity write or bulk action answers the same code. Retry
BB_CATEGORY_NOT_FOUND404, 400 as a referenced parent
BB_CATEGORY_NAME_TAKEN409Sibling name in use
BB_CATEGORY_PARENT_DELETED409Parent is soft-deleted
BB_CATEGORY_DEPTH_EXCEEDED400Past depth 6
BB_CATEGORY_MOVE_CYCLE400Move under own descendant
BB_CATEGORY_HAS_CHILDREN409Live children block delete
BB_CATEGORY_HAS_PRODUCTS409Live products block delete
BB_BRAND_NOT_FOUND404, 400
BB_BRAND_NAME_TAKEN409
BB_BRAND_DELETED409The brand is soft-deleted
BB_BRAND_HAS_SERIES409
BB_BRAND_HAS_PRODUCTS409
BB_BRAND_SERIES_NOT_FOUND404, 400
BB_BRAND_SERIES_NAME_TAKEN409
BB_BRAND_SERIES_BRAND_MISMATCH400Series of another brand, or a series with no brand
BB_BRAND_SERIES_HAS_PRODUCTS409
BB_TAG_NOT_FOUND404, 400details.publicIds on PUT .../tags
BB_TAG_NAME_TAKEN409
BB_PRODUCT_NOT_FOUND404Missing or soft-deleted
BB_PRODUCT_REFERENT_NOT_FOUND400Category, brand or series missing; details.field
BB_PRODUCT_REFERENT_DELETED409Category, brand or series soft-deleted; details.field
BB_PRODUCT_VERSION_CONFLICT409Stale version / productVersion
BB_PRODUCT_GALLERY_INVALID400Gallery item kind, prefix, alt, poster or video count
BB_PRODUCT_DESCRIPTION_TOO_LONG400Sanitized text over 20,000 code points; details.maxLength
BB_PRODUCT_DESCRIPTION_EMPTY400Nothing allowed left after sanitizing
BB_VARIANT_NOT_FOUND404
BB_VARIANT_SKU_TAKEN409details.sku
BB_VARIANT_SKU_DUPLICATE_IN_REQUEST400Same SKU twice in one request, compared case-insensitively
BB_VARIANT_PRICE_INVALID400Selling price above MRP, or a price that is not whole paisa within 0 to 1,000,000,000,000
BB_VARIANT_DEFAULT_INACTIVE409Default must be active
BB_VARIANT_LAST_LIVE409Cannot delete the last live variant
BB_VARIANT_HAS_STOCK409Cannot delete a variant whose stock is above 0; write it off first (phase 3, see the stock API)
BB_VARIANT_NO_ACTIVE_SUCCESSOR409No active variant can become default
BB_VARIANT_VERSION_CONFLICT409Stale variant write
BB_VARIANT_OPTION_VALUES_INVALID400
BB_VARIANT_DUPLICATE_COMBINATION409Another live variant has the combination and label
BB_VARIANT_LIMIT_EXCEEDED400More than 100 live variants
BB_CATALOG_FIELD_INVALID400Any other chk_bb_* check violation
BB_OPTION_NOT_FOUND404
BB_OPTION_NAME_TAKEN409
BB_OPTION_LIMIT_EXCEEDED400More than 5 axes or 50 values
BB_OPTION_VALUE_NOT_FOUND404
BB_OPTION_VALUE_TAKEN409
BB_OPTION_VALUE_HAS_LIVE_VARIANTS409
BB_OPTION_ADD_WOULD_DUPLICATE_VARIANTS409
BB_OPTION_REMOVAL_WOULD_DUPLICATE_VARIANTS409
BB_BULK_TOO_MANY_ITEMS400Over 100 ids after de-duplication. The DTO rejects a raw array over 100 first as VALIDATION_FAILED, so this is not reachable through the routes
BB_REORDER_INVALID_ITEM400details.reason: duplicate_id, not_found, mixed_parents, incomplete_set
BB_JOB_NOT_FOUND404Also returned for another entity's job
BB_JOB_NOT_CANCELLABLE409Job already finished
BB_JOB_FILE_INVALID400Extension, MIME or unreadable file; also a missing file. As a row-0 entry in errors[] of a failed import: empty or unreadable file, not a workbook, wrong header, unclosed quote
BB_JOB_FILE_TOO_LARGE400Multer size limit at upload. As a row-0 entry in errors[]: over 5,000 data rows, 50 columns, 25 MiB, or a workbook that expands past 100 MiB
BB_JOB_EXPORT_TOO_LARGE400Over 50,000 rows at submit; also a row-0 entry when the data grew past it before the worker finished
BB_JOB_RESULT_NOT_AVAILABLE409No result file yet, or not a completed export
BB_JOB_RESULT_GONE410Export file missing on disk. A finished export's file is not expired
BB_JOB_TOO_MANY_ACTIVE409More than 2 queued or processing jobs for this admin
BB_JOB_INCLUDE_DELETED_FORBIDDEN403includeDeleted without BB_<E>_RESTORE
BB_JOB_IDEMPOTENCY_CONFLICT409Same key, different file
IDEMPOTENCY_KEY_REQUIRED400Import without the header
VALIDATION_FAILED400DTO failure; also an Idempotency-Key over 200 characters, and multer limits other than file size
UPLOAD_FILE_ACCESS_DENIED403A shared upload route asked for a uploads/bb-* key

Job-level codes, written to a job row and never returned as an HTTP error: BB_JOB_AUTHORIZATION_REVOKED, BB_JOB_LEASE_EXPIRED, BB_JOB_NEVER_DISPATCHED, BB_JOB_RETRY_ABANDONED. Import row codes in errors[]: BB_IMPORT_ROW_INVALID, _DUPLICATE, _CONFLICT, _REFERENT_INVALID, _MOVE_INVALID, _SKU_NOT_DEFAULT. When each row code is raised is in the Import and export files section.


Guardrail Summary

  1. Prices are integer paisa and never exceed 1,000,000,000,000. Do not send rupees or decimals.
  2. Never send a raw id as a label. Map every errorCode, kind, status and permission code to text in the client.
  3. A bulk response of 200 can still hold failures. Always read failed[].
  4. Reorder must send the exact live sibling set. Refetch after a 400 BB_REORDER_INVALID_ITEM.
  5. Send productVersion on every option write. Send version on product, variant and product-delete writes when you hold one, and handle 409 by reloading.
  6. Every create needs an Idempotency-Key. Reuse the same key only for a retry of the same request.
  7. A job is asynchronous. Poll GET .../:publicId; stop on completed, failed or cancelled. A 201 means queued, not done.
  8. An import is all or nothing and its uploaded file is deleted when the job ends. Fix every row in errors[], then upload again under a new Idempotency-Key. Replaying the same key with the same file returns the original job id, not a new job.
  9. Do not link to a job file path. Download an export only through .../:publicId/result; the shared upload routes refuse uploads/bb-*.
  10. A UI permission check is a convenience. The backend enforces every code.

See Also

  • Catalog feature overview: catalog-feature
  • Catalog backend architecture: catalog-backend
  • Phase 1 API: api