Skip to main content
The syncing endpoints are designed to treat your business and customer data as the source of truth. If you have a unique identifier for business or customer within your vertical software, you can provide that as the external_id on every request and Pocketflows will create or update the record to match and return the Pocketflows ID as well. There are four sync endpoints:
  • POST /sync/businesses
  • POST /sync/businesses/batch
  • POST /sync/businesses/:business_id/customers
  • POST /sync/businesses/:business_id/customers/batch
For the requests to send, see Sync businesses and customers.

Create or replace

All of the sync endpoints adopt a “create or replace” strategy. When external_id is provided in the API payload, if no existing record is found with the external_id, a new record is created. When an existing record is found, then its properties are wholly replaced by the new ones.
This also blanks out properties that are not provided in the request, so it is important to pass all properties in every sync request.

id and external_id

The sync endpoints allow either external_id or id (the Pocketflows ID) to be passed. id takes precedence over external_id and will be used to find the record. When both id and external_id are passed, the record is first found via the id then the external_id is updated to whatever is passed (along with all other fields)

Batch requests

The customer batch endpoint allows for partial success: when a customer record is invalid for whatever reason, the rest of the request will process and create / replace the other records synced. The business batch endpoint does not: if any record is invalid, for example an id that does not match one of your businesses, the whole request fails and no businesses are synced.