Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShopperGiftCertificates<ConfigParameters>

*Download API specification

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.

Customization

Custom Properties

This API supports custom properties (prefixed with c_). For details, see Custom Properties.

Hooks

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

Request Details

URL Encoding

If resource identifiers in request parameters contain commas (,) or percent signs (%), they must be URL encoded. For details, see Encode URL Special Characters.

Response Details

Personalization

Responses from this API are not personalized via the Shopper Context API.

Caching

Responses from this API are not cached.

Timeouts

Shopper API requests must respond within 10 seconds, including any hook execution. If a response exceeds this threshold, an HTTP 504 status code is returned. For details, see Timeouts and Limits.

Error Handling

Error responses follow the RFC 7807 problem detail format. To trace errors, include a correlation-id header in your request — the response returns it as x-correlation-id. For details, see HTTP Status Codes and Errors.

Use Cases

Retrieve a Gift Certificate

Look up a gift certificate by its code. The code is sent in the request body (not the URL) for security.

curl "https://{shortCode}.api.commercecloud.salesforce.com/pricing/shopper-gift-certificates/v1/organizations/{organizationId}/gift-certificate?siteId=RefArch" \
-X POST \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{ "giftCertificateCode": "GIFT-1234-ABCD" }'

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.

Related APIs

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

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/pricing/shopper-gift-certificates/v1" = currentBaseUri

Static Readonly paramKeys

paramKeys: { getGiftCertificate: ["organizationId", "siteId"]; getGiftCertificateRequired: ["organizationId", "siteId"] } = {getGiftCertificate: ['organizationId','siteId',],getGiftCertificateRequired: ['organizationId','siteId',],} as const

Type declaration

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

Methods

getGiftCertificate

Object literals

Static Readonly apiPaths

apiPaths: object

getGiftCertificate

getGiftCertificate: string = "/organizations/{organizationId}/gift-certificate"

Generated using TypeDoc