# Batch Process Reversals via API (Web Services) Overview

<a href="https://pxa.impact.com/student/activity/2268418?sid=0c0e3e5c-54c9-4435-9bee-ebcdccb7f292&#x26;sid_i=0?utm_source=app.impact.com&#x26;utm_medium=owned-platform&#x26;utm_content=&#x26;utm_campaign=help-center" class="button primary">Take the PXA course</a>

If anything about an action changes (e.g., an order was canceled, an item was returned, etc.), you can use the API to modify (or reverse) it, changing the commission amount for the action. In this article, we'll show how to modify and reverse an action with cURL calls to the impact.com Brand API.

**Batch process reversal options:**

* Modify or reverse one or more items in an action via API
* Reverse an entire action via API

#### Prerequisite: Retrieve the *ActionId* value

To reverse an action, you'll need its `ActionId` value. The call below will retrieve all actions for a specified *Program* (i.e., *Campaign*) — you can use this to find the action you want to modify.

* You can specify a date range in your call — otherwise, the endpoint defaults to showing the last 30 days of actions.
* [Rate limits](https://integrations.impact.com/impact-brand/reference/rate-limits) apply.
* View the [List all actions](https://integrations.impact.com/impact-brand/reference/list-all-actions) API endpoint documentation to learn more.

<details>

<summary>Parameter reference</summary>

| Parameter    | Description                                                                                                                                                                                                                                                                                                                                                                               |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `AccountId`  | Your impact.com account's API account ID value. [Learn how to find this value](https://help.impact.com/brand/account-administration/account-settings/api-tokens/manage-api-access-tokens-as-a-brand).                                                                                                                                                                                     |
| `AuthToken`  | Your impact.com account's API authorization token value. [Learn how to find this value](https://help.impact.com/brand/account-administration/account-settings/api-tokens/manage-api-access-tokens-as-a-brand).                                                                                                                                                                            |
| `CampaignId` | <p>The ID value of the program (campaign) that the action was tracked under.</p><p><img src="https://4048883401-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-31394f285a15896ee35415220c2ee33641e1e8db%2F6cdb04166abb32ded5995d58f18ef3e6462d01cddcf81cd387abb3cac22e3389.png?alt=media" alt="" data-size="original"></p> |

</details>

{% tabs %}
{% tab title="Example call" %}

```programlisting
curl 'https://api.impact.com/Advertisers/{AccountSID}/Actions' \
  -X GET \
  -u '{AccountSID}:{AuthToken}' \
  -H 'Accept: application/json' \
  -d 'CampaignId={CampaignId}'
```

{% endtab %}

{% tab title="Example response" %}

```programlisting
{
  "@page": "1",
  ...,
  "Actions": [
    {
      "Id": "1000.4636.158133",
      ...,
    }
  ]
}
```

{% endtab %}
{% endtabs %}

#### FAQs

<details>

<summary>How do I reset a modification / reversal made to an action (or action items)?</summary>

If an action has been modified or reversed before its locking date, you can submit `RESET` as a reason to update the action back to its default state:

```programlisting
curl 'https://api.impact.com/Advertisers/{AccountSID}/Actions' \
  -X PUT \
  -u '{AccountSID}:{AuthToken}' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'ActionId={ActionId}' \
  -d 'Reason=RESET'
```

Actions that have been reset via the `RESET` code may not appear correctly in reporting (e.g., revenue values may be calculated incorrectly).

</details>

<details>

<summary>What is the difference between a disposition code &#x26; reason?</summary>

Both Disposition Codes and Reasons are used in the same context — *Reasons* are predefined codes that the API will accept by default, whereas *Disposition Codes* are custom reasons you can configure. [Learn more about Disposition Codes](https://help.impact.com/brand/platform-features/tracking/set-up-tracking/manage-disposition-codes).

Submitting any of these values as a reason will reverse the item (or action):

| Code                    | Description                  |
| ----------------------- | ---------------------------- |
| `CONS_FRAUD`            | Consumer fraud               |
| `CONS_ERROR`            | Consumer error               |
| `ITEM_RETURNED`         | Item returned                |
| `ORDER_ERROR`           | Order error                  |
| `ORDER_UPDATE`          | Order was updated            |
| `PUB_ACT_DISPUTE`       | Partner activity dispute     |
| `ADV_ACT_DISPUTE`       | Advertiser activity dispute  |
| `NOT_COMPLIANCE_TERMS`  | Not in compliance with terms |
| `ITEM_OUT_OF_STOCK`     | Item is out of stock         |
| `TEST_ACTION`           | Test action                  |
| `PARTNER_NOT_ACTIVE`    | Partner account deactivated  |
| `CREDITED_DIFFERENT_MP` | Credited to another partner  |
| `OTHER`                 | Other reason                 |
| `ITEM_CANCELLED`        | Item in order was cancelled  |

</details>

<details>

<summary>How can I see when modifications / reversals are applied to an action?</summary>

You can use the [action updates](https://integrations.impact.com/impact-brand/reference/the-action-update-object) endpoint to see when an action was last updated and what its current state is.

```programlisting
curl 'https://api.impact.com/Advertisers/{AccountSID}/ActionUpdates/{ActionUpdatesId}' \
  -X GET \
  -u '{AccountSID}:{AuthToken}' \
  -H 'Accept: application/json' \
```

{% hint style="info" %}
**Note:** An `ActionUpdatesID` value is different from an `ActionId` value — you must use the `ActionUpdatesID` value to retrieve updates for an action.
{% endhint %}

</details>
