# Declare a payment

By calling the **declare** API, the Acquiring Service Partner (ACQP) initiates a declaration request to Alipay+.

## Processing logic

### Request parameters

When using the **declare** API, the following request parameters need to be correctly specified:

-   _customsDeclarationRequestId_: indicates the unique ID that is assigned by the merchant to identify a customs declaration request. This parameter is not provided for customs.
-   _declarationAmount_: indicates the amount declared to customs. When specifying the child parameters:

-   _declarationAmount.currency_: the value of this parameter needs to be fixed as `CNY`.
-   _declarationAmount.value_: the value of this parameter and the accumulated declaration amount for the same _paymentRequestId_ cannot exceed the transaction amount, namely the value of _customsDeclarationAmount.value_ in the **inquiryPayment** and **notifyPayment** APIs.

-   _isSplit_: indicates whether the payment order needs to be split for declaration. Specify the value of this parameter as `true` in either of the following situations:

-   The payment needs to be split into multiple orders and declared to multiple customs districts.
-   The payment needs to be split into multiple orders and only some of these orders need to be declared.

Otherwise, specify the value of this parameter as `false`.

### Identity check between buyer and payer

If the merchant wants to ensure that the buyer's identity is consistent with the payer's identity, specify the _buyer_ parameter in the **declare** request. Alipay+ then returns the identity check result in the **declare** response via the _identityCheckResult_ parameter. Valid values of this parameter are:

-   `CHECK_PASSED`: indicates that the buyer's name and ID card number are the same as the payer's.
-   `CHECK_NOT_PASSED`: indicates that the buyer's name and ID card number are not the same as that of the payer's.

However, no matter the value of the _identityCheckResult_ parameter, AlipayCN transfers the payer's information to the Customs.

### Retransmission

The **declare** API can also be called to retransmit or update an existing declaration. For more information about applicable scenarios, preconditions, and Alipay+'s responses of retransmission, see [How to retransmit a declaration](../api_acq/declare#WQ5hb).

For more information about how to use the **declare** API, see [declare](../api_acq/declare).

## Sample

The following samples show the request and response when the ACQP calls the Alipay+ **declare** API.

**Request from the ACQP to Alipay+**

```json
{
  "paymentRequestId": "2021081200000002312800000",
  "customsDeclarationRequestId": "20210812000000045800000",
  "customs": {
    "customsCode": "HANGZHOU",
    "region": "CN"
  },
  "merchantCustomsInfo": {
    "merchantCustomsCode": "test_merchant_customs_code",
    "merchantCustomsName": "test_merchant_customs_name"
  },
  "declarationAmount": {
    "currency": "CNY",
    "value": "100"
  },
  "isSplit": "true",
  "referenceOrderId": "P202108120000000231280000",
  "buyerCertificate": {
    "certificateType": "ID_CARD",
    "certificateNo": "230227198707200000",
    "holderName": {
      "fullName": "张三"
    }
  }
}
```

**Response from Alipay+ to the ACQP**

```json
{
  "result": {
    "resultCode": "SUCCESS",
    "resultMsg": "Success",
    "resultStatus": "S"
  },
  "pspPaymentId": "202108120000000231200000",
  "pspDeclarationRequestId": "2013112611001004680073950000",
  "pspCustomsCode": "31222699S7",
  "clearingTransactionId": "202108120000000808000000",
  "clearingChannel": "CUP",
  "pspOrderAmount": {
    "currency": "CNY",
    "value": "100"
  },
  "identityCheckResult": "CHECK_NOT_PASSED"
}
```