# Process Order Refunds and Retractions in Advocate

This guide explains how to process order refunds and retractions as well as reward cancellations within the Advocate program.

{% stepper %}
{% step %}

### Set up your Advocate program rule configuration

To enable automatic reward retraction when a referred purchase is refunded, you must configure a specific rule in your Advocate program. This rule is essential. Without it, API calls to reverse actions will not trigger reward retraction.

In the impact.com platform:

1. In the left navigation menu, select ![](/files/BeULgToxpyZwSNyrMQdA) **\[Engage] → Program rules**.
2. Select **Add Rule** within the *Program rules* section.

<div data-with-frame="true"><figure><img src="/files/6vJIPAgiTGrHHvKEmFJt" alt="" width="563"><figcaption></figcaption></figure></div>

3. Select **Friend refunds a purchase** as the rule trigger from the dropdown menu.
4. Select the purchase event that the refund is associated to, and give the rule a name.
5. Select **Next**.
6. Select the action you want to take once it triggers.
7. Give the action a name, then select **Next**.
8. Review the rule details, then select **Save**.
   {% endstep %}

{% step %}

### Trigger a retraction action via API

Advocate requires a specific API call to process a refund or retraction. Do not create a new conversion event. Instead, use the [Reverse an Action ](/brand-api-reference/brand-api-reference-v13/reference/actions/actions.md#delete-a-dvertisers-accountsid-actions)API to trigger the retraction.

#### Key requirements

* You must include `Amount=0` in your API call to indicate a full retraction.

When you send a modification or reversal request, you can use two methods:

* Use an **order ID** (`OID`) **+ event type ID** (`ActionTrackerID`) combination: All actions associated with this event type ID and order ID will be reversed or modified.
* Use an **Action ID** (`action\_id`). Only the unique action will be reversed or modified.

{% tabs %}
{% tab title="Submit the ActionId" %}
How to find the `ActionId`:

* Use the [Get Rewards](https://integrations.impact.com/impact-brand/reference/getrewards) endpoint to list rewards.
* Once you have the reward, extract the associated `ActionId` for use in the reverse action API call.

{% hint style="success" %}
**Note:** The API may require iterating over participants to find the correct reward/action. There is currently no direct way to search by Order ID.
{% endhint %}
{% endtab %}

{% tab title="Submit the OrderId" %}
When submitting the `OrderId`, you’ll also need to submit the `ActionTrackerId`.
{% endtab %}
{% endtabs %}

**Example using Action ID:**

{% tabs %}
{% tab title="cURL" %}

```bash
curl 'https://api.impact.com/Advertisers/<AccountSID>/Actions' \
  -X DELETE \
  -u '<AccountSID>:<AuthToken>' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'ActionId=1234.5678.9123456' \
  -d 'Amount=0' \
  -d 'DispositionCode=RETRACTION'
```

{% endtab %}
{% endtabs %}

**Example using Order ID:**

{% tabs %}
{% tab title="cURL" %}

```bash
curl 'https://api.impact.com/Advertisers/<AccountSID>/Actions' \
  -X DELETE \
  -u '<AccountSID>:<AuthToken>' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'ActionTrackerId=12345' \
  -d 'OrderId=abc_123' \
  -d 'Amount=0' \
  -d 'DispositionCode=RETRACTION'
```

{% endtab %}
{% endtabs %}

**Example response**

{% tabs %}
{% tab title="JSON" %}

```json
{
  "Status": "QUEUED",
  "QueuedUri": "/Advertisers/<AccountSID>/APISubmissions/A-f1534308-e731-4146-86b9-56992f50eefe"
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
**Important:** Setting `Amount=0` is required. This ensures the action is fully retracted and the reward is cancelled, not just treated as an adjustment.
{% endhint %}

#### Common pitfalls & troubleshooting

The Advocate program evaluates the event amount based on item-level fields (`ItemPrice`, `ItemQuantity`, etc.).

`OrderDiscount` and `OrderSubTotalPostDiscount` are recorded but do not drive the retraction logic. For a full refund, ensure that all item prices are set to **0** in the event payload.

For partial refunds, you’ll need to update the item prices to reflect the new (post-refund) amount.

If the retraction rule doesn’t trigger, double-check that:

* The *program rule* is configured as described above.
* The API call includes `Amount = 0`.
* The correct `ActionId` is used.
  {% endstep %}

{% step %}

### Submit batch reversals

#### Prepare your data file

Prepare a .CSV file containing your reversals. Use the following template:

{% tabs %}
{% tab title="CSV" %}

```csv
ActionTrackerId,OrderId,Amount,Reason
```

{% endtab %}
{% endtabs %}

Start by adding your action data in the first row under the headers. Then, save the file with an identifiable name, such as:

`Batch_Mods_Reversals_2020_02_12.csv`

**Example file**

{% tabs %}
{% tab title="CSV" %}

```csv
ActionTrackerId,OrderId,Amount,Reason
16027,O7427540,0,ITEM_RETURNED
16027,O8306075,0,OTHER
```

{% endtab %}
{% endtabs %}

Refer to [Batch Modifications and Reversals File Parameters and Reason Codes](https://help.impact.com/en/support/solutions/articles/155000001483-batch-modifications-reversals-file-parameters-reason-codes) for a list of reason codes and fields that can be used in an FTP/SMTP batch modification or reversal.

#### Submit the file

Refer to [Set Up & Submit Batch Modifications & Reversals via FTP or Email](https://help.impact.com/brand/what-would-you-like-to-learn-about/platform-features/submit-and-modify-conversion-data/batch-modify-conversion-data/submit-batch-modifications-and-reversals) for instructions on how to submit the file.
{% endstep %}

{% step %}

### Review the results

1. In the top navigation bar, select ![](/files/UDyrrRTGbHJFFllCZxyw) **\[User Profile] → Settings**.
2. Under the technical section, select **File Submissions** to see if the file has been processed. Submitted files will appear within 10-15 minutes of being processed.

You will see an `ACTION_NOT_FOUND` error on all lines that are related to Advocate events, this is normal and expected.

**Confirm referrals were successfully retracted:**

1. In the left navigation menu, select ![](https://res.cloudinary.com/product-enablement/image/upload/v1768905009/Accessibility%20Icons/engage-v2.svg) **\[Engage] → Reporting → Referral Feed**.
2. Check if the referrals have been retracted. Retracted referrals will be listed with a status of *Started* and the date the Conversion was retracted.

<div data-with-frame="true"><figure><img src="/files/TaxebvJrGNVmd3dr8WuK" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://integrations.impact.com/integration-guides/for-brands/advocate/process-order-refunds-and-retractions-in-advocate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
