Pre-Requisites

  1. You must be a customer of OrderProtection. If you are not a customer of OrderProtection but would like to be please reach out to Onboarding
  2. You must have access to your OrderProtection dashboard at https://app.orderprotection.com

Installing the Plugin

You can download the Magento module zip file Here To install the plugin please follow the README.md which will be included in the directory. After Magento Installation Before you edit the plugin settings we need to generate a few items from your OrderProtection dashboard. Login here Once signed in, you must make sure that the store you would like to install the plugin on is selected from the store dropdown. sidebar img

Generating your API Token

You must generate an API token which will be used to authenticate your store with OrderProtection’s API. This is a sensitive key as it will allow you to send order information into OrderProtection. Please store this in a safe place. Click on the settings navigation item in the left sidebar. sidebar-settings After navigating to settings, navigate to the API Tokens tab woo-settings-api-tokens Generate a new API token using the Create API Token button. You can name this anything that you’d like. We use the name to attribute actions to a specific key. If your API key were to be compromised you’d be able to know exactly which key to remove. create-api-token After clicking Create make sure to save the value shown. You will not be able to see this value again! woo-created-api-token Save this token somewhere safe, you’ll need this in your OrderProtection Magento plugin settings.

Creating a Webhook

In order for OrderProtection to be able to create replacement orders and refund customers we need to create a webhook. This webhook will send a request to your OrderProtection Magento plugin informing the plugin which items to reship or refund. You’ll need to know your hosted sites location e.g (https://orderprotection.com) Go back to your settings tab in your OrderProtection dashboard and click on the Webhooks tab. webhooks-view Click on the Create Webhook button and add the following details: Payload URL:
https://${yourdomain}/rest/V1/order-protection/webhook
Webhook Secret In your Magento dashboard: You will need to navigate to System -> Integration and create a new Integration. You can call this Integration Order Protection. Once you have this integration you need to click on the Edit (pencil) button. This will show you the integration settings. You need to find the Access Token field. Your webhook secret will match the following format: ${AccessToken} Input this into your OrderProtection webhook secret field. Events Click on Let me select individual events Choose the following:
  • Claims -> Approved
  • Claims -> Created
You only need this one event for the OrderProtection Plugin to work correctly. Click Create It should look something like this: webhook-select-events woo-webhook-filled

Finalizing Plugin Settings

Once you have your API token and Webhook secret, navigate to your admin page of your store. You will need to find the Order Protection section You can find this section by navigating to Stores -> Configuration -> Sales -> Order Protection Side Bar View of Config Once in this section you will need to scroll to the API Setting section. Here you will configure your api token and store URL.