📬
Gorgias x Smartrr Integration
Instructions on how to integrate the Smartrr app with Gorgias
First, you'll need to generate a new access token in the Smartrr App for Gorgias. To start, navigate to Integrations under CONFIGURATION then click API Tokens on the top tab bar. Click Create Key.
Once the menu opens, give your token a nickname and set the Application Name to "Gorgias". Next, scroll down and set the Subscription permissions to Read and Write to allow Gorgias custom actions to modify Subscriptions.
Next, go to your Gorgias account > Settings and get the REST API credentials:
Back in the Smartrr app, return to the Integrations tab and navigate into the Integrations Marketplace. Scroll down to the Gorgias Card click Connect
Fill in the four fields with the necessary information and click Connect and Create Widget
Now that your integration has been set up and your widget has been created, return to Gorgias and create a sample ticket. Click on the gear in the upper right hand corner to edit the widget settings.
Scroll down the widget view until you locate Smartrr Integration. Drag over any data that you would like to see to the widget sidebar.
Note: The Smartrr widget will only populate and appear if the customer has subscriptions within Smartrr.

Using the Smartrr Widget

Once you've configured your Smartrr widget, you can view Smartrr subscription information and take subscription management actions directly from the Gorgias ticket interface.

Managing a Customer's Subscription with the Smartrr Widget

You can easily skip a subscriber's upcoming order, pause their subscription, or change the next order date using the quick actions at the top of the widget:
Quick actions within the Smartrr widget in Gorgias
Any actions taken from the widget within Gorgias will be added to the ticket history in Gorgias, as shown below:
When an upcoming order is skipped from within Gorgias, this appears in the Gorgias ticket log

Displaying Smartrr Subscription Information

Arm your CX team with all the relevant information about your subscribers by adding data to the Smartrr Widget, as shown below:
Remember you can always customize the data and buttons that appear in the widget by clicking the Edit Widgets settings button:
Edit widgets settings within Gorgias

Manual Integration

Use the below instructions in the event the above instructions do not work. First, go to Gorgias > Your Profile > Integrations > HTTP Integration > Add New Integration. Fill out the information asked. When asked for URL, enter:
https://api.smartrr.com/vendor/order/formatted?filterLike[emailOrName]={{ticket.customer.email}}
You'll have to add a header called x-smartrr-access-token. This is the access token you generated back in the Smartrr app in the Integrations tab.
Now that your integration has been set up and your widget has been created, return to Gorgias and create a sample ticket. Click on the gear in the upper right hand corner to edit the widget settings.
Scroll down the widget view until you locate Smartrr Integration. Drag over any data that you would like to see to the widget sidebar.​

Triggers

Triggers are currently activated by Gorgias only. Every time one of the actions listed in this section (Ticket created, Ticket updated, Ticket message created) is performed, it will send a request to the Smartrr app to pull data from our API.

Custom Actions

Gorgias allows for users to create buttons (custom actions) in the widget. To create a custom action for Smartrr, head over to the Widget Editor in Gorgias.
Note: Smartrr will automatically create some predefined buttons for you if the integration was done through via the Integrations tab in the Smartrr app. Due to some limitations, actions generated by Smartrr will only apply to the most recent subscriptions of a customer.
Once you’re in the widget editor, click Add Button.
A request window will open. From there, you're able to add custom actions on your end.
Include the same header and token you used to create the integration.
Most Smartrr actions require the PUT method and the URL will look similar to the one below:
https://api.smartrr.com/vendor/customer/{{ticket.customer.integrations.42404.data[0].custRel.id}}/purchase-state/{{ticket.customer.integrations.42404.data[0].sts[0].id}}/skip
Notes: 42404 in the above URL is the integration ID which is unique to every integration. You can find in the URL on Gorgias' integration’s page. data[0] and sts[0] refer to the subscription that you want to modify. 0 would be the most recent subscription and incrementing it by 1 will go back one subscription. The double brackets in the URL signify a macro variable in Gorgias which you can learn more about here.
To get a list of all actions available to you, you can visit Smartrr’s API documentation here.