Implement Platform Event Notifications
When a Bold app is first installed, it performs some initial tasks that sync the customer, order, and product data between the platform and the Bold database. After the initial sync, it is important to continue to keep Bold up-to-date on any changes to that data. In a Platform Connector project, you must create webhooks to send that updated information to Bold.
The Platform Event Notification Specifications provide information about the endpoints that you can call to update Bold about changes to your customer, order, and product data. How and when you call these endpoints is entirely up to your own implementation. This document provides several examples of scenarios during which you may need to call these endpoints.
Scenario 1: Simple data change
The following image and steps demonstrate the actions that must be taken when a merchant creates a new product without Bold’s knowledge:
- The brand creates a new product and adds it to their product database, which is synced with their platform.
- The platform notes that something has changed and provides the Platform Connector with the product information.
- The Platform Connector sends a
Save Productevent notification to Bold.
- Bold updates their own database, and both databases are in sync. Bold sends a success message back to the Platform Connector.
Scenario 2: Data change with side effects
In addition, the Platform Connector may also need to send an event notification to Bold if an entity changes in response to another operation. For example, the following image and steps demonstrate the actions that must be taken when a customer changes their default address on the store.
The following image first shows the original operation, then the event notification that must happen as a result of those changes.
- While completing their checkout, a customer enters a new address and marks it as default.
- Bold makes an
Update Customercall to the Platform Connector telling it to create a new address for a given customer and mark the newly created address as default.
- The Platform Connector creates the new address and sets
- According to the brand's platform, there cannot be more than one default address. The platform updates the
is_defaultfield of the original address to
- Recognizing that the platform and Bold are out of sync because the original address changed, the Platform Connector sends Bold a
Save Customerevent notification with the updated customer information.
- Bold updates their database and sets the
is_defaultproperty of the original address to