# Mastercom Complex Business Flows Tutorial
source: https://developer.mastercard.com/mastercom/documentation/tutorials-and-guides/complex-flows-tutorial/index.md

## Overview {#overview}

This tutorial explains how to use the generated Java API client to process a complex flow in the dispute resolution cycle.
>
> #### What you will learn {#what-you-will-learn}
>
> * How to search for a transaction.
> * How to create a claim and retrieve claim details.
> * How to retrieve claims from a queue.
> * How to create a retrieval request, retrieval fulfillment, and fulfillment response.
> * How to create a first chargeback and a second presentment.
> * How to create a pre-arbitration case, respond to a case and escalate a case.

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

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

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

Tip: Refer to the [API Reference](https://developer.mastercard.com/mastercom/documentation/api-reference/v6-reference/index.md) to see all request and response fields available for each of the endpoints explained in this tutorial.

## Step 1: Search for a transaction {#step-1-search-for-a-transaction}

Issuers use transaction search to search for information on an original transaction. Transaction search retrieves transaction data required for claim creation, such as transaction amount, currency, and clearing and authorization transaction IDs.

To make the search using the API client, use the `TransactionsApi` class.

To retrieve transactions, create a `TransactionSearchRequest` object and set the appropriate search fields. Then use method `transactionsApi.transactionSearch(body)`to perform the search.

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

```java
public class Main {
  public static void main(String[] args) {
    // Set up the API client here...

    TransactionsApi transactionsApi = new TransactionsApi(client);
    TransactionSearchRequest body = new TransactionSearchRequest();
    body.setPrimaryAccountNum("5488888888887192");
    body.setTranStartDate("2021-03-01");
    body.setTranEndDate("2021-03-30");

    try {
        TransactionSummary result = transactionsApi.transactionSearch(body);
    } catch (ApiException e) {
        System.err.println("Exception when calling TransactionsApi#transactionSearch");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getResponseBody());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
    }
  }
}
```

The search returns an instance of `TransactionSummary` containing the results.

Call `getAuthorizationSummary()` on this object to retrieve a `List<AuthorizationSummary>`, which you iterate to get the authorization data, including transaction ID, amount, currency, and other fields.

The authorization summary has a `List<ClearingSummary>`, which you retrieve by calling `getClearingSummary()`.

```java
public class Main {
  public static void main(String[] args) {
    // Transaction search here...

    try {
        TransactionSummary result = transactionsApi.transactionSearch(body);
        
        for (AuthorizationSummary auth : result.getAuthorizationSummary()) {
            System.out.println("Authorization transactionId: " + auth.getTransactionId());
            
            for (ClearingSummary clearing : auth.getClearingSummary()) 
                System.out.println("Clearing transactionId: " + clearing.getTransactionId());            
        }
    } catch (ApiException e) {
        // Exception handling here...
    }
  }
}
```

Now that you have the transaction data, you can proceed to create a claim.

## Step 2: Create a claim and retrieve its details {#step-2-create-a-claim-and-retrieve-its-details}

### 1. Create a claim {#1-create-a-claim}

All dispute events (retrievals, chargebacks, case filings, and so on) for a transaction must be contained in a single claim.

Create and manage claims by using the `ClaimApi` class. Instantiate a `CreateClaimRequest` object and set the proper values for the attributes. Use the values retrieved from transaction search call for the amount, currency, type, clearing transaction ID, and, optionally, the authorization transaction ID.

Call `claimsApi.createClaim(body)` to create the claim. This returns a `ClaimResponse` object holding the generated claim ID, which you retrieve by calling `getClaimId()`.
Note: When the issuer creates a claim, Mastercom will automatically create a new claim, with a different claim ID, for the acquirer. Each side of the dispute will always refer to its own claim ID when working on dispute items.

```java
public class Main {
  public static void main(String[] args) {
    // Transaction search here...

    ClaimsApi claimsApi = new ClaimsApi(client);
    CreateClaimRequest body = new CreateClaimRequest();
    body.setClearingTransactionId(clearingTransactionId);
    body.setAuthTransactionId(authTransactionId);
    body.setClaimType(ClaimTypeEnum.STANDARD);
    body.disputedAmount(disputedAmount);
    body.disputedCurrency(disputedCurrency);
    
    try {
      ClaimResponse result = claimsApi.createClaim(body);
      String claimId = result.getClaimId();
      System.out.println("claimId: " + claimId);
    } catch (ApiException e) {
      // Exception handling here...
    }
  }
}
```

### 2. Retrieve the claim details {#2-retrieve-the-claim-details}

After the claim is created, retrieve the claim details by calling `claimsApi.getClaimDetail(claimId)`. The `ClaimDetail` object contains detailed information associated with the claim, such as chargebacks, retrievals and case details.

```java
public class Main {
  public static void main(String[] args) {    
    // Claim creation here...
    
    try {
      ClaimDetail claimDetail = claimsApi.getClaimDetail(claimId);
      List<ChargebackDetails> chargebackDetails = claimDetail.getChargebackDetails();
      RetrievalSummary retrievalDetails = claimDetail.getRetrievalDetails();
      CaseFilingLifeCycle caseFilingDetails = claimDetail.getCaseFilingDetails();
    } catch (ApiException e) {
      // Exception handling here...
    }
  }
}
```

A claim is always associated with a *queue* . When the issuer creates the claim, the claim is first assigned to the *Pending* queue. The claim moves to a different queue when the issuer or acquirer adds new dispute items to the claim.

For example, if the issuer creates a Retrieval Request for a claim, the issuer claim moves to the *IssuerWorked* queue, and the acquirer claim moves to the *AcquirerUnworked* queue.

## Step 3: Retrieve claims from a queue {#step-3-retrieve-claims-from-a-queue}

Retrieve claims from specific queues to take appropriate actions according to the claim's state.

Use the `QueuesApi` to work with queues. You can use its methods to list the available queue names and to retrieve claims associated with a specific queue.

To list all available queue names, call `queuesApi.getQueues()`.

```java
public class Main {
  public static void main(String[] args) {
    // Set up code here...

    QueuesApi queuesApi = new QueuesApi(client);
    try {
      List<Queue> queues = queuesApi.getQueues();
      queues.forEach(q -> System.out.println("queueName: " + q.getQueueName()));
    } catch (ApiException e) {
      // Exception handling here...
    }
  }
}
```

This will output a list similar to the one below.

```text
queueName: Closed
queueName: Rejects
queueName: IssuerRepresentmentUnworked
queueName: AcquirerFirstCBUnworked
queueName: AcquirerRRUnworked
queueName: AcquirerArbCBUnworked
queueName: FeeCollectionUnworked
queueName: IssuerWorked
queueName: AcquirerWorked
queueName: Pending
queueName: IssuerRRUnworked
queueName: SenderCaseFiling
queueName: ReceiverCaseFiling
queueName: PendingDocumentation
```

Next, retrieve the claims from a specific queue. Create a `GetQueueContentRequest` object and set the queue name, the last modified date range of the claims that you wish to search for, and the page number.

Call `queuesApi.getQueueSummaryPost(body)` to retrieve the claims that match the criteria.
Call `getClaimList()` on the returned `QueueContentSummary` object to get the claim list. Each item on this list contains the "summary" of the claim, so many fields are not present. If you need the details of a claim, obtain the claim ID from the summary item, and then use the `claimsApi.getClaimDetail(claimId)` from the previous step to get the `ClaimDetail` object.

```java
public class Main {
  public static void main(String[] args) {
    // Set up code here...

    String queueName = "Pending";

    QueuesApi queuesApi = new QueuesApi(client);
    GetQueueContentRequest body = new GetQueueContentRequest(); // GetQueueContentRequest | Get queue content request
    body.setQueueName(queueName);
    body.setLastModifiedDateFrom("2021-03-15T00:00");
    body.setLastModifiedDateTo("2021-03-15T23:59");
    body.setPageNb("1");

    try {
      QueueContentSummary result = queuesApi.getQueueSummaryPost(body);
      List<ClaimSummary> claimSummaryList = result.getClaimList();
    } catch (ApiException e) {
      // Exception handling here...
    }
  }
}
```

## Step 4: Create a retrieval request, retrieval fulfillment and fulfillment response {#step-4-create-a-retrieval-request-retrieval-fulfillment-and-fulfillment-response}

### 1. Retrieval request {#1-retrieval-request}

In some disputes, the issuer requires additional transaction information. Create a retrieval request through the `RetrievalsApi`to request transaction information from the acquirer.

To create a retrieval request, provide the claim ID and the request body. For the body, instantiate a `CreateRetrievalRequest` object and set the appropriate values. Create the retrieval request by calling `retrievalsApi.createRetrievalRequest(claimId, body)`.

After the retrieval request is created, the issuer claim moves to the *IssuerWorked* queue, and the acquirer claim moves to the *AcquirerRRUnworked* queue.

```java
public class Main {
  public static void main(String[] args) {
    // Claim creation here...

    RetrievalsApi retrievalsApi = new RetrievalsApi(client);    
    CreateRetrievalRequest body = new CreateRetrievalRequest();
    body.setRetrievalRequestReason(RetrievalRequestReasonEnum._6343);
    body.setDocNeeded(DocNeededEnum._2);
    body.setInstructionsForHealthcare("Instructions to acquirer for fulfilling the retrieval request");

    try {
      CreateRetrievalResponse result = retrievalsApi.createRetrievalRequest(claimId, body);
    } catch (ApiException e) {
      // Exception handling here...
    }
  }
}
```

### 2. Retrieval fulfillment {#2-retrieval-fulfillment}

The acquirer can respond to the retrieval request by creating a retrieval fulfillment.

Prior to creating the retrieval fulfillment, the acquirer has to retrieve the claim from the *AcquirerRRUnworked* queue, as explained in section [Retrieving claims from a queue](https://developer.mastercard.com/mastercom/documentation/tutorials-and-guides/complex-flows-tutorial/index.md#retrieving-claims-from-a-queue).

Retrieve the claim and the claim details using `claimsApi.getClaimDetail(claimId)`. Call `claimDetail.getRetrievalDetails().getRequestId()` to retrieve the retrieval request ID.

To create the retrieval fulfillment request body, instantiate an `AcquirerFulfillmentRequest` object and fill its attributes with the appropriate values. Provide the document by setting the file name and file attributes in a `DocumentStructure` object. Call `retrievalsApi.acqFulfillRetrievalRequest(claimId, requestId, body)` to submit the request.

When the retrieval fulfillment is created, the acquirer claim moves to the *AcquirerWorked* queue, and the issuer claim moves to the *IssuerRRUnworked* queue.

```java
public class Main {
  public static void main(String[] args) {    
    // Retrieve claim from "AcquirerRRUnworked" queue using QueueApi here...
    // Retrieve claim details using ClaimApi here...
    // Retrieve claimId and requestId from the claim details here...
    
    RetrievalsApi retrievalsApi = new RetrievalsApi(client);
    AcquirerFulfillmentRequest body = new AcquirerFulfillmentRequest();
    body.setAcquirerResponseCd(AcquirerResponseCdEnum.C);
    body.setRefundReversalType("REFUND");
    body.setRefundReversalDate("2021-02-15T12:01");
    body.setRefundReversalAmount("100.00");
    body.setRefundReversalCurrency("USD");
    body.setRefundReversalReferenceId("123458111");
    body.setMemo("Initiating refund");
    body.setDocTypeIndicator(DocTypeIndicatorEnum._2);

    DocumentStructure documentStructure = new DocumentStructure();
    documentStructure.setFilename("image.tif");
    documentStructure.setFile("This is an image file stored in a base64 encoded string");
    body.setFileAttachment(documentStructure);

    try {
        AcquirerFulfillmentResponse result = retrievalsApi.acqFulfillRetrievalRequest(claimId, requestId, body);            
    } catch (ApiException e) {
        // Exception handling here...
    }
  }
}
```

### 3. Fulfillment response {#3-fulfillment-response}

After the acquirer submits the fulfillment, the issuer can approve or reject the fulfillment, based on documentation requirements. The issuer submits a fulfillment response to approve or reject the fulfillment.

First, the issuer retrieves the claim from the *IssuerRRUnworked* queue and obtains the retrieval request ID from the claim details, similar to what the acquirer did to work with the retrieval fulfillment (only the queue is different).

To create the fulfillment response body, create an `IssuerFulfillmentRequest` object and set the fields indicating the approval or rejection of the retrieval fulfillment. Then call `retrievalsApi.issuerResponseRetrievalRequest(claimId, requestId, body)` to submit the response.

```java
public class Main {
  public static void main(String[] args) {    
    // Retrieve claim from "IssuerRRUnworked" queue using QueueApi here...
    // Retrieve claim details using ClaimApi here...
    // Retrieve requestId from the claim details here...
    
    RetrievalsApi retrievalsApi = new RetrievalsApi(client);
    IssuerFulfillmentRequest body = new IssuerFulfillmentRequest(); 
    body.setIssuerResponseCd(IssuerResponseCdEnum.APPROVE);
    body.setMemo("Document accepted");
    
    try {
      RetrievalResponse result = retrievalsApi.issuerResponseRetrievalRequest(claimId, requestId, body);            
    } catch (ApiException e) {
      // Exception handling here...
    }
  }
}
```

### 4. Retrieving documents {#4-retrieving-documents}

Issuers and acquirers obtain the retrieval request documentation to evaluate its contents. To retrieve the documentation, provide the claim ID, request ID and desired return format to the `retrievalsApi.getRetrievalDoc(claimId, requestId, format)` method.

This method returns a `DocumentResponseStructure` object. Call `getFileAttachment().getFilename()` and `getFileAttachment().getFile()` on this object to return the file name and file contents (in Base64 format).

```java
public class Main {
  public static void main(String[] args) {    
    // Retrieve claim details using ClaimApi here...
    // Retrieve requestId from the claim details here...
    
    String format = "ORIGINAL";
    try {
      DocumentResponseStructure result = retrievalsApi.getRetrievalDoc(claimId, requestId, format);
      String filename = result.getFileAttachment().getFilename();
      String file = result.getFileAttachment().getFile();
    } catch (ApiException e) {
      // Exception handling here...
    }
  }
}
```

## Step 5: Create a first chargeback and a second presentment {#step-5-create-a-first-chargeback-and-a-second-presentment}

### 1. First chargeback {#1-first-chargeback}

To dispute a transaction, the issuer submits a first chargeback. This is achieved by using the `ChargebacksApi`.

The chargeback is created by providing the claim ID and the chargeback request body. Create the request body by instantiating a `CreateChargebackRequest` object and setting proper attribute values. Since this is a first chargeback, chargeback type must be `CHARGEBACK`. To submit the chargeback, call `chargebacksApi.createChargeback(claimId, body)`. This will return a `ChargebackResponse` object containing the chargeback ID generated.

When a first chargeback is created, the issuer claim moves to the *IssuerWorked* queue, and the acquirer claim moves to the *AcquirerFirstCBUnworked* queue.

```java
public class Main {
  public static void main(String[] args) {    
    // Claim creation here...
    
    ChargebacksApi chargebacksApi = new ChargebacksApi(client);
    CreateChargebackRequest body = new CreateChargebackRequest();
    body.setAmount("100.00");
    body.setChargebackType(ChargebackTypeEnum.CHARGEBACK);
    body.setCurrency("USD");
    body.setDocumentIndicator("true");
    body.setReasonCode("4853");
    body.setIsPartialChargeback(false);
    body.setMessageText("Chargeback request message");

    DocumentStructure documentStructure = new DocumentStructure();
    documentStructure.setFilename("image.tif");
    documentStructure.setFile("This is an image file stored in a base64 encoded string");
    body.setFileAttachment(documentStructure);
    
    try {
        ChargebackResponse result = chargebacksApi.createChargeback(claimId, body);            
    } catch (ApiException e) {
        // Exception handling here...
    }
  }
}
```

### 2. Second presentment {#2-second-presentment}

When a chargeback is received, the acquirer can accept the chargeback or initiate a second presentment (or representment) to respond or pursue the chargeback.

To check for unworked first chargebacks, the acquirer must first retrieve the claims from the *AcquirerFirstCBUnworked*.

Creating a second presentment is similar to creating a first chargeback. Set the appropriate fields in a `CreateChargebackRequest` object and call `chargebacksApi.createChargeback(claimId, body)`. Chargeback type is `SECOND_PRESENTMENT`.

When a second presentment is created, the acquirer claim moves to the *AcquirerWorked* queue, and the issuer claim moves to the *IssuerRepresentmentUnworked* queue.

```java
public class Main {
  public static void main(String[] args) {
    // Retrieve claim from "AcquirerFirstCBUnworked" queue using QueueApi here...
    
    ChargebacksApi chargebacksApi = new ChargebacksApi(client);
    CreateChargebackRequest body = new CreateChargebackRequest();
    body.setAmount("100.00");
    body.setChargebackType(ChargebackTypeEnum.SECOND_PRESENTMENT);
    body.setCurrency("USD");
    body.setDocumentIndicator("true");
    body.setReasonCode("2008");
    body.setIsPartialChargeback(false);
    body.setMessageText("Second presentment message");

    DocumentStructure documentStructure = new DocumentStructure();
    documentStructure.setFilename("image.tif");
    documentStructure.setFile("This is an image file stored in a base64 encoded string");
    body.setFileAttachment(documentStructure);
    
    try {
        ChargebackResponse result = chargebacksApi.createChargeback(claimId, body);            
    } catch (ApiException e) {
        // Exception handling here...
    }
  }
}
```

### 3. Retrieving documents {#3-retrieving-documents}

Issuers and acquirers retrieve the chargeback or second presentment documentation to evaluate its contents. To retrieve the documentation, provide the claim ID and chargeback ID.

You can get the chargeback ID either from the chargeback (first chargeback / second presentment) creation call, or from the claim details, by calling `claimsApi.getClaimDetail(claimId)` and iterating over the chargeback records in `claimDetail.getChargebackDetails()`.

To retrieve the documentation, call `chargebacksApi.getChargebackDoc(claimId, chargebackId, format)`. This will return a `DocumentResponseStructure` object. Then call `result.getFileAttachment().getFilename()` and `result.getFileAttachment().getFile()` to return the file name and file contents (in Base64 format) respectively.

```java
public class Main {
  public static void main(String[] args) {    
    // Retrieve claim id and chargeback id from claim details here...
    
    ChargebacksApi chargebacksApi = new ChargebacksApi(client);
    String format = "ORIGINAL";
    
    try {
      DocumentResponseStructure result = chargebacksApi.getChargebackDoc(claimId, chargebackId, format);
      String filename = result.getFileAttachment().getFilename();
      String file = result.getFileAttachment().getFile();
    } catch (ApiException e) {
      // Exception handling here...
    }
  }
}
```

### 4. Accepting a first chargeback or second presentment {#4-accepting-a-first-chargeback-or-second-presentment}

In case the acquirer or issuer accepts the first chargeback or second presentment, they can mark the received item as "processed". Acknowledging a first chargeback or second presentment moves the claim from the "Unworked" queue (*AcquirerFirstCBUnworked* or *IssuerRepresentmentUnworked* ) to the "Worked" queue (*AcquirerWorked* or *IssuerWorked*).

To acknowledge the first chargeback or second presentment, instantiate the request body, a `ChargebackMarkProcessedRequest` object, and add the chargeback items to it. Each item is a `ChargebackMarkProcessedRequestStructure` object, in which you set the claim ID and chargeback ID. After building the request body, call `chargebacksApi.acknowledgeChargebacks(body)` to process the items.

```java
public class Main {
  public static void main(String[] args) {
    // Retrieve claim from "AcquirerFirstCBUnworked" queue (acquirer) or "IssuerRepresentmentUnworked" queue (issuer)
    // Retrieve claim details here...
    // Retrieve chargeback id from claim details here...

    ChargebacksApi chargebacksApi = new ChargebacksApi(client);
    ChargebackMarkProcessedRequest body = new ChargebackMarkProcessedRequest();

    ChargebackMarkProcessedRequestStructure chargebackListItem = new ChargebackMarkProcessedRequestStructure();
    chargebackListItem.setClaimId(claimId);
    chargebackListItem.setChargebackId(chargebackId);
    body.addChargebackListItem(chargebackListItem);

    try {
        ChargebackMarkProcessedResponse result = chargebacksApi.acknowledgeChargebacks(body);            
    } catch (ApiException e) {
        // Exception handling here...
    }
  }
}
```

## Step 6: Create a pre-arbitration case, respond to a case and escalate a case {#step-6-create-a-pre-arbitration-case-respond-to-a-case-and-escalate-a-case}

### 1. Pre-arbitration case {#1-pre-arbitration-case}

Case filing is used when a dispute is not resolved during the normal chargeback cycles. An issuer can file a pre-arbitration case immediately following a second presentment if they believe that they still have the rights for the dispute.

To create and manage cases, use the `CaseFilingApi`. To create a case, instantiate a `CreateCaseRequest` object for the request body and set the appropriate values. In the example below we are creating a pre-arbitration case (case type = 1). Set the chargebackRefNum in the request, which can be retrieved from the chargeback details inside the claim details (`claimDetail.getChargebackDetails()`). To submit the case, call `caseFilingApi.createCaseFiling(body)`.
Tip: You can use the same logic below to create other case types, such as Pre-compliance or Compliance cases. Change the request attributes accordingly.

```java
public class Example {
  public static void main(String[] args) {
    // Retrieve chargebackRefNum here...

    CaseFilingApi caseFilingApi = new CaseFilingApi(client);
    CreateCaseRequest body = new CreateCaseRequest();
    body.setCaseType(CaseTypeEnum._1);
    body.setChargebackRefNum(Arrays.asList(chargebackRefNum));
    body.setDisputeAmount("100.00");
    body.setCurrencyCode("USD");
    body.setFiledAgainstIca("004321");
    body.filingAs(FilingAsEnum.I);
    body.setFilingIca("001234");
    body.setMemo("Please review attached documentation");
    body.setChargebackReasonCode(ChargebackReasonCodeEnum._4853);
    body.setMerchantName("Merchant name");

    DocumentStructure documentStructure = new DocumentStructure();
    documentStructure.setFilename("image.tif");
    documentStructure.setFile("This is an image file stored in a base64 encoded string");
    body.setFileAttachment(documentStructure);
        
    try {
        CaseFilingResponse result = caseFilingApi.createCaseFiling(body);
    } catch (ApiException e) {
        // Exception handling here...
    }
  }
}
```

After the case is created, the sender's claim moves to the *SenderCaseFiling* queue, and the receiver's claim moves to the *ReceiverCaseFiling* queue.

### 2. Respond to a received case {#2-respond-to-a-received-case}

The receiver reviews the received case and takes an action, such as ACCEPT, REJECT and REBUT. The case ID is required to take actions on a received case.

Retrieve the claim from the *ReceiverCaseFiling* queue, and get the claim details. Call `claimDetail.getCaseFilingDetails().getCaseFilingDetails().getCaseId()` to get the case filing details and case ID.

After retrieving the case ID, create a `UpdateCaseRequest` object and set the appropriate fields, such as the action that you want to apply to the case. Call `caseFilingApi.updateCaseFiling(caseId, body)` to apply the action to the case.

```java
public class Example {
  public static void main(String[] args) {
    // Retrieve claim from "ReceiverCaseFiling" queue using QueueApi here...
    // Retrieve claim details using ClaimApi here...
    // Retrieve case id from claim details here...

    CaseFilingApi caseFilingApi = new CaseFilingApi(client);
    UpdateCaseRequest body = new UpdateCaseRequest();
    body.setAction(ActionEnum.REJECT);
    body.setMemo("Document is invalid");

    try {
      CaseFilingResponse result = caseFilingApi.updateCaseFiling(caseId, body);
    } catch (ApiException e) {
        // Exception handling here...
    }
  }
}
```

### 3. Escalate a case {#3-escalate-a-case}

The sender of the case can also apply actions to the case, such as ESCALATE and WITHDRAW. To escalate a case, set the action in the request body to `ESCALATE` and call `caseFilingApi.updateCaseFiling(caseId, body)`. An escalated Pre-arbitration case becomes an Arbitration case, which can be rejected, accepted or rebutted by the receiver.

```java
public class Example {
  public static void main(String[] args) {
    // Retrieve claim from "ReceiverCaseFiling" queue using QueueApi here...
    // Retrieve claim details using ClaimApi here...
    // Retrieve case id from claim details here...

    CaseFilingApi caseFilingApi = new CaseFilingApi(client);
    UpdateCaseRequest body = new UpdateCaseRequest();
    body.setAction(ActionEnum.ESCALATE);

    try {
      CaseFilingResponse result = caseFilingApi.updateCaseFiling(caseId, body);
    } catch (ApiException e) {
        // Exception handling here...
    }
  }
}
```

Note: To learn more about all available Mastercom API endpoints, refer to the [Testing](https://developer.mastercard.com/mastercom/documentation/testing/index.md) page.

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