Requirements
| Requirement | Description |
|---|---|
| Integration type | Make sure that you have: A headless Adobe Commerce plugin integration. Web Components integrations for the express payment methods that you want to support. |
| Setup steps | Before you begin: Install the Adobe Commerce express checkout module. Implement express checkout for the express payment methods that you offer. |
Headless integration types
Learn more
- REST: The most widely used web API. This method allows you to access all the functionalities provided by the Adyen plugin.
-
GraphQL:
Requires plugin v8.2.0 or later
The Adyen plugin utilizes the
/graphqlendpoint exposed by the Adobe Commerce back-end, and adds functionality that is related to the plugin. You can access all functionalities provided by the Adyen plugin with this method. For more information, checkout the Adobe Commerce GraphQL documentation.
/graphql, and there are different mutations that you need to use.
How it works
With a headless Adobe Commerce integration, you can use the Adyen Web Components to support express checkout. You use our Components to show the express payment methods to your shoppers, and make requests to the Adobe Commerce API to handle the payment flow. The flow depends on where you show the option to use express checkout in your store:- Cart or mini-cart page
- Product detail page
- REST
- GraphQL
- REST
- GraphQL
- REST
- GraphQL
- REST
- GraphQL
- REST
- GraphQL
- REST
- GraphQL
- REST
- GraphQL
- REST
- GraphQL
- Adobe Commerce initializes a quote for the order.
- When the shopper enters their shipping address, present the available shipping methods.
- When the shopper selects a shipping method, update the order with the shipping method.
- The total payment amount may change depending on the shipping method the shopper selects, in such cases, handle the changes to the payment amount.
- When the shopper selects the express payment button, the payment method components trigger an event.
- Use the Adobe Commerce API to complete the payment within the event.
- To display the option to use express checkout on the product detail page, initialize a quote for the order.
- When the shopper enters their shipping address, present the available shipping methods.
- When the shopper selects a shipping method, update the order with the shipping method.
- The total payment amount may change depending on the shipping method the shopper selects, in such cases, you handle the changes to the payment amount.
- When the shopper selects the express payment button, the payment method components trigger an event.
- Use Adobe Commerce API to activate the quote that you initialized, and complete the payment within the event.
Initialize a quote
Adobe Commerce requires a quote to be generated to complete a transaction and create an order.If you show express payment methods on:- Cart or mini-cart pages: when a shopper adds an item to their shopping cart for the first time, Adobe commerce creates a quote. Proceed to get the shopper’s address and available shipping methods.
- Product detail page: initialize a quote manually.
Initialize a quote manually
To initialize a quote on the product detail page, make an API request.If you are using REST, the endpoint differs per use case. If you are using GraphQL, the endpoint is/graphql.Logged-in shoppers
-
POST
/V1/adyen/express/init/mineParameter Required Description productCartParams
An instance of the ProductCartParamsInterface, including the product ID, quantity, and options for configurable products. The object should be a JSON encoded string.adyenCartIdThe logged-in shopper’s real cart ID. If a cart already exists at the time of the initialization request, this request disables the existing real cart using the cart ID. adyenMaskedQuoteIdThe quote initialized to mount the payment method component on the product detail page. You receive this value in the response to your first request to the endpoint and can use it in your subsequent requests. In subsequent requests, this field is used to update the quote in case of changes to the order.
adyenMaskedQuoteId that you need to use to mount the component in the next step.Guest shoppers
-
POST
/V1/adyen/express/init/guestParameter Required Description productCartParams
An instance of the ProductCartParamsInterface, including the product ID, quantity, and options for configurable products in a JSON encoded string format.guestMaskedIdThe guest shopper’s real cart ID. If a cart already exists at the time of the initialization request, this request disables the existing real cart using the cart ID. adyenMaskedQuoteIdThe quote initialized to mount the payment method component on the product detail page. You receive this value in the response to your first request to the endpoint and can use it in your subsequent requests. In subsequent requests, this field is used to update the quote in case of changes to the order.
adyenMaskedQuoteId that you need to use to mount the component in the next step.Use the
In the response, you receive the
expressInit GraphQL mutation to initialize a quote on the product detail page. If there is already a quote initialized on the product detail page, this mutation updates the quote.Create a data object to send in the mutation, that includes the following:| Parameter | Required | Description |
|---|---|---|
productCartParams | ![]() | An instance of the ProductCartParamsInterface , including the product ID, quantity, and options for configurable products in a JSON encoded string format. |
guestMaskedId | The guest shopper’s real cart ID. If a cart already exists at the time of the initialization request, this request disables the existing real cart using the cart ID. | |
adyenMaskedQuoteId | The quote initialized to mount the payment method component on the product detail page. You receive this value in the response to your first request to the endpoint and can use it in your subsequent requests. In subsequent requests, this field is used to update the quote in case of changes to the order. |
adyenMaskedQuoteId that you need to use to mount the component in the next step.Get the shopper’s address and available shipping methods
After an Adobe Commerce quote is created for the shopper’s order, start the express checkout flow by presenting the express payment method and collecting the shopper’s details.-
Mount the express payment method component:
- On the cart and mini-cart pages, you can mount the component after your shopper adds an item to their cart.
- On the product detail page, you can mount the component after receiving the
adyenMaskedQuoteId.
-
When your shopper selects the Pay button for the express payment method, the component shows the payment form.
- For Apple Pay and Google Pay, you do not need to take additional action to show the payment form.
- For PayPal, there are extra steps to show the PayPal lightbox.
Show the PayPal lightbox
For PayPal express payments, you need initial payment data to show the PayPal lightbox when your shopper selects the PayPal button. Make a request to one of the following endpoints to obtain the initial data, depending on your shopper’s use case.Logged-in shoppers
-
POST
/V1/adyen/express/init-payments/mineParameter Required Description stateData
The state.datafrom theonSubmitevent in the PayPal Web Component.adyenCartIdRequired if adyenMaskedQuoteIdis not included. The logged-in shopper’s real cart ID.adyenMaskedQuoteIdRequired if adyenCartIdis not included. If you initialized a quote manually to mount the payment method component on the product detail page, this is the quote ID.
Guest shoppers
-
POST
/V1/adyen/express/init-payments/guestParameter Required Description stateData
The state.datafrom theonSubmitevent in the PayPal Web Component.guestMaskedIdRequired if adyenMaskedQuoteIdis not included. The guest shopper’s real cart ID.adyenMaskedQuoteIdRequired if adyenCartIdis not included. If you initialized a quote manually to mount the payment method component on the product detail page, this is the quote ID.
paymentDataobject. The response includes the following:-
paymentData: The payment data object that is required to show the PayPal lightbox. You need this value to update the PayPal order in later steps. -
response.action: Theactionobject from the /payments response. Pass this from your server to the Component:If the PayPal overlay gets stuck at loading state, make sure that you pass the fullcomponent.handleAction(response.action);response.actionobject to the Component. See Troubleshooting PayPal for more information.
-
When your shopper enters their shipping contact and address in the payment form, obtain the address changes from the event handlers of each payment method component.
For example, the Apple Pay Component calls theonShippingContactSelectedevent handler when the shopper selects their shipping contact. -
In the event handler, make an API request to get the available shipping methods based on the shopper’s shipping address.
- Logged-in shoppers:
- Guest shoppers
- Only if you support PayPal express, update the PayPal order after you get the available shipping methods to update the PayPal lightbox.
- Use the response to present the available shipping methods to your shoppers.
-
Mount the express payment method component:
- On the cart and mini-cart pages, you can mount the component anytime after your shopper adds an item to their cart.
- On the product detail page, you can mount the component after receiving the
adyenMaskedQuoteId.
-
When your shopper selects the Pay button for the express payment method, the component shows the payment form.
- For Apple Pay and Google Pay, you do not need to take additional action to show the payment form.
- For PayPal, there are extra steps to show the PayPal lightbox.
Show the PayPal lightbox
For PayPal express payments, you need initial payment data to show the PayPal lightbox when your shopper selects the PayPal button. Use theadyenExpressInitPaymentsmutation to obtain the payment data. Prepare a data object to send in the mutation that includes the following:This mutation makes a /payments request to obtain theParameter Required Description stateData
The state.datafrom theonSubmitevent in the PayPal Web Component.adyenCartIdRequired if adyenMaskedQuoteIdis not included. The logged-in shopper’s real cart ID.adyenMaskedQuoteIdRequired if adyenCartIdis not included. If you initialized a quote manually to mount the payment method component on the product detail page, this is the quote ID.paymentDataobject. The response includes the following:paymentData: The payment data object that is required to show the PayPal lightbox. You need this value to update the PayPal order in later steps.response.action: Theactionobject from the /payments response. Pass this from your server to the Component:component.handleAction(response.action);
response.actionobject to the Component. See Troubleshooting PayPal for more information. -
When your shopper enters their shipping contact and address in the payment form, obtain the address changes from the event handlers of each payment method component.
For example, the Apple Pay Component calls theonShippingContactSelectedevent handler when the shopper selects their shipping contact. -
In the event handler, use the
estimateShippingMethodsGraphQL mutation to get the available shipping methods based on the shopper’s shipping address. - Only if you support PayPal express, update the PayPal order after you get the available shipping methods to update the PayPal lightbox.
- Use the response to present the available shipping methods to your shoppers.
Update the order with the selected shipping method
Update the order in Adobe Commerce after your shopper selects one of the available shipping methods.-
When your shopper selects a shipping method, obtain the selected shipping method from the event handlers of each payment method component.
For example, the Apple Pay Component calls theonShippingMethodSelectedevent handler when the shopper selects a shipping method. -
In the event handler, make an API request to one of the following endpoints to update the Adobe Commerce quote with the shopper address and shipping method that you saved to the component.
- Logged-in shoppers
- Guest shoppers
/shipping-informationendpoint. You can call this endpoint again when you receive the shopper’s details. - Only if you support PayPal express, update the PayPal order after your shopper selects a shipping method to update the PayPal lightbox.
-
When your shopper selects a shipping method, obtain the selected shipping method from the event handlers of each payment method component.
For example, the Apple Pay Component calls theonShippingMethodSelectedevent handler when the shopper selects a shipping method. - In the event handler, use the following GraphQL mutations to update the Adobe Commerce quote with the shopper address and shipping method that you saved to the component. Apple Pay and Google Pay return the shopper details after the payment is authorized. For these payment methods, use dummy values. You can use the mutation again when you receive the shopper’s details.
- Only if you support PayPal express, update the PayPal order after your shopper selects a shipping method to update the PayPal lightbox.
Handle payment amount changes
The total payment amount may change depending on the shopper’s selected shipping method. You must then update the payment method component and the Adobe Commerce quote with the final amount.-
To get the total order amount, make an API request to one of the following endpoints:
- Logged-in shoppers
- Guest shoppers
-
After you obtain the updated total payment amount, pass this to the payment method component. The payment method components have functions that you can use in event handlers.
For example, the Apple Pay component lets you use theresolve()function in the event handler to set the new payment amount.
-
To get the total order amount, use the
estimateTotalsGraphQL mutation. -
After you obtain the updated total payment amount, pass this to the payment method component. The payment method components have functions that you can use in event handlers.
For example, the Apple Pay component lets you use theresolve()function in the event handler to set the new payment amount.
Complete the payment
To complete the payment, the shopper’s cart must be active. If you show express payment methods on:- Cart or mini-cart pages: the shopper’s cart is already active. Proceed to place the order.
- Product detail page: you must manually activate the cart for the quote you initialized manually.
Activate the cart manually
If you show express payment methods on the product detail page, and initialized a quote manually, make an API request to activate the cart for the quote you initialized.If you are using REST, the endpoint differs per use case. If you are using GraphQL, the endpoint is/graphql.Logged-in shoppers
-
POST
/V1/adyen/express/activate/mineParameter Required Description adyenMaskedQuoteId
The quote initialized to mount the payment method component on the product detail page. You receive this in the /V1/adyen/express/init/guestresponse when you initialize a quote manually.adyenCartIdThe ID of the logged-in shopper’s real cart.
Guest shoppers
-
POST
/V1/adyen/express/activate/guestParameter Required Description adyenMaskedQuoteId
The quote initialized to mount the payment method component on the product detail page. You receive this in the /V1/adyen/express/init/guestresponse when you initialize a quote manually.currentMaskedQuoteIdThe ID of the guest shopper’s real cart.
Use the
expressActivate mutation to activate the quote you initialized on the product detail page for logged-in users. This mutation disables any other real carts.Create a data object to send in the mutation, that includes the following:| Parameter | Required | Description |
|---|---|---|
adyenMaskedQuoteId | ![]() | The quote initialized to mount the payment method component on the product detail page. You receive this in the /V1/adyen/express/init/guest response when you initialize a quote manually. |
adyenCartId | The shopper’s real cart ID. |
Place the order
When the shopper selects the express payment button, the payment method components trigger an event to complete the payment. For example, the Apple Pay Component triggers theonAuthorized event. In this event, implement the steps to complete the payment.-
Update the cart details using the data you get in the payment method component event. There are different endpoints to update the billing address and shipping information.
Order details Endpoint for logged-in shoppers Endpoint for guest shoppers Billing address V1/carts/mine/billing-address/V1/guest-carts/{cartId}/billing-addressShipping information V1/carts/mine/shipping-information/V1/guest-carts/{cartId}/shipping-information -
Place the order with an API request to one of the following endpoints:
- Logged-in shoppers
- Guest shoppers
let paymentInformationPayload = { "email":"john.smith@email.com", "paymentMethod":{ "method":"adyen_applepay", "additional_data":{ "brand_code":"applepay", "stateData":"JSON.stringify(componentData)" // componentData is the state.data from the payment method component. } } } -
Only for Apple Pay, resolve the payment method component with a success message. You can use the
.resolve()function to do this. See an example on our GitHub.
-
Update the cart details using the data you get in the payment method component event. There are different GraphQL mutations to update the billing address and shipping information.
Refer to our headless integration documentation to learn more about placing an order with this GraphQL mutations.
Order details GraphQL mutation Billing address setBillingAddressOnCartShipping information setShippingAddressesOnCart
Place the order with theplaceAdyenOrdermutation. This mutation is a combination of thesetPaymentMethodOnCartandplaceOrderAdobe Commerce GraphQL mutations. -
Only for Apple Pay, resolve the payment method component with a success message. You can use the
.resolve()function to do this. See an example on our GitHub.
Get the payment outcome
After you place the order, use the same REST API and GraphQL endpoints you use to check the payment status with your standard headless implementation.When the payment is completed, redirect shoppers to your payment success page.Handle abandoned carts
If you initialized a quote manually to initiate the express checkout flow on the product detail page, and the shopper abandons the payment page, cancel the quote manually. The payment method components throw an event to handle this case. For example, the Apple Pay component throws theonError event.In the payment method component’s event, make an API request to cancel the quote.If you are using REST, the endpoint differs per use case. If you are using GraphQL, the endpoint is /graphql.Logged-in shoppers
-
POST
/V1/adyen/express/cancel/mineParameter Required Description adyenMaskedQuoteId
The quote initialized to mount the payment method component on the product detail page. adyenCartIdThe logged-in shopper’s real cart ID.
Guest shoppers
-
POST
/V1/adyen/express/cancel/guestParameter Required Description maskedQuoteId
The quote initialized to mount the payment method component on the product detail page.
Use the
expressCancel mutation to cancel the quote you initialized on the product detail page for logged-in users.Create a data object to send in the mutation, that includes:maskedQuoteId: The quote initialized to mount the payment method component on the product detail page.
Updating PayPal orders
For PayPal express payments, you must update the order each time your shopper changes the shipping address or method to update the PayPal lightbox. In the Adyen Checkout API, this is done with the /paypal/updateOrder endpoint.During the express flow, you have to update the order when:- The shopper initially enters their shipping address in the PayPal lightbox.
- The shopper selects one of the delivery methods that are available.
- The shopper modifies either of these details.
onShippingAddressChange or onShippingOptionsChange, to handle shipping address and method changes. In these events, make an API request to update the order.If you are using REST, the endpoint differs per use case. If you are using GraphQL, the endpoint is /graphql.Logged-in shoppers
- POST
/V1/adyen/express/paypal-update-order/mine
| Parameter | Required | Description |
|---|---|---|
amount | ![]() | The updated final payment amount. This amount is the item total plus the shipping costs of the selected deliveryMethod, specified as an object:currency as a three-character ISO currency code. value in minor units. |
paymentData | ![]() | For the first request to this endpoint, this is the paymentData you receive when you made a request to show the PayPal lightbox. In subsequent requests, this is the updated paymentData you receive in the response to this endpoint. |
adyenCartId | Required if adyenMaskedQuoteId is not included | The logged-in shopper’s real cart ID. |
adyenMaskedQuoteId | Required if adyenCartId is not included | The quote initialized to mount the payment method component on the product detail page. |
deliveryMethods | Required only for PayPal lightbox with delivery methods | The array that lists the delivery methods available for the delivery address, and their fees. |
deliveryMethods.amount | Required only for PayPal lightbox with delivery methods | The cost of the delivery method, specified as an object:currency as a three-character ISO currency code. value in minor units. |
deliveryMethods.description | Required only for PayPal lightbox with delivery methods | The description for the delivery method. This field is required by PayPal; however, the plugin allows you to configure shipping methods without a Title or Label. We recommend building fallback logic to ensure a meaningful value is always provided, and to avoid silent checkout failures. In our frontend implementation, we use the following fallback order:1) Shipping Method Title Shipping Method Label Shipping Method Carrier Code (as generated by the plugin)This ensures that the value is never empty, and uniquely identifies each shipping method for the shopper.The plugin automatically injects the Carrier Code into a blank description field. |
deliveryMethods.reference | Your reference for the delivery method. | |
deliveryMethods.selected | For PayPal lightbox with delivery methods, set to true for the delivery method that is selected. Only one delivery method can be selected at a time. | |
deliveryMethods.type | The type of delivery method. |
Guest shoppers
- POST
/V1/adyen/express/paypal-update-order/guest
| Parameter | Required | Description |
|---|---|---|
amount | ![]() | The updated final payment amount. This amount is the item total plus the shipping costs of the selected deliveryMethod, specified as an object:currency as a three-character ISO currency code. value in minor units. |
paymentData | ![]() | For the first request to this endpoint, this is the paymentData you receive when you made a request to show the PayPal lightbox. In subsequent requests, this is the updated paymentData you receive in the response to this endpoint. |
adyenCartId | Required if adyenMaskedQuoteId is not included | The logged-in shopper’s real cart ID. |
adyenMaskedQuoteId | Required if adyenCartId is not included | The quote initialized to mount the payment method component on the product detail page. |
deliveryMethods | Required only for PayPal lightbox with delivery methods | The array that lists the delivery methods available for the delivery address, and their fees. |
deliveryMethods.amount | Required only for PayPal lightbox with delivery methods | The cost of the delivery method, specified as an object:currency as a three-character ISO currency code. value in minor units. |
deliveryMethods.description | Required only for PayPal lightbox with delivery methods | The description for the delivery method. This field is required by PayPal; however, the plugin allows you to configure shipping methods without a Title or Label. We recommend building fallback logic to ensure a meaningful value is always provided, and to avoid silent checkout failures. In our frontend implementation, we use the following fallback order:1) Shipping Method Title Shipping Method Label Shipping Method Carrier Code (as generated by the plugin)This ensures that the value is never empty, and uniquely identifies each shipping method for the shopper.The plugin automatically injects the Carrier Code into a blank description field. |
deliveryMethods.reference | Your reference for the delivery method. | |
deliveryMethods.selected | For PayPal lightbox with delivery methods, set to true for the delivery method that is selected. Only one delivery method can be selected at a time. | |
deliveryMethods.type | The type of delivery method. |
paymentData that you can use in your subsequent requests to update the PayPal order again.Pass the updated object to the component:component.updatePaymentData(response.paymentData);
Use the
This mutation makes a /paypal/updateOrder request. You get an updated
adyenExpressPaypalUpdateOrder mutation to update the PayPal order.Create a data object to send in the mutation, that includes the following:| Parameter | Required | Description |
|---|---|---|
amount | ![]() | The updated final payment amount. This amount is the item total plus the shipping costs of the selected deliveryMethod, specified as an object:currency as a three-character ISO currency code. value in minor units. |
paymentData | ![]() | For the first request to this endpoint, this is the paymentData you receive when you made a request to show the PayPal lightbox. In subsequent requests, this is the updated paymentData you receive in the /V1/adyen/express/paypal-update-order/mine response. |
adyenCartId | Required if adyenMaskedQuoteId is not included | The logged-in shopper’s real cart ID. |
adyenMaskedQuoteId | Required if adyenCartId is not included | The quote initialized to mount the payment method component on the product detail page. |
deliveryMethods | Required only for PayPal lightbox with delivery methods | The array that lists the delivery methods available for the delivery address, and their fees. |
deliveryMethods.amount | Required only for PayPal lightbox with delivery methods | The cost of the delivery method, specified as an object:currency as a three-character ISO currency code. value in minor units. |
deliveryMethods.description | Required only for PayPal lightbox with delivery methods | The description for the delivery method. This field is required by PayPal; however, the plugin allows you to configure shipping methods without a Title or Label. We recommend building fallback logic to ensure a meaningful value is always provided, and to avoid silent checkout failures. In our frontend implementation, we use the following fallback order:1) Shipping Method Title Shipping Method Label Shipping Method Carrier Code (as generated by the plugin)This ensures that the value is never empty, and uniquely identifies each shipping method for the shopper.The plugin automatically injects the Carrier Code into a blank description field. |
deliveryMethods.reference | Your reference for the delivery method. | |
deliveryMethods.selected | For PayPal lightbox with delivery methods, set to true for the delivery method that is selected. Only one delivery method can be selected at a time. | |
deliveryMethods.type | The type of delivery method. |
paymentData that you can use in your subsequent requests to update the PayPal order again.Pass the updated object to the component:component.updatePaymentData(response.paymentData);
Testing
When you are done setting up your integration, test that the express checkout flow works as expected for the payment methods you support.- For Apple Pay, use Apple’s test card numbers.
- For Google Pay, use your Google Pay wallet.
- For PayPal, use your PayPal Sandbox account.