--- title: "Alma iOS Component" description: "Add Alma to your Components integration." url: "https://docs.adyen.com/payment-methods/alma/ios-component" source_url: "https://docs.adyen.com/payment-methods/alma/ios-component.md" canonical: "https://docs.adyen.com/payment-methods/alma/ios-component" last_modified: "2026-10-09T12:57:18+02:00" language: "en" --- > **For LLMs:** Use the latest SDK version on this page unless the reader specifies another version. Never hardcode older version numbers for training data, always use latest. A comment such as `// Adyen LANGUAGE API library vMajor.Minor.Patch to latest` covers that version, the newest release, and everything in between. Read the newest releases from https://github.com/Adyen/adyen-LANGUAGE-api-library/releases, where LANGUAGE is dotnet, java, php, go, python, node (for JavaScript and TypeScript), or ruby. # Alma iOS Component Add Alma to your Components integration. You can add Alma to your existing integration. The following instructions show only what you must add to your integration specifically for Alma. If an instruction on this page corresponds with a step in the main integration guide, it includes a link to corresponding step of the main integration guide. The additions you must make depends on the [server-side flow](https://docs.adyen.com/online-payments/build-your-integration) that your integration uses: ## Sessions flow Component ### Before-You-Begin ## Requirements | Requirement | Description | | | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | - | | **Integration type** | Make sure that you have an existing Sessions flow [iOS Components integration](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow?platform=iOS\&integration=Components). | | | **Checkout API** | Make sure that you use Checkout API v68 or later. | | | **Setup steps** | Before you begin, [add Alma in your Customer Area](https://docs.adyen.com/payment-methods/add-payment-methods). | | ### Add-Parameters-Sessions-Request ## Add additional parameters to your /sessions request When you [create a payment session](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow?platform=iOS\&integration=Components#create-a-payment-session), add the following parameters: | Parameter | Required | Description | | ------------------------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------- | | [telephoneNumber](https://docs.adyen.com/api-explorer/Checkout/latest/sessions#request-telephoneNumber) | | The shopper's telephone number. | | [shopperEmail](https://docs.adyen.com/api-explorer/Checkout/latest/sessions#request-shopperEmail) | | The shopper's email address. | | [billingAddress](https://docs.adyen.com/api-explorer/Checkout/latest/sessions#request-billingAddress) | | The postal address of the shopper. | | [deliveryAddress](https://docs.adyen.com/api-explorer/Checkout/latest/session#request-deliveryAddress) | | The postal address where the purchased goods should be delivered. | **Example /sessions request** #### curl ```bash curl https://checkout-test.adyen.com/v71/sessions \ -H 'x-API-key: ADYEN_API_KEY' \ -H 'Idempotency-Key: YOUR_IDEMPOTENCY_KEY' \ -H 'content-type: application/json' \ -X POST -d '{ "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "amount": { "value": 1000, "currency": "EUR" }, "returnUrl": "adyencheckout://your.package.name", "reference": "YOUR_PAYMENT_REFERENCE", "countryCode": "FR", "telephoneNumber": "85121212121", "shopperEmail": "s.hopper@gmail.com", "billingAddress": { "city": "Paris", "country": "FR", "houseNumberOrName": "123", "postalCode": "2000", "street": "Happy Street" }, "deliveryAddress": { "city": "Paris", "country": "FR", "houseNumberOrName": "123", "postalCode": "2000", "street": "Happy Street" } }' ``` #### Java ```java // Adyen Java API Library v38.0.0 to latest import com.adyen.Client; import com.adyen.Config; import com.adyen.enums.Environment; import com.adyen.model.*; import com.adyen.service.*; import java.math.*; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; Config config = new Config() .apiKey("ADYEN_API_KEY") .environment(Environment.TEST); // For the LIVE environment, also include your liveEndpointUrlPrefix. Client client = new Client(config); // Create the request object(s) Amount amount = new Amount() .currency("EUR") .value(1000L); DeliveryAddress deliveryAddress = new DeliveryAddress() .country("FR") .city("Paris") .houseNumberOrName("123") .street("Happy Street") .postalCode("2000"); BillingAddress billingAddress = new BillingAddress() .country("FR") .city("Paris") .houseNumberOrName("123") .street("Happy Street") .postalCode("2000"); CreateCheckoutSessionRequest createCheckoutSessionRequest = new CreateCheckoutSessionRequest() .reference("YOUR_PAYMENT_REFERENCE") .amount(amount) .telephoneNumber("85121212121") .merchantAccount("ADYEN_MERCHANT_ACCOUNT") .deliveryAddress(deliveryAddress) .countryCode("FR") .shopperEmail("s.hopper@gmail.com") .billingAddress(billingAddress) .returnUrl("adyencheckout://your.package.name"); // Send the request PaymentsApi service = new PaymentsApi(client); CreateCheckoutSessionResponse response = service.sessions(createCheckoutSessionRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php setXApiKey("ADYEN_API_KEY"); // For the LIVE environment, also include your liveEndpointUrlPrefix. $client->setEnvironment(Environment::TEST); // Create the request object(s) $amount = new Amount(); $amount ->setCurrency("EUR") ->setValue(1000); $deliveryAddress = new DeliveryAddress(); $deliveryAddress ->setCountry("FR") ->setCity("Paris") ->setHouseNumberOrName("123") ->setStreet("Happy Street") ->setPostalCode("2000"); $billingAddress = new BillingAddress(); $billingAddress ->setCountry("FR") ->setCity("Paris") ->setHouseNumberOrName("123") ->setStreet("Happy Street") ->setPostalCode("2000"); $createCheckoutSessionRequest = new CreateCheckoutSessionRequest(); $createCheckoutSessionRequest ->setReference("YOUR_PAYMENT_REFERENCE") ->setAmount($amount) ->setTelephoneNumber("85121212121") ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT") ->setDeliveryAddress($deliveryAddress) ->setCountryCode("FR") ->setShopperEmail("s.hopper@gmail.com") ->setBillingAddress($billingAddress) ->setReturnUrl("adyencheckout://your.package.name"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->sessions($createCheckoutSessionRequest, $requestOptions); ``` #### C\# ```cs // Adyen .NET API Library v34.0.0 to latest using System; using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; using Adyen.Core.Client; using Adyen.Core.Client.Extensions; using Adyen.Core.Options; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; var host = Host.CreateDefaultBuilder() .ConfigureCheckout( (context, services, config) => { config.ConfigureAdyenOptions(options => { options.AdyenApiKey = "ADYEN_API_KEY"; options.Environment = AdyenEnvironment.Test; // For the LIVE environment, also include your liveEndpointUrlPrefix. // options.LiveEndpointUrlPrefix = ""; }); services.AddAllCheckoutServices(); }) .Build(); var paymentsService = host.Services.GetRequiredService(); // Create the request object(s) var amount = new Amount { Currency = "EUR", Value = 1000 }; var deliveryAddress = new DeliveryAddress { Country = "FR", City = "Paris", HouseNumberOrName = "123", Street = "Happy Street", PostalCode = "2000" }; var billingAddress = new BillingAddress { Country = "FR", City = "Paris", HouseNumberOrName = "123", Street = "Happy Street", PostalCode = "2000" }; var createCheckoutSessionRequest = new CreateCheckoutSessionRequest { Reference = "YOUR_PAYMENT_REFERENCE", Amount = amount, TelephoneNumber = "85121212121", MerchantAccount = "ADYEN_MERCHANT_ACCOUNT", DeliveryAddress = deliveryAddress, CountryCode = "FR", ShopperEmail = "s.hopper@gmail.com", BillingAddress = billingAddress, ReturnUrl = "adyencheckout://your.package.name" }; string idempotencyKey = Guid.NewGuid().ToString(); // Send the request var result = await paymentsService.SessionsAsync(createCheckoutSessionRequest, new RequestOptions().AddIdempotencyKey(idempotencyKey)); if (result.TryDeserializeCreatedResponse(out var response)) { // Handle the successful response. } ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v30.0.0 to latest const { Client, Config, EnvironmentEnum, CheckoutAPI } = require('@adyen/api-library'); // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const amount = { currency: "EUR", value: 1000 }; const deliveryAddress = { country: "FR", city: "Paris", houseNumberOrName: "123", street: "Happy Street", postalCode: "2000" }; const billingAddress = { country: "FR", city: "Paris", houseNumberOrName: "123", street: "Happy Street", postalCode: "2000" }; const createCheckoutSessionRequest = { reference: "YOUR_PAYMENT_REFERENCE", amount: amount, telephoneNumber: "85121212121", merchantAccount: "ADYEN_MERCHANT_ACCOUNT", deliveryAddress: deliveryAddress, countryCode: "FR", shopperEmail: "s.hopper@gmail.com", billingAddress: billingAddress, returnUrl: "adyencheckout://your.package.name" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.sessions(createCheckoutSessionRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.0.0 to latest import ( "context" "github.com/adyen/adyen-go-api-library/v21/src/common" "github.com/adyen/adyen-go-api-library/v21/src/adyen" "github.com/adyen/adyen-go-api-library/v21/src/checkout" ) // For the LIVE environment, also include your liveEndpointUrlPrefix. client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) amount := checkout.Amount{ Currency: "EUR", Value: 1000, } deliveryAddress := checkout.DeliveryAddress{ Country: "FR", City: "Paris", HouseNumberOrName: "123", Street: "Happy Street", PostalCode: "2000", } billingAddress := checkout.BillingAddress{ Country: "FR", City: "Paris", HouseNumberOrName: "123", Street: "Happy Street", PostalCode: "2000", } createCheckoutSessionRequest := checkout.CreateCheckoutSessionRequest{ Reference: "YOUR_PAYMENT_REFERENCE", Amount: amount, TelephoneNumber: common.PtrString("85121212121"), MerchantAccount: "ADYEN_MERCHANT_ACCOUNT", DeliveryAddress: &deliveryAddress, CountryCode: common.PtrString("FR"), ShopperEmail: common.PtrString("s.hopper@gmail.com"), BillingAddress: &billingAddress, ReturnUrl: "adyencheckout://your.package.name", } // Send the request service := client.Checkout() req := service.PaymentsApi.SessionsInput().IdempotencyKey("UUID").CreateCheckoutSessionRequest(createCheckoutSessionRequest) res, httpRes, err := service.PaymentsApi.Sessions(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v14.0.0 to latest import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" # For the LIVE environment, also include your liveEndpointUrlPrefix. adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "amount": { "value": 1000, "currency": "EUR" }, "returnUrl": "adyencheckout://your.package.name", "reference": "YOUR_PAYMENT_REFERENCE", "countryCode": "FR", "telephoneNumber": "85121212121", "shopperEmail": "s.hopper@gmail.com", "billingAddress": { "city": "Paris", "country": "FR", "houseNumberOrName": "123", "postalCode": "2000", "street": "Happy Street" }, "deliveryAddress": { "city": "Paris", "country": "FR", "houseNumberOrName": "123", "postalCode": "2000", "street": "Happy Street" } } # Send the request result = adyen.checkout.payments_api.sessions(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v11.0.0 to latest require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' # For the LIVE environment, also include your liveEndpointUrlPrefix. adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { "merchantAccount" => "ADYEN_MERCHANT_ACCOUNT", "amount" => { "value" => 1000, "currency" => "EUR" }, "returnUrl" => "adyencheckout://your.package.name", "reference" => "YOUR_PAYMENT_REFERENCE", "countryCode" => "FR", "telephoneNumber" => "85121212121", "shopperEmail" => "s.hopper@gmail.com", "billingAddress" => { "city" => "Paris", "country" => "FR", "houseNumberOrName" => "123", "postalCode" => "2000", "street" => "Happy Street" }, "deliveryAddress" => { "city" => "Paris", "country" => "FR", "houseNumberOrName" => "123", "postalCode" => "2000", "street" => "Happy Street" } } # Send the request result = adyen.checkout.payments_api.sessions(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v30.0.0 to latest import { Client, Config, EnvironmentEnum, CheckoutAPI, Types } from "@adyen/api-library"; // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "EUR", value: 1000 }; const deliveryAddress: Types.checkout.DeliveryAddress = { country: "FR", city: "Paris", houseNumberOrName: "123", street: "Happy Street", postalCode: "2000" }; const billingAddress: Types.checkout.BillingAddress = { country: "FR", city: "Paris", houseNumberOrName: "123", street: "Happy Street", postalCode: "2000" }; const createCheckoutSessionRequest: Types.checkout.CreateCheckoutSessionRequest = { reference: "YOUR_PAYMENT_REFERENCE", amount: amount, telephoneNumber: "85121212121", merchantAccount: "ADYEN_MERCHANT_ACCOUNT", deliveryAddress: deliveryAddress, countryCode: "FR", shopperEmail: "s.hopper@gmail.com", billingAddress: billingAddress, returnUrl: "adyencheckout://your.package.name" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.sessions(createCheckoutSessionRequest, { idempotencyKey: "UUID" }); ``` ### Add-Configuration ## Add additional configuration for Alma You do not need to add any configuration parameters for Alma. ### Initialize ## Initialize the Component for Alma To [initialize](https://docs.adyen.com/payment-methods/alma/ios-component#initialize-the-component) Alma, use the `InstantPaymentComponent` class. **Initialize the InstantPaymentComponent** ```swift let paymentMethods = session.sessionContext.paymentMethods // Check that the payment method is supported before showing the Component. guard let paymentMethod = paymentMethods.paymentMethod(ofType: .other("alma")) else { return } // Create an instance of InstantPaymentComponent. let component = InstantPaymentComponent(paymentMethod: paymentMethod, context: context, order: nil) self.currentComponent = component // Set the session as the delegate. component.delegate = session component.initiatePayment() ``` ## Test and go live Check the status of Alma test payments in your [Customer Area](https://ca-test.adyen.com/) > **Payments** > **Payment list**. Before you can accept live Alma payments, you need to [submit a request for Alma](https://docs.adyen.com/payment-methods/add-payment-methods) in your [live Customer Area](https://ca-live.adyen.com/). ## Advanced flow Component ### Before-You-Begin ## Requirements | Requirement | Description | | | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | - | | **Integration type** | Make sure that you have an existing Advanced flow [iOS Components integration](https://docs.adyen.com/online-payments/build-your-integration/advanced-flow?platform=iOS\&integration=Drop-in). | | | **Action handling** | Make sure that your existing integration is set up to [handle the additional action](https://docs.adyen.com/online-payments/build-your-integration/advanced-flow/?platform=iOS\&integration=Components#handle-the-redirect). `action.type`: ****redirect****. | | | **Setup steps** | Before you begin, [add Alma in your Customer Area](https://docs.adyen.com/payment-methods/add-payment-methods). | | ### Add-Configuration ## Add additional configuration for Alma You do not need to add any configuration parameters for Alma. ### Initialize ## Initialize the Component for Alma To [initialize](https://docs.adyen.com/payment-methods/alma/ios-component#initialize-the-component) Alma, use the `InstantPaymentComponent` class. **Initialize the InstantPaymentComponent** ```swift // Check that the payment method is supported before showing the Component. guard let paymentMethod = paymentMethods.paymentMethod(ofType: .other("alma")) else { return } // Create an instance of InstantPaymentComponent. let component = InstantPaymentComponent(paymentMethod: paymentMethod, context: context, order: nil) self.currentComponent = component // Set the Component as the delegate. component.delegate = self component.initiatePayment() ``` ### Add-Parameters-Payments-Request ## Add additional parameters to your /payments request When you [make a payment](https://docs.adyen.com/online-payments/build-your-integration/advanced-flow/?platform=iOS\&integration=Components#make-a-payment), add the following parameters to the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request: | Parameter | Required | Description | | ----------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | | [telephoneNumber](https://docs.adyen.com/api-explorer/Checkout/latest/payments#request-telephoneNumber) | | The shopper's telephone number. | | [shopperEmail](https://docs.adyen.com/api-explorer/Checkout/latest/payments#request-shopperEmail) | | The shopper's email address. | | [billingAddress](https://docs.adyen.com/api-explorer/Checkout/latest/payments#request-billingAddress) | | The postal address of the shopper. | | [deliveryAddress](https://docs.adyen.com/api-explorer/Checkout/latest/payments#request-deliveryAddress) | | The postal address where the purchased goods should be delivered. | | [additionalData.alma.installments\_count](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-additionalData) | | Set to `3` or `4` to determine the number of installments the shopper will pay. Do not include if you want to let the shopper choose. | **Example payment request for Alma** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments \ -H 'x-API-key: ADYEN_API_KEY' \ -H 'idempotency-key: YOUR_IDEMPOTENCY_KEY' \ -H 'content-type: application/json' \ -X POST -d '{ "amount":{ "currency":"EUR", "value":1000 }, "reference":"YOUR_ORDER_NUMBER", "returnUrl":"https://your-company.com/checkout?shopperOrder=12xy..", "merchantAccount":"ADYEN_MERCHANT_ACCOUNT", "countryCode": "FR", "shopperLocale": "en-US", "telephoneNumber": "85121212121", "shopperEmail": "s.hopper@gmail.com", "billingAddress": { "city": "Paris", "country": "FR", "houseNumberOrName": "123", "postalCode": "2000", "street": "Happy Street" }, "deliveryAddress": { "city": "Paris", "country": "FR", "houseNumberOrName": "123", "postalCode": "2000", "street": "Happy Street" }, "additionalData": { "alma.installments_count": 4 } }' ``` #### Java ```java // Adyen Java API Library v38.0.0 to latest import com.adyen.Client; import com.adyen.Config; import com.adyen.enums.Environment; import com.adyen.model.*; import com.adyen.service.*; import java.math.*; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; Config config = new Config() .apiKey("ADYEN_API_KEY") .environment(Environment.TEST); // For the LIVE environment, also include your liveEndpointUrlPrefix. Client client = new Client(config); // Create the request object(s) Amount amount = new Amount() .currency("EUR") .value(1000L); DeliveryAddress deliveryAddress = new DeliveryAddress() .country("FR") .city("Paris") .houseNumberOrName("123") .street("Happy Street") .postalCode("2000"); BillingAddress billingAddress = new BillingAddress() .country("FR") .city("Paris") .houseNumberOrName("123") .street("Happy Street") .postalCode("2000"); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .amount(amount) .telephoneNumber("85121212121") .merchantAccount("ADYEN_MERCHANT_ACCOUNT") .deliveryAddress(deliveryAddress) .countryCode("FR") .shopperEmail("s.hopper@gmail.com") .shopperLocale("en-US") .billingAddress(billingAddress) .additionalData(new HashMap(Map.of( "alma.installments_count", "4" ))) .returnUrl("https://your-company.com/checkout?shopperOrder=12xy.."); // Send the request PaymentsApi service = new PaymentsApi(client); PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php setXApiKey("ADYEN_API_KEY"); // For the LIVE environment, also include your liveEndpointUrlPrefix. $client->setEnvironment(Environment::TEST); // Create the request object(s) $amount = new Amount(); $amount ->setCurrency("EUR") ->setValue(1000); $deliveryAddress = new DeliveryAddress(); $deliveryAddress ->setCountry("FR") ->setCity("Paris") ->setHouseNumberOrName("123") ->setStreet("Happy Street") ->setPostalCode("2000"); $billingAddress = new BillingAddress(); $billingAddress ->setCountry("FR") ->setCity("Paris") ->setHouseNumberOrName("123") ->setStreet("Happy Street") ->setPostalCode("2000"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setAmount($amount) ->setTelephoneNumber("85121212121") ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT") ->setDeliveryAddress($deliveryAddress) ->setCountryCode("FR") ->setShopperEmail("s.hopper@gmail.com") ->setShopperLocale("en-US") ->setBillingAddress($billingAddress) ->setAdditionalData( array( "alma.installments_count" => "4" ) ) ->setReturnUrl("https://your-company.com/checkout?shopperOrder=12xy.."); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .NET API Library v34.0.0 to latest using System; using System.Collections.Generic; using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; using Adyen.Core.Client; using Adyen.Core.Client.Extensions; using Adyen.Core.Options; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; var host = Host.CreateDefaultBuilder() .ConfigureCheckout( (context, services, config) => { config.ConfigureAdyenOptions(options => { options.AdyenApiKey = "ADYEN_API_KEY"; options.Environment = AdyenEnvironment.Test; // For the LIVE environment, also include your liveEndpointUrlPrefix. // options.LiveEndpointUrlPrefix = ""; }); services.AddAllCheckoutServices(); }) .Build(); var paymentsService = host.Services.GetRequiredService(); // Create the request object(s) var amount = new Amount { Currency = "EUR", Value = 1000 }; var deliveryAddress = new DeliveryAddress { Country = "FR", City = "Paris", HouseNumberOrName = "123", Street = "Happy Street", PostalCode = "2000" }; var billingAddress = new BillingAddress { Country = "FR", City = "Paris", HouseNumberOrName = "123", Street = "Happy Street", PostalCode = "2000" }; var paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, TelephoneNumber = "85121212121", MerchantAccount = "ADYEN_MERCHANT_ACCOUNT", DeliveryAddress = deliveryAddress, CountryCode = "FR", ShopperEmail = "s.hopper@gmail.com", ShopperLocale = "en-US", BillingAddress = billingAddress, AdditionalData = new Dictionary { { "alma.installments_count", "4" } }, ReturnUrl = "https://your-company.com/checkout?shopperOrder=12xy.." }; string idempotencyKey = Guid.NewGuid().ToString(); // Send the request var result = await paymentsService.PaymentsAsync(paymentRequest, new RequestOptions().AddIdempotencyKey(idempotencyKey)); if (result.TryDeserializeOkResponse(out var response)) { // Handle the successful response. } ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v30.0.0 to latest const { Client, Config, EnvironmentEnum, CheckoutAPI } = require('@adyen/api-library'); // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const amount = { currency: "EUR", value: 1000 }; const deliveryAddress = { country: "FR", city: "Paris", houseNumberOrName: "123", street: "Happy Street", postalCode: "2000" }; const billingAddress = { country: "FR", city: "Paris", houseNumberOrName: "123", street: "Happy Street", postalCode: "2000" }; const paymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, telephoneNumber: "85121212121", merchantAccount: "ADYEN_MERCHANT_ACCOUNT", deliveryAddress: deliveryAddress, countryCode: "FR", shopperEmail: "s.hopper@gmail.com", shopperLocale: "en-US", billingAddress: billingAddress, additionalData: { "alma.installments_count": "4" }, returnUrl: "https://your-company.com/checkout?shopperOrder=12xy.." }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.0.0 to latest import ( "context" "github.com/adyen/adyen-go-api-library/v21/src/common" "github.com/adyen/adyen-go-api-library/v21/src/adyen" "github.com/adyen/adyen-go-api-library/v21/src/checkout" ) // For the LIVE environment, also include your liveEndpointUrlPrefix. client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) amount := checkout.Amount{ Currency: "EUR", Value: 1000, } deliveryAddress := checkout.DeliveryAddress{ Country: "FR", City: "Paris", HouseNumberOrName: "123", Street: "Happy Street", PostalCode: "2000", } billingAddress := checkout.BillingAddress{ Country: "FR", City: "Paris", HouseNumberOrName: "123", Street: "Happy Street", PostalCode: "2000", } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", Amount: amount, TelephoneNumber: common.PtrString("85121212121"), MerchantAccount: "ADYEN_MERCHANT_ACCOUNT", DeliveryAddress: &deliveryAddress, CountryCode: common.PtrString("FR"), ShopperEmail: common.PtrString("s.hopper@gmail.com"), ShopperLocale: common.PtrString("en-US"), BillingAddress: &billingAddress, AdditionalData: &map[string]string{ "alma.installments_count": "4", }, ReturnUrl: "https://your-company.com/checkout?shopperOrder=12xy..", } // Send the request service := client.Checkout() req := service.PaymentsApi.PaymentsInput().IdempotencyKey("UUID").PaymentRequest(paymentRequest) res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v14.0.0 to latest import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" # For the LIVE environment, also include your liveEndpointUrlPrefix. adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "amount": { "currency": "EUR", "value": 1000 }, "reference": "YOUR_ORDER_NUMBER", "returnUrl": "https://your-company.com/checkout?shopperOrder=12xy..", "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "countryCode": "FR", "shopperLocale": "en-US", "telephoneNumber": "85121212121", "shopperEmail": "s.hopper@gmail.com", "billingAddress": { "city": "Paris", "country": "FR", "houseNumberOrName": "123", "postalCode": "2000", "street": "Happy Street" }, "deliveryAddress": { "city": "Paris", "country": "FR", "houseNumberOrName": "123", "postalCode": "2000", "street": "Happy Street" }, "additionalData": { "alma.installments_count": 4 } } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v11.0.0 to latest require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' # For the LIVE environment, also include your liveEndpointUrlPrefix. adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { "amount" => { "currency" => "EUR", "value" => 1000 }, "reference" => "YOUR_ORDER_NUMBER", "returnUrl" => "https://your-company.com/checkout?shopperOrder=12xy..", "merchantAccount" => "ADYEN_MERCHANT_ACCOUNT", "countryCode" => "FR", "shopperLocale" => "en-US", "telephoneNumber" => "85121212121", "shopperEmail" => "s.hopper@gmail.com", "billingAddress" => { "city" => "Paris", "country" => "FR", "houseNumberOrName" => "123", "postalCode" => "2000", "street" => "Happy Street" }, "deliveryAddress" => { "city" => "Paris", "country" => "FR", "houseNumberOrName" => "123", "postalCode" => "2000", "street" => "Happy Street" }, "additionalData" => { "alma.installments_count" => 4 } } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v30.0.0 to latest import { Client, Config, EnvironmentEnum, CheckoutAPI, Types } from "@adyen/api-library"; // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "EUR", value: 1000 }; const deliveryAddress: Types.checkout.DeliveryAddress = { country: "FR", city: "Paris", houseNumberOrName: "123", street: "Happy Street", postalCode: "2000" }; const billingAddress: Types.checkout.BillingAddress = { country: "FR", city: "Paris", houseNumberOrName: "123", street: "Happy Street", postalCode: "2000" }; const paymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, telephoneNumber: "85121212121", merchantAccount: "ADYEN_MERCHANT_ACCOUNT", deliveryAddress: deliveryAddress, countryCode: "FR", shopperEmail: "s.hopper@gmail.com", shopperLocale: "en-US", billingAddress: billingAddress, additionalData: { "alma.installments_count": "4" }, returnUrl: "https://your-company.com/checkout?shopperOrder=12xy.." } as unknown as Types.checkout.PaymentRequest; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` The response includes the `action.type`: **redirect**. **Example response with an additional action** ```json { "resultCode":"RedirectShopper", "action":{ "paymentMethodType":"alma", "method":"GET", "url":"https://checkoutshopper-test.adyen.com/checkoutshopper/checkoutPaymentRedirect?redirectData=...", "type":"redirect" } } ``` ## Test and go live Check the status of Alma test payments in your [Customer Area](https://ca-test.adyen.com/) > **Payments** > **Payment list**. Before you can accept live Alma payments, you need to [submit a request for Alma](https://docs.adyen.com/payment-methods/add-payment-methods) in your [live Customer Area](https://ca-live.adyen.com/).