import { BaseClient, ClientConfig, Response } from "@commerce-apps/core";
import type { CommonParameters } from "@commerce-apps/core";
import type { OperationOptions } from "retry";
import type { RequestInit } from "node-fetch";
import type { CompositeParameters, CustomRequestBody, QueryParameters, RequireParametersUnlessAllAreOptional } from "../../types";
import type { Coupon, CouponCodeRedemptionRequest, CouponCodes, CouponMultiCodesRequest, CouponRedemptionSearchResult, CouponSearchResult, SearchRequest } from '../models/index';
/**
* [Coupons](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=coupons:Summary)
* ==================================
*
* *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/coupons/coupons-oas-v1-public.yaml)
# API Overview
Use the Coupons API to create, modify, retrieve, and delete coupons for a given channel. You can also use it to create and retrieve coupon codes using a couponID.
Coupons _must_ be added as a qualifier to a campaign before they can be used.
For more information, see [Using Coupons as Qualifiers](https://documentation.b2c.commercecloud.salesforce.com/DOC1/topic/com.demandware.dochelp/Promotions/UsingCouponsasQualifiers.html) in the Salesforce B2C Commerce Infocenter.
## Authentication & Authorization
The client requesting the coupon's information must have access to the Coupon resource. For resource access, you must use a client ID and client secret from Account Manager to request an access token. The access token is used as a bearer token and added to the Authorization header of your API request. The client must first authenticate against Account manager to log in.
You must include the relevant scope(s) in the client ID used to generate the token. For details, see [Authorization Scopes Catalog.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/auth-z-scope-catalog.html)
For detailed setup instructions, see [Authorization for Admin APIs](https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-admin-apis.html).
## Use Cases
### Single-Use Coupon
Single-use coupons are your standard coupons, which you can only use once per customer.
For example, use the Coupons API to create a coupon with a single coupon code that can be applied only once per order per customer.
### Multiple-Use Coupon
A multiple-use coupon can be used any number of times by any number of customers.
For example, use the Coupons API to create a coupon that can be applied once per order and has system-generated codes.
### Search Coupon
Use the Coupons API to search for coupons using simple or complex querying.
### Search Coupon Redemptions
Use the Coupons API to search for coupon redemptions using simple or complex querying.
For more detail, see [Coupon Redemption](https://documentation.b2c.commercecloud.salesforce.com/DOC1/topic/com.demandware.dochelp/Coupons/CouponRedemption.html) in the Salesforce B2C Commerce Infocenter.*
*
* 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
*
* ```typescript
* import { Coupons, ClientConfig } from "commerce-sdk";
* // or
* const { Coupons, 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 Coupons(clientConfig);
* ```
*
*
* API Version: 1.4.4
* Last Updated:
*
*
*/
export declare class Coupons extends BaseClient {
constructor(config: ClientConfig);
/**
* The Coupon Redemption Search document contains a search object that allows filtering on various attributes.
The following searchable query attributes can be used to narrow down the search:
| 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 returned coupon codes are masked.
*
* If you would like to get a raw Response object use the other couponRedemptionsSearch function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type CouponRedemptionSearchResult.
*/
couponRedemptionsSearch(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: SearchRequest & CustomRequestBody;
}>): Promise;
/**
* The Coupon Redemption Search document contains a search object that allows filtering on various attributes.
The following searchable query attributes can be used to narrow down the search:
| 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 returned coupon codes are masked.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type CouponRedemptionSearchResult otherwise.
*/
couponRedemptionsSearch(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: SearchRequest & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
* The Coupon Search document contains a search object that allows filtering on various attributes.
The following searchable query attributes can be used to narrow the search:
| 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.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type CouponSearchResult.
*/
couponsSearch(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: SearchRequest & CustomRequestBody;
}>): Promise;
/**
* The Coupon Search document contains a search object that allows filtering on various attributes.
The following searchable query attributes can be used to narrow the search:
| 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.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type CouponSearchResult otherwise.
*/
couponsSearch(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: SearchRequest & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
*
*
* If you would like to get a raw Response object use the other createCoupon function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.couponId - The ID of the coupon to create.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type Coupon.
*/
createCoupon(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
couponId: string;
organizationId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: Coupon & CustomRequestBody;
}>): Promise;
/**
*
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.couponId - The ID of the coupon to create.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Coupon otherwise.
*/
createCoupon(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
couponId: string;
organizationId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: Coupon & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
*
*
* If you would like to get a raw Response object use the other deleteCoupon function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.couponId - The ID of the coupon to create.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type void.
*/
deleteCoupon(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
couponId: string;
organizationId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise;
/**
*
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.couponId - The ID of the coupon to create.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type void otherwise.
*/
deleteCoupon(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
couponId: string;
organizationId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise;
/**
* If the user role does not have the View_Coupon_Codes permission, then the returned coupon codes are masked.
*
* If you would like to get a raw Response object use the other getCoupon function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.couponId - The ID of the coupon to create.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type Coupon.
*/
getCoupon(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
couponId: string;
organizationId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise;
/**
* If the user role does not have the View_Coupon_Codes permission, then the returned coupon codes are masked.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.couponId - The ID of the coupon to create.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Coupon otherwise.
*/
getCoupon(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
couponId: string;
organizationId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise;
/**
*
*
* If you would like to get a raw Response object use the other getCouponCodes function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.couponId - The ID of the coupon to create.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.limit - Maximum records to retrieve per request, not to exceed 200. Defaults to 25.
* @param options.parameters.offset - Used to retrieve the results based on a particular resource offset.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type CouponCodes.
*/
getCouponCodes(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
couponId: string;
organizationId: string;
siteId: string;
limit?: number;
offset?: number;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise;
/**
*
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.couponId - The ID of the coupon to create.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.limit - Maximum records to retrieve per request, not to exceed 200. Defaults to 25.
* @param options.parameters.offset - Used to retrieve the results based on a particular resource offset.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type CouponCodes otherwise.
*/
getCouponCodes(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
couponId: string;
organizationId: string;
siteId: string;
limit?: number;
offset?: number;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise;
/**
* The coupon code must be redeemable.
---
***Note: Coupon redemptions are evaluated during checkout. A large number of coupon redemptions negatively impacts order creation performance and scale.***
1. Avoid importing unnecessary coupon redemptions.
2. Clean up coupon codes and related redemptions when they are no longer required.
---
*
* If you would like to get a raw Response object use the other redeemCoupon function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type void.
*/
redeemCoupon(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: CouponCodeRedemptionRequest & CustomRequestBody;
}>): Promise;
/**
* The coupon code must be redeemable.
---
***Note: Coupon redemptions are evaluated during checkout. A large number of coupon redemptions negatively impacts order creation performance and scale.***
1. Avoid importing unnecessary coupon redemptions.
2. Clean up coupon codes and related redemptions when they are no longer required.
---
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type void otherwise.
*/
redeemCoupon(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: CouponCodeRedemptionRequest & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
*
*
* If you would like to get a raw Response object use the other updateCoupon function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.couponId - The ID of the coupon to create.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type Coupon.
*/
updateCoupon(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
couponId: string;
organizationId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: Coupon & CustomRequestBody;
}>): Promise;
/**
*
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.couponId - The ID of the coupon to create.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Coupon otherwise.
*/
updateCoupon(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
couponId: string;
organizationId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: Coupon & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
*
*
* If you would like to get a raw Response object use the other updateCouponCodes function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.couponId - The ID of the coupon to create.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.delete - Pass as true to delete the passed codes.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type void.
*/
updateCouponCodes(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
couponId: string;
organizationId: string;
siteId: string;
delete?: boolean;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: CouponMultiCodesRequest & CustomRequestBody;
}>): Promise;
/**
*
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.couponId - The ID of the coupon to create.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.delete - Pass as true to delete the passed codes.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type void otherwise.
*/
updateCouponCodes(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
couponId: string;
organizationId: string;
siteId: string;
delete?: boolean;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: CouponMultiCodesRequest & CustomRequestBody;
}>, rawResponse?: T): Promise;
}