Catalogs
GET /establishments/[establishmentId]/catalogs
Retrieves a list of prize catalogs for the specified establishment. Each catalog represents a collection of prizes organized by category.
Endpoint
Parameters
Atributo | Descripcion | Tipo | Ubicación | Requerido |
---|---|---|---|---|
establishmentId | string | path | Sí |
Responses
200
Catalogs fetched successfully.
[
{
"establishmentId": "string"
"catalogId": "string"
"category": "string"
"name": "string"
"productCount": "integer"
}
]
500
Failed to retrieve catalogs due to server error.
POST /establishments/[establishmentId]/catalogs
Creates a new prize catalog for the given establishment. A catalog may optionally include an array of initial product IDs.
Endpoint
Request Body
{
"name": "string" // required
"category": "string" // required
"productIds": "array"
}
Atributo | Tipo | Requerido | Descripción |
---|---|---|---|
name | string | Sí | |
category | string | Sí | |
productIds | array | No |
Parameters
Atributo | Descripcion | Tipo | Ubicación | Requerido |
---|---|---|---|---|
establishmentId | string | path | Sí |
Responses
200
Catalog created successfully.
500
Server error while creating catalog.
GET /establishments/[establishmentId]/catalogs/[catalogId]
Fetches details for a specific catalog, including associated metadata and prize relationships.
Endpoint
Parameters
Atributo | Descripcion | Tipo | Ubicación | Requerido |
---|---|---|---|---|
establishmentId | string | path | Sí | |
catalogId | string | path | Sí |
Responses
200
Catalog and associated products retrieved successfully.
{
"establishmentId": "string"
"catalogId": "string"
"category": "string"
"name": "string"
"products": "array"
}
400
Invalid catalog or establishment ID.
500
Failed to retrieve catalog or associated products.
PUT /establishments/[establishmentId]/catalogs/[catalogId]
Updates the catalog name or metadata for a given catalog ID. Typically used to rename or re-categorize the catalog.
Endpoint
Request Body
{
"name": "string" // required
}
Atributo | Tipo | Requerido | Descripción |
---|---|---|---|
name | string | Sí |
Parameters
Atributo | Descripcion | Tipo | Ubicación | Requerido |
---|---|---|---|---|
establishmentId | string | path | Sí | |
catalogId | string | path | Sí |
Responses
200
Catalog updated successfully.
500
Server error while updating catalog.
DELETE /establishments/[establishmentId]/catalogs/[catalogId]
Deletes a catalog by its ID. This action will detach all product associations linked to the catalog.
Endpoint
Parameters
Atributo | Descripcion | Tipo | Ubicación | Requerido |
---|---|---|---|---|
establishmentId | string | path | Sí | |
catalogId | string | path | Sí |
Responses
200
Catalog deleted successfully.
500
Server error while deleting catalog.
POST /establishments/[establishmentId]/catalogs/[catalogId]/products
Adds a batch of product IDs to the specified catalog. Useful for dynamically updating prize sets or rotating inventory.
Endpoint
Request Body
{
"productIds": "array" // required
}
Atributo | Tipo | Requerido | Descripción |
---|---|---|---|
productIds | array | Sí |
Parameters
Atributo | Descripcion | Tipo | Ubicación | Requerido |
---|---|---|---|---|
establishmentId | string | path | Sí | |
catalogId | string | path | Sí |
Responses
200
Products added to catalog successfully.
500
Server error while adding products to catalog.
DELETE /establishments/[establishmentId]/catalogs/[catalogId]/products/[productId]
Removes a specific product from the given catalog. Does not delete the product itself—only the catalog linkage.
Endpoint
Parameters
Atributo | Descripcion | Tipo | Ubicación | Requerido |
---|---|---|---|---|
establishmentId | string | path | Sí | |
catalogId | string | path | Sí | |
productId | string | path | Sí |
Responses
200
Product removed from catalog.
500
Failed to remove product from catalog.