Skip to content
On this page

WooCommerce

Setup

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 Seth
  2. You must have access to your OrderProtection dashboard at https://app.orderprotection.com

Installing the Plugin

You should receive a zip file with the contents of the OrderProtection plugin. Once you receive this plugin you must install this in wp-content/plugins

In order to activate the plugin you must have WooCommerce installed, otherwise installation will fail.

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 WooCommerce 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 WooCommerce 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}/wp-json/order-protection/v1/claim-resolution

Webhook Secret

You can add anything here, it's recommended to use something that is not easily guessed.

You can generate a unique secret using the following command.

bash
openssl rand --hex 24

this will generate a random string that won't be easily guessed.

Events Click on Let me select individual events

Choose Claims -> Resolved

You only need this one event for the OrderProtection Plugin to work correctly.

Click Create

It should look something like this:

woo-webhook-filled

Finalizing Plugin Settings

Once you have your API token and Webhook secret, navigate to the installed plugins settings for Order Protection and add the following:

  • URL: this should be your store URL with the domain only (no HTTP prefix). Example: orderprotection.com
  • API token: API token generated in the Order Protection app.
  • Webhook Secret: Webhook secret generated in the Order Protection app.

woo-plugin-settings

Summary

That's it! If you have any issues with OrderProtection's plugin you can enable and disable easily using the checkbox in your WordPress plugin settings.