Skip to content
ad-platform

Salesforce

To keep vendor balances synchronized between Salesforce and Topsort, two workflows are required:

Salesforce to Topsort: Update Vendor Balance

When a vendor’s budget is updated in Salesforce, the client must trigger a workflow that calls the Topsort API to update the vendor’s balance:

Endpoint:

POST https://api.topsort.com/public/v1/billing-service/vendors/{external-vendor-id}/balance

Request Payload:

{
"balance": 1,
"description": "Free credits added to the account"
}

Amounts are truncated to the smallest currency unit. For example, $1,000.234 becomes $1,000.23.

Topsort to Salesforce: Update Vendor Balance

To keep Salesforce up to date, you must configure a webhook in Topsort to send a daily balance report for each vendor.

Endpoint:

POST https://api.topsort.com/public/v1/webhooks/webhooks

Request Payload:

{
"channel": "vendor:budget_update",
"url": "<client_endpoint_url>"
}

Required Fields:

  • channel: Must be “vendor:budget_update”
  • url: The client’s endpoint where Topsort will send updates

This will generate a daily POST request to the url provided by the client, with the following payload.

{
"channel": "vendor:budget_update",
"timestamp": "2024-10-31T14:42:55.759185Z",
"id": "gUo",
"payload": {
"name": "<Vendor name>",
"external_vendor_id": "<Vendor id>"
"budget": 1000
}
}

Payload Fields:

  • name: Vendor name
  • external_vendor_id: Marketplace’s vendor ID
  • budget: Current vendor budget