Skip to content
Chapter

Product

Product

A product is what Sharma Distributors orders. ERP owns the catalogue. Salesforce has no outbound integration for Product_Category__c or Product_Master__c.

The sample is one category and one product. A bundle is a second product that points at the first.

Code What it is Parent
CAT-TEA Category, level 1, Tea none
TEA-500 Assam Leaf 500g category CAT-TEA
TEA-GIFT Assam Leaf Gift Pack, a bundle of two TEA-500 category CAT-TEA

Saving a category or a product calls Salesforce in the same request. The local row is kept either way. syncStatus is Synced when the call succeeded and Failed when it did not.

ERP API What Salesforce receives
POST /api/product-categories PATCH of Product_Category__c by Category_Code__c
POST /api/products and PATCH /api/products/{code} PATCH of Product_Master__c by Product_Code__c
A product with "isBundle": true The product upsert, then the old Bundle_Component__c rows are deleted and the new ones are created

A product may name categoryCode only when that category already exists in ERP. A category of level 2 or higher needs a parent code. A category cannot be its own parent.

Product status is Active, Discontinuing, End of Life (EOL), or Inactive. Each GST rate (CGST, SGST, IGST, UTGST) must be from 0 through 28. Is_Taxable__c is true when any of those rates is above 0.

The JSON ERP posts is on ERP → Salesforce. What Salesforce returns is on Salesforce → ERP.

What Sharma Distributors pays for TEA-500 is the next chapter, Price.