Skip to content
Chapter

Vendor

Vendor

A vendor is a service company on the territory, not a distributor. ERP owns the vendor. Salesforce has no outbound integration for a Vendor Account. The sample is Speedy Service, on the same territory as Sharma Distributors.

Code Name Territory GSTIN PAN Status
VN-00001 Speedy Service TER-KA-BLR-01 29FGHIJ5678K1Z2 FGHIJ5678K Active

ERP assigns the code. The first vendor is VN-00001. The next is VN-00002. The caller does not send a code.

The territory must already exist, and it must be an active Territory-level row. TER-KA-BLR-01 is that row. GSTIN and PAN are required. Phone and pincode may be blank. A phone, when sent, is 10 digits. A pincode, when sent, is 6 digits. A create stores the vendor as Active.

Saving a vendor 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. A first create stores the Salesforce id.

ERP API What Salesforce receives
POST /api/vendors and PATCH /api/vendors/{code} PATCH of Account by Vendor_Code__c, record type Vendor, status Active
PATCH /api/vendors/{code}/deactivate The same PATCH with Account_Status__c Inactive
POST /api/service-requests and POST /api/asset-service-assignments Nothing. Both stay in ERP

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

With the territory, catalogue, and vendor in place, the next chapter brings in the distributor: Distributor onboarding.