Searches for coupon redemptions.
The Coupon Redemption Search document contains a search object that allows filtering on various attributes.
The query attribute specifies a complex query that can be used to narrow down the search with the following searchable attributes:
Attribute | Type |
---|---|
code | String |
couponId | String |
customerEmail | String |
orderNo | String |
Note that only searchable attributes can be used in sorting.
If the user role does not have the View_Coupon_Codes
permission, then the coupon codes returned are masked.
If you would like to get a raw Response object use the other couponRedemptionsSearch function.
An object containing the options for this method.
A promise of type Coupons.CouponRedemptionSearchResult.
Searches for coupon redemptions.
The Coupon Redemption Search document contains a search object that allows filtering on various attributes.
The query attribute specifies a complex query that can be used to narrow down the search with the following searchable attributes:
Attribute | Type |
---|---|
code | String |
couponId | String |
customerEmail | String |
orderNo | String |
Note that only searchable attributes can be used in sorting.
If the user role does not have the View_Coupon_Codes
permission, then the coupon codes returned are masked.
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 Coupons.CouponRedemptionSearchResult otherwise.
Searches for coupons.
The Coupon Search document contains a search object that allows filtering on various attributes.
The query attribute specifies a complex query that can be used to narrow down the search with the following searchable attributes:
Attribute | Type |
---|---|
couponId | String |
description | String |
type | one of {"single_code", "multiple_codes", "system_codes"} |
enabled | Boolean |
Note that only searchable attributes can be used in sorting.
If you would like to get a raw Response object use the other couponsSearch function.
An object containing the options for this method.
A promise of type Coupons.CouponSearchResult.
Searches for coupons.
The Coupon Search document contains a search object that allows filtering on various attributes.
The query attribute specifies a complex query that can be used to narrow down the search with the following searchable attributes:
Attribute | Type |
---|---|
couponId | String |
description | String |
type | one of {"single_code", "multiple_codes", "system_codes"} |
enabled | Boolean |
Note that only searchable attributes can be used in sorting.
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 Coupons.CouponSearchResult otherwise.
Creates a coupon using the information provided. If a coupon exists with the same unique identifier, the coupon is replaced completely.
If you would like to get a raw Response object use the other createCoupon function.
An object containing the options for this method.
A promise of type Coupons.Coupon.
Creates a coupon using the information provided. If a coupon exists with the same unique identifier, the coupon is replaced completely.
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 Coupons.Coupon otherwise.
Delete a coupon by ID.
If you would like to get a raw Response object use the other deleteCoupon function.
An object containing the options for this method.
A promise of type void.
Delete a coupon by ID.
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 void otherwise.
Returns coupon information for the given coupon ID. If the user role does not have the View_Coupon_Codes permission, then the coupon codes returned are masked.
If you would like to get a raw Response object use the other getCoupon function.
An object containing the options for this method.
A promise of type Coupons.Coupon.
Returns coupon information for the given coupon ID. If the user role does not have the View_Coupon_Codes permission, then the coupon codes returned are masked.
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 Coupons.Coupon otherwise.
Get the coupon codes for the given coupon.
If the user role does not have the View_Coupon_Codes permission, then the coupon codes returned are masked.
If you would like to get a raw Response object use the other getCouponCodes function.
An object containing the options for this method.
A promise of type Coupons.CouponCodes.
Get the coupon codes for the given coupon.
If the user role does not have the View_Coupon_Codes permission, then the coupon codes returned are masked.
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 Coupons.CouponCodes otherwise.
Redeems a coupon code for an existing coupon within the selected site. The coupon code must be redeemable.
If you would like to get a raw Response object use the other redeemCoupon function.
An object containing the options for this method.
A promise of type void.
Redeems a coupon code for an existing coupon within the selected site. The coupon code must be redeemable.
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 void otherwise.
Updates the coupon with the specified information.
If you would like to get a raw Response object use the other updateCoupon function.
An object containing the options for this method.
A promise of type Coupons.Coupon.
Updates the coupon with the specified information.
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 Coupons.Coupon otherwise.
Add or delete (modify) multiple codes to and from the supplied coupon.
If you would like to get a raw Response object use the other updateCouponCodes function.
An object containing the options for this method.
A promise of type void.
Add or delete (modify) multiple codes to and from the supplied coupon.
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 void otherwise.
Generated using TypeDoc
Coupons
Manage coupons for use in your storefront.
For instructions on how to retrieve access token for admin APIs: https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-admin-apis.html
Example with admin auth
API Version: 1.0.28import { Pricing, ClientConfig } from "commerce-sdk"; // or const { Pricing, ClientConfig } = require("commerce-sdk"); const clientConfig: ClientConfig = { parameters: { clientId: "XXXXXX", organizationId: "XXXX", shortCode: "XXX", siteId: "XX" } }; token = { access_token: 'INSERT_ACCESS_TOKEN_HERE' }; clientConfig.headers['authorization'] = `Bearer ${token.access_token}`; const couponsClient = new Pricing.Coupons(clientConfig);
Last Updated: