Products
GET /products
Retrieves all products associated with a specific establishment. Each product includes metadata, stock levels, pricing, and categorization.
Endpoint
Parameters
| Atributo | Descripcion | Tipo | Ubicación | Requerido |
|---|---|---|---|---|
| establishment_id | string | query | Sí |
Responses
200
Products retrieved successfully.
[
{
"catalogs": "object"
"status": "string"
"reserved": "integer"
"stock": "integer"
"establishmentId": "string"
"weight": "integer"
"probability": "number"
"valueInEuros": "number"
"provider": "string"
"verificationDate": "string"
"featured": "boolean"
"productId": "string"
"certificate": "boolean"
"order": "number"
"digital": "boolean"
"helpLink": "string"
"providerId": "string"
"medias": "array"
"height": "integer"
"year": "integer"
"verifiedBy": "string"
"category": "string"
"prizeCategory": "string"
"price": "number"
"type": "string"
"translations": "object"
}
]500
Server error while retrieving products.
POST /products
Creates a new product within the context of a given establishment. Products include detailed information such as name, price, category, verification metadata, and display configuration.
Endpoint
Request Body
{
"establishmentId": "string" // required
"stock": "integer" // required
"price": "number" // required
"internalPrice": "number"
"valueInEuros": "number" // required
"height": "integer"
"weight": "integer"
"name": "string" // required
"status": "string"
"description": "string" // required
"extendedDescription": "string" // required
"additionalDetails": "string" // required
"verificationDate": "string" // required
"verifiedBy": "string"
"providerId": "string"
"provider": "string"
"category": "string"
"type": "string"
"certificate": "boolean"
"isAdmin": "boolean"
"helpLink": "string"
"prizeCategory": "string" // required
"imageUrl": "string"
"featuredImageUrl": "string"
"featured": "boolean"
"digital": "boolean"
"medias": "array"
"year": "integer" // required
}| Atributo | Tipo | Requerido | Descripción |
|---|---|---|---|
| establishmentId | string | Sí | |
| stock | integer | Sí | |
| price | number | Sí | |
| internalPrice | number | No | |
| valueInEuros | number | Sí | |
| height | integer | No | |
| weight | integer | No | |
| name | string | Sí | |
| status | string (available, unavailable, booked, hidden, sold) | No | |
| description | string | Sí | |
| extendedDescription | string | Sí | |
| additionalDetails | string | Sí | |
| verificationDate | string | Sí | |
| verifiedBy | string | No | |
| providerId | string | No | |
| provider | string | No | |
| category | string | No | |
| type | string | No | |
| certificate | boolean | No | |
| isAdmin | boolean | No | |
| helpLink | string | No | |
| prizeCategory | string (legendary, epic, rare, uncommon, common, virtual) | Sí | |
| imageUrl | string | No | |
| featuredImageUrl | string | No | |
| featured | boolean | No | |
| digital | boolean | No | |
| medias | array | No | |
| year | integer | Sí |
Responses
200
Product created successfully.
400
Invalid or incomplete product definition.
500
Failed to create product.
GET /products/[productId]
Retrieves the details of a specific product by its ID. Returns complete metadata, including category, availability, and configuration.
Endpoint
Parameters
| Atributo | Descripcion | Tipo | Ubicación | Requerido |
|---|---|---|---|---|
| productId | string | path | Sí |
Responses
200
Product retrieved successfully.
{
"catalogs": "object"
"internalPrice": "number"
"status": "string"
"reserved": "integer"
"stock": "integer"
"establishmentId": "string"
"weight": "integer"
"probability": "number"
"valueInEuros": "number"
"provider": "string"
"verificationDate": "string"
"featured": "boolean"
"productId": "string"
"visible": "boolean"
"certificate": "boolean"
"order": "number"
"isAdmin": "boolean"
"digital": "boolean"
"helpLink": "string"
"providerId": "string"
"medias": "array"
"height": "integer"
"year": "integer"
"verifiedBy": "string"
"category": "string"
"prizeCategory": "string"
"price": "number"
"type": "string"
"translations": "object"
}400
Invalid product ID.
404
Product not found.
500
Error retrieving product details.
PUT /products/[productId]
Updates a product by ID. Fields such as price, stock, translations, and metadata can be modified. Only valid product data should be submitted to avoid data integrity issues.
Endpoint
Request Body
{
"stock": "integer"
"price": "integer"
"internalPrice": "integer"
"valueInEuros": "number"
"height": "integer"
"weight": "integer"
"status": "string"
"verificationDate": "string"
"verifiedBy": "string"
"providerId": "string"
"provider": "string"
"category": "string"
"type": "string"
"certificate": "boolean"
"isAdmin": "boolean"
"helpLink": "string"
"prizeCategory": "string"
"imageUrl": "string"
"featuredImageUrl": "string"
"featured": "boolean"
"digital": "boolean"
"medias": "array"
"year": "integer"
"translations": "object"
}| Atributo | Tipo | Requerido | Descripción |
|---|---|---|---|
| stock | integer | No | |
| price | integer | No | |
| internalPrice | integer | No | |
| valueInEuros | number | No | |
| height | integer | No | |
| weight | integer | No | |
| status | string (available, unavailable, booked, hidden, sold) | No | |
| verificationDate | string | No | |
| verifiedBy | string | No | |
| providerId | string | No | |
| provider | string | No | |
| category | string | No | |
| type | string | No | |
| certificate | boolean | No | |
| isAdmin | boolean | No | |
| helpLink | string | No | |
| prizeCategory | string (legendary, epic, rare, uncommon, common, virtual) | No | |
| imageUrl | string | No | |
| featuredImageUrl | string | No | |
| featured | boolean | No | |
| digital | boolean | No | |
| medias | array | No | |
| year | integer | No | |
| translations | object | No | Per-locale translations; keys are language codes (e.g., 'en', 'es'). |
Parameters
| Atributo | Descripcion | Tipo | Ubicación | Requerido |
|---|---|---|---|---|
| productId | string | path | Sí |
Responses
200
Product updated successfully.
404
Product not found.
500
Failed to update product.
DELETE /products/[productId]
Deletes a product by its ID. This operation is irreversible and will remove the product from all associated catalogs and listings.
Endpoint
Parameters
| Atributo | Descripcion | Tipo | Ubicación | Requerido |
|---|---|---|---|---|
| productId | string | path | Sí |
Responses
200
Product deleted successfully.
400
Invalid product ID.
404
Product not found.
500
Server error during deletion.
POST /exclusive
Requests an exclusive product lock or reservation for a limited time period. This may be used to provide VIP-only availability or time-sensitive rewards.
Endpoint
Request Body
{
"days": "number" // required
}| Atributo | Tipo | Requerido | Descripción |
|---|---|---|---|
| days | number | Sí |
Responses
200
Exclusive access granted or acknowledged.
400
Invalid exclusivity request.
500
Failed to process exclusivity request.