# Open an Event
source: https://developer.mastercard.com/mastercard-processing-core/documentation/sandbox-testing/card-lifecycle-management/open-event/index.md

## Test case -- Success {#test-case--success}

This test case describes opening an event in the CMS for a specified contract (account contract or card contract).

For this test case, use the following information in the request:

|    Field    |   Available value   |
|-------------|---------------------|
| `eventCode` | MDES_TKN_DEACTIVATE |

**Sample request**

`POST /contracts/70001/events`

```JSON
{
  "amount": 100,
  "currency": "EUR",
  "endDate": "2031-06-25",
  "eventCode": "MDES_TKN_DEACTIVATE",
  "reason": "MP_API_OPEN_EVENT",
  "startDate": "2031-06-25"
}
```

**Sample response**

`200`

## Test case -- Fail -- Invalid eventCode {#test-case--fail--invalid-eventcode}

This test case describes an attempt to open an event in the CMS for a specified contract using a value in the `eventCode` field in the request body that is not supported by the CMS.

For this test case, use the following information in the request:

|    Field    | Available value |
|-------------|-----------------|
| `eventCode` | INVALID         |

**Sample request**

`PUT /contracts/70001/events`

```JSON
{
  "endDate": "2031-06-25",
  "eventCode": "INVALID",
  "parameterString": "VALUE",
  "reason": "MP_API_OPEN_EVENT",
  "startDate": "2031-06-25"
}
```

**Sample response**

`400`

```JSON
{
    "Errors": {
        "Error": [
            {
                "Source": "MASTERCARD PROCESSING",
                "ReasonCode": "EVENT_CODE_NOT_SUPPORTED",
                "Description": "Event code INVALID is not supported for contract with id 70001.",
                "Recoverable": false
            }
        ]
    }
}
```

## Test case -- Fail -- Amount, currency, and parameterString are filled {#test-case--fail--amount-currency-and-parameterstring-are-filled}

This test case describes an attempt to open an event in the CMS for a specified contract by sending the `amount`, `currency`, and `parameterString` in the request body.

Note: To successfully open an event in the CMS, you must send in the request body:

* the `amount` and `currency` fields  
  or
* the `parameterString` field
**Sample request**

<br />

`POST /contracts/70001/events`

```JSON
{
  "amount": 100,
  "currency": "EUR",
  "endDate": "2031-06-25",
  "eventCode": "MDES_TKN_DEACTIVATE",
  "parameterString": "VALUE",
  "reason": "MP_API_OPEN_EVENT",
  "startDate": "2031-06-25"
}
```

**Sample response**

`400`

```JSON
{
  "Errors": {
    "Error": [
      {
        "Source": "MASTERCARD PROCESSING",
        "ReasonCode": "REQUEST_VALIDATION",
        "Description": "Invalid object event. Validation error: Only one of 2 options: (Amount, Currency) OR (Parameter String) may be filled.",
        "Recoverable": false
      }
    ]
  }
}
```

