Item/Products
This section covers creating an item/product, viewing a product, and sending a product to eTIMS.
Create an item/product
Description
This endpoint creates a new item/product.
Several fields reference IDs/codes that must be fetched from their own lookup endpoints before you create a product — see Where to get the reference IDs below.
Key fields
| Priority | Key | Type | Description |
|---|---|---|---|
| REQUIRED | name | text | Product name |
| REQUIRED | product_type | text | e.g. sku, consu, service |
| REQUIRED | item_type | text | eTIMS item type code |
| REQUIRED | scu_item_classification | integer | KRA item classification code (see lookup below) |
| REQUIRED | packaging_unit | uuid | Packaging unit ID (see lookup below) |
| REQUIRED | quantity_unit | uuid | Quantity unit ID (see lookup below) |
| REQUIRED | country_of_origin | text | Country ISO code |
| Optional | sale_taxes | uuid[] | Sale tax IDs (see lookup below) |
| Optional | purchase_taxes | uuid[] | Purchase tax IDs (see lookup below) |
| Optional | categories | uuid[] | Category IDs (see lookup below) |
| Optional | levies | uuid | Levy ID — only if the product attracts a levy (e.g. catering levy) (see lookup below) |
| Optional | selling_price | text | Selling price |
| Optional | stockable | boolean | Whether the product is stockable |
Where to get the reference IDs
Call these endpoints (with your X-Workstation header) to list valid values and copy the id/code into the payload above.
| Payload field | Lookup endpoint |
|---|---|
packaging_unit | GET /api/products/packaging_units/ |
quantity_unit | GET /api/products/quantity_units/ |
sale_taxes, purchase_taxes | GET /api/products/taxes/ |
categories | GET /api/products/categories/ |
levies (e.g. catering levy) | GET /api/products/levies/ |
scu_item_classification | GET /api/etims/item_classifications/ |
Headers
AcceptReturns response in json format
X-Workstation[REQUIRED] Workstation ID
Create an item/product › Request Body
namescu_item_classificationselling_pricepurchasing_pricesale_taxesproduct_typeitem_typecategoriespackaging_unitquantity_unitcountry_of_originpurchase_taxesCreate an item/product › Responses
Created
categoriescodeidnameorganisationproduct_typepurchase_taxespurchasing_pricequantity_at_handsale_taxesselling_pricesupplier_idsupplier_nametaxesmetadataslade_codeactivecreatedcreated_byupdatedupdated_bydescriptionitem_typeproduct_variantcountry_of_origincan_be_soldcan_be_purchasedcharge_masterpreferred_nametrackingbarcodeis_drop_shippedcover_imagethumbnailcover_image_urlthumbnail_urlis_favoriteshow_quantityis_featuredsent_to_etimsscu_item_codeorganisation_pinis_pre_packagedproduct_uomsupplierscu_item_classificationquantity_unitpackaging_unitView a product
Description
This endpoint retrieves a single product by its ID. The id is the product ID returned when the product was created.
Required
- id - [REQUIRED] The product ID.
path Parameters
id(Required) Product UID
Headers
AcceptX-Workstation[REQUIRED] Workstation ID
View a product › Responses
OK
categoriescodeidnameorganisationproduct_typepurchase_taxespurchasing_pricequantity_at_handsale_taxesselling_pricesupplier_idsupplier_nametaxesmetadataslade_codeactivecreatedcreated_byupdatedupdated_bydescriptionitem_typeproduct_variantcountry_of_origincan_be_soldcan_be_purchasedcharge_masterpreferred_nametrackingbarcodeis_drop_shippedcover_imagethumbnailcover_image_urlthumbnail_urlis_favoriteshow_quantityis_featuredsent_to_etimsscu_item_codeorganisation_pinis_pre_packagedproduct_uomsupplierscu_item_classificationquantity_unitpackaging_unitSend a product to eTIMS
Description
Sends a specific list of products to eTIMS synchronously. Products that are already sent, or that are missing an scu_item_code, are handled as described below.
Request Body
| Priority | Key | Type | Description |
|---|---|---|---|
| REQUIRED | product_ids | uuid[] | Non-empty list of product IDs to send to eTIMS |
Required
- X-Workstation - [REQUIRED] The workstation ID of the user. The user's branch must be eTIMS-verified.
Headers
AcceptReturns the response in JSON format
X-Workstation[REQUIRED] Workstation ID
Send a product to eTIMS › Request Body
product_idsNon-empty list of product IDs to send to eTIMS
Send a product to eTIMS › Responses
Products processed. Returns the counts and IDs of products that were synced and those that failed. When every requested product was already sent, the response is {"detail": "All requested products are already sent to eTIMS."}.
detailsynced_countsynced_product_idsfailed_countfailed_product_ids
