import { APIResource } from "../core/resource.mjs"; import * as PricesAPI from "./prices.mjs"; import * as Shared from "./shared.mjs"; import { APIPromise } from "../core/api-promise.mjs"; import { RequestOptions } from "../internal/request-options.mjs"; export declare class Products extends APIResource { /** * Create Product */ create(body: ProductCreateParams, options?: RequestOptions): APIPromise; /** * Get Product */ retrieve(id: string, options?: RequestOptions): APIPromise; /** * Update Product */ update(id: string, body: ProductUpdateParams, options?: RequestOptions): APIPromise; /** * List Products */ list(query?: ProductListParams | null | undefined, options?: RequestOptions): APIPromise; } export interface ProductClientSelectSchema { id: string; active: boolean; /** * Epoch milliseconds. */ createdAt: number; default: boolean; description: string | null; imageURL: string | null; livemode: boolean; name: string; organizationId: string; pluralQuantityLabel: string | null; pricingModelId: string; singularQuantityLabel: string | null; slug: string | null; /** * Epoch milliseconds. */ updatedAt: number; } export interface ProductCreateResponse { product: ProductClientSelectSchema; } export interface ProductRetrieveResponse { id: string; active: boolean; /** * Epoch milliseconds. */ createdAt: number; default: boolean; /** * The default price for the product. If no price is explicitly set as default, * will return the first price created for the product.. */ defaultPrice: PricesAPI.SubscriptionPriceClientSelectSchema | PricesAPI.SinglePaymentPriceClientSelectSchema | PricesAPI.UsagePriceClientSelectSchema; description: string | null; features: Array; imageURL: string | null; livemode: boolean; name: string; organizationId: string; pluralQuantityLabel: string | null; prices: Array; pricingModelId: string; singularQuantityLabel: string | null; slug: string | null; /** * Epoch milliseconds. */ updatedAt: number; } export declare namespace ProductRetrieveResponse { interface ResourceFeatureClientSelectSchema { id: string; active: boolean; /** * A positive integer */ amount: number; /** * Epoch milliseconds. */ createdAt: number; description: string; livemode: boolean; name: string; organizationId: string; pricingModelId: string; resourceId: string; slug: string; type: 'resource'; /** * Epoch milliseconds. */ updatedAt: number; renewalFrequency?: null; usageMeterId?: null; } } export interface ProductUpdateResponse { product: ProductClientSelectSchema; } export interface ProductListResponse { data: Array; hasMore: boolean; total: number; currentCursor?: string; nextCursor?: string; } export interface ProductCreateParams { price: ProductCreateParams.ProductSubscriptionPriceInsert | ProductCreateParams.ProductSinglePaymentPriceInsert | ProductCreateParams.ProductUsagePriceInsert; product: ProductCreateParams.Product; featureIds?: Array; } export declare namespace ProductCreateParams { interface ProductSubscriptionPriceInsert { /** * A positive integer */ intervalCount: number; intervalUnit: 'day' | 'week' | 'month' | 'year'; /** * Whether or not this price is the default price. For product prices, this * indicates the default price for that product. For usage prices, this indicates * the default price for that usage meter. */ isDefault: boolean; type: 'subscription'; /** * The price per unit. This should be in the smallest unit of the currency. For * example, if the currency is USD, GBP, CAD, EUR or SGD, the price should be in * cents. */ unitPrice: number; active?: boolean; name?: string | null; slug?: string | null; /** * The trial period in days. If the trial period is 0 or null, there will be no * trial period. */ trialPeriodDays?: number | null; /** * Omitted. */ usageEventsPerUnit?: null; /** * Omitted. */ usageMeterId?: null; } interface ProductSinglePaymentPriceInsert { /** * Whether or not this price is the default price. For product prices, this * indicates the default price for that product. For usage prices, this indicates * the default price for that usage meter. */ isDefault: boolean; type: 'single_payment'; /** * The price per unit. This should be in the smallest unit of the currency. For * example, if the currency is USD, GBP, CAD, EUR or SGD, the price should be in * cents. */ unitPrice: number; active?: boolean; /** * Omitted. */ intervalCount?: null; /** * Omitted. */ intervalUnit?: null; name?: string | null; slug?: string | null; /** * Omitted. */ trialPeriodDays?: null; /** * Omitted. */ usageEventsPerUnit?: null; /** * Omitted. */ usageMeterId?: null; } interface ProductUsagePriceInsert { /** * A positive integer */ intervalCount: number; intervalUnit: 'day' | 'week' | 'month' | 'year'; /** * Whether or not this price is the default price. For product prices, this * indicates the default price for that product. For usage prices, this indicates * the default price for that usage meter. */ isDefault: boolean; type: 'usage'; /** * The price per unit. This should be in the smallest unit of the currency. For * example, if the currency is USD, GBP, CAD, EUR or SGD, the price should be in * cents. */ unitPrice: number; /** * The number of usage events per unit. Used to determine how to map usage events * to quantities when raising invoices for usage. */ usageEventsPerUnit: number; /** * The usage meter that uses this price. All usage events on that meter must be * associated with a price that is also associated with that usage meter. */ usageMeterId: string; active?: boolean; name?: string | null; slug?: string | null; /** * Omitted. */ trialPeriodDays?: null; } interface Product { active: boolean; name: string; pricingModelId: string; default?: boolean; description?: string | null; imageURL?: string | null; pluralQuantityLabel?: string | null; singularQuantityLabel?: string | null; slug?: string | null; } } export interface ProductUpdateParams { product: ProductUpdateParams.Product; featureIds?: Array; /** * The latest price fields. Ignored if the product is a default product for its * pricing model. */ price?: ProductUpdateParams.SubscriptionPriceClientInsertSchema | ProductUpdateParams.SinglePaymentPriceClientInsertSchema | ProductUpdateParams.UsagePriceClientInsertSchema; } export declare namespace ProductUpdateParams { interface Product { id: string; active: boolean; name: string; default?: boolean; description?: string | null; imageURL?: string | null; pluralQuantityLabel?: string | null; singularQuantityLabel?: string | null; slug?: string | null; } interface SubscriptionPriceClientInsertSchema { /** * A positive integer */ intervalCount: number; intervalUnit: 'day' | 'week' | 'month' | 'year'; /** * Whether or not this price is the default price. For product prices, this * indicates the default price for that product. For usage prices, this indicates * the default price for that usage meter. */ isDefault: boolean; /** * The product this price belongs to. Required for subscription prices. */ productId: string; type: 'subscription'; /** * The price per unit. This should be in the smallest unit of the currency. For * example, if the currency is USD, GBP, CAD, EUR or SGD, the price should be in * cents. */ unitPrice: number; active?: boolean; name?: string | null; slug?: string | null; /** * The trial period in days. If the trial period is 0 or null, there will be no * trial period. */ trialPeriodDays?: number | null; /** * Omitted. */ usageEventsPerUnit?: null; /** * Omitted. */ usageMeterId?: null; } interface SinglePaymentPriceClientInsertSchema { /** * Whether or not this price is the default price. For product prices, this * indicates the default price for that product. For usage prices, this indicates * the default price for that usage meter. */ isDefault: boolean; /** * The product this price belongs to. Required for single payment prices. */ productId: string; type: 'single_payment'; /** * The price per unit. This should be in the smallest unit of the currency. For * example, if the currency is USD, GBP, CAD, EUR or SGD, the price should be in * cents. */ unitPrice: number; active?: boolean; /** * Omitted. */ intervalCount?: null; /** * Omitted. */ intervalUnit?: null; name?: string | null; slug?: string | null; /** * Omitted. */ trialPeriodDays?: null; /** * Omitted. */ usageEventsPerUnit?: null; /** * Omitted. */ usageMeterId?: null; } interface UsagePriceClientInsertSchema { /** * A positive integer */ intervalCount: number; intervalUnit: 'day' | 'week' | 'month' | 'year'; /** * Whether or not this price is the default price. For product prices, this * indicates the default price for that product. For usage prices, this indicates * the default price for that usage meter. */ isDefault: boolean; type: 'usage'; /** * The price per unit. This should be in the smallest unit of the currency. For * example, if the currency is USD, GBP, CAD, EUR or SGD, the price should be in * cents. */ unitPrice: number; /** * The number of usage events per unit. Used to determine how to map usage events * to quantities when raising invoices for usage. */ usageEventsPerUnit: number; /** * The usage meter that uses this price. All usage events on that meter must be * associated with a price that is also associated with that usage meter. */ usageMeterId: string; active?: boolean; name?: string | null; /** * Omitted. */ productId?: null; slug?: string | null; /** * Omitted. */ trialPeriodDays?: null; } } export interface ProductListParams { cursor?: string; limit?: string; } export declare namespace Products { export { type ProductClientSelectSchema as ProductClientSelectSchema, type ProductCreateResponse as ProductCreateResponse, type ProductRetrieveResponse as ProductRetrieveResponse, type ProductUpdateResponse as ProductUpdateResponse, type ProductListResponse as ProductListResponse, type ProductCreateParams as ProductCreateParams, type ProductUpdateParams as ProductUpdateParams, type ProductListParams as ProductListParams, }; } //# sourceMappingURL=products.d.mts.map