---
title: "Alipay+"
canonical_url: https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/integration
---

* [Overview](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/overview/globalcollect.md)
* [Countries \& currencies](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/countries-and-currencies/globalcollect.md)
* [Integration](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/integration/globalcollect.md)
* [Process flows](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/process-flows/globalcollect.md)
* [Testing](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/testing/globalcollect.md)
* [Additional information](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/additional-information/globalcollect.md)
* [Consumer experience](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/consumer-experience/globalcollect.md)
* [Reporting](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/reporting/globalcollect.md)
* [FAQ](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/faqs/globalcollect.md)

# Integration

* [Using MyCheckout hosted payment pages](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/integration.md#mycheckout)
* [Using your own checkout page](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/integration.md#your-checkout-page)
* [Consumer redirection](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/integration.md#consumer-redirection)
* [Next steps](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/integration.md#next-steps)

## Before you begin

* Make sure you've been boarded with Alipay+
* Build your server integration

# Using MyCheckout hosted payment pages

[MyCheckout hosted payment pages](https://docs.connect.worldline-solutions.com/documentation/hosted-payment-pages/.md) is the optimal solution if you're looking for the quickest way to accept payments and a hassle-free experience for your consumers.

Make the [Create hosted checkout API call](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/hostedcheckouts/create.html?paymentPlatform=ALL), submitting the required properties.  
Below, you'll find an example API call with the essential data. To add more information with additional properties, please visit to our [API Reference](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/hostedcheckouts/create.html?paymentPlatform=ALL).  

|          Property           | Data type | Required |
|-----------------------------|-----------|----------|
| order                       | object    | yes      |
| amountOfMoney               | object    | yes      |
| currencyCode                | string    | yes      |
| amount                      | integer   | yes      |
| customer                    | object    | yes      |
| merchantCustomerId          | string    | yes      |
| billdingAddress             | object    | yes      |
| countryCode                 | string    | yes      |
| hostedCheckoutSpecificInput | object    | yes      |
| locale                      | string    | no       |
| variant                     | string    | no       |

POST HOSTEDCHECKOUTS REQUESTCopy code

```hljs javascript language-javascript
{
  "order": {
    "amountOfMoney": {
      "currencyCode": "HKD",
      "amount": 1500
    },
    "customer": {
      "merchantCustomerId": "123456547",
      "billingAddress": {
        "countryCode": "HK"
      },
      "hostedCheckoutSpecificInput": {
        "locale": "en_GB",
        "variant": "105"
      }
    }
  }
}
```

POST HOSTEDCHECKOUTS RESPONSECopy code

```hljs javascript language-javascript

{
  "RETURNMAC": "55c6d5ad-ac05-410c-b60c-c2b5479fa3d3",
  "hostedCheckoutId": "0667c1c5-****-71ff-****-53760ae5ef9d",
  "partialRedirectUrl": "pay1.preprod.checkout.worldline-solutions.com/checkout/*****......."
}
```

From the response, the important properties are:

* hostedCheckoutId -- can be used in subsequent API calls to retrieve the transaction details (with [Get hosted checkout status](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/hostedcheckouts/get.html?paymentPlatform=ALL) API call);
* partialRedirectUrl -- is used to create the URL to which the customer needs to be redirected. By default, we configure every account with the subdomain payment, so you can always connect https://payment. with the partialRedirectUrl, for example:

*https://payment.pay1.preprod.checkout.worldline-solutions.com/checkout/13801.......*

For more information on customizing the checkout page, please refer to our [MyCheckout hosted payment pages](https://docs.connect.worldline-solutions.com/documentation/hosted-payment-pages/.md) guide.  
The hostedCheckoutId is only valid for 2 hours. Ensure to store the createdPaymentOutput.payment.id from [Get hosted checkout](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/hostedcheckouts/get.html?paymentPlatform=ALL) status response to be able to retrieve data after 2 hours have elapsed via [Get payment](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/payments/get.html?paymentPlatform=ALL) API call. Alternatively, we can also send a [webhook event](https://docs.connect.worldline-solutions.com/documentation/webhooks/.md) that will contain it.

# Using your own checkout page

Using this integration option implies that you have your own checkout page design ready and only need to use our APIs to accept payments on your website.

## Build payment product selection form

To build the payment product selection form, you need to get the mandatory fields. Make the [Get payment products](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/products/find.html?paymentPlatform=ALL) API call, submitting the countryCode and currencyCode as the minimum payload.  

|   Property   | Data type | Required |
|--------------|-----------|----------|
| countryCode  | object    | yes      |
| currencyCode | object    | yes      |

You'll need the following properties from the API response to build your payment products selection form:  

|   Property   |  Data   |                                                                                                                                                 Description                                                                                                                                                 |
|--------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| displayOrder | integer | Determines the order in which the payment products and groups should be shown (sorted ascending).                                                                                                                                                                                                           |
| label        | string  | Name of the payment product or group based on the locale that was included in the request.                                                                                                                                                                                                                  |
| logo         | string  | Partial URL that you can reference for the image of this payment product or group. You can use our server-side resize functionality by appending '?size={{width}}x{{height}}' to the full URL, where width and height are specified in pixels. The resized image will always keep its correct aspect ratio. |

Get payment products response exampleCopy code

```hljs javascript language-javascript
{
   "id" : "000008800510000157710000100001",
   "paymentOutput" : {
      "amountOfMoney" : {
         "amount" : 1500,
         "currencyCode" : "HKD"
      },
      "references" : {
         "paymentReference" : "T8850006WTMA"
      },
      "paymentMethod" : "redirect",
      "redirectPaymentMethodSpecificOutput" : {
         "paymentProductId" : 866
      }
   },
   "status" : "REDIRECTED",
   "statusOutput" : {
      "isCancellable" : false,
      "isRetriable" : false,
      "statusCategory" : "PENDING_PAYMENT",
      "statusCode" : 50,
      "statusCodeChangeDateTime" : "20241216151358",
      "isAuthorized" : false,
      "isRefundable" : false
   }
}
```

## Build payment products details form

This step is done with [Get payment product](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/products/get.html?paymentPlatform=ALL) API call, submitting the countryCode and currencyCode as the minimum payload.  

|   Property   | Data type | Required |
|--------------|-----------|----------|
| countryCode  | object    | yes      |
| currencyCode | object    | yes      |

The mandatory fields you need to build the payment product details form are included in the fields parent property.  
You can also get the required consumer input fields for the payment product by sending only [Get payment products](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/products/get.html?paymentPlatform=ALL) API call instead of two separate ones. The minimum payload must include the countryCode and currencyCode properties.

## Render payment product selection form

Building the UI of the checkout page using the property values from the previous steps. You can check the example apps we have on our GitHub, provided for different programming languages.

[Worldline Global Collect GitHub](https://github.com/Worldline-Global-Collect)

## Collect consumer data and send it to your server

You can skip this step if you already have the consumer's details stored on your server (for example, if the consumer previously created an account/profile).

# Make a payment

Make a [Create payment](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/payments/create.html?paymentPlatform=ALL) API call, submitting the required properties.  
Below, you'll find an example API call with the essential data. To add more information with additional properties, please visit to our [API Reference](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/payments/create.html?paymentPlatform=GLOBALCOLLECT).  

|              Property              | Data type | Required |
|------------------------------------|-----------|----------|
| order                              | object    | yes      |
| amountOfMoney                      | object    | yes      |
| currencyCode                       | string    | yes      |
| amount                             | integer   | yes      |
| customer                           | object    | yes      |
| billdingAddress                    | object    | yes      |
| countryCode                        | string    | yes      |
| redirectPaymentMethodSpecificInput | object    | yes      |
| paymentProductId                   | integer   | yes      |
| redirectionData                    | object    | yes      |
| returnUrl                          | string    | yes      |

Create paymentCopy code

```hljs javascript language-javascript
{
  "order": {
    "amountOfMoney": {
      "currencyCode": "HKD",
      "amount": 1500
    },
    "customer": {
      "billingAddress": {
        "countryCode": "HK"
      }
    }
  },
  "redirectPaymentMethodSpecificInput": {
    "paymentProductId": "866",
    "redirectionData": {
      "returnUrl": "https://example.com"
    }
  }
}
```

## Consumer redirection

If you use [Create payment](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/json/payments/create.html?paymentPlatform=ALL) API call, you also need to take care of the consumer redirection (in the case of [Create hosted checkout](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/hostedcheckouts/create.html?paymentPlatform=ALL), we handle it ourselves). In the API response to this call we'll return a merchantAction object.

While there are several different actionType values, for Alipay+ transactions, we consistently return the actionType value as REDIRECT. Along with this, a redirectData object is included, containing a redirectURL. You'll need to direct your consumer to this URL to complete their payment.

The merchantAction is only returned in the response to [Create payment](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/json/payments/create.html?paymentPlatform=ALL) as shown in the following example:  
create payment responseCopy code

```hljs javascript language-javascript
{
   "creationOutput" : {
      "additionalReference" : "00000880050000091417",
      "externalReference" : "000008800500000914170000100001"
   },
   "merchantAction" : {
      "actionType" : "REDIRECT",
      "redirectData" : {
         "RETURNMAC" : "fd9200d3-ddf5-4f4a-b0f4-01ad01cf9df2",
         "redirectURL" : "https://open-sea-global.alipayplus.com/api/open/v1/ac/cashier/self/codevalue/checkout.htm?codeValue=281666040097Ph7t0bsVIzSv5H1k6dSv4Z4N&loadMode=2"
      },
      "showData" : [ ]
   },
   "payment" : {
      "id" : "000008800500000914170000100001",
      "paymentOutput" : {
         "amountOfMoney" : {
            "amount" : 1500,
            "currencyCode" : "HKD"
         },
         "references" : {
            "paymentReference" : "170109005160"
         },
         "paymentMethod" : "redirect",
         "redirectPaymentMethodSpecificOutput" : {
            "paymentProductId" : 866
         }
      },
      "status" : "REDIRECTED",
      "statusOutput" : {
         "isCancellable" : false,
         "isRetriable" : false,
         "statusCategory" : "PENDING_PAYMENT",
         "statusCode" : 50,
         "statusCodeChangeDateTime" : "20240805221259",
         "isAuthorized" : false,
         "isRefundable" : false
      }
   }
}
```

The merchantAction is omitted from the [Get payment](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/payments/get.html?paymentPlatform=ALL) API call and will return the following API response:  
Get payment responseCopy code

```hljs javascript language-javascript
{
   "id" : "000008800510000157710000100001",
   "paymentOutput" : {
      "amountOfMoney" : {
         "amount" : 1500,
         "currencyCode" : "HKD"
      },
      "references" : {
         "paymentReference" : "T8850006WTMA"
      },
      "paymentMethod" : "redirect",
      "redirectPaymentMethodSpecificOutput" : {
         "paymentProductId" : 866
      }
   },
   "status" : "REDIRECTED",
   "statusOutput" : {
      "isCancellable" : false,
      "isRetriable" : false,
      "statusCategory" : "PENDING_PAYMENT",
      "statusCode" : 50,
      "statusCodeChangeDateTime" : "20241216151358",
      "isAuthorized" : false,
      "isRefundable" : false
   }
}
```

## Next steps

* [Receive webhook messages](https://docs.connect.worldline-solutions.com/documentation/webhooks/.md)
* [Cancel the payment](https://docs.connect.worldline-solutions.com/accepting-payments/payment-scenarios/refunds-and-cancellations.md)
* [Refund the payment](https://docs.connect.worldline-solutions.com/accepting-payments/payment-scenarios/refunds-and-cancellations.md)

[Next Process flows](https://docs.connect.worldline-solutions.com/payment-product/alipay-plus/process-flows/globalcollect.md)
