Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShopperPayments<ConfigParameters>

*Download API specification

API Overview

Use the Shopper Payments API to retrieve payment configuration information for organizations in the B2C Commerce system.

The Shopper Payments API provides access to comprehensive payment configuration data, including payment processor settings, gateway configurations, and payment method details.

Authentication & Authorization

The client requesting payment configuration information must have access to the /payment-configuration resource. The Shopper Payments API requires a shopper access token from the Shopper Login and API Access Service (SLAS).

For details on how to request a shopper access token from SLAS, see the guest user flows for public clients and private clients in the SLAS guides.

You must include sfcc.shopper-baskets-orders or sfcc.shopper-baskets-orders.rw in the client ID used to generate the token. For a full list of permissions, see the Authorization Scopes Catalog.

Use Cases

Payment Method Discovery

Retrieve available payment methods and their capabilities for dynamic payment form generation.

  • Payment Method Set Information: Access details about configured payment method set accounts.
  • Payment Methods: Supported payment method types (card, paypal, applepay, etc.), available payment modes for each method, and account associations.
  • Active Gateways: Return detailed payment method information including supported card brands.

Gateway Status Monitoring

Check the status and configuration of payment gateways and processors.

  • Gateway Response Data: Retrieve payment processor gateway information and supported payment methods.
  • Payment Method Set Accounts: Account identifiers and configurations, payment processor API keys and settings, gateway identifiers and response data, live/test mode indicators, and vendor information (Stripe, Adyen, PayPal, etc.).
  • Inactive/Pending Gateways: Might return null gateway response data.
  • Multiple Vendors: Support for different payment processors with vendor-specific configurations.

Payment Flow Configuration

Determine supported payment modes (multi-step vs express) for different payment methods.

  • Payment Modes Configuration: View supported payment modes (Multistep, Express) for each payment method.
  • Configuration Settings: Multi-step checkout enablement status, express checkout enablement status, automatic card capture settings, zone identification, saved payment method configuration, and merchant account identification.

SDK Version Management

Ensure compatibility by checking the current SDK version requirements.

  • SDK Version Information: Get the current SDK version being used.*

Simple example:

  import { ShopperPayments } from "commerce-sdk-isomorphic";

  const clientConfig = {
    parameters: {
      clientId: "XXXXXX",
      organizationId: "XXXX",
      shortCode: "XXX",
      siteId: "XX"
    }
  };
  const shopperPaymentsClient = new ShopperPayments(clientConfig);
API Version: 0.0.33
Last Updated:

Type parameters

Hierarchy

  • ShopperPayments

Index

Constructors

Properties

Methods

Object literals

Constructors

constructor

Properties

clientConfig

clientConfig: ClientConfig<ConfigParameters> & { baseUri: string }

Static Readonly defaultBaseUri

defaultBaseUri: "https://{shortCode}.api.commercecloud.salesforce.com/checkout/shopper-payments/v1" = currentBaseUri

Static Readonly paramKeys

paramKeys: { getPaymentConfiguration: ["organizationId", "siteId", "currency", "countryCode", "zoneId"]; getPaymentConfigurationRequired: ["organizationId", "siteId", "currency"] } = {getPaymentConfiguration: ['organizationId','siteId','currency','countryCode','zoneId',],getPaymentConfigurationRequired: ['organizationId','siteId','currency',],} as const

Type declaration

  • getPaymentConfiguration: ["organizationId", "siteId", "currency", "countryCode", "zoneId"]
  • getPaymentConfigurationRequired: ["organizationId", "siteId", "currency"]

Methods

getPaymentConfiguration

  • Retrieves the payment configuration for the organization.

    Parameters:*

    • siteId: Required. The site identifier for context-specific configuration
    • currency: Required. Three-letter currency code (ISO 4217) for payment method configuration
    • countryCode: Required. Two-letter country code (ISO 3166-1 alpha-2) for country-specific payment configuration

    Response Behavior:*

    • Returns payment configuration data when available
    • Returns null values for missing data (e.g., when account not found or payments zone not found)

    If you would like to get a raw Response object use the other getPaymentConfiguration function.

    Parameters

    Returns Promise<PaymentConfiguration>

    A promise of type PaymentConfiguration.

  • Retrieves the payment configuration for the organization.

    Parameters:*

    • siteId: Required. The site identifier for context-specific configuration
    • currency: Required. Three-letter currency code (ISO 4217) for payment method configuration
    • countryCode: Required. Two-letter country code (ISO 3166-1 alpha-2) for country-specific payment configuration

    Response Behavior:*

    • Returns payment configuration data when available
    • Returns null values for missing data (e.g., when account not found or payments zone not found)

    Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ countryCode?: undefined | string; currency: string; organizationId: string; siteId: string; zoneId?: string | null } & QueryParameters, ConfigParameters> }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : PaymentConfiguration>

    A promise of type Response if rawResponse is true, a promise of type PaymentConfiguration otherwise.

Object literals

Static Readonly apiPaths

apiPaths: object

getPaymentConfiguration

getPaymentConfiguration: string = "/organizations/{organizationId}/payment-configuration"

Generated using TypeDoc