Accept Alipay with server-side-only integration

Build your own payment form to add Alipay payment to the checkout page.


Alipay payment method doesn’t require any input from the customer on the merchant website. The customer will specify the required payment information on the Alipay platform.

Before you begin

Step 1: Create a Payment Type resource
server side

When creating the payment type Alipay you need to send a request to the Unzer API. The response will contain an id , this is later referred to as typeId. You will need this typeId to perform the transaction.

POST https://api.unzer.com/v1/types/alipay


$unzer = new Unzer('s-priv-xxxxxxxxxx');
$alipay = new Alipay();
$unzer->createPaymentType($alipay );

Unzer unzer = new Unzer("s-priv-xxxxxxxxxx");
Alipay alipay = new Alipay();

The response will look similar to the following example:

    "id": "s-ali-17k67coxrfrg",
    "method": "alipay",
    "recurring": false,
    "geoLocation": {
        "clientIp": "",
        "countryIsoA2": "DE"

For more details on Alipay payment type creation, see API reference.

Next steps

The next steps are the same as for the UI components integration, check Accept Alipay with UI Components from Step 2 onwards.