/**
* Klaviyo API
* The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details.
*
* Contact: developers@klaviyo.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { AxiosResponse } from "axios";
import { CouponCodeCreateJobCreateQuery } from '../model/couponCodeCreateJobCreateQuery';
import { CouponCodeCreateQuery } from '../model/couponCodeCreateQuery';
import { CouponCodeUpdateQuery } from '../model/couponCodeUpdateQuery';
import { CouponCreateQuery } from '../model/couponCreateQuery';
import { CouponUpdateQuery } from '../model/couponUpdateQuery';
import { GetCouponCodeCouponRelationshipResponse } from '../model/getCouponCodeCouponRelationshipResponse';
import { GetCouponCodeCreateJobResponseCollectionCompoundDocument } from '../model/getCouponCodeCreateJobResponseCollectionCompoundDocument';
import { GetCouponCodeCreateJobResponseCompoundDocument } from '../model/getCouponCodeCreateJobResponseCompoundDocument';
import { GetCouponCodeResponseCollection } from '../model/getCouponCodeResponseCollection';
import { GetCouponCodeResponseCollectionCompoundDocument } from '../model/getCouponCodeResponseCollectionCompoundDocument';
import { GetCouponCodeResponseCompoundDocument } from '../model/getCouponCodeResponseCompoundDocument';
import { GetCouponCodesRelationshipsResponseCollection } from '../model/getCouponCodesRelationshipsResponseCollection';
import { GetCouponResponse } from '../model/getCouponResponse';
import { GetCouponResponseCollection } from '../model/getCouponResponseCollection';
import { PatchCouponCodeResponse } from '../model/patchCouponCodeResponse';
import { PatchCouponResponse } from '../model/patchCouponResponse';
import { PostCouponCodeCreateJobResponse } from '../model/postCouponCodeCreateJobResponse';
import { PostCouponCodeResponse } from '../model/postCouponCodeResponse';
import { PostCouponResponse } from '../model/postCouponResponse';
import { Session } from './apis';
export declare class CouponsApi {
session: Session;
protected _basePath: string;
protected _defaultHeaders: any;
protected _useQuerystring: boolean;
constructor(session: Session);
set useQuerystring(value: boolean);
set basePath(basePath: string);
set defaultHeaders(defaultHeaders: any);
get defaultHeaders(): any;
get basePath(): string;
/**
* Create a coupon-code-bulk-create-job to bulk create a list of coupon codes. Max number of coupon codes per job we allow for is 1000. Max number of jobs queued at once we allow for is 100.
*Rate limits*:
Burst: `75/s`
Steady: `750/m` **Scopes:** `coupon-codes:write`
* @summary Bulk Create Coupon Codes
* @param couponCodeCreateJobCreateQuery
*/
bulkCreateCouponCodes(couponCodeCreateJobCreateQuery: CouponCodeCreateJobCreateQuery): Promise<{
response: AxiosResponse;
body: PostCouponCodeCreateJobResponse;
}>;
/**
* Creates a new coupon.
*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `coupons:write`
* @summary Create Coupon
* @param couponCreateQuery
*/
createCoupon(couponCreateQuery: CouponCreateQuery): Promise<{
response: AxiosResponse;
body: PostCouponResponse;
}>;
/**
* Synchronously creates a coupon code for the given coupon.
*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `coupon-codes:write`
* @summary Create Coupon Code
* @param couponCodeCreateQuery
*/
createCouponCode(couponCodeCreateQuery: CouponCodeCreateQuery): Promise<{
response: AxiosResponse;
body: PostCouponCodeResponse;
}>;
/**
* Delete the coupon with the given coupon ID.
*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `coupons:write`
* @summary Delete Coupon
* @param id The internal id of a Coupon is equivalent to its external id stored within an integration.
*/
deleteCoupon(id: string): Promise<{
response: AxiosResponse;
body?: any;
}>;
/**
* Deletes a coupon code specified by the given identifier synchronously. If a profile has been assigned to the coupon code, an exception will be raised
*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `coupon-codes:write`
* @summary Delete Coupon Code
* @param id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with.
*/
deleteCouponCode(id: string): Promise<{
response: AxiosResponse;
body?: any;
}>;
/**
* Get all coupon code bulk create jobs. Returns a maximum of 100 jobs per request.
*Rate limits*:
Burst: `75/s`
Steady: `750/m` **Scopes:** `coupon-codes:read`
* @summary Get Bulk Create Coupon Code Jobs
* @param fieldsCouponCodeBulkCreateJob For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets* @param filter For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals`* @param pageCursor For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#pagination
*/
getBulkCreateCouponCodeJobs(options?: {
fieldsCouponCodeBulkCreateJob?: Array<'completed_at' | 'completed_count' | 'created_at' | 'errors' | 'expires_at' | 'failed_count' | 'status' | 'total_count'>;
filter?: string;
pageCursor?: string;
}): Promise<{
response: AxiosResponse;
body: GetCouponCodeCreateJobResponseCollectionCompoundDocument;
}>;
/**
* Get a coupon code bulk create job with the given job ID.
*Rate limits*:
Burst: `75/s`
Steady: `750/m` **Scopes:** `coupon-codes:read`
* @summary Get Bulk Create Coupon Codes Job
* @param jobId ID of the job to retrieve.
* @param fieldsCouponCodeBulkCreateJob For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets* @param fieldsCouponCode For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets* @param include For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#relationships
*/
getBulkCreateCouponCodesJob(jobId: string, options?: {
fieldsCouponCodeBulkCreateJob?: Array<'completed_at' | 'completed_count' | 'created_at' | 'errors' | 'expires_at' | 'failed_count' | 'status' | 'total_count'>;
fieldsCouponCode?: Array<'expires_at' | 'status' | 'unique_code'>;
include?: Array<'coupon-codes'>;
}): Promise<{
response: AxiosResponse;
body: GetCouponCodeCreateJobResponseCompoundDocument;
}>;
/**
* Get a specific coupon with the given coupon ID.
*Rate limits*:
Burst: `75/s`
Steady: `750/m` **Scopes:** `coupons:read`
* @summary Get Coupon
* @param id The internal id of a Coupon is equivalent to its external id stored within an integration.
* @param fieldsCoupon For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
*/
getCoupon(id: string, options?: {
fieldsCoupon?: Array<'description' | 'external_id' | 'monitor_configuration'>;
}): Promise<{
response: AxiosResponse;
body: GetCouponResponse;
}>;
/**
* Returns a Coupon Code specified by the given identifier.
*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `coupon-codes:read`
* @summary Get Coupon Code
* @param id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with.
* @param fieldsCouponCode For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets* @param fieldsCoupon For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets* @param include For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#relationships
*/
getCouponCode(id: string, options?: {
fieldsCouponCode?: Array<'expires_at' | 'status' | 'unique_code'>;
fieldsCoupon?: Array<'description' | 'external_id' | 'monitor_configuration'>;
include?: Array<'coupon'>;
}): Promise<{
response: AxiosResponse;
body: GetCouponCodeResponseCompoundDocument;
}>;
/**
* Gets a list of coupon code relationships associated with the given coupon id
*Rate limits*:
Burst: `75/s`
Steady: `750/m` **Scopes:** `coupon-codes:read`
* @summary Get Coupon Code IDs for Coupon
* @param id The ID of the coupon to look up the relationship of.
* @param filter For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals`* @param pageCursor For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#pagination
*/
getCouponCodeIdsForCoupon(id: string, options?: {
filter?: string;
pageCursor?: string;
}): Promise<{
response: AxiosResponse;
body: GetCouponCodesRelationshipsResponseCollection;
}>;
/**
* Gets a list of coupon codes associated with a coupon/coupons or a profile/profiles. A coupon/coupons or a profile/profiles must be provided as required filter params.
*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `coupon-codes:read`
* @summary Get Coupon Codes
* @param filter For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals`
* @param fieldsCouponCode For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets* @param fieldsCoupon For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets* @param include For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#relationships* @param pageCursor For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#pagination
*/
getCouponCodes(filter: string, options?: {
fieldsCouponCode?: Array<'expires_at' | 'status' | 'unique_code'>;
fieldsCoupon?: Array<'description' | 'external_id' | 'monitor_configuration'>;
include?: Array<'coupon'>;
pageCursor?: string;
}): Promise<{
response: AxiosResponse;
body: GetCouponCodeResponseCollectionCompoundDocument;
}>;
/**
* Gets a list of coupon codes associated with the given coupon id
*Rate limits*:
Burst: `75/s`
Steady: `750/m` **Scopes:** `coupon-codes:read`
* @summary Get Coupon Codes for Coupon
* @param id The ID of the coupon to look up the relationship of.
* @param fieldsCouponCode For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets* @param filter For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals`* @param pageCursor For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#pagination
*/
getCouponCodesForCoupon(id: string, options?: {
fieldsCouponCode?: Array<'expires_at' | 'status' | 'unique_code'>;
filter?: string;
pageCursor?: string;
}): Promise<{
response: AxiosResponse;
body: GetCouponCodeResponseCollection;
}>;
/**
* Get the coupon associated with a given coupon code ID.
*Rate limits*:
Burst: `75/s`
Steady: `750/m` **Scopes:** `coupons:read`
* @summary Get Coupon For Coupon Code
* @param id The ID of the coupon to look up the relationship of.
* @param fieldsCoupon For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
*/
getCouponForCouponCode(id: string, options?: {
fieldsCoupon?: Array<'description' | 'external_id' | 'monitor_configuration'>;
}): Promise<{
response: AxiosResponse;
body: GetCouponResponse;
}>;
/**
* Gets the coupon relationship associated with the given coupon code id
*Rate limits*:
Burst: `75/s`
Steady: `750/m` **Scopes:** `coupons:read`
* @summary Get Coupon ID for Coupon Code
* @param id The ID of the coupon to look up the relationship of.
*/
getCouponIdForCouponCode(id: string): Promise<{
response: AxiosResponse;
body: GetCouponCodeCouponRelationshipResponse;
}>;
/**
* Get all coupons in an account. To learn more, see our [Coupons API guide](https://developers.klaviyo.com/en/docs/use_klaviyos_coupons_api).
*Rate limits*:
Burst: `75/s`
Steady: `750/m` **Scopes:** `coupons:read`
* @summary Get Coupons
* @param fieldsCoupon For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets* @param pageCursor For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#pagination
*/
getCoupons(options?: {
fieldsCoupon?: Array<'description' | 'external_id' | 'monitor_configuration'>;
pageCursor?: string;
}): Promise<{
response: AxiosResponse;
body: GetCouponResponseCollection;
}>;
/**
* *Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `coupons:write`
* @summary Update Coupon
* @param id The internal id of a Coupon is equivalent to its external id stored within an integration.* @param couponUpdateQuery
*/
updateCoupon(id: string, couponUpdateQuery: CouponUpdateQuery): Promise<{
response: AxiosResponse;
body: PatchCouponResponse;
}>;
/**
* Updates a coupon code specified by the given identifier synchronously. We allow updating the \'status\' and \'expires_at\' of coupon codes.
*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `coupon-codes:write`
* @summary Update Coupon Code
* @param id The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with.* @param couponCodeUpdateQuery
*/
updateCouponCode(id: string, couponCodeUpdateQuery: CouponCodeUpdateQuery): Promise<{
response: AxiosResponse;
body: PatchCouponCodeResponse;
}>;
}
export interface CouponsApi {
/**
* Alias of {@link CouponsApi.bulkCreateCouponCodes}
*
* @deprecated Use {@link CouponsApi.bulkCreateCouponCodes} instead
*/
spawnCouponCodeBulkCreateJob: typeof CouponsApi.prototype.bulkCreateCouponCodes;
}
export interface CouponsApi {
/**
* Alias of {@link CouponsApi.bulkCreateCouponCodes}
*
* @deprecated Use {@link CouponsApi.bulkCreateCouponCodes} instead
*/
createCouponCodeBulkCreateJob: typeof CouponsApi.prototype.bulkCreateCouponCodes;
}
export interface CouponsApi {
/**
* Alias of {@link CouponsApi.getBulkCreateCouponCodeJobs}
*
* @deprecated Use {@link CouponsApi.getBulkCreateCouponCodeJobs} instead
*/
getCouponCodeBulkCreateJobs: typeof CouponsApi.prototype.getBulkCreateCouponCodeJobs;
}
export interface CouponsApi {
/**
* Alias of {@link CouponsApi.getBulkCreateCouponCodesJob}
*
* @deprecated Use {@link CouponsApi.getBulkCreateCouponCodesJob} instead
*/
getCouponCodeBulkCreateJob: typeof CouponsApi.prototype.getBulkCreateCouponCodesJob;
}
export interface CouponsApi {
/**
* Alias of {@link CouponsApi.getCouponCodeIdsForCoupon}
*
* @deprecated Use {@link CouponsApi.getCouponCodeIdsForCoupon} instead
*/
getCouponCodeRelationshipsCoupon: typeof CouponsApi.prototype.getCouponCodeIdsForCoupon;
}
export interface CouponsApi {
/**
* Alias of {@link CouponsApi.getCouponCodeIdsForCoupon}
*
* @deprecated Use {@link CouponsApi.getCouponCodeIdsForCoupon} instead
*/
getCodeIdsForCoupon: typeof CouponsApi.prototype.getCouponCodeIdsForCoupon;
}
export interface CouponsApi {
/**
* Alias of {@link CouponsApi.getCouponCodeIdsForCoupon}
*
* @deprecated Use {@link CouponsApi.getCouponCodeIdsForCoupon} instead
*/
getCouponRelationshipsCodes: typeof CouponsApi.prototype.getCouponCodeIdsForCoupon;
}
export interface CouponsApi {
/**
* Alias of {@link CouponsApi.getCouponCodesForCoupon}
*
* @deprecated Use {@link CouponsApi.getCouponCodesForCoupon} instead
*/
getCouponCouponCodes: typeof CouponsApi.prototype.getCouponCodesForCoupon;
}
export interface CouponsApi {
/**
* Alias of {@link CouponsApi.getCouponCodesForCoupon}
*
* @deprecated Use {@link CouponsApi.getCouponCodesForCoupon} instead
*/
getCodesForCoupon: typeof CouponsApi.prototype.getCouponCodesForCoupon;
}
export interface CouponsApi {
/**
* Alias of {@link CouponsApi.getCouponForCouponCode}
*
* @deprecated Use {@link CouponsApi.getCouponForCouponCode} instead
*/
getCouponCodeCoupon: typeof CouponsApi.prototype.getCouponForCouponCode;
}
export interface CouponsApi {
/**
* Alias of {@link CouponsApi.getCouponIdForCouponCode}
*
* @deprecated Use {@link CouponsApi.getCouponIdForCouponCode} instead
*/
getCouponRelationshipsCouponCodes: typeof CouponsApi.prototype.getCouponIdForCouponCode;
}