# Pre-arbitration and arbitration case filing tutorial
source: https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/casefilingarb-tutorial/index.md

## Overview {#overview}

This tutorial will show you the process of senders (issuers) and receivers (acquirers) managing pre-arbitration and arbitration cases.
>
> #### What you will learn {#what-you-will-learn}
>
> * How to create a pre-arbitration or arbitration case
> * How to update or respond to a pre-arbitration and arbitration case
> * How to retrieve details for an existing case

## Before you start {#before-you-start}

Before starting this tutorial, ensure that you have already completed the following:

* [Mastercom Extended API Client Generation Tutorial](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/clientgeneration-tutorial/index.md)
* [Quick Start Guide](https://developer.mastercard.com/mastercom-extended/documentation/quick-start-guide/index.md)

## Step 1: Upload documents {#step-1-upload-documents}

The sender (issuer) uploads documents.

API Reference: `POST /documents`

**Refer to [Step 1](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/documents-tutorial/index.md) of the [Documents](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/documents-tutorial/index.md) tutorial for more specific information on how to utilize this endpoint.**

## Step 2: Create a new pre-arbitration case {#step-2-create-a-new-pre-arbitration-case}

Senders (issuers) use this endpoint to create a pre-arbitration case.

API Reference: `POST /cases/arbitrations`

To create a pre-arbitration case, create a `CaseFilingApi` object. Then use method `caseFilingApi.createPreArbOrArbCase`.

This method expects the request body to be provided alongside the type of arbitration case being created. The request body is an instantiation of `ArbitrationCaseCreate` object.

```java
public class Main {
  public static void main(String[] args) {
    // API client set up here...    
    CaseFilingApi caseFilingApi = new CaseFilingApi(BaseClassUtil.getClient());
    
    ArbitrationCaseCreate body = new ArbitrationCaseCreate();
    body.setClaimId("713992756751");
    body.setCaseDisputeAmount("12300");
    body.setMemo("This is a sample memo");
    try {
      CaseCreateCaseId result = caseFilingApi.createPreArbOrArbCase("PRE_ARBITRATION", body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseFilingApi#createPreArbOrArbCase");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

### Review the possible error codes associated with this request {#review-the-possible-error-codes-associated-with-this-request}

| HTTP Code |              Error Code              |                        Description                         |
|-----------|--------------------------------------|------------------------------------------------------------|
| 400       | BAD_REQUEST                          | Bad request                                                |
| 400       | INVALID_INPUT_VALUE                  | Invalid input value for field `fieldName`                  |
| 400       | INVALID_INPUT_LENGTH                 | Invalid input length for field `fieldName`                 |
| 400       | CRTE_ARB_CASE_REQ_UPDT_REASON_FIELDS | When you provide `fieldName`, you must provide `fieldName` |
| 401       | NOT_AUTHORIZED_REQUEST               | Unauthorized                                               |
| 403       | FORBIDDEN                            | Forbidden                                                  |
| 404       | RESOURCE_UNKNOWN                     | Resource not found                                         |

Review additional error codes [here](https://developer.mastercard.com/mastercom-extended/documentation/code-and-formats/errorsandexceptions/index.md).

### Verify response {#verify-response}

You should receive a 201 Created response and the `caseId`.

## Step 3: Retrieve the document processing details {#step-3-retrieve-the-document-processing-details}

The sender (issuer) uses this endpoint to retrieve the processing status of the documents associated with the case.

API Reference: `GET /cases/documents/attributes`

**Refer to [Step 3](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/casefilingdocuments-tutorial/index.md) of the [Case filing documents](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/casefilingdocuments-tutorial/index.md) tutorial for more specific information on how to use this endpoint.**

## Step 4: Retrieve details for existing case {#step-4-retrieve-details-for-existing-case}

The sender (issuer) uses this endpoint to retrieve details for an existing case.

API Reference: `GET /cases/{case_id}`

To retrieve case details, create a `CaseFilingApi` object. Then use method `caseFilingApi.retrieveCaseDetails`.

This method expects a `caseId` as part of the path. The `caseId` can be obtained from [Step 2](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/casefilingarb-tutorial/index.md) leveraging `POST /cases/arbitrations`.

```java
public class Main {
  public static void main(String[] args) {
    // API client set up here...    
    CaseFilingApi caseFilingApi = new CaseFilingApi(BaseClassUtil.getClient());
    try {
      CaseDetails result = caseFilingApi.retrieveCaseDetails("5415063");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseFilingApi#retrieveCaseDetails");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

### Review the possible error codes associated with this request {#review-the-possible-error-codes-associated-with-this-request-1}

| HTTP Code |           Error           |                               Error Description                               | Error Code |
|-----------|---------------------------|-------------------------------------------------------------------------------|------------|
| 400       | INVALID_REQUEST           | `caseId` is not found                                                         | 200001     |
| 400       | INVALID_REQUEST           | Unable to authorize access. Reason: Insufficient Privileges                   | 200001     |
| 400       | INVALID_REQUEST           | Invalid `caseId` or User have not Provisioned                                 | 200001     |
| 400       | INVALID_REQUEST           | Bad Request                                                                   | 200001     |
| 400       | INVALID_INPUT_PATH_FORMAT | The maximum list size for field `caseFilingList` allowed in the request is 10 | 210003     |

Review additional error codes [here](https://developer.mastercard.com/mastercom-extended/documentation/code-and-formats/errorsandexceptions/index.md).

### Verify response {#verify-response-1}

You should receive a 200 OK response. Returns case details.

## Step 5: Retrieve list of claims within a queue {#step-5-retrieve-list-of-claims-within-a-queue}

The receiver (acquirer) uses this endpoint to request the contents of the queue within a date range to retrieve claims from the Receiver Case Filing queue.

API Reference: `GET /queues/{queue_id}/claims`

**Refer to [Step 4](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/queues-tutorial/index.md) of the [Queues](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/queues-tutorial/index.md) tutorial for more specific information on how to utilize this endpoint.**

## Step 6: Retrieve details for existing case {#step-6-retrieve-details-for-existing-case}

The receiver (acquirer) uses this endpoint to retrieve the details for an existing case.

API Reference: `GET /cases/{case_id}`

**Refer to [Step 4](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/casefilingarb-tutorial/index.md) for more specific information on how to use this endpoint.**

## Step 7: Retrieve processed documents associated with a case {#step-7-retrieve-processed-documents-associated-with-a-case}

The receiver (acquirer) uses this endpoint to retrieve all documents from a case. The documents include all documents whether attached by the sender or receiver.

API Reference: `GET /cases/{case_id}/documents`

**Refer to [Step 1](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/casefilingdocuments-tutorial/index.md) of the [Case filing documents](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/casefilingdocuments-tutorial/index.md) tutorial for more specific information on how to use this endpoint.**

## Step 8: Update or respond to a pre-arbitration case {#step-8-update-or-respond-to-a-pre-arbitration-case}

The receiver (acquirer) uses this endpoint to update the case to either accept or reject the case.

API Reference: `PUT /cases/{case_id}/arbitrations`

To update or respond to a pre-arbitration case, instantiate a `CaseFilingApi` object. Then use method `caseFilingApi.takeActionOnArbitrationCase`.

This method expects the request body to be provided. The request body is an instantiation of the `CaseTakeActionArbitration` object.

This method does not have any response body.

```java
public class Main {
  public static void main(String[] args) {
    // API client set up here...    
    CaseFilingApi caseFilingApi = new CaseFilingApi(BaseClassUtil.getClient());
    CaseTakeActionArbitration body = new CaseTakeActionArbitration();
    body.action(CaseTakeActionArbitration.ActionEnum.ACCEPT);
    body.documentUploadedId("e59c3a2a9f4311ee8855eeee0afc63f1");
    body.memo("This is a sample memo");
    try {
      caseFilingApi.takeActionOnArbitrationCase("5415063", body);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseFilingApi#takeActionOnArbitrationCase");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

### Review the possible error codes associated with this request {#review-the-possible-error-codes-associated-with-this-request-2}

| HTTP Code |        Error         |                              Error Description                              | Error Code | Action Type |
|-----------|----------------------|-----------------------------------------------------------------------------|------------|-------------|
| 400       | INVALID_REQUEST      | `caseId` is invalid                                                         | 200001     | Accept      |
| 400       | INVALID_REQUEST      | The selected case is already accepted                                       | 200001     | Accept      |
| 400       | INVALID_REQUEST      | The selected case is already withdrawn                                      | 200001     | Accept      |
| 400       | INVALID_REQUEST      | The selected case is already ruled                                          | 200001     | Accept      |
| 400       | INVALID_REQUEST      | The selected case is already expired.                                       | 200001     | Accept      |
| 400       | INVALID_REQUEST      | Unable to authorize access. Reason: Insufficient Privileges                 | 200001     | Accept      |
| 400       | INVALID_INPUT_VALUE  | Invalid input value for field `action`                                      | 230000     | Accept      |
| 400       | INVALID_REQUEST      | Invalid `caseId` or User have not Provisioned                               | 200001     | Escalate    |
| 400       | INVALID_REQUEST      | Case is not Rejected                                                        | 200001     | Escalate    |
| 400       | INVALID_REQUEST      | Case is already Accepted or Withdrawn or Expired or Ruled                   | 200001     | Escalate    |
| 400       | INVALID_REQUEST      | Case is already escalated                                                   | 200001     | Escalate    |
| 400       | INVALID_REQUEST      | The selected case is already withdrawn.                                     | 200001     | Escalate    |
| 400       | INVALID_REQUEST      | Document process status is not completed                                    | 200001     | Escalate    |
| 400       | INVALID_REQUEST      | ARN can not be null or empty when Case Type is Pre-Compliance or Compliance | 200001     | Escalate    |
| 400       | INVALID_INPUT_VALUE  | Invalid input value for field `filingIca`                                   | 230000     | Escalate    |
| 400       | INVALID_REQUEST      | `caseId` is invalid                                                         | 200001     | Rebut       |
| 400       | INVALID_REQUEST      | Can't Rebutt Case. Case Already Accepted                                    | 200001     | Rebut       |
| 400       | INVALID_REQUEST      | Can't Rebutt Case. Case Already Withdrawn                                   | 200001     | Rebut       |
| 400       | INVALID_REQUEST      | Case Already Rebutted                                                       | 200001     | Rebut       |
| 400       | INVALID_REQUEST      | Can't Rebutt Case. Case already Ruled                                       | 200001     | Rebut       |
| 400       | INVALID_REQUEST      | Unable to authorize access. Reason: Insufficient Privileges                 | 200001     | Rebut       |
| 400       | INVALID_REQUEST      | `caseId` is invalid                                                         | 200001     | Reject      |
| 400       | INVALID_INPUT_LENGTH | Invalid input length for field `memo`                                       | 210000     | Reject      |
| 400       | INVALID_REQUEST      | The selected case is already accepted                                       | 200001     | Reject      |
| 400       | INVALID_REQUEST      | The selected case is already withdrawn                                      | 200001     | Reject      |
| 400       | INVALID_REQUEST      | The selected case is already ruled                                          | 200001     | Reject      |
| 400       | INVALID_REQUEST      | The selected case is already Accepted/Rejected is in progress               | 200001     | Reject      |
| 400       | INVALID_REQUEST      | The selected case is already expired.                                       | 200001     | Reject      |
| 400       | INVALID_REQUEST      | Compliance case can't be rejected                                           | 200001     | Reject      |
| 400       | INVALID_REQUEST      | The selected case is already rejected                                       | 200001     | Reject      |
| 400       | INVALID_REQUEST      | Unable to authorize access. Reason: Insufficient Privileges                 | 200001     | Reject      |
| 400       | INVALID_INPUT_VALUE  | Invalid input value for field `action`                                      | 230000     | Reject      |
| 400       | INVALID_INPUT_VALUE  | Invalid input value for field `action`                                      | 230000     | Withdrawn   |
| 400       | INVALID_REQUEST      | Case is already accepted                                                    | 200001     | Withdrawn   |
| 400       | INVALID_REQUEST      | The selected case is already withdrawn                                      | 200001     | Withdrawn   |
| 400       | INVALID_REQUEST      | The selected case can't be withdrawn yet                                    | 200001     | Withdrawn   |
| 400       | INVALID_REQUEST      | The selected case is already ruled                                          | 200001     | Withdrawn   |
| 400       | INVALID_REQUEST      | The selected case is in 'Filed in Error' status                             | 200001     | Withdrawn   |
| 400       | INVALID_REQUEST      | Unable to authorize access. Reason: Insufficient Privileges                 | 200001     | Withdrawn   |

Review additional error codes [here](https://developer.mastercard.com/mastercom-extended/documentation/code-and-formats/errorsandexceptions/index.md).

### Verify response {#verify-response-2}

You should receive a 204 Success - No Content response.

## Step 9: Retrieve list of claims within a queue {#step-9-retrieve-list-of-claims-within-a-queue}

The sender (issuer) uses this endpoint to request to retrieve claims from the Sender Case Filing queue.

API Reference: `GET /queues/{queue_id}/claims`

**Refer to [Step 4](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/queues-tutorial/index.md) of the [Queues](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/queues-tutorial/index.md) tutorial for more specific information on how to utilize this endpoint.**

## Step 10: Retrieve details for existing case {#step-10-retrieve-details-for-existing-case}

The sender (issuer) uses this endpoint to retrieve the details for an existing case.

API Reference: `GET /cases/{case_id}`

**Refer to [Step 4](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/casefilingarb-tutorial/index.md) for more specific information on how to use this endpoint.**

## Step 11: Retrieve processed documents associated with a case {#step-11-retrieve-processed-documents-associated-with-a-case}

The sender (issuer) uses this endpoint to retrieve all documents from a case. The documents include all documents whether attached by the sender or receiver.

API Reference: `GET /cases/{case_id}/documents`

**Refer to [Step 1](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/casefilingdocuments-tutorial/index.md) of the [Case filing documents](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/casefilingdocuments-tutorial/index.md) tutorial for more specific information on how to use this endpoint.**

## Step 12: Update or respond to a pre-arbitration case {#step-12-update-or-respond-to-a-pre-arbitration-case}

If the sender (issuer) wants to continue the dispute, they use this endpoint to escalate the case to arbitration.

API Reference: `PUT /cases/{case_id}/arbitrations`

**Refer to [Step 8](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/casefilingarb-tutorial/index.md) for more specific information on how to use this endpoint.**

## Step 13: Create an arbitration case {#step-13-create-an-arbitration-case}

Senders (issuers) use this endpoint to create an arbitration case.

API Reference: `POST /cases/arbitrations`

Note: The sender can withdraw a case at any time prior to receiving an accepted response by the receiver or a ruling by Dispute Resolution Management (DRM).

To create an arbitration case, create a `CaseFilingApi` object. Then use method `caseFilingApi.createPreArbOrArbCase`.

This method expects the request body to be provided alongside the type of arbitration case being created. The request body is an instantiation of `ArbitrationCaseCreate` object.

```java
public class Main {
  public static void main(String[] args) {
    // API client set up here...    
    CaseFilingApi caseFilingApi = new CaseFilingApi(BaseClassUtil.getClient());
    
    ArbitrationCaseCreate body = new ArbitrationCaseCreate();
    body.setClaimId("713992756751");
    body.setCaseDisputeAmount("12300");
    body.setMemo("This is a sample memo");
    try {
      CaseCreateCaseId result = caseFilingApi.createPreArbOrArbCase("ARBITRATION", body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseFilingApi#createPreArbOrArbCase");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

### Review the possible error codes associated with this request {#review-the-possible-error-codes-associated-with-this-request-3}

| HTTP Code |       Error Code       |    Description     |
|-----------|------------------------|--------------------|
| 400       | BAD_REQUEST            | Bad request        |
| 401       | NOT_AUTHORIZED_REQUEST | Unauthorized       |
| 403       | FORBIDDEN              | Forbidden          |
| 404       | RESOURCE_UNKNOWN       | Resource not found |

Review additional error codes [here](https://developer.mastercard.com/mastercom-extended/documentation/code-and-formats/errorsandexceptions/index.md).

### Verify response {#verify-response-3}

You should receive a 201 Created response and the `caseId`.

### Dispute Resolution Management is notified of a case. {#dispute-resolution-management-is-notified-of-a-case}

## Step 14: Update or respond to an arbitration case {#step-14-update-or-respond-to-an-arbitration-case}

The receiver (acquirer) uses this endpoint to respond and accept the case. The sender (issuer) uses this endpoint to withdraw the case.

API Reference: `PUT /cases/{case_id}/arbitrations`

To update or respond to an arbitration case, instantiate a `CaseFilingApi` object. Then use method `caseFilingApi.takeActionOnArbitrationCase`.

This method expects the request body to be provided. The request body is an instantiation of the `CaseTakeActionArbitration` object.

This method does not have any response body.

```java
public class Main {
  public static void main(String[] args) {
    // API client set up here...    
    CaseFilingApi caseFilingApi = new CaseFilingApi(BaseClassUtil.getClient());
    CaseTakeActionArbitration body = new CaseTakeActionArbitration();
    body.action(CaseTakeActionArbitration.ActionEnum.ACCEPT);
    body.documentUploadedId("e59c3a2a9f4311ee8855eeee0afc63f1");
    body.memo("This is a sample memo");
    try {
      caseFilingApi.takeActionOnArbitrationCase("5415063", body);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseFilingApi#takeActionOnArbitrationCase");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

### Review the possible error codes associated with this request {#review-the-possible-error-codes-associated-with-this-request-4}

| HTTP Code |       Error Code       |    Description     |
|-----------|------------------------|--------------------|
| 400       | BAD_REQUEST            | Bad request        |
| 401       | NOT_AUTHORIZED_REQUEST | Unauthorized       |
| 403       | FORBIDDEN              | Forbidden          |
| 404       | RESOURCE_UNKNOWN       | Resource not found |

Review additional error codes [here](https://developer.mastercard.com/mastercom-extended/documentation/code-and-formats/errorsandexceptions/index.md).

### Verify response {#verify-response-4}

You should receive a 204 Success - No Content response.

### Dispute Resolution Management rules on the case. {#dispute-resolution-management-rules-on-the-case}

## Step 15: Retrieve list of claims within a queue {#step-15-retrieve-list-of-claims-within-a-queue}

The receiver (acquirer) uses this endpoint to retrieve claims from the Receiver Case Filing queue.

The sender uses this endpoint to request the contents of the queue within a date range to retrieve claims from the Sender Case Filing queue.

API Reference: `GET /queues/{queue_id}/claims`

**Refer to [Step 4](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/queues-tutorial/index.md) of the [Queues](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/queues-tutorial/index.md) tutorial for more specific information on how to utilize this endpoint.**

## Step 16: Retrieve details for existing case {#step-16-retrieve-details-for-existing-case}

The sender (issuer) or receiver (acquirer) uses this endpoint to retrieve case details including the outcome of the case.

API Reference: `GET /cases/{case_id}`

**Refer to [Step 4](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/casefilingarb-tutorial/index.md) for more specific information on how to use this endpoint.**

Return to [Tutorials](https://developer.mastercard.com/mastercom-extended/documentation/tutorials-and-guides/index.md).
