---
title: "Wero"
canonical_url: https://docs.connect.worldline-solutions.com/payment-product/wero/integration
---

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

# Integration

You have two options when it comes to processing Wero payments. You can either use our hosted checkout pages or directly initiate payments on our platform and use your own checkout page. Both options are available to you, so you can choose the one that best suits your needs.

## Before you begin

To follow along with this guide, please ensure that you have the following ready:

* The correct [API endpoint](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/json/endpoints.html?paymentPlatform=ALL)
* A way to construct the [authorization header](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/json/authentication.html?paymentPlatform=ALL) (API Explorer, [SDKs](https://docs.connect.worldline-solutions.com/documentation/sdk/.md), etc.)
* A way to send REST API calls (API Explorer, [SDKs](https://docs.connect.worldline-solutions.com/documentation/sdk/.md), etc.)

## MyCheckout hosted payment pages

If you're looking for the quickest way to accept Wero payments, our [MyCheckout hosted payment pages](https://docs.connect.worldline-solutions.com/documentation/hosted-payment-pages/.md) is the optimal solution. By using this service, you'll be able to smoothly process payments and provide your customers with a convenient, hassle-free payment experience.

To initiate the desired action, execute **POST /v1/{merchantId}/hostedcheckouts** API call. This request enables you to interact with the hosted checkouts functionality, allowing seamless integration and customization for an enhanced user experience.  
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       |

CREATE HOSTED CHECKOUT REQUESTCopy code

```hljs javascript language-javascript
{
   "order": {
    "amountOfMoney": {
      "currencyCode": "EUR",
      "amount": 1000
    },
    "customer": {
      "merchantCustomerId": "123456547",
      "billingAddress": {
        "countryCode": "NL"
      }
    }
  }
}
```

CREATE HOSTEDCHECKOUTS RESPONSECopy code

```hljs javascript language-javascript
{
   "RETURNMAC" : "10def562-6f86-4669-9a67-5177410a6a65",
   "hostedCheckoutId" : "066b137f-4665-71ff-af47-5653483a922f",
   "partialRedirectUrl" : "pay.int.checkout.worldline-solutions.com/checkout/9991-ab040093f6014115be7f4aa1c2e0f532:066b137f-4665-71ff-af47-5653483a922f:b8f953b63d554d71bc71a193958b024b"
}
```

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.pay2.preprod.checkout.worldline-solutions.com/checkout/9991......*

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

If you choose to not use the MyCheckout hosted payment pages option, perhaps that you require more styling customization options, or already have an existing payment page, you can build a direct integration using [our SDKs](https://docs.connect.worldline-solutions.com/documentation/sdk/server/.md) (or integrate our API from scratch). Within this option, you have variations depending on how you wish to integrate.

### Client encryption

Our [Client API](https://apireference.connect.worldline-solutions.com/c2sapi/v1/en_US/index.html?paymentPlatform=ALL) allows you to perform various actions. All you need is to be able to create a session via the **POST/v1/{merchantId}/sessions** API call, which will grant you access to the Client API.

It's highly recommended that you use our [Client SDKs](https://docs.connect.worldline-solutions.com/documentation/sdk/mobile/.md), provided for the following programming languages:

* [JavaScript](https://docs.connect.worldline-solutions.com/documentation/sdk/mobile/javascript/.md)
* [Java](https://docs.connect.worldline-solutions.com/documentation/sdk/mobile/android/.md)
* [Swift](https://docs.connect.worldline-solutions.com/documentation/sdk/mobile/swift/.md)
* [Objective-C](https://docs.connect.worldline-solutions.com/documentation/sdk/mobile/ios/.md)
* [Flutter](https://docs.connect.worldline-solutions.com/documentation/sdk/mobile/flutter/.md)

We also have reference implementations showing how to use these SDKs on [GitHub](https://github.com/Ingenico-ePayments).

By using this integration type, you'll be able to smoothly process payments and provide your customers with a convenient payment experience. To initiate the desired action, execute **POST /v1/{merchantId}/payments** API call.  

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

See create payment request with the minimum required data set below. If you want to supplement it with other data, please read the [API documentation.](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/json/payments/create.html?paymentPlatform=ALL)  
CREATE PAYMENT REQUESTCopy code

```hljs javascript language-javascript
{
    "order": {
        "amountOfMoney": {
            "amount": 1000,
            "currencyCode": "EUR"
        },
        "customer": {
            "billingAddress": {
                "countryCode": "NL"
            }
        }
    },
    "redirectPaymentMethodSpecificInput": {
        "paymentProductId": 900,
        "redirectionData": {
            "returnUrl": "https://www.example.com"
        }
    }
}
```

### Consumer redirection

If you use **POST /v1/{merchantId}/payments** API call, you also need to take care of the consumer redirection (in the case of**POST /v1/{merchantId}/hostedcheckouts** , we handle it ourselves). We'll return a merchantAction object. While there are several different actionType values, for payment product name 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.

Be aware that the merchantAction is only returned in the response to **POST /v1/{merchantId}/payments** and looks like this:  
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://example.com/api/open/v1/ac/checkout.htm?codeValue=281666040097Ph7t0bsVIzSv5H1k6dSv4Z4N&loadMode=2"
      },
      "showData" : [ ]
   },
   "payment" : {
      "id" : "000008800500000914170000100001",
      "paymentOutput" : {
         "amountOfMoney" : {
            "amount" : 1000,
            "currencyCode" : "EUR"
         },
         "references" : {
            "paymentReference" : "170109005160"
         },
         "paymentMethod" : "redirect",
         "redirectPaymentMethodSpecificOutput" : {
            "paymentProductId" : 900
         }
      },
      "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 /v1/{merchantId}/payments/{paymentId}** API call and will return a response like this:  
GET PAYMENT RESPONSECopy code

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

## Refund

To start a refund process, you should use the API call**POST /v1/{merchantId}/payments/{paymentId}/refund.** This action is only applicable if the payment status is **PAID.** If you wish to refund the full order amount, you can do so by sending a request using this API call, but with the only parameter refundReason:  
GET REFUND REQUESTCopy code

```hljs javascript language-javascript
{
  "refundReason": "RETURN"
}
```

refundReason is a mandatory parameter to refund a Wero transaction, and its value specifies the reason for the refund request. Possible values are:

* RETURN
* CORRECTION
* PRE_DISPUTE
* SUBSCRIPTION
* SERVICE_LATE_CANCELLATION
* OTHER

You have the option to refund a part of the funds as well. For this, it's necessary to include a payload with the **amountOfMoney** object, where you specify the amount and the **currencyCode**:  
GET REFUND REQUESTCopy code

```hljs javascript language-javascript
{
  "amountOfMoney": {
    "amount": 200,
    "currencyCode": "EUR"
  },
  "refundReason": "RETURN"
}
```

Additionally, if you want to view the details of your refund, you can use the API call [GET /v1/{merchantId}/refunds/{refundId}](https://apireference.connect.worldline-solutions.com/s2sapi/v1/en_US/java/refunds/get.html?paymentPlatform=ALL).

## Webhooks

To track transaction status updates, you can subscribe to the following [webhooks notifications](https://docs.connect.worldline-solutions.com/documentation/webhooks/.md):

* payment.created
* payment.redirected
* payment.pending_payment
* payment.captured
* payment.paid

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