Skip to content

Last updated: 27 May 2026 | Change log

Web for APMs - Components SDK


Take Alternative Payment Methods (APMs) using a secure, hosted iframe solution.
Integrate the SDK into your web application, ensuring a seamless and secure payment experience for your customers.

Prerequisite

Contact your Worldpay Implementation Manager for your checkout id (in UUId format) and your credentials.

Integration steps

  1. SDK initialization - load and configure the SDK in your web application.

  2. UI rendering - the hosted component is embedded against a chosen selector on your checkout page.

  3. Payment data collection - collect payment details securely via the iframe.

  4. Session creation - receive a session from the SDK.

  5. Payment submission - send the session to your backend for payment processing.

  6. QR code APMs - handle QR code display and retrieve payment statuses for APMs (Pix, WeChat Pay, Swish).

  7. Recurring transactions - process recurring payments for SEPA, Klarna (recurring) and iDEAL.

Redirect APM flow for the Components SDK

APMs APIMerchantComponents SDKCustomerAPMs APIMerchantComponents SDKCustomerConfigure and initialize Components SDK1Submit payment details for the selected method2Return session href3Submit payment request with session href4Return redirect URL5Redirect customer to APM provider6Authorize payment7Poll transaction status8Return transaction status9Redirect customer to the status page10
APMs APIMerchantComponents SDKCustomerAPMs APIMerchantComponents SDKCustomerConfigure and initialize Components SDK1Submit payment details for the selected method2Return session href3Submit payment request with session href4Return redirect URL5Redirect customer to APM provider6Authorize payment7Poll transaction status8Return transaction status9Redirect customer to the status page10

QR code APM flow for the Components SDK

APMs APIMerchantComponents SDKCustomerAPMs APIMerchantComponents SDKCustomerConfigure and initialize Components SDK1Submit payment details for the selected method2Return session href3Submit payment request with session href4Return redirect payload containing QR code data5Pass QR code data using continue method6Display QR code7Complete payment in provider app8Poll transaction status9Return transaction status10Redirect customer to the status page11
APMs APIMerchantComponents SDKCustomerAPMs APIMerchantComponents SDKCustomerConfigure and initialize Components SDK1Submit payment details for the selected method2Return session href3Submit payment request with session href4Return redirect payload containing QR code data5Pass QR code data using continue method6Display QR code7Complete payment in provider app8Poll transaction status9Return transaction status10Redirect customer to the status page11

Integration and initialization

Add the Components SDK script to your web application:

<script type="module" src="https://js.worldpay.com/1.214.1/components.js"></script>

Adding type="module" is required when loading components.js. The Components SDK is delivered as an ES module, so the browser must load it in module mode for Worldpay.components to be available.


Integration example - preview only

You can initialize the SDK using a simple configuration.

<script type="module">
  const config = {
    id: "your-checkout-id",
    baseUrl: "https://try.access.worldpay.com",
    selector: "#payment-wrapper",
    transaction: {
      amount: 100,
      currency: "GBP",
      countryCode: "GB"
    },
    elements: [
      {
        element: 'accordion',
        methods: [{ name: 'alipay_cn' }, { name: 'paypal' }, { name: 'sepa' }, { name: 'blik' }, { name: 'swish' }],
      },
    ],
    advancedConfiguration: {
      additionalFields: [`name`, `email`, `dob`, `phone`, `shippingAddress`, `billingAddress`, `identityDocuments`]
    }
  }

  Worldpay.components.init(config)
</script>
ParameterDescription
idCheckout merchant ID.
baseUrlThe URL for our try/live environment.
selectorThe DOM selector where the iframe is mounted.
transactionAn object containing payment details.
amountThe transaction amount in minor units (e.g., pence for GBP).
currencyThe ISO currency code.
countryCodeThe ISO country code.
loadingSkeletonEnables a loading skeleton while the iframe is initializing.
elements and methodsDefines the elements and payment methods.

User data collection

Customers enter their payment details directly into the hosted iframe. The SDK handles validation and securely transmits the information to us. We process and store the data and send you an encrypted session.

Handling session

Once payment details are entered and validated, the SDK returns a session representing the payment data.

<script type="module">
  Worldpay.components.init(config)
    .onSuccess((session, method) => { 
      console.log(session) // "https://try.access.worldpay.com/sessions/eyJrIjoxLCJkIjoiWnRLYmErUUNkOTRnc2NUZ3Z5..."
      console.log(method) // e.g. "paypal"
  })
</script>

You can then apply the session directly in our APMs API.

  1. Set instruction.paymentInstrument.type": "checkout"
  2. Apply the session in the value for instruction.paymentInstrument.sessionHref

The data you can collect with the SDK is directly mapped to our APMs API. This is then passed in the encrypted session, meaning you don't need to re-supply it. The SDK maps the APMs API field as follows:

additionalFieldsSDK display nameAPMs API service mapping
billingAddressBilling Addressinstruction.paymentInstrument.billingAddress
shippingAddressShipping Addressinstruction.shipping
emailEmail Addressinstruction.customer.email
nameFirst Nameinstruction.customer.firstName
nameLast Nameinstruction.customer.lastName
phoneTelephone Numberinstruction.customer.phone
dateOfBirthDate of Birthinstruction.customer.dateOfBirth
identityDocumentsCPF/CNPJinstruction.customer.identityDocuments.reference
identityDocumentsCPF/CNPJinstruction.customer.identityDocuments.type

Supported payment methods

Payment methodInitializing request payment name
ACH/eCheckach
Alipay Chinaalipay_cn
Alipay Hong Kongalipay_hk
Alipay+alipay_uni
Bancontactbancontact
BLIKblik
Eutellereuteller
iDEALideal
Klarna (recurring)klarna
Konbinikonbini
Multibancomultibanco
MyBankmybank
Open Bankingopen_banking
Przelewy24przelewy
PayPalpaypal
PaysafeCardpaysafecard
Pixpix
SafetyPaysafetypay
SEPA Direct Debitsepa
Swishswish
Trustlytrustly
WeChat Paywechatpay

Example - Initializing 4 payment methods, with default fields

Components initialization example screenshot

<script type="module">
  Worldpay.components.init({
    // ...other config
    elements: [
      {
        element: "accordion",
        methods: [
          { name: "paypal" },
          { name: "sepa" },
          { name: "blik" },
          { name: "konbini" }
        ]
      }
    ]
  })
</script>