Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityDoc feedbackLog In
GitHubNuGetDev CommunityDoc feedback


Optimizely <<product-name>> allows users to cancel orders in the Admin Console or website. Enabling this option requires some initial setup:

  • Change two three settings to expose the cancel options.

  • Build the cancel order integration job.

IMPORTANT

If an order is canceled without a Cancel Order integration job, <<product-name>> will show that the order has been canceled. However, this cancellation has only occurred on the <<product-name>> side, and without the integration job, it will not have been communicated to the ERP. To correctly send the order cancellation to the ERP, the Order Cancel integration job must be built.

The following steps must be completed to display the option to cancel an order:

Setting up the option to cancel orders is a two step process:

  1. Create the correct order statuses via the **Order Status Mapping** tool (See the Order Status Mapping article for more details).

  2. Identify which statuses allow for order cancellation.

## Create and map the order statuses

  1. Go to **Admin Console** \> **Administration** \> **System** \> **Order Status Mapping.**

  2. Create the mapping and select the option to **Allow Cancellation** (See the Order Status Mapping article for more details).

  3. Click **Save**.

## Identify the cancellable order statuses

  1. Go to **Admin Console** \> **Administration** \> **System** \> **Settings.**

  2. Search for **Cancellable Order Statuses**.

  3. Enter the cancellable order statuses listed within the **Order Status Mapping** screen that will allow an order to be canceled. As necessary. use the **Plus** sign to add additional statuses.

    

  4. Click **Save**.

## Create the integration processor

A custom coded integration processor needs to be created first, which calls the API to update the ERP. The integration processor is then referenced as a part of the integration job, which is described below.

## Create the cancel order integration job

  1. Go to **Admin Console** \> **Administration** \> **Jobs** \> **Job Definitions**.

  2. In the **Primary** toolbar, click **Add New Job Definition**.

  3. In the **Details** finger tab, populate the following fields:

    <table style="margin-left: 0;margin-right: auto;width: 100%;mc-table-style: url('../../../Resources/Stylesheets/TableStyles/Borders.css');" class="TableStyle-Borders" cellspacing="0"><thead><tr class="TableStyle-Borders-Head-Header1"><th class="TableStyle-Borders-HeadE-Regular-Header1">Field Name</th><th class="TableStyle-Borders-HeadE-Regular-Header1">Value</th><th class="TableStyle-Borders-HeadD-Regular-Header1">Notes</th></tr></thead><tbody><tr class="TableStyle-Borders-Body-Row1"><td class="TableStyle-Borders-BodyE-Regular-Row1"><strong>Job Name</strong></td><td class="TableStyle-Borders-BodyE-Regular-Row1">OrderCancel</td><td class="TableStyle-Borders-BodyD-Regular-Row1">This is the recommended name.</td></tr><tr class="TableStyle-Borders-Body-Row1"><td class="TableStyle-Borders-BodyE-Regular-Row1"><strong>Job Type</strong></td><td class="TableStyle-Borders-BodyE-Regular-Row1">Execution</td><td class="TableStyle-Borders-BodyD-Regular-Row1">&#160;</td></tr><tr class="TableStyle-Borders-Body-Row1"><td class="TableStyle-Borders-BodyE-Regular-Row1"><strong>Connection</strong></td><td class="TableStyle-Borders-BodyE-Regular-Row1">ERP Connection</td><td class="TableStyle-Borders-BodyD-Regular-Row1">Typically done through the API connection, if any</td></tr><tr class="TableStyle-Borders-Body-Row1"><td class="TableStyle-Borders-BodyE-Regular-Row1"><strong>Preprocessor</strong></td><td class="TableStyle-Borders-BodyE-Regular-Row1">None</td><td class="TableStyle-Borders-BodyD-Regular-Row1">&#160;</td></tr><tr class="TableStyle-Borders-Body-Row1"><td class="TableStyle-Borders-BodyE-Regular-Row1"><strong>Integration Processor</strong></td><td class="TableStyle-Borders-BodyE-Regular-Row1">&#160;</td><td class="TableStyle-Borders-BodyD-Regular-Row1">This is custom per the customer ERP</td></tr><tr class="TableStyle-Borders-Body-Row1"><td class="TableStyle-Borders-BodyB-Regular-Row1"><strong>Post Processor</strong></td><td class="TableStyle-Borders-BodyB-Regular-Row1">None</td><td class="TableStyle-Borders-BodyA-Regular-Row1">&#160;</td></tr></tbody></table>

  4. Click **Save**.

  5. Next, click the **Parameters** finger tab and click **Add Job Definition Parameter**.

  6. Populate the following fields:

    <table style="margin-left: 0;margin-right: auto;width: 100%;mc-table-style: url('../../../Resources/Stylesheets/TableStyles/Borders.css');" class="TableStyle-Borders" cellspacing="0"><thead><tr class="TableStyle-Borders-Head-Header1"><th class="TableStyle-Borders-HeadE-Regular-Header1">Field Name</th><th class="TableStyle-Borders-HeadE-Regular-Header1">Value</th><th class="TableStyle-Borders-HeadD-Regular-Header1">Note</th></tr></thead><tbody><tr class="TableStyle-Borders-Body-Row1"><td class="TableStyle-Borders-BodyE-Regular-Row1"><strong>Name</strong></td><td class="TableStyle-Borders-BodyE-Regular-Row1">OrderNumber</td><td class="TableStyle-Borders-BodyD-Regular-Row1">&#160;</td></tr><tr class="TableStyle-Borders-Body-Row1"><td class="TableStyle-Borders-BodyE-Regular-Row1"><strong>Value Type</strong></td><td class="TableStyle-Borders-BodyE-Regular-Row1">String</td><td class="TableStyle-Borders-BodyD-Regular-Row1">&#160;</td></tr><tr class="TableStyle-Borders-Body-Row1"><td class="TableStyle-Borders-BodyE-Regular-Row1"><strong>Default Value</strong></td><td class="TableStyle-Borders-BodyE-Regular-Row1">&#160;</td><td class="TableStyle-Borders-BodyD-Regular-Row1">Leave blank</td></tr><tr class="TableStyle-Borders-Body-Row1"><td class="TableStyle-Borders-BodyB-Regular-Row1"><strong>Prompt</strong></td><td class="TableStyle-Borders-BodyB-Regular-Row1">Order Number</td><td class="TableStyle-Borders-BodyA-Regular-Row1">This can be left blank</td></tr></tbody></table>

  7. Click the **Save** .