# notifyRegistrationStatus

The **notifyRegistrationStatus** API is used by Alipay+ to notify the Acquiring Service Provider (ACQP) of the merchant registration result. Each time Alipay+ receives a notification from the Mobile Payment Provider (MPP), Alipay+ will notify the ACQP of the registration status. 

**Note:** In the following sections, Mobile Payment Provider(MPP) is also known as Payment Service Provider. For example, the pspId parameter specifies the ID that identifies an MPP. 

## Structure

A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see:

-   [Request header](api_overview#3mLq0)
-   [Response header](api_overview#YdmVS) 

**Note:**

1\. Set the data type of each parameter (except array) as String. This means that you must use double quotation marks (" ") to enclose the parameter value. Examples:

-   If the data type of a parameter is Integer and its value is 20, set it as "20".
-   If the data type of a parameter is Boolean and its value is `true`, set it as "true".

2\. For optional parameters that are not required in your case, you can take one of the following actions:

-   Exclude the parameters from the request body.
-   Set the parameter values as `null`. (without the double quotation marks).

Do NOT leave the optional parameters empty by setting their values as `""`; otherwise, an error might occur.

## Request parameters

#### referenceMerchantId (String, REQUIRED)

The unique ID that is assigned by the ACQP to identify a merchant.

More information:

- Maximum length: 32 characters

#### referenceStoreId (String)

The unique ID that is assigned by the ACQP to identify a store, which is affiliated with the merchant.

This parameter is specified by Alipay+ if the merchant supports in-store payments.

More information:

- Maximum length: 32 characters

#### registrationResult (RegistrationResult, REQUIRED)

The collective registration result of all the MPPs to be registered to for each of the unique pair of _referenceMerchantId_ and _referenceStoreId_.

##### registrationStatus (String, REQUIRED)

The registration status that reflects whether all the MPPs to be registered to have returned the registration result. Valid values are:

-   `COMPLETED`: indicates that all the MPPs have returned the registration result.
-   `PENDING`: indicates that at least one MPP has not returned the registration result. The ACQP can check the value of _pspResgitrationResultList_ for the registration status of each MPP.

#### pspRegistrationResultList (Array<PSPRegistrationResult>)

The list of individual registration results of all the MPPs to be registered to.

This parameter is specified by Alipay+ if at least one MPP has updated its registration status.

More information:

- Maximum size: Unlimited

##### pspName (String, REQUIRED)

The MPP's name. View [MPP Capabilities](../mpp_list/mpp_capabilities) for a complete list of valid values.

##### registrationResult (RegistrationResult)

The registration result from a certain MPP.

###### registrationStatus (String, REQUIRED)

The registration status that reflects the registration result of a specific MPP to be registered.

-   `PENDING`: indicates that the MPP has not returned the registration result.
-   `CANCELLED`: indicates that the registration is canceled by the MPP.
-   `APPROVED`: indicates that the registration is approved by the MPP.
-   `REJECTED`: indicates that the registration is rejected by the MPP.

###### rejectionReason (string, CONDITIONAL)

The reason why the MPP rejected the merchant registration.

**Note**: This parameter is specified by Alipay+ if _pspRegistrationResultList.registrationResult.registrationStatus_ is `REJECTED`.

More information:

- Maximum length: 1024 characters

##### productCodes (Array<String>, REQUIRED)

The list of product codes to specify the payment products that the merchant support. Valid values are:

-   `CASHIER_PAYMENT`: indicates the Cashier Payment product. For more information, see [Cashier Payment](../product_intro_acq/product_cashier_acq_tile).
-   `AGREEMENT_PAYMENT`: indicates the Auto Debit product. For more information, see [Auto Debit](../product_intro_acq/product_debit_acq_tile).
-   `IN_STORE_PAYMENT`: indicates the in-store payment products, such as User-presented Mode Payment and Merchant-presented Mode Payment. For more information, see [User-presented Mode Payment](../product_intro_acq/product_upm_acq) and [Merchant-presented Mode Payment](../product_intro_acq/product_mpm_acq).

#### registrationRequestId (String)

The unique ID that is assigned by the ACQP to identify a registration request.

This parameter is specified by Alipay+ if the merchant supports in-store payments and _referenceStoreId_ is not specified.

More information:

- Maximum length: 64 characters

## Response parameters

#### result (Result, REQUIRED)

The result of the business processing, including the result status, result code, and the result message.

##### resultCode (String, REQUIRED)

The result code that indicates the detailed processing result.

More information:

- Maximum length: 64 characters

##### resultStatus (String, REQUIRED)

The result status that indicates the processing result. Valid values are:

-   `S`: Successful
-   `F`: Failed
-   `U`: Unknown

##### resultMessage (String)

The result message that describes the result code in detail.

More information:

- Maximum length: 256 characters

## More information

### How to return the result

The ACQP needs to return the result (specified in the _result_ parameter) according to the business processing result.

-   If you received the notification successfully, set the value of _result.resultStatus_ to `S` and the value of _result.resultCode_ to `SUCCESS`.
-   If you failed to receive the notification, set the value of _result.resultStatus_ to `F` or `U` and specify the value of _result.resultCode_ according to the failure reason. Alipay+ takes the notification delivery as unsuccessful and retries sending the notification up to 7 times. The intervals between two consecutive times are as follows: 2min, 10min, 10min, 1h, 2h, 6h, and 15h. Note that Alipay+ does not retry to send the notification if you test Alipay+ APIs in the sandbox environment.  

For more information about how to define your result codes, see the _Result codes_ section below.

## Result/Error codes

| Code | Value | Message | Further action |
| --- | --- | --- | --- |
| SUCCESS | S | Success | N/A |
| ACCESS_DENIED | F | Access is denied. | It is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue. |
| INVALID_CLIENT | F | The client is invalid. | It is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue. |
| INVALID_SIGNATURE | F | The signature is invalid. | Check whether the public key, signed message, and signature algorithm are as expected. |
| KEY_NOT_FOUND | F | The key is not found. | It is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue. |
| MEDIA_TYPE_NOT_ACCEPTABLE | F | The server does not implement the media type that is acceptable to the client. | Use a media type that is accepted by Alipay+. |
| METHOD_NOT_SUPPORTED | F | The server does not implement the requested HTTPS method. | Ensure the HTTP method is POST. |
| NO_INTERFACE_DEF | F | API is not defined. | Check whether the request URL is correct. Ensure that the endpoint of the called API is correct. |
| PARAM_ILLEGAL | F | Illegal parameters. For example, non-numeric input, invalid date. | Check whether the request parameters, including the header parameters and body parameters, are correct and valid. For more information about the parameters of each API, see the Structure section of the specific API reference topic. |
| PROCESS_FAIL | F | A general business failure occurred. Do not retry. | It is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue. |
| REQUEST_TRAFFIC_EXCEED_LIMIT | U | The request traffic exceeds the limit. | Reduce the frequency of API calls. |
| UNKNOWN_EXCEPTION | U | An API call failed, which is caused by unknown reasons. | Try to recall the API. |

## Request

```json
{
  "registrationRequestId": "2020091811058602000006001420000",
  "referenceMerchantId": "2188120000190000",
  "referenceStoreId": "340000",
  "registrationResult": {
    "registrationStatus": "COMPLETED"
  },
  "pspRegistrationResultList": [
    {
      "productCodes": [
        "IN_STORE_PAYMENT"
      ],
      "pspName": "ALIPAY_CN",
      "registrationResult": {
        "registrationStatus": "REJECTED",
        "rejectionReason": "rejectionReason message"
      }
    },
    {
      "productCodes": [
        "CASHIER_PAYMENT"
      ],
      "pspName": "ALIPAY_CN",
      "registrationResult": {
        "registrationStatus": "APPROVED"
      }
    }
  ]
}
```

## Response

```json
{
  "result": {
    "resultCode": "SUCCESS",
    "resultStatus": "S",
    "resultMessage": "Success"
  }
}
```