Chord Commerce Event Tracking
...
Guides
Integrations

Yotpo

3min



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



New Function
New Function




Select "Destination Function" and click Build

Paste in the function code from above

Function Type - Destination
Function Type - Destination




and click Settings - Add Setting

Label = apikey

Name = apikey

Unanmed = <apikey> (found in Yotpo settings)

Click Add Setting

Adding Setting
Adding Setting






Label = secretkey

Name = secretkey

Unamed = <secretkey> (found in Yopto settings)

Click Add Setting

Document image




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

Events Setting
Events Setting




Click Configure

Provide a Name, we recommend Yotpo Function

Provide a Description, and even a logo and click create Function

Creating Function
Creating Function




Your Function has been created!

Click Connect Destination

Connecting the Destination
Connecting the Destination


For Autonomy customers, the destination function should be connected to the Ruby back-end source.

example of Ruby autonomy back-end
example of Ruby autonomy back-end


For Performance customers, the destination function should be connected to the Javascript front- end source.

example of JS Performance front-end
example of JS Performance front-end




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:

Order Completed Debugger
Order Completed Debugger


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:

Event Tester
Event Tester






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:

Event Lifecycle
Event Lifecycle




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!







Updated 19 Dec 2023
Did this page help you?