# userInitiatedPay (Merchant-presented Mode Payment - Private Order Code)

`POST /aps/api/v1/payments/userInitiatedPay`

The **userInitiatedPay** API is used when the user initiates a payment request by scanning an order code that is issued by the Acquiring Service Provider (ACQP). Alipay+ calls this API to send the decoding request to the ACQP and then processes the payment according to the response returned by the ACQP.

**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.md#3mLq0)
-   [Response header](api_overview.md#YdmVS)

**Note:**

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

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

## Request parameters

#### acquirerId (String)

The unique ID that is assigned by Alipay+ to identify an ACQP.

More information:

- Maximum length: 64 characters

#### pspId (String)

The unique ID that is assigned by Alipay+ to identify an MPP.

More information:

- Maximum length: 64 characters

#### codeValue (String, REQUIRED)

The code value that the user scans.

More information:

- Maximum length: 512 characters

#### customerId (String)

The unique ID that is assigned by Alipay+ to identify an MPP user.

**Note**: Specified by Alipay+ if the relevant information is passed in by the MPP.

More information:

- Maximum length: 64 characters

## Response parameters

#### result (Result, REQUIRED)

The result of the business processing, including the result status, result code, and result message. For more information about how to return the result of the **userInitiatedPay** API, see How to return the result.

##### 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

#### codeType (String)

The type of code that the user scans.

**Note**: In the Merchant-presented Mode Payment Order Code scenario, the value of this parameter must be set to `ORDER_CODE` if the value of the _result.resultCode_ parameter is `SUCCESS`, which means that the decoding succeeds.

#### paymentRequestId (String)

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

**Note**: Required if the value of the _result.resultCode_ parameter is `SUCCESS`, which means that the decoding succeeds.

More information:

- Maximum length: 64 characters

#### order (Order)

The order details that are agreed upon by the buyer and the merchant, including the information about the buyer, the merchant, the goods, the initial order amount, and so on. The order details are displayed in purchase records and used for risk and regulatory reporting.

**Note**: 

In the Merchant-presented Mode Payment Order Code scenario, if the value of the _result.resultCode_ parameter is `SUCCESS`, apart from the required child parameters, the following child parameter must be returned:

-   _merchant.store_

The following child parameters are recommended to be returned:

-   _env.storeTerminalId_
-   _env.storeTerminalRequestTime_

##### referenceOrderId (String, REQUIRED)

The unique ID that is assigned by the merchant to identify an order. The ID is used to display the user's purchase record and to track follow-up operations, such as customer complaints and disputes.

More information:

- Maximum length: 64 characters

##### orderDescription (String, REQUIRED)

The description of the order.

More information:

- Maximum length: 256 characters

##### orderAmount (Amount, REQUIRED)

The original order amount that is displayed by the merchant on the cashier page.

###### currency (String, REQUIRED)

The currency code of the amount. The value of this parameter must be an alphabetic code that follows the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, for example, "EUR" for Euros.

More information:

- Maximum length: 3 characters

###### value (Integer, REQUIRED)

The value of the amount as a natural number. By default, the value of this parameter is in the smallest currency unit. For example, if the currency is USD and the amount is $1.00, set the value of this parameter to 100; or if the currency is JPY and the amount is ￥1, set the value of this parameter to 1.

Due to the currency practices in Indonesia, when the currency is IDR, round the amount with banker's rounding and fix the last two digits of the value of this parameter as `00`.

More information:

- Value range: 1 - unlimited

##### merchant (Merchant, REQUIRED)

The merchant information, including the merchant ID, merchant name, merchant category code, and so on.

###### referenceMerchantId (String, REQUIRED)

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

More information:

- Maximum length: 32 characters

###### merchantMCC (String, REQUIRED)

The merchant category code (MCC) that represents the categorization of the merchant's business type. See [Alipay+ MCC Standards](https://docs.alipayplus.com/alipayplus/alipayplus/mcc-standards/overview.md) for details.

More information:

- Maximum length: 4 characters

###### merchantName (String, REQUIRED)

The legal name of the merchant.

More information:

- Maximum length: 256 characters

###### merchantAddress (Address, REQUIRED)

In the Cashier Payment and Auto Debit scenarios, specify the region where the merchant is registered. In the User-presented Mode and Merchant-presented Mode Payment scenarios, specify the region where the payment transaction occurs. The value of this parameter is used by Alipay+ to determine whether the transaction is domestic or cross-border and therefore affects the fee calculation logic.

###### region (String, REQUIRED)

The region where the address is located. The value of this parameter must be a 2-character country/region code that follows the [ISO 3166](https://www.iso.org/iso-3166-country-codes.html) standard.

More information:

- Maximum length: 2 characters

###### state (String)

The state, country, or province where the address is located.

**Note**: Specify this parameter if you have the information. This provides better user experience.

More information:

- Maximum length: 8 characters

###### city (String)

The city, district, suburb, town, or village where the address is located.

**Note**: Specify this parameter if you have the information. This provides better user experience.

More information:

- Maximum length: 32 characters

###### address1 (String)

The address line 1, which contains the street name, PO box, or company name. 

**Note**: Specify this parameter if you have the information. This provides better user experience.

More information:

- Maximum length: 256 characters

###### address2 (String)

The address line 2, which contains the apartment, suite, unit, or building name.

**Note**: Specify this parameter if you have the information. This provides better user experience.

More information:

- Maximum length: 256 characters

###### zipCode (String)

The zip or postal code.

**Note**: Specify this parameter if you have the information. This provides better user experience.

More information:

- Maximum length: 32 characters

###### merchantDisplayName (String)

The display name of the merchant.

**Note**: It is recommended that you specify this parameter if your display name is different from your legal name. The default value of this parameter is the value of the _merchantName_ parameter.

More information:

- Maximum length: 64 characters

###### merchantRegisterDate (Datetime)

The time when the merchant registered its business at the local regulatory agency.

**Note**: Specify this parameter if you have the information. This helps anti-money laundering and fraud detection, and increases payment success rates.

More information:

- The value follows the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) standard format. For example, "2019-11-27T12:01:01+08:00".

###### store (Store)

The information about the store of the merchant.

###### referenceStoreId (String, REQUIRED)

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

More information:

- Maximum length: 32 characters

###### storeName (String, REQUIRED)

The legal name of the store.

More information:

- Maximum length: 256 characters

###### storeMCC (String, REQUIRED)

The merchant category code (MCC) that represents the categorization of the store's business type. See [Alipay+ MCC Standards](https://docs.alipayplus.com/alipayplus/alipayplus/mcc-standards/overview.md) for details.

More information:

- Maximum length: 4 characters

###### storeDisplayName (String)

The display name of the store.

**Note**: It is recommended that you specify this parameter if the display name of the store is different from its legal name.

More information:

- Maximum length: 64 characters

###### storeTerminalId (String)

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

**Note**: Specify this parameter if you have the information. This helps anti-money laundering and fraud detection, and increases payment success rates.

More information:

- Maximum length: 64 characters

###### storeOperatorId (String)

The unique ID that is assigned by the merchant to identify a cashier at the store.

More information:

- Maximum length: 64 characters

###### storePhoneNo (String)

The contact number of the store.

More information:

- Maximum length: 16 characters

###### storeAddress (Address)

The address where the store is located.

###### region (String, REQUIRED)

The region where the address is located. The value of this parameter must be a 2-character country/region code that follows the [ISO 3166](https://www.iso.org/iso-3166-country-codes.html) standard.

More information:

- Maximum length: 2 characters

###### state (String)

The state, country, or province where the address is located.

**Note**: Specify this parameter if you have the information. This provides better user experience.

More information:

- Maximum length: 8 characters

###### city (String)

The city, district, suburb, town, or village where the address is located.

**Note**: Specify this parameter if you have the information. This provides better user experience.

More information:

- Maximum length: 32 characters

###### address1 (String)

The address line 1, which contains the street name, PO box, or company name. 

**Note**: Specify this parameter if you have the information. This provides better user experience.

More information:

- Maximum length: 256 characters

###### address2 (String)

The address line 2, which contains the apartment, suite, unit, or building name.

**Note**: Specify this parameter if you have the information. This provides better user experience.

More information:

- Maximum length: 256 characters

###### zipCode (String)

The zip or postal code.

**Note**: Specify this parameter if you have the information. This provides better user experience.

More information:

- Maximum length: 32 characters

##### goods (Array<Goods>)

The goods information, including the goods ID, goods name, and so on.

**Note**: Specify this parameter if you have the information. This helps anti-money laundering and fraud detection, and increases payment success rates.

More information:

- Maximum size: 100 elements

###### referenceGoodsId (String, REQUIRED)

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

More information:

- Maximum length: 64 characters

###### goodsName (String, REQUIRED)

The name of the goods.

More information:

- Maximum length: 256 characters

###### goodsCategory (String)

The categorization of the goods.

More information:

- Maximum length: 64 characters

###### goodsBrand (String)

The brand name of the goods.

More information:

- Maximum length: 32 characters

###### goodsUnitAmount (Amount)

The unit price of the goods.

**Note**: Specify this parameter if you have the information. This helps anti-money laundering and fraud detection, and increases payment success rates.

###### currency (String, REQUIRED)

The currency code of the amount. The value of this parameter must be an alphabetic code that follows the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, for example, "EUR" for Euros.

More information:

- Maximum length: 3 characters

###### value (Integer, REQUIRED)

The value of the amount as a natural number. By default, the value of this parameter is in the smallest currency unit. For example, if the currency is USD and the amount is $1.00, set the value of this parameter to 100; or if the currency is JPY and the amount is ￥1, set the value of this parameter to 1.

Due to the currency practices in Indonesia, when the currency is IDR, round the amount with banker's rounding and fix the last two digits of the value of this parameter as `00`.

More information:

- Value range: 1 - unlimited

###### goodsQuantity (Integer)

The quantity of the goods. 

**Note**: Specify this parameter if you have the information. This helps anti-money laundering and fraud detection, and increases payment success rates.

More information:

- Value range: 1 - unlimited

##### shipping (Shipping)

The shipping information, including the information about the recipient and the carrier. 

**Note**: Specify this parameter if you have the information. This helps anti-money laundering and fraud detection, and increases payment success rates.

###### shippingName (UserName, REQUIRED)

The name of the shipping recipient.

###### firstName (String)

The first name of the user.

**Note**: Specify this parameter if you have the information. This helps anti-money laundering and fraud detection, and increases payment success rates.

More information:

- Maximum length: 32 characters

###### middleName (String)

The middle name of the user.

**Note**: Specify this parameter if you have the information. This helps anti-money laundering and fraud detection, and increases payment success rates.

More information:

- Maximum length: 32 characters

###### lastName (String)

The last name of the user.

**Note**: Specify this parameter if you have the information. This helps anti-money laundering and fraud detection, and increases payment success rates.

More information:

- Maximum length: 32 characters

###### fullName (String, REQUIRED)

The full name of the user.

More information:

- Maximum length: 128 characters

###### shippingAddress (Address, REQUIRED)

The shipping address.

###### region (String, REQUIRED)

The region where the address is located. The value of this parameter must be a 2-character country/region code that follows the [ISO 3166](https://www.iso.org/iso-3166-country-codes.html) standard.

More information:

- Maximum length: 2 characters

###### state (String)

The state, country, or province where the address is located.

**Note**: Specify this parameter if you have the information. This provides better user experience.

More information:

- Maximum length: 8 characters

###### city (String)

The city, district, suburb, town, or village where the address is located.

**Note**: Specify this parameter if you have the information. This provides better user experience.

More information:

- Maximum length: 32 characters

###### address1 (String)

The address line 1, which contains the street name, PO box, or company name. 

**Note**: Specify this parameter if you have the information. This provides better user experience.

More information:

- Maximum length: 256 characters

###### address2 (String)

The address line 2, which contains the apartment, suite, unit, or building name.

**Note**: Specify this parameter if you have the information. This provides better user experience.

More information:

- Maximum length: 256 characters

###### zipCode (String)

The zip or postal code.

**Note**: Specify this parameter if you have the information. This provides better user experience.

More information:

- Maximum length: 32 characters

###### shippingCarrier (String)

The name of the shipping carrier, such as FedEx, UPS, or USPS. 

**Note**: Specify this parameter if you have the information. This helps anti-money laundering and fraud detection, and increases payment success rates.

More information:

- Maximum length: 128 characters

###### shippingPhoneNo (String)

The contact number of the shipping recipient.

**Note**: Specify this parameter if you have the information. This helps anti-money laundering and fraud detection, and increases payment success rates.

More information:

- Maximum length: 16 characters

##### buyer (Buyer)

The buyer information, including the buyer ID, buyer name, and so on. 

**Note**: It is highly recommended that you specify this parameter because it is used for risk control.

###### referenceBuyerId (String)

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

**Note**: Specify this parameter if you have the information. This helps anti-money laundering and fraud detection, and increases payment success rates.

More information:

- Maximum length: 64 characters

###### buyerName (UserName)

The name of the buyer.

**Note**: Specify this parameter if you have the information. This helps anti-money laundering and fraud detection, and increases payment success rates.

###### firstName (String)

The first name of the user.

**Note**: Specify this parameter if you have the information. This helps anti-money laundering and fraud detection, and increases payment success rates.

More information:

- Maximum length: 32 characters

###### middleName (String)

The middle name of the user.

**Note**: Specify this parameter if you have the information. This helps anti-money laundering and fraud detection, and increases payment success rates.

More information:

- Maximum length: 32 characters

###### lastName (String)

The last name of the user.

**Note**: Specify this parameter if you have the information. This helps anti-money laundering and fraud detection, and increases payment success rates.

More information:

- Maximum length: 32 characters

###### fullName (String, REQUIRED)

The full name of the user.

More information:

- Maximum length: 128 characters

###### buyerPhoneNo (String)

The contact number of the buyer.

**Note**: Specify this parameter if you have the information. This helps anti-money laundering and fraud detection, and increases payment success rates.

More information:

- Maximum length: 24 characters

###### buyerEmail (Email)

The email address of the buyer.

**Note**: Specify this parameter if you have the information. This helps anti-money laundering and fraud detection, and increases payment success rates.

More information:

- Maximum length: 64 characters

##### env (Env)

The environment information about the device that is used by the user to place orders at the merchant side.

###### terminalType (String)

The type of terminal that is used to initiate the payment. 

Valid values are:

-   `WEB`: indicates that a PC browser is used.
-   `WAP`: indicates that a mobile browser is used.
-   `APP`: indicates that a mobile app is used.
-   `MINI_APP`: indicates that a mini program is used.

###### osType (String)

The mobile operating system type. Valid values are:

-   `IOS`: indicates the iOS system
-   `ANDROID`: indicates the Android system

###### deviceTokenId (String)

The token ID of the client device.

**Note**: Specify this parameter if you can obtain the information from the user. This helps anti-money laundering and fraud detection, and increases payment success rates.

More information:

- Maximum length: 64 characters

###### clientIp (String)

The IP address of the client device.

**Note**: Specify this parameter if you can obtain the information from the user. This helps anti-money laundering and fraud detection, and increases payment success rates.

More information:

- Maximum length: 32 characters

###### cookieId (String)

The cookie ID of the user.

**Note**: Specify this parameter if you can obtain the information from the user. This helps anti-money laundering and fraud detection, and increases payment success rates.

More information:

- Maximum length: 64 characters

###### userAgent (String)

The user-agent information.

**Note**: Specify this parameter if you can obtain the information from the user. This helps anti-money laundering and fraud detection, and increases payment success rates.

More information:

- Maximum length: 1024 characters

###### storeTerminalId (String)

The ID of the terminal device that is used in the store to process the payment.

**Note**: Specify this parameter if you have the information. This helps anti-money laundering and fraud detection, and increases payment success rates.

More information:

- Maximum length: 64 characters

###### storeTerminalRequestTime (Datetime)

The time when the request is sent by the terminal device that is used in the store.

**Note**: The value of this parameter must be accurate to milliseconds. If you do not have the terminal request time, specify the time when your gateway received the API request.

More information:

- The value follows the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) standard format. For example, "2019-11-27T12:01:01+08:00".

##### indirectAcquirer (IndirectAcquirer)

Information about the indirect acquiring partner.

Return this parameter if an indirect acquiring partner participates in the payment, for example, when you are acquiring through a special payment network.

###### referenceAcquirerId (String, REQUIRED)

The unique ID that is assigned by the ACQP to identify an indirect acquiring partner.

More information:

- Maximum length: 64 characters

###### acquirerName (String)

The legal name of the indirect acquiring partner.

More information:

- Maximum length: 256 characters

###### acquirerAddress (Address)

The address of the indirect acquiring partner.

###### region (String, REQUIRED)

The region where the address is located. The value of this parameter must be a 2-character country/region code that follows the [ISO 3166](https://www.iso.org/iso-3166-country-codes.html) standard.

More information:

- Maximum length: 2 characters

###### state (String)

The state, country, or province where the address is located.

**Note**: Specify this parameter if you have the information. This provides better user experience.

More information:

- Maximum length: 8 characters

###### city (String)

The city, district, suburb, town, or village where the address is located.

**Note**: Specify this parameter if you have the information. This provides better user experience.

More information:

- Maximum length: 32 characters

###### address1 (String)

The address line 1, which contains the street name, PO box, or company name.

**Note**: Specify this parameter if you have the information. This provides better user experience.

More information:

- Maximum length: 256 characters

###### address2 (String)

The address line 2, which contains the apartment, suite, unit, or building name.

**Note**: Specify this parameter if you have the information. This provides better user experience.

More information:

- Maximum length: 256 characters

###### zipCode (String)

The zip or postal code.

**Note**: Specify this parameter if you have the information. This provides better user experience.

More information:

- Maximum length: 32 characters

#### paymentFactor (PaymentFactor)

Factors that impact payment-related items such as service fee, interchange fee (also known as interpartner fee), and regulatory reporting. This parameter is used to identify the payment scenario.

**Note**:

In the Merchant-presented Mode Payment Order Code scenario, if the value of the _result.resultCode_ parameter is `SUCCESS`, the following parameters must be returned and set to the specific values as shown below:

-   _isInStorePayment_: set the value to `true` 
-   _isCashierPayment:_ set the value to `true` 
-   _inStorePaymentScenario_: set the value to `OrderCode`

##### isInStorePayment (Boolean)

Specifies whether the payment scenario is in-store payment. If the value of this parameter is specified as `true`, the payment scenario is in-store payment; otherwise, the payment scenario is online payment.

##### isCashierPayment (Boolean)

Specifies whether a cashier page is presented to the user during the payment. If the value of this parameter is specified as `true`, a cashier page is presented to the user during the payment; otherwise, no cashier page is presented to the user during the payment.

##### inStorePaymentScenario (String)

The in-store payment scenario. Valid values are:

-   `PaymentCode`: indicates the scenario where a user presents a payment code to pay.
-   `OrderCode`: indicates the scenario where a user scans an order code to pay.
-   `EntryCode`: indicates the scenario where a user scans an entry code to pay.

##### isAgreementPayment (Boolean)

Specifies whether the payment scenario is Auto Debit. If the value of this parameter is specified as `true`, the payment scenario is Auto Debit; otherwise, the payment scenario is not Auto Debit.

#### paymentAmount (Amount)

The amount that the ACQP requests to receive from Alipay+. The currency of the amount must be specified to the one that the ACQP uses to create the payment order.

**Note**: Required if the value of the _result.resultCode_ parameter is `SUCCESS`, which means that the decoding succeeds.

##### currency (String, REQUIRED)

The currency code of the amount. The value of this parameter must be an alphabetic code that follows the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, for example, "EUR" for Euros.

More information:

- Maximum length: 3 characters

##### value (Integer, REQUIRED)

The value of the amount as a natural number. By default, the value of this parameter is in the smallest currency unit. For example, if the currency is USD and the amount is $1.00, set the value of this parameter to 100; or if the currency is JPY and the amount is ￥1, set the value of this parameter to 1.

Due to the currency practices in Indonesia, when the currency is IDR, round the amount with banker's rounding and fix the last two digits of the value of this parameter as 00.

More information:

- Value range: 1 - unlimited

#### paymentNotifyUrl (URL, REQUIRED)

The URL that is used to receive the payment result notification from Alipay+.

More information:

- Maximum length: 2048 characters

#### paymentRedirectUrl (URL)

The URL where the user is redirected to after the payment order is completed.

**Note**: Required if the value of the _result.resultCode_ parameter is `SUCCESS` and the user needs to be redirected from the MPP's payment result page to a predetermined page, for example, the merchant result page.

More information:

- Maximum length: 2048 characters

#### paymentExpiryTime (Datetime)

The time after which the payment order is expired. The payment expiration time is calculated from the time when the order is placed. If the payment transaction is not completed before the time that is specified for this parameter, Alipay+ closes the order and calls the **notifyPayment** API to notify the ACQP of the payment result.

**Note**: 

1.  Required if the value of the _result.resultCode_ parameter is `SUCCESS` and the ACQP wants the payment transaction to be completed before a specific time.
2.  In the Merchant-presented Mode Payment Order Code scenario, the default value of this parameter is 3 minutes. 
3.  The specified expiration time must be shorter than the default expiration time; otherwise, the default expiration time takes effect instead of the specified expiration time.

More information:

- The value follows the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) standard format. For example, "2019-11-27T12:01:01+08:00".

#### settlementStrategy (SettlementStrategy)

The settlement strategy that is applied to the payment order, for example, the currency that the ACQP wants to be settled against.

**Note**: Required if the value of the _result.resultCode_ parameter is `SUCCESS` and the settlement currency is different from the payment currency that is specified for the _paymentAmount.currency_ parameter.

##### settlementCurrency (String, REQUIRED)

The currency that the ACQP wants to be settled against. The value of this parameter is an alphabetic code that follows the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, for example, "EUR" for Euros.

More information:

- Maximum length: 3 characters

#### splitSettlementId (String)

The unique ID that is assigned by Alipay+ to the ACQP for multi-batch reconciliation. For each unique value of this parameter, Alipay+ performs a batch of clearing and settlement, and transfers a batch of funds to the ACQP's bank account.

**Note:** Required if the ACQP needs to split its settlement for transactions in one region and one currency into multiple batches.

More information:

- Maximum length: 16 characters

## More information

#### How to return the result

-   If the decoding succeeds, set the value of _result.resultStatus_ to `S` and value of _result.resultCode_ to `SUCCESS`.
-   If the decoding fails, set the value of _result.resultStatus_ to `F`.
-   If the decoding result is unknown, set the value of _result.resultStatus_ to `U` and the value of _result.resultCode_ to `UNKNOWN_EXCEPTION`.

## Result/Error codes

| Code | Value | Message |
| --- | --- | --- |
| SUCCESS | S | Success |
| ACCESS_DENIED | F | Access is denied. |
| CURRENCY_NOT_SUPPORT  | F | The currency is not supported. |
| EXPIRED_CODE | F | The code is expired. |
| INVALID_CLIENT | F | The client is invalid. |
| INVALID_CODE | F | The code is invalid. |
| INVALID_CONTRACT | F | The contract is invalid. |
| INVALID_SIGNATURE | F | The signature is invalid. |
| KEY_NOT_FOUND | F | The key is not found. |
| MEDIA_TYPE_NOT_ACCEPTABLE | F | The server does not implement the media type that is acceptable to the client. |
| MERCHANT_NOT_REGISTERED | F | The merchant is not registered. |
| METHOD_NOT_SUPPORTED | F | The server does not implement the requested HTTPS method. |
| NO_INTERFACE_DEF | F | API is not defined. |
| ORDER_IS_CLOSED | F | order has been cancelled |
| PARAM_ILLEGAL | F | Illegal parameters. For example, non-numeric input, invalid date. |
| PAYMENT_AMOUNT_INVALID | F | Payment amount is invalid.  |
| PROCESS_FAIL | F | A general business failure occurred. Do not retry. |
| REQUEST_TRAFFIC_EXCEED_LIMIT | U | The request traffic exceeds the limit. |
| UNKNOWN_EXCEPTION | U | An API call failed, which is caused by unknown reasons. |

## Request

### ALIPAY, ALIPAY_HK, DANA, H5, DIRECT

```json
{
  "acquirerId": "2021228100000000",
  "pspId": "1022172000000000000",
  "codeValue": "http://a.com/2810060438884961634",
  "customerId": "208812211210000"
}
```

## Response

```json
{
  "result": {
    "resultCode": "SUCCESS",
    "resultStatus": "S",
    "resultMessage": "success"
  },
  "codeType": "ORDER_CODE",
  "order": {
    "referenceOrderId": "OrderID_010101001",
    "orderDescription": "SHOES",
    "orderAmount": {
      "value": "100",
      "currency": "JPY"
    },
    "merchant": {
      "referenceMerchantId": "M0000000001",
      "merchantMCC": "5411",
      "merchantName": "UGG",
      "store": {
        "referenceStoreId": "S000000001",
        "storeName": "UGG-2",
        "storeMCC": "5411"
      },
      "merchantAddress": {
        "region": "JP",
        "city": "xxx"
      }
    },
    "env": {
      "storeTerminalId": "122222",
      "storeTerminalRequestTime": "2019-06-01T12:01:01+08:00"
    },
    "indirectAcquirer": {
      "referenceAcquirerId": "2112211212",
      "acquirerName": "UGG",
      "acquirerAddress": {
        "region": "JP",
        "city": "xxx"
      }
    }
  },
  "paymentRequestId": "20200101234567890000",
  "paymentAmount": {
    "value": "100",
    "currency": "JPY"
  },
  "paymentFactor": {
    "isInStorePayment": "true",
    "isCashierPayment": "true",
    "inStorePaymentScenario": "OrderCode"
  },
  "settlementStrategy": {
    "settlementCurrency": "USD"
  },
  "paymentNotifyUrl": "https://xmock.inc.alipay.net/api/Ipay/globalSite/automtion/paymentNotify.htm",
  "paymentRedirectUrl": "https://alipay.com"
}
```