Edit in GitHubLog an issue

Create a new cart in the Product Details Page workflows

These steps describe the flow of requests and responses with the Payment Services solution enabled for guests and logged-in customers. This workflow is required to create a new cart in the Product Details Page (PDP) with smart buttons.

Add product to a new cart in a PDP workflow

These steps describe the use case when a shopper adds a product to the cart on a PDP.

Payment Services sequence diagram

  1. Run the getPaymentConfig query to fetch the payment configuration needed to render details about PayPal components, such as hosted fields, smart buttons, and Apple Pay.

  2. Adobe Commerce returns payment configuration information.

  3. Run addProductsToNewCart to create a new cart and add the item.

  4. Commerce returns a cart object, which includes the cart id field.

  5. Run createPaymentOrder to begin the authorization process.

  6. Commerce forwards the request to PayPal.

    If there is an error during the payment process, or the shopper cancels the payment process on the PDP, run setCartAsInactive to set the corresponding cartId as inactive and to avoid having multiple active carts for logged-in customers.

  7. PayPal returns an id value.

  8. Adobe Commerce generates a order_id and forwards the value in the mp_order_id field and the PayPal response in the id field.

  9. Run the placeOrder mutation.

  10. Commerce sends an authorization request to PayPal.

  11. PayPal returns the result to Commerce.

  12. Commerce creates an order.

Payment cancellation while on a PDP workflow

These steps describe the use case when a shopper cancels the payment process on the PDP.

Payment Services sequence diagram

  1. Run the getPaymentConfig query to fetch the payment configuration needed to render details about PayPal components, such as hosted fields, smart buttons, and Apple Pay.

  2. Adobe Commerce returns payment configuration information.

  3. Run addProductsToNewCart to create a new cart and add the item.

  4. Commerce returns a cart object, which includes the cart id field.

  5. Run setCartAsInactive to set a specific cartId as inactive.

  6. Commerce returns a confirmation that a specific cartId is inactive.

  7. If the shopper clicks the smart button again, addProductsToNewCart mutation runs once more to return a new cart object.

  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2025 Adobe. All rights reserved.