Skip to content
Draft
4 changes: 4 additions & 0 deletions src/pages/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
- [2.4.8 Reference](/reference/graphql/2-4-8/index.md)
- [2.4.7 Reference](/reference/graphql/2-4-7/index.md)
- [2.4.6 Reference](/reference/graphql/2-4-6/index.md)
- [Payment Services SDK](/payment-services-sdk/index.md)

- subPages:
- [Payment Services SDK](/payment-services-sdk/index.md)
- [Instantiate the SDK](/payment-services-sdk/instantiating-the-sdk.md)
- [Payment lifecycle](/payment-services-sdk/payment-lifecycle.md)
- [Introduction](/get-started/index.md)
- API Security header
- [Input limiting](/get-started/api-security.md)
Expand Down
66 changes: 36 additions & 30 deletions src/pages/contributors.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"total": 648,
"total": 649,
"offset": 0,
"limit": 648,
"limit": 649,
"data": [
{
"page": "/",
"avatars": [
"https://avatars.githubusercontent.com/u/38460853?v=4",
"https://avatars.githubusercontent.com/u/12731225?v=4",
"https://avatars.githubusercontent.com/u/14320591?v=4",
"https://avatars.githubusercontent.com/u/98363870?v=4",
"https://avatars.githubusercontent.com/u/13662379?v=4",
"https://avatars.githubusercontent.com/u/11652541?v=4",
"https://avatars.githubusercontent.com/u/57922?v=4"
],
"lastUpdated": "11/5/2026"
"lastUpdated": "11/11/2026"
},
{
"page": "/_includes/accs/accs-early-access",
Expand Down Expand Up @@ -546,6 +547,7 @@
{
"page": "/config",
"avatars": [
"https://avatars.githubusercontent.com/u/38460853?v=4",
"https://avatars.githubusercontent.com/u/16409901?v=4",
"https://avatars.githubusercontent.com/u/98363870?v=4",
"https://avatars.githubusercontent.com/u/11652541?v=4",
Expand All @@ -555,7 +557,7 @@
"https://avatars.githubusercontent.com/u/12731225?v=4",
"https://avatars.githubusercontent.com/u/14320591?v=4"
],
"lastUpdated": "10/26/2026"
"lastUpdated": "11/11/2026"
},
{
"page": "/get-started/",
Expand Down Expand Up @@ -920,12 +922,12 @@
{
"page": "/graphql/payment-services-extension/",
"avatars": [
"https://avatars.githubusercontent.com/u/38460853?v=4",
"https://avatars.githubusercontent.com/u/12731225?v=4",
"https://avatars.githubusercontent.com/u/14320591?v=4",
"https://avatars.githubusercontent.com/u/11652541?v=4",
"https://avatars.githubusercontent.com/u/38460853?v=4"
"https://avatars.githubusercontent.com/u/11652541?v=4"
],
"lastUpdated": "6/1/2026"
"lastUpdated": "11/11/2026"
},
{
"page": "/graphql/payment-services-extension/mutations/",
Expand Down Expand Up @@ -1045,10 +1047,10 @@
{
"page": "/graphql/payment-services-extension/workflows/",
"avatars": [
"https://avatars.githubusercontent.com/u/14320591?v=4",
"https://avatars.githubusercontent.com/u/38460853?v=4"
"https://avatars.githubusercontent.com/u/38460853?v=4",
"https://avatars.githubusercontent.com/u/14320591?v=4"
],
"lastUpdated": "5/27/2026"
"lastUpdated": "11/11/2026"
},
{
"page": "/graphql/payment-services-extension/workflows/cart-pdp",
Expand All @@ -1062,11 +1064,11 @@
{
"page": "/graphql/payment-services-extension/workflows/checkout",
"avatars": [
"https://avatars.githubusercontent.com/u/38460853?v=4",
"https://avatars.githubusercontent.com/u/12731225?v=4",
"https://avatars.githubusercontent.com/u/14320591?v=4",
"https://avatars.githubusercontent.com/u/38460853?v=4"
"https://avatars.githubusercontent.com/u/14320591?v=4"
],
"lastUpdated": "6/1/2026"
"lastUpdated": "11/11/2026"
},
{
"page": "/graphql/payment-services-extension/workflows/minicart",
Expand Down Expand Up @@ -2650,16 +2652,6 @@
],
"lastUpdated": "9/11/2026"
},
{
"page": "/graphql/schema/cart/queries/pickup-locations",
"avatars": [
"https://avatars.githubusercontent.com/u/12731225?v=4",
"https://avatars.githubusercontent.com/u/14320591?v=4",
"https://avatars.githubusercontent.com/u/11652541?v=4",
"https://avatars.githubusercontent.com/u/13662379?v=4"
],
"lastUpdated": "6/24/2026"
},
{
"page": "/graphql/schema/catalog-service/",
"avatars": [
Expand Down Expand Up @@ -4125,13 +4117,6 @@
],
"lastUpdated": "11/5/2026"
},
{
"page": "/graphql/schema/products/queries/source-availability",
"avatars": [
"https://avatars.githubusercontent.com/u/98363870?v=4"
],
"lastUpdated": "9/4/2026"
},
{
"page": "/graphql/schema/products/queries/url-resolver",
"avatars": [
Expand Down Expand Up @@ -4726,6 +4711,27 @@
],
"lastUpdated": "11/5/2026"
},
{
"page": "/payment-services-sdk/",
"avatars": [
"https://avatars.githubusercontent.com/u/38460853?v=4"
],
"lastUpdated": "11/11/2026"
},
{
"page": "/payment-services-sdk/instantiating-the-sdk",
"avatars": [
"https://avatars.githubusercontent.com/u/38460853?v=4"
],
"lastUpdated": "11/11/2026"
},
{
"page": "/payment-services-sdk/payment-lifecycle",
"avatars": [
"https://avatars.githubusercontent.com/u/38460853?v=4"
],
"lastUpdated": "11/11/2026"
},
{
"page": "/reference/graphql/2-4-6/",
"avatars": [
Expand Down
2 changes: 2 additions & 0 deletions src/pages/graphql/payment-services-extension/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ It provides powerful tools to give you the insight and control needed for creati

## Payment Services GraphQL

For a JavaScript integration that renders payment controls on a custom frontend, see the [Payment Services SDK](../../payment-services-sdk/index.md).

[Payment Services for Adobe Commerce](https://commercemarketplace.adobe.com/magento-payment-services.html) 2.3.0 and higher provides enhanced payment method capabilities. With this extension, you can implement the following payment methods:

* Apple Pay with PayPal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ keywords:

These steps describe the flow of requests and responses required to complete a typical [checkout](../../tutorials/checkout/index.md) authorization with Payment Services enabled.

If you use the [Payment Services SDK](../../../payment-services-sdk/index.md), follow its [payment lifecycle](../../../payment-services-sdk/payment-lifecycle.md) instead of manually duplicating the payment requests managed by the SDK. Your application must still place the order after payment approval.

## Checkout workflow

![Payment Services sequence diagram](../../../images/graphql/payment-services.png)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ keywords:

The workflows described in this section provide detailed guides on various processes and workflows related to the Payment Services extension. These guides help you understand and implement different features and functionalities provided by the extension, ensuring seamless integration and optimal usage of Payment Services.

For an SDK-managed payment interaction on a custom frontend, see the [Payment Services SDK payment lifecycle](../../../payment-services-sdk/payment-lifecycle.md). The SDK performs payment-related GraphQL requests, but your frontend still prepares the cart and places the order.

If you have installed [Payment Services for Adobe Commerce](https://commercemarketplace.adobe.com/magento-payment-services.html) 2.3.0 or higher, check the following workflows:

* [Checkout](checkout.md)---This workflow describes the flow of requests and responses required to complete a typical checkout authorization with the Payment Services extension enabled.
Expand Down
8 changes: 7 additions & 1 deletion src/pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ keywords:

# Commerce Web APIs

The Commerce Web APIs allow you to integrate third-party software and build headless applications for Adobe Commerce. The Web API documentation is divided into three guides: REST, GraphQL, and Getting Started.
The Commerce Web APIs allow you to integrate third-party software and build headless applications for Adobe Commerce. This documentation covers REST, GraphQL, Getting Started, and the Payment Services SDK.

<Resources slots="heading, links"/>

Expand Down Expand Up @@ -50,6 +50,12 @@ The REST API documentation describes the REST APIs that are available on the lat

GraphQL is a language for querying and manipulating data. It is widely viewed as more powerful, flexible, and efficient than REST for frontend development.

<DiscoverBlock slots="link, text"/>

[Payment Services SDK](payment-services-sdk/index.md)

Learn how to render Payment Services payment methods on custom frontends without Commerce Storefront or drop-ins using the JavaScript SDK.

## Contributing to this documentation

We encourage you to participate in our open documentation initiative. If you have suggestions, corrections, additions, or deletions for this documentation, check out the source on [GitHub](https://github.com/adobedocs/commerce-webapi), and open a pull request.
Expand Down
48 changes: 48 additions & 0 deletions src/pages/payment-services-sdk/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: Payment Services SDK
description: Learn about the Payment Services JavaScript SDK for custom Adobe Commerce storefronts.
keywords:
- Payments
- SDK
---

# Payment Services SDK

<InlineAlert variant="warning" slots="text"/>

The Payment Services SDK is version 0.x (pre-1.0) and is under active development.

See the [Payment Services SDK alpha documentation](https://git.corp.adobe.com/pages/magento-payments/payments-js-sdk/alpha/) for the published SDK reference.

The Payment Services JavaScript SDK renders [Adobe Commerce Payment Services](https://experienceleague.adobe.com/en/docs/commerce/payment-services/guide-overview) payment methods on a storefront: credit card fields, Apple Pay, Google Pay, and PayPal buttons. It can also save (vault) credit cards for later use.

This guide is intended for developers building custom frontends without Edge Delivery Services Commerce Storefront or drop-ins, including Adobe Commerce as a Cloud Service (ACCS) customers evaluating a custom integration.

<InlineAlert variant="warning" slots="text"/>

ACCS compatibility is not verified by the SDK source documentation. Its requirements describe Adobe Commerce with the Payment Services extension, not ACCS-specific provisioning, endpoints, or authentication. Confirm SDK availability and support for your deployment with Adobe before implementing an ACCS integration.

The SDK sends GraphQL requests to Adobe Commerce on behalf of the shopper to create a payment for the shopper's cart. After the shopper approves the payment, your storefront must place the order. The SDK does not replace your cart, checkout, or order-placement logic.

## Requirements

* Adobe Commerce with the Payment Services extension, version 2.17 or later.
* Payment Services configured in the Commerce Admin, with the payment methods you want to render enabled.

For Payment Services onboarding and configuration, see the [Payment Services guide](https://experienceleague.adobe.com/en/docs/commerce/payment-services/guide-overview).

## Integration steps

1. [Load and instantiate the SDK](instantiating-the-sdk.md) with your Commerce GraphQL endpoint and shopper authentication.
1. [Initialize and render payment methods](payment-lifecycle.md) for a storefront location.
1. Handle approval, cancellation, and errors in your frontend.
1. Place the order after payment approval.
1. Remove rendered payment methods when they are no longer needed.

## SDK and GraphQL responsibilities

Use the SDK to render payment controls and manage the payment interaction. Your application remains responsible for preparing the cart and completing the order.

The [Payment Services GraphQL workflows](../graphql/payment-services-extension/workflows/index.md) describe the underlying API integrations, including [checkout](../graphql/payment-services-extension/workflows/checkout.md), [minicart](../graphql/payment-services-extension/workflows/minicart.md), and [product detail page smart buttons](../graphql/payment-services-extension/workflows/cart-pdp.md). They are API-level workflows, not additional steps to run alongside every SDK call. Their extension version requirements differ from the SDK requirements.

The SDK also exposes credit card vaulting types. See the [vaulting workflows](../graphql/payment-services-extension/workflows/vault-without-purchase.md) for the API-level process and [TypeScript imports](instantiating-the-sdk.md#typescript-types) for the SDK's vault entry point.
95 changes: 95 additions & 0 deletions src/pages/payment-services-sdk/instantiating-the-sdk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
title: Instantiate the Payment Services SDK
description: Load the Payment Services SDK and configure its GraphQL endpoint and shopper authentication.
keywords:
- Payments
- SDK
---

# Instantiate the Payment Services SDK

<InlineAlert variant="warning" slots="text"/>

The Payment Services SDK is version 0.x (pre-1.0) and is under active development.

Start with an instance of the `PaymentServicesSDK` class, which is defined by the SDK's JavaScript bundle on a CDN. Load the bundle with `loadPaymentServicesSDK` from the npm package, or with a script tag. Then instantiate the class with the configuration for your Commerce deployment.

See the [SDK requirements](index.md#requirements) before you begin.

## Load with the npm package

Install the package, which contains the loader and TypeScript definitions:

```bash
npm install @adobe-commerce/payment-services-sdk
```

The loader adds a script tag for the latest CDN bundle compatible with the package's version, then returns the SDK class.

```js
import { loadPaymentServicesSDK } from "@adobe-commerce/payment-services-sdk"

const PaymentServicesSDK = await loadPaymentServicesSDK()
const sdk = new PaymentServicesSDK({
gqlApiUrl: "https://example.com/graphql",
})
```

Replace the example endpoint with your Commerce GraphQL endpoint. Handle rejected loading or initialization promises in your application's initialization error handling.

## Load with a script tag

Alternatively, add the bundle to your page:

```html
<script src="https://commerce-payments-sdk.adobe.io/v0/{minor}/PaymentSDK.js"></script>
```

Replace `{minor}` with the SDK minor version. The script adds the SDK class to `window`.

```js
const sdk = new window.PaymentServicesSDK({
gqlApiUrl: "https://example.com/graphql",
})
```

## Versioning

In version 0.x, minor releases can introduce breaking changes; patch releases do not. The bundle URL includes the minor version: `v0/{minor}/PaymentSDK.js` receives patch releases for that minor version without breaking changes.

By default, `npm install` saves the version with a caret (`^`). For version 0.x, this accepts only patch releases of the same minor version.

## Shopper authentication

Use `getCustomerToken` to return the shopper's customer token, or `null` for a guest. If your application knows whether the shopper is a guest, also set `isGuestCustomer` to avoid an extra request.

In this example, `getCustomerTokenOrNull` is an application-provided function, not an SDK API. It must return the current shopper's token or `null`.

```js
const sdk = new PaymentServicesSDK({
gqlApiUrl: "https://example.com/graphql",
getCustomerToken: () => getCustomerTokenOrNull(),
isGuestCustomer: () => getCustomerTokenOrNull() === null,
})
```

Storefronts served by Adobe Commerce itself can instead rely on its session cookie. Set `gqlApiUrl` to the store's base URL followed by `graphql`, such as `/default/graphql`, so that the browser sends the cookie. For separately hosted custom frontends, provide the shopper's customer token through `getCustomerToken`.

## TypeScript types

The npm package exports SDK types even when you load the bundle with a script tag:

```ts
import type {
PaymentServicesSDK,
SdkConfig,
} from "@adobe-commerce/payment-services-sdk"
import type {
CreditCardRenderConfig,
} from "@adobe-commerce/payment-services-sdk/payment"
import type {
CreditCardVaultRenderConfig,
} from "@adobe-commerce/payment-services-sdk/vault"
```

Next, follow the [payment lifecycle](payment-lifecycle.md) to initialize and render payment methods.
Loading
Loading