Class ShopperGiftCertificates<ConfigParameters>

Shopper Gift Certificates

*# API Overview

Use the Shopper Gift Certificates API to obtain gift certificate details.

Authentication & Authorization

The Shopper Gift Certificates API requires a JSON Web Token acquired via the Shopper Customers endpoint:

https://{{shortCode}}.api.commercecloud.salesforce.com/customer/shopper-customers/v1/organizations/{{organizationId}}/customers/actions/login

You must include the relevant scope(s) in the client ID used to generate the SLAS token. For details, see Authorization Scopes Catalog.

Use Cases

Retrieve Existing Gift Certificate Details

A shopper who received a code identifying a gift certificate can use the gift certificate code to query information, such as the status or remaining balance.

Use Hooks

For details working with hooks, see Extensibility with Hooks.*

Simple example:

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

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

Type Parameters

Hierarchy

  • ShopperGiftCertificates

Constructors

Methods

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

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: {
              giftCertificateCode: string;
          } & {
              [key: string]: any;
          } & CustomRequestBody;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in string | number]: (Omit<{
                  organizationId: string;
                  siteId: string;
              } & QueryParameters, keyof ConfigParameters> & Partial<{
                  organizationId: string;
                  siteId: string;
              } & QueryParameters>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<GiftCertificate>

    A promise of type GiftCertificate.

  • Type Parameters

    • T extends boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: {
              giftCertificateCode: string;
          } & {
              [key: string]: any;
          } & CustomRequestBody;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in string | number]: (Omit<{
                  organizationId: string;
                  siteId: string;
              } & QueryParameters, keyof ConfigParameters> & Partial<{
                  organizationId: string;
                  siteId: string;
              } & QueryParameters>)[K]
          };
      }>

      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
        : GiftCertificate>

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

Properties

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

Type declaration

  • baseUri: string
apiPaths: {
    getGiftCertificate: string;
}

Type declaration

  • getGiftCertificate: string
defaultBaseUri: "https://{shortCode}.api.commercecloud.salesforce.com/pricing/shopper-gift-certificates/v1" = "https://{shortCode}.api.commercecloud.salesforce.com/pricing/shopper-gift-certificates/v1"
paramKeys: {
    getGiftCertificate: readonly ["organizationId", "siteId"];
    getGiftCertificateRequired: readonly ["organizationId", "siteId"];
}

Type declaration

  • Readonly getGiftCertificate: readonly ["organizationId", "siteId"]
  • Readonly getGiftCertificateRequired: readonly ["organizationId", "siteId"]