# Update Subscription
source: https://developer.mastercard.com/commercial-event-notifications/documentation/use_cases/update_subscription/index.md

Update an existing subscription to change the filter criteria or to deactivate or reactivate the subscription. When performing the update, specify all the details of the subscription in the request,
even if you are not changing some of the settings.
Diagram update-subscription

```java
//Calling update subscription API.
//creating subscription resource to update.
Subscription subscriptionRequest = new Subscription(); //Subscription to update
Specification specificationRequest = new Specification(); //Specification
FieldContent fieldContent = new FieldContent(); //FieldContent
fieldContent.contentType(TEXT).setValue("RcnAliasText");
specificationRequest
        .type(FIELD)
        .operator(WHERE)
        .children(new ArrayList<>())
        .fieldMappingName("purchaseRequest.rcnAlias") //FieldMapping
        .fieldOperator(EQUALS) //Filed Operator
        .expectedContent(fieldContent);
SubscriptionApi subscriptionApi = new SubscriptionApi(client);
//calling a post to create subscription
 Subscription subscriptionResponse = null;
try {
subscriptionResponse = subscriptionApi.updateSubscription("MySubscriptionID",subscriptionRequest);

} catch (ApiException e) {
    System.err.println("Exception while calling update SubscriptionAPI");
    e.printStackTrace();
}
System.out.println("Updated subscription response:" + subscriptionResponse.toString());
```

In the above sample code, you are passing:

* The initialized API client for authentication
* The Subscription ID for the `MySubscriptionID` parameter along with the updated `subscriptionRequest` details.

### Try it Out {#try-it-out}


API Reference: `PUT /subscriptions/{id}`

### Additional Information {#additional-information}

Refer to the [Codes and Formats](https://developer.mastercard.com/commercial-event-notifications/documentation/codeandformats/index.md) for more information about error codes.
