Yotpo
This document will walk through integrating Chord's OMS with Yotpo. Once you integrate, your customers will be able to use a powerful data-driven tools that makes it very easy for your customers to provide their feedback so you can transform every purchase made into a review.
The Yotpo destination function is used to sync completed orders from the Chord's OMS platform to Yotpo to be able to collect higher-quality reviews addressing high-converting topics that actually inspire purchases and grow your business
For more information about Yotpo and custmizing the request flows please refer to their document here
Before starting the creation of the function ensure that you are using the correct code template. There are two different code templates for Autonomy vs Performance customers. It is important to choose the right one.
Copy the correct code
Navigate to Segment and click Catalog -> Functions -> New Function
Select "Destination Function" and click Build
Paste in the function code from above
and click Settings - Add Setting
Label = apikey
Name = apikey
Unanmed = <apikey> (found in Yotpo settings)
Click Add Setting
Label = secretkey
Name = secretkey
Unamed = <secretkey> (found in Yopto settings)
Click Add Setting
Label = secretkey
Name = secretkey
Unamed = <secretkey> (found in Yopto settings)
Click Array
In the First Item event field paste Order Completed
Remove Second and Third Item fields
Click Add Setting
Click Configure
Provide a Name, we recommend Yotpo Function
Provide a Description, and even a logo and click create Function
Your Function has been created!
Click Connect Destination
For Autonomy customers, the destination function should be connected to the Ruby back-end source.
For Performance customers, the destination function should be connected to the Javascript front- end source.
When you connect the destination function, you'll need to provide values for the settings you configured above.
Select your Destination and click Next
Provide a Destination Name, we recommend something like "Yotpo Production" Click Save
Enter the Yotpo API key and secret key (found in the Yotpo admin), and Order Completed for the events setting.
Make sure to enable the function
You can test that the function is working correctly in the "Event Tester" tab.
You'll need an example event, so find (or place a test order) a recent Order Completed event in the Segment Debugger for the source that you connected to the Yotpo function, and copy the entire event JSON from the "Raw" tab:
Navigate to the "Event Tester" tab of the Yotpo destination function you just created, and replace the dummy JSON with the event JSON you copied:
The order from the Order Completed event you copied will be synced to Yotpo, so if Yotpo is configured to send automatic review requests, the customer will receive one.
Hit "Send Event" and make sure you see a 200:
If you would like to query the Yotpo API to see what orders have been submitted from the function, here's how:
- Get an access token
Populate the API_KEY and the SECRET_KEY in the code snippet:
curl --request POST \
--url https://api.yotpo.com/core/v3/stores/API_KEY/access_tokens \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{ "secret": "SECRET_KEY" }'
Copy the access_tokenfrom the output and use it in the next step.
- Get the list of orders
Populate the API_KEY and the TOKEN (from access_token above) in the code snippet:
curl --request GET \
--url https://api.yotpo.com/core/v3/stores/API_KEY/orders \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Yotpo-Token: TOKEN'
You should get a JSON list of orders from Yotpo.
Your connection is now successfully created!