If you would like to get a raw Response object use the other getGiftCertificate function.
An object containing the options for this method.
A promise of type GiftCertificate.
An object containing the options for this method.
Set to true to return entire Response object instead of DTO.
A promise of type Response if rawResponse is true, a promise of type GiftCertificate otherwise.
Generated using TypeDoc
Shopper Gift Certificates
*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/loginYou 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-idheader in your request — the response returns it asx-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:
API Version: 0.0.33import { ShopperGiftCertificates } from "commerce-sdk-isomorphic"; const clientConfig = { parameters: { clientId: "XXXXXX", organizationId: "XXXX", shortCode: "XXX", siteId: "XX" } }; const shopperGiftCertificatesClient = new ShopperGiftCertificates(clientConfig);Last Updated: