---
title: "Building a cloud integration"
description: "Learn how to build an integration with cloud communications."
url: "https://docs.adyen.com/point-of-sale/design-your-integration/choose-your-architecture/cloud"
source_url: "https://docs.adyen.com/point-of-sale/design-your-integration/choose-your-architecture/cloud.md"
canonical: "https://docs.adyen.com/point-of-sale/design-your-integration/choose-your-architecture/cloud"
last_modified: "2023-08-29T10:29:00+02:00"
language: "en"
---

# Building a cloud integration

Learn how to build an integration with cloud communications.

[View source](/point-of-sale/design-your-integration/choose-your-architecture/cloud.md)

![](/user/pages/docs/03.point-of-sale/04.design-your-integration/06.choose-your-architecture/02.cloud/postman-logo-vertical-orange-2021.svg?decoding=auto\&fetchpriority=auto)  [Postman collection](https://www.postman.com/adyendev/workspace/adyen-in-person-payments/overview)

**Implementation examples**\
![](/user/pages/reuse/development-resources/additional-info-resources/java-original.svg?decoding=auto\&fetchpriority=auto)  [Java Spring](https://github.com/adyen-examples/adyen-java-spring-online-payments/tree/main/in-person-payments-example)\
![](/user/pages/reuse/development-resources/additional-info-resources/dot-net-original.svg?decoding=auto\&fetchpriority=auto)  [.NET](https://github.com/adyen-examples/adyen-dotnet-online-payments/tree/main/in-person-payments-example)\
![](/user/pages/reuse/development-resources/additional-info-resources/nodejs-original.svg?decoding=auto\&fetchpriority=auto)  [Node.js](https://github.com/adyen-examples/adyen-node-online-payments/tree/main/in-person-payments-example)

With an integration that uses cloud communications, your POS app and the payment terminal communicate with each other over the internet:

1. Your POS app makes an API request to the Adyen payments platform.

2. The Adyen payments platform routes the request to your payment terminal, to start the payment on the device.

3. The terminal sends the transaction to the Adyen payments platform for processing.

4. You receive the result of the transaction synchronously or asynchronously, depending on how you build your integration:

   * **Synchronously**: when your POS app makes an API request, it keeps the connection open until the transaction result is known.
   * **Asynchronously**: your POS app makes an API request, then closes the connection. You receive the transaction result including the receipt data in an event notification or by making a transaction status request.

To build a cloud integration, you need to:

1. [Configure your network](#configure-network).
2. [Optionally install an API library](#install-library).
3. [Build your payment flow](#build-payment-flow).
4. Learn how to [handle network issues](#handle-network-issues).

## Step 1: Configure your network

To enable your POS app to connect to Adyen:

1. Add Adyen's domains to your firewall's allowlist.\
   Configure your firewall to allow outgoing HTTPS traffic from the IP addresses of your POS apps and terminals to:

   * `*.adyen.com`
   * `*.adyenpayments.com`

   Allowlisting should be based on the DNS name of these URLs. Your firewall should dynamically check for IP address updates, at least every 60 seconds.

   Do not hard-code Adyen's IP addresses, because these can change over time. We do not share a list of our IP addresses publicly.

2. Open the ports:

   * **tcp/443** to the internet.
   * **tcp/8443** on your LAN.

3. Contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) to enable web sockets for your account.

For more information, see [Network and connectivity](/point-of-sale/design-your-integration/network-and-connectivity).

## Step 2 (optional): Install a GitHub API library

On our [GitHub](https://github.com/adyen), we provide API libraries in several languages. Because the libraries are connected to managed package systems (Gradle, Maven, npm, NuGet) they are easy to include in your project.\
Installing a GitHub library is not required, but can save you development time, because a library includes all Terminal API models so you can use these to create requests. Most libraries also send requests to Adyen using a built-in HTTP client and construct the correct TEST and LIVE endpoints.

The following GitHub libraries are available for a Terminal API integration that uses cloud communications:

* .NET - [adyen-dotnet-api-library](https://github.com/Adyen/adyen-dotnet-api-library)

* Java - [adyen-java-api-library](https://github.com/Adyen/adyen-java-api-library)

* Go - [adyen-go-api-library](https://github.com/Adyen/adyen-go-api-library)

* Node - [adyen-node-api-library](https://github.com/Adyen/adyen-node-api-library)

* PHP - [adyen-php-api-library](https://github.com/Adyen/adyen-php-api-library)

* Ruby - [adyen-ruby-api-library](https://github.com/Adyen/adyen-ruby-api-library)

* iOS/macOS - [adyen-terminal-api-ios](https://github.com/Adyen/adyen-terminal-api-ios). This package is intended for following scenarios:

  * when integrating the [POS Mobile SDK](/point-of-sale/ipp-mobile)
  * when integrating server-side with Adyen payment terminals using cloud communications

These GitHub libraries work with Terminal API and are completely separate from the [classic libraries, which are being deprecated](/point-of-sale/classic-library-deprecation).

## Step 3: Build your payment flow

When building your payment flow, decide how you want to receive the result of your Terminal API requests:

* [Synchronously](#sync), as an API response. The request returns the response with all the details.
* [Asynchronously](#async), from a webhook. The request returns `200 OK`. The response with all the details is sent to a webhook server that you set up for event notifications. For payments, you can also get the payment response by making a transaction status request.

### Receiving a synchronous result

To receive the payment result synchronously:

* Your POS app needs to make HTTPS requests to the synchronous endpoint:\
  <https://terminal-api-test.adyen.com/sync>\
  This request must use an extended time-out of more than 150 seconds. During this time the connection is kept alive and a synchronous response will follow.

* Optionally show [display notifications](/point-of-sale/design-your-integration/notifications/display-notifications) in your POS app.\
  During a transaction or *[tender](/get-started-with-adyen/adyen-glossary/#tender)*, the payment terminal generates display notifications. You can show these in your POS app to keep your staff up-to-date on the progress of the tender. For example, whether the customer has selected Dynamic Currency Conversion, or finished entering their PIN.

* As a fallback in case the synchronous response is not received due to network or WebSocket connection issues, consider also setting up platform-generated [standard webhooks](/development-resources/webhooks).

![](/user/pages/docs/03.point-of-sale/04.design-your-integration/06.choose-your-architecture/02.cloud/synchronous_flow.png)

The synchronous [Terminal API payment response](/point-of-sale/design-your-integration/terminal-api#responses) provides:

* The result of the payment.
* Adyen's [PSP reference](/get-started-with-adyen/adyen-glossary/#psp-reference) that uniquely identifies the transaction.
* Your unique transaction reference.
* Data that you can use to [generate a receipt](/point-of-sale/basic-tapi-integration/generate-receipts). You can generate a printed receipt, show it on the terminal display, or email it to the customer.

### Receiving an asynchronous result

If you do not want to use an extended time-out of 150 seconds, you can instead receive the response asynchronously. In this case:

* Your POS app needs to make an HTTPS request to the asynchronous endpoint:\
  <https://terminal-api-test.adyen.com/async>\
  This returns an HTTP status code of 200 OK when the terminal receives the request.\
  The time between making the request and receiving the HTTP status code depends on the quality of the terminal's internet connection.

* To asynchronously receive the actual Terminal API response, you need to set up [event notifications](/point-of-sale/design-your-integration/notifications/event-notifications). The terminal will send the Terminal API response over the WebSocket connection to your event notifications endpoint. However, you need to filter out the Terminal API responses from the event notifications.

* You need to [accept](/point-of-sale/design-your-integration/notifications/event-notifications#accept-event-notifications) the event notification with the Terminal API response when you receive it, by responding with a successful HTTP response status code.

* We retry sending asynchronous Terminal API responses up to three times, but only if the HTTP response code you send is **5xx**. Any other response code is treated as a success.

* As a fallback in case event notifications are not sent due to an issue with the WebSocket connection, consider also setting up platform-generated [standard webhooks](/development-resources/webhooks).

* To synchronously receive data to generate a receipt, your POS app needs to make a [transaction status request](/point-of-sale/basic-tapi-integration/verify-transaction-status) to the synchronous endpoint <https://terminal-api-test.adyen.com/sync>.

* Optionally show [display notifications](/point-of-sale/design-your-integration/notifications/display-notifications) in your POS app.\
  During a transaction or *[tender](/get-started-with-adyen/adyen-glossary/#tender)*, the payment terminal generates display notifications. You can show these in your POS app to keep your staff up-to-date on the progress of the tender. For example, whether the customer has selected Dynamic Currency Conversion, or finished entering their PIN.

![](/user/pages/docs/03.point-of-sale/04.design-your-integration/06.choose-your-architecture/02.cloud/async_cloud_trans_status.svg?decoding=auto\&fetchpriority=auto)

Both the event notification with the [Terminal API payment response](/point-of-sale/design-your-integration/terminal-api#responses) and the transaction status response provide:

* The result of the payment.
* Adyen's [PSP reference](/get-started-with-adyen/adyen-glossary/#psp-reference) that uniquely identifies the transaction.
* Your unique transaction reference.
* Data that you can use to [generate a receipt](/point-of-sale/basic-tapi-integration/generate-receipts). You can generate a printed receipt, show it on the terminal display, or email it to the customer.

#### Guarantee payment response delivery

By default, we stop trying to send a payment response to your event notifications endpoint after three attempts. To make sure you do not miss a Terminal API response, you can enable the guarantee payment response delivery feature. It keeps sending the Terminal API response until your server acknowledges the webhook with a [successful HTTP response status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#successful_responses), for example **200**.

To enable the feature, contact the [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other).

Because the [Terminal API response](/point-of-sale/design-your-integration/notifications/event-notifications#async-response) is sent asynchronously, the POS app might receive it in the middle of a different transaction.

## Step 4: Handle network issues

To make your integration more resilient in case of connection issues, your integration should automatically [make a transaction status request](/point-of-sale/basic-tapi-integration/verify-transaction-status) when it does not receive a payment response from Adyen.

Payment requests time out after 150 seconds. If you do not receive a payment response (or a response indicating a time-out) after 150 seconds, your integration should automatically make a transaction status request.

Displaying the result of the transaction status request in your POS app reduces the risk that your store staff will unnecessarily attempt to cancel or refund the transaction, or make a duplicate transaction.

You can optionally request the status of a transaction before 150 seconds. For example, you may also want to let store staff manually request the status of a payment at any time from your POS app.

***

Now that you are familiar with how to build your integration, you can learn about the basics of our Terminal API.

## Next steps

[required](/point-of-sale/design-your-integration/terminal-api)

[Terminal API fundamentals](/point-of-sale/design-your-integration/terminal-api)

[Learn about our point of sale API.](/point-of-sale/design-your-integration/terminal-api)

[Set up display notifications](/point-of-sale/design-your-integration/notifications/display-notifications)

[Keep your store staff informed of the transaction progress.](/point-of-sale/design-your-integration/notifications/display-notifications)

[Set up event notifications](/point-of-sale/design-your-integration/notifications/event-notifications)

[Receive asynchronous responses and notifications of terminal events.](/point-of-sale/design-your-integration/notifications/event-notifications)
