# Alerts Test Cases
source: https://developer.mastercard.com/merchant-self-services/documentation/testing/alerts-test-cases/index.md

This article provides test case data that shows the merchant detail responses you can expect to receive from some example Ethoca Alerts requests sent to the Merchant Self Services API.

## Test Data {#test-data}

Following are the types of test data provided in this article:

* [TD1: Add an Alerts sub-merchant](https://developer.mastercard.com/merchant-self-services/documentation/testing/alerts-test-cases/index.md#td1-add-an-alerts-sub-merchant)
* [TD2: Update an existing Alerts sub-merchant](https://developer.mastercard.com/merchant-self-services/documentation/testing/alerts-test-cases/index.md#td2-update-an-existing-alerts-sub-merchant)
* [TD3: Update an existing Alerts sub-merchant status](https://developer.mastercard.com/merchant-self-services/documentation/testing/alerts-test-cases/index.md#td3-update-an-existing-alerts-sub-merchant-status)
* [TD4: Add a merchant identifier (ID) to an existing Alerts sub-merchant](https://developer.mastercard.com/merchant-self-services/documentation/testing/alerts-test-cases/index.md#td4-add-a-merchant-identifier-id-to-an-existing-alerts-sub-merchant)
* [TD5: Add a merchant identifier (name) to an existing Alerts sub-merchant](https://developer.mastercard.com/merchant-self-services/documentation/testing/alerts-test-cases/index.md#td5-add-a-merchant-identifier-name-to-an-existing-alerts-sub-merchant)
* [TD6: Add an acquirer ID to a merchant](https://developer.mastercard.com/merchant-self-services/documentation/testing/alerts-test-cases/index.md#td6-add-an-acquirer-id-to-a-merchant)
* [TD7: Retrieve merchant organization profile](https://developer.mastercard.com/merchant-self-services/documentation/testing/alerts-test-cases/index.md#td7-retrieve-merchant-organization-profile)

### TD1: Add an Alerts sub-merchant {#td1-add-an-alerts-sub-merchant}

Here, you create an `AlertsSubMerchantCreate` object and send a request to the **createAlertsSubMerchant** endpoint of the Merchant Self Services API. The Merchant Self Services API validates and persists and returns an `AlertsSubMerchantResource`.

#### Request {#request}

```JSON
{
	"name": "Merchant 1",	
	"merchantCategoryCode": "3002"
}
```

#### Expected response {#expected-response}

```JSON
{
	"subMerchantId": "99ca4b15-72a6-41dd-8127-573d4b07669c",
	"name": "MERCHANT 1",
	"merchantType": "SUBMERCHANT",
	"status": "ACTIVATED",
	"parentMemberId": "99ca4b15-72a6-41dd-8127-573d4b07669c",
	"merchantCategoryCode": "3002",
	"createdBy": {
		"timestamp": "2023-04-28T10:30:00.000Z",
		"user": "John Doe"
	},
	"modifiedBy": {
		"timestamp": "2023-04-28T10:30:00.000Z",
		"user": "John Doe"
	},
	"statusUpdateTs": "2023-04-28T10:30:00.000Z"
}
```

[Back to top](https://developer.mastercard.com/merchant-self-services/documentation/testing/alerts-test-cases/index.md#test-data)

### TD2: Update an existing Alerts sub-merchant {#td2-update-an-existing-alerts-sub-merchant}

In this scenario, you create an `AlertsSubMerchantUpdate` object and send a request to the **updateAlertsSubMerchant** endpoint of the Merchant Self Services API. The Merchant Self Services API validates and persists and returns an `AlertsSubMerchantResource`.

#### Request {#request-1}

```JSON
{
	"name": "Merchant 1 - Updated",
	"merchantCategoryCode": "3000"
}
```

#### Expected response {#expected-response-1}

```JSON
{
	"subMerchantId": "99ca4b15-72a6-41dd-8127-573d4b07669c",
	"name": "MERCHANT 1 - UPDATED",
	"merchantType": "SUBMERCHANT",
	"status": "ACTIVATED",
	"parentMemberId": "99ca4b15-72a6-41dd-8127-573d4b07669c",
	"merchantCategoryCode": "3000",
	"createdBy": {
		"timestamp": "2023-04-28T10:30:00.000Z",
		"user": "John Doe"
	},
	"modifiedBy": {
		"timestamp": "2023-04-28T10:30:00.000Z",
		"user": "John Doe"
	},
	"statusUpdateTs": "2023-04-28T10:30:00.000Z"
}
```

[Back to top](https://developer.mastercard.com/merchant-self-services/documentation/testing/alerts-test-cases/index.md#test-data)

### TD3: Update an existing Alerts sub-merchant status {#td3-update-an-existing-alerts-sub-merchant-status}

For this test case, you create an `AlertsSubMerchantStatusUpdate` object and send a request to the **updateAlertsSubMerchantStatus** endpoint of the Merchant Self Services API. The Merchant Self Services API validates, persists and returns an `AlertsSubMerchantResource`.

#### Request {#request-2}

```JSON
{
	"status": "DEACTIVATED"
}
```

#### Expected response {#expected-response-2}

```JSON
{
	"subMerchantId": "99ca4b15-72a6-41dd-8127-573d4b07669c",
	"name": "Merchant 1",
	"merchantType": "SUBMERCHANT",
	"status": "DEACTIVATED",
	"parentMemberId": "99ca4b15-72a6-41dd-8127-573d4b07669c",
	"merchantCategoryCode": "3002",
	"createdBy": {
		"timestamp": "2023-04-28T10:30:00.000Z",
		"user": "John Doe"
	},
	"modifiedBy": {
		"timestamp": "2023-04-28T10:30:00.000Z",
		"user": "John Doe"
	},
	"statusUpdateTs": "2023-04-28T10:30:00.000Z"
}
```

[Back to top](https://developer.mastercard.com/merchant-self-services/documentation/testing/alerts-test-cases/index.md#test-data)

### TD4: Add a merchant identifier (ID) to an existing Alerts sub-merchant {#td4-add-a-merchant-identifier-id-to-an-existing-alerts-sub-merchant}

Here, you create an `AlertsCardAcceptorIdConfig` object and send a request to the **createAlertsCardAcceptorIdConfig** endpoint of the Merchant Self Services API. The Merchant Self Services API validates, persists and returns an `AlertsMerchantIdentifierConfigIdOnly`.

#### Request {#request-3}

```JSON
{
	"acquirerReferenceId": "123456",
	"cardAcceptorId": "card_acceptorA"
}
```

#### Expected response {#expected-response-3}

```JSON
{
	"merchantIdentifierConfigId": "88ca4b15-72a6-41dd-8127-573d4b07875c"
}
```

[Back to top](https://developer.mastercard.com/merchant-self-services/documentation/testing/alerts-test-cases/index.md#test-data)

### TD5: Add a merchant identifier (name) to an existing Alerts sub-merchant {#td5-add-a-merchant-identifier-name-to-an-existing-alerts-sub-merchant}

In this scenario, you create an `AlertsCardAcceptorNameConfig` object and send a request to the **createAlertsCardAcceptorNameConfig** endpoint of the Merchant Self Services API. The Merchant Self Services API validates, persists and returns an `AlertsMerchantIdentifierConfigIdOnly`.

#### Request {#request-4}

```JSON
{
	"cardAcceptorName": "card_acceptor1",
	"cardAcceptorCity": "Toronto",
	"cardAcceptorRegion": "019",
	"cardAcceptorCountry": "CAN"
}
```

#### Expected response {#expected-response-4}

```JSON
{
	"merchantIdentifierConfigId": "88ca4b15-72a6-41dd-8127-573d4b07875c"
}
```

[Back to top](https://developer.mastercard.com/merchant-self-services/documentation/testing/alerts-test-cases/index.md#test-data)

### TD6: Add an acquirer ID to a merchant {#td6-add-an-acquirer-id-to-a-merchant}

Here, you create an `AlertsAcquirerReferenceIdConfig` object and send a request to the **createAlertsAcquirerReferenceIdConfig** endpoint of the Merchant Self Services API. The Merchant Self Services API validates, persists and returns an `AlertsMerchantIdentifierConfigIdOnly`.

#### Request {#request-5}

```JSON
{
	"cardScheme": "MASTERCARD",
	"acquirerReferenceId": "123456"
}
```

#### Expected response {#expected-response-5}

```JSON
{
	"merchantIdentifierConfigId": "88ca4b15-72a6-41dd-8127-573d4b07875c"
}
```

[Back to top](https://developer.mastercard.com/merchant-self-services/documentation/testing/alerts-test-cases/index.md#test-data)

### TD7: Retrieve merchant organization profile {#td7-retrieve-merchant-organization-profile}

For this test case, you send a request to the **getAlertsOrgProfiles** endpoint of the Merchant Self Services API. The Merchant Self Services API retrieves and returns your organization profile hierarchy.

#### Request {#request-6}

```JSON
curl -X 'GET' \
  'https://api.ethocaweb.com/ethoca/merchant-self-services/alerts/merchants/org-profiles' \
  -H 'accept: application/json' 
```

#### Expected response {#expected-response-6}

```JSON
{
	"memberId": "99ca4b15-72a6-41dd-8127-573d4b07669c",
	"name": "Partner Merchant 1",
	"merchantType": "PARTNER",
	"status": "ACTIVATED",
	"subOrgProfiles": [
		{
			"memberId": "11ab4b15-72a6-41dd-8127-573d4b07669c",
			"name": "Acquirer Merchant 1",
			"merchantType": "ACQUIRER",
			"status": "ACTIVATED"
		},
		{
			"memberId": "22de5c10-72a6-41dd-8127-573d4b07660c",
			"name": "Acquirer Merchant 2",
			"merchantType": "ACQUIRER",
			"status": "DEACTIVATED"
		}
	]
}
```

[Back to top](https://developer.mastercard.com/merchant-self-services/documentation/testing/alerts-test-cases/index.md#test-data)

## Next Steps {#next-steps}

* [API Reference](https://developer.mastercard.com/merchant-self-services/documentation/api-reference/index.md#apis) provides details about all of the fields and values in the Merchant Self Services API.
* See [Code and Formats](https://developer.mastercard.com/merchant-self-services/documentation/code-and-formats/index.md) for detailed information about error response handling.
