Adding Product Inventory
Endpoints: POST /admin/products/{product_id}/inventories
Purpose
This endpoint allows administrators to update inventory-related settings for a specific product. It modifies key inventory management parameters including stock levels, inventory tracking preferences, and order quantity restrictions. The endpoint ensures accurate inventory control and prevents overselling by enforcing quantity limits.
Path Parameters
Parameter | Type | Description |
---|---|---|
product_id | Integer | The unique identifier of the product whose inventory is being updated |
Query Parameters
No query parameters for this endpoint.
Use Case
Administrators use this endpoint when they need to adjust inventory settings after receiving new stock, changing inventory management strategies, or correcting system discrepancies. The functionality is essential for maintaining accurate stock levels, setting low stock alerts, and enforcing business rules around minimum and maximum order quantities. This becomes particularly important during inventory audits, seasonal stock changes, or when implementing new inventory management policies across product lines.
Request Body
{
"product": {
"product_pricing_and_stock": {
"track_inventory": BOOLEAN,
"available_stock": "AVAILABLE_STOCK",
"low_level_stock": "LOW_LEVEL_STOCK",
"minimum_order_quantity": "MINIMUM_ORDER_QUANTITY",
"maximum_order_quantity": "MAXIMUM_ORDER_QUANTITY"
}
}
}
Response
The response confirms the successful update of inventory settings with a status message. The success message indicates all inventory parameters were updated according to the request, while any validation errors would return appropriate error messages.
{
"status": "success",
"message": "Inventory has been updated successfully"
}
Adding Product Images
Endpoints: POST /admin/products/{product_id}/image
Purpose
This endpoint enables administrators to upload and associate new images with existing products. It processes image files provided as base64-encoded strings, stores them in the product media library, and automatically generates optimized thumbnail versions. The endpoint maintains all existing media associations while adding new images.
Path Parameters
Parameter | Type | Description |
---|---|---|
product_id | Integer | The unique identifier of the product receiving the new images |
Query Parameters
No query parameters for this endpoint.
Use Case
Administrators use this endpoint when they need to add supplemental product imagery after initial product creation or to enhance existing product listings with additional visual content. Typical scenarios include adding new product angles, lifestyle shots, or updated packaging images. The endpoint handles the image processing and association automatically, ensuring proper integration with the product's existing media assets while preserving all previously uploaded content.
Request Body
{
"product": {
"image_and_video": {
"images": [
{
"filename": "IMAGE_FILE_NAME",
"base64": "BASE64_FORMAT_IMAGE"
}
]
}
}
}
Response
The response provides a complete snapshot of all media assets now associated with the product, including the newly uploaded images along with any pre-existing videos and specification files. For each uploaded image, the response includes system-generated identifiers, access URLs for both the original and thumbnail versions, and the processed filename. The response maintains the product's full media context by including all previously associated videos and documents alongside the new images.
{
"product": {
"images": [
{
"id": IMAGE_ID,
"filename": "IMAGE_FILENAME",
"thumbnail": "IMAGE_THUMBNAIL_URL",
"link": "IMAGE_URL"
}
],
"videos": [
{
"id": VIDEO_ID,
"filename": "VIDEO_FILENAME",
"thumbnail": "VIDEO_THUMBNAIL_URL",
"link": "VIDEO_URL"
}
],
"specs": [
{
"id": SPEC_ID,
"filename": "SPEC_FILENAME",
"link": "SPEC_URL"
}
]
}
}
Adding Product Reviews
Endpoints: POST /admin/products/{product_id}/reviews
Purpose
This endpoint allows administrators to create and attach customer reviews to specific products. It supports adding review text, star ratings, and optional attachments. The endpoint handles the complete review creation process including media upload and association with the product.
Path Parameters
Parameter | Type | Description |
---|---|---|
product_id | Integer | The unique identifier of the product receiving the review |
Query Parameters
No query parameters for this endpoint.
Use Case
Administrators use this endpoint to add customer reviews to products, typically when importing reviews from other systems or adding verified purchase reviews. Functionality is essential for building social proof and enhancing product credibility. Common scenarios include migrating reviews during platform changes, adding professional product evaluations, or incorporating offline customer feedback into the e-commerce system. The endpoint supports batch processing of multiple reviews in a single request.
Request Body
{
"product": {
"reviews": [
{
"name": "USER_NAME",
"email": "USER_EMAIL",
"review": "PRODUCT_REVIEW",
"file": [
{
"filename": "FILE_NAME",
"base64": "BASE64_ENCODED_STRING"
}
],
"rating": RATING_VALUE
}
]
}
}
Response
The response returns the successfully created review with system-generated identifiers for both the review record and any uploaded media assets. The review object includes all submitted information along with the processed image URLs, replacing the original base64 data with accessible resource links. The response maintains the structure of the input while adding server-generated IDs and transforming the file attachments into accessible resources.
{
"product": {
"reviews": [
{
"id": REVIEW_ID,
"name": "USER_NAME",
"email": "USER_EMAIL",
"review": "PRODUCT_REVIEW",
"file": [
{
"id": FILE_ID,
"filename": "FILE_NAME",
"thumbnail": "THUMBNAIL_URL"
}
],
"rating": RATING_VALUE
}
]
}
}