Skip to content
Account lifecycle

Salesforce to ERP

Salesforce → ERP

Salesforce does not push Sold To or Bill To edits, freezes, or deactivations into ERP. ERP is the caller for this chapter. What comes back is the HTTP result of that call, and one callback when a new Bill To is created.

PATCH response

Every update and every status change is a PATCH. Success is HTTP 204 and an empty body.

HTTP/1.1 204 No Content

ERP does not read any field from that response. The Account Id was already known.

A validation failure comes back as the Salesforce error array, and ERP logs it. The ERP API the user called has already returned 200 or 201. Typical causes are a GSTIN or PAN that fails the Salesforce rule, a pincode that is not 6 digits, or a payment term outside Net 15, Net 30, Net 45, Net 60, and Net 90.

POST response for a new Bill To

POST /services/data/v67.0/sobjects/Account for WARE001 succeeds with HTTP 201:

{
  "id": "001000000000003AAA",
  "success": true,
  "errors": []
}

ERP writes 001000000000003AAA onto Bill To WARE001 immediately. HTTP 200 with the same shape is also accepted. An empty id is a failure and is logged. The code WARE001 still exists in ERP.

Record ID callback for the new Bill To

The insert is a new Bill To, so BillTo_AfterSave calls Account_AfterSave_Shared, which posts the same callback used at the end of onboarding.

POST /api/accounts/salesforce-callback

{
  "salesforceRecordId": "001000000000003AAA",
  "accountType": "BillTo",
  "erpCode": "WARE001",
  "timestamp": "2026-11-06T04:00:02Z"
}

ERP already stored that Id from the 201. The callback finds the same Id and answers HTTP 200 without changing the row:

{
  "status": "received",
  "erpCode": "WARE001"
}

A callback that names a different Account Id for WARE001 is HTTP 409:

{
  "error": "conflict",
  "message": "bill to account already linked to a different salesforce record id"
}

Sold To and Bill To field updates, freezes, and deactivations do not send this callback. The Account Id did not change.

The callback path, retries, and the dead-letter log are the same as in distributor onboarding.