@epilot/pricing-client
Version:
Client for epilot Pricing APIs
1,367 lines (1,364 loc) • 246 kB
TypeScript
/* eslint-disable */
import type {
OpenAPIClient,
Parameters,
UnknownParamsObject,
OperationResponse,
AxiosRequestConfig,
} from 'openapi-client-axios';
declare namespace Components {
namespace Schemas {
export interface Address {
[name: string]: any;
/**
* example:
* [
* "billing"
* ]
*/
_tags?: string[];
/**
* The first line of the address. Typically the street address or PO Box number.
*/
street?: string | null;
/**
* The second line of the address. Typically the number of the apartment, suite, or unit.
*/
street_number?: string | null;
/**
* The postal code for the address.
*/
postal_code?: string | null;
/**
* The name of the city, district, village, or town.
*/
city?: string | null;
/**
* The two-letter code for the country of the address.
*/
country?: string | null;
/**
* An additional description for the address
*/
additional_info?: string | null;
/**
* the company name, usually used as extra delivery instructions
*/
company_name?: string | null;
/**
* the first name of the recipient, usually used as extra delivery instructions
*/
first_name?: string | null;
/**
* the last name of the recipient, usually used as extra delivery instructions
*/
last_name?: string | null;
/**
* the salutation of the recipient, usually used as extra delivery instructions
*/
salutation?: string | null;
/**
* the title of the recipient, usually used as extra delivery instructions
*/
title?: string | null;
}
export interface Amounts {
/**
* Total of all items before (discounts or) taxes are applied.
*/
amount_subtotal?: number;
/**
* Total of all items before (discounts or) taxes are applied, as a string with all the decimal places.
*/
amount_subtotal_decimal?: string;
/**
* Total of all items after (discounts and) taxes are applied.
*/
amount_total?: number;
/**
* Total of all items after (discounts and) taxes are applied, as a string with all the decimal places.
*/
amount_total_decimal?: string;
/**
* The cashback amount.
*/
cashback_amount?: number;
/**
* The cashback amount as a string with all the decimal places.
*/
cashback_amount_decimal?: string;
cashback_period?: /* The cashback period, for now it's limited to either 0 months or 12 months */ CashbackPeriod;
/**
* Total amount after cashback is applied.
*/
after_cashback_amount_total?: number;
/**
* Total amount after cashback is applied as a string with all the decimal places.
*/
after_cashback_amount_total_decimal?: string;
/**
* The discount amount.
*/
discount_amount?: number;
/**
* The discount amount as a string with all the decimal places.
*/
discount_amount_decimal?: string;
/**
* The discount percentage, if the applied coupon had a percentage type.
*/
discount_percentage?: number;
/**
* Total amount before discount is applied.
*/
before_discount_amount_total?: number;
/**
* Total amount before discount is applied as a string with all the decimal places.
*/
before_discount_amount_total_decimal?: string;
}
/**
* Availability check request payload
*/
export interface AvailabilityCheckParams {
/**
* Products to check availability
*/
products: string[];
filters: /* Availability filters dimensions */ AvailabilityFilters;
}
export interface AvailabilityDate {
/**
* The availability interval start date
* example:
* 2017-07-21
*/
available_start_date?: string; // date
/**
* The availability interval end date
* example:
* 2017-07-21
*/
available_end_date?: string; // date
}
/**
* Availability filters dimensions
*/
export interface AvailabilityFilters {
location: AvailabilityLocation;
/**
* A value to be matched against the availability window (start & end date)
* example:
* 2017-07-21
*/
available_date?: string; // date
}
export interface AvailabilityLocation {
/**
* The first line of the address. Typically the street address or PO Box number.
*/
street?: string;
/**
* The second line of the address. Typically the number of the apartment, suite, or unit.
*/
street_number?: string;
/**
* The postal code for the address.
*/
postal_code?: string;
/**
* The name of the city, district, village, or town.
*/
city?: string;
/**
* The name of the country.
*/
country?: string;
}
/**
* The availability check result payload
* example:
* {
* "available_products": [],
* "check_results": [
* {
* "product_id": "my-product-id-123-1",
* "matching_hits": 0
* },
* {
* "product_id": "my-product-id-123-2",
* "matching_hits": 0
* }
* ]
* }
*/
export interface AvailabilityResult {
available_products: string[];
/**
* The check result details
*/
check_results?: {
product_id: string;
/**
* The number of rules matched
*/
matching_hits?: number;
/**
* A set of matching errors when checking availability
*/
matching_error?: {
[name: string]: any;
};
}[];
}
/**
* An average market price over a given period in time.
*/
export interface AverageMarketPriceRecord {
/**
* Cost in Cents, e.g. 12.3 for 12,3 Cents = 0.123€.
* example:
* 12.3
*/
unit_amount: number;
/**
* Cost in decimal format, e.g. 0.123€.
* example:
* 0.123
*/
unit_amount_decimal: string;
unit_amount_currency: /**
* Three-letter ISO currency code, in lowercase. Must be a supported currency.
* ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
*
* example:
* EUR
*/
Currency;
/**
* An ISO 8601 interval in the format 'start/end'.
* example:
* 2025-01-01T00:00:00Z/2025-01-31T23:59:59Z
*/
timestamp: string;
}
export interface AverageMarketPriceResult {
market: /* The market for a spot market price. */ SpotMarketType;
bidding_zone: /* The bidding zone for a spot market price. */ SpotMarketBiddingZone;
price: /* An average market price over a given period in time. */ AverageMarketPriceRecord;
_meta?: /* Signature meta data payload */ SignatureMeta;
}
/**
* The common properties for a composite price entity, without the price components
* example:
* {
* "$ref": "#/components/examples/composite-price"
* }
*/
export interface BaseCompositePrice {
[name: string]: any;
/**
* The billing period duration
*/
billing_duration_amount?: number;
/**
* The billing period duration unit
*/
billing_duration_unit?: "weeks" | "months" | "years";
/**
* The notice period duration
*/
notice_time_amount?: number;
/**
* The notice period duration unit
*/
notice_time_unit?: "weeks" | "months" | "years";
/**
* The termination period duration
*/
termination_time_amount?: number;
/**
* The termination period duration unit
*/
termination_time_unit?: "weeks" | "months" | "years";
/**
* The renewal period duration
*/
renewal_duration_amount?: number;
/**
* The renewal period duration unit
*/
renewal_duration_unit?: "weeks" | "months" | "years";
/**
* Whether the price can be used for new purchases.
*/
active?: boolean;
/**
* A brief description of the price.
*/
description?: string;
/**
* A set of [price](/api/pricing#tag/simple_price_schema) components that define the composite price.
*/
price_components?: /* A set of [price](/api/pricing#tag/simple_price_schema) components that define the composite price. */ /**
* The price entity schema for simple pricing
* example:
* {
* "$ref": "#/components/examples/price"
* }
*/
Price[] | {
$relation?: PriceComponentRelation[];
};
/**
* Three-letter ISO currency code, in lowercase.
*/
unit_amount_currency?: /* Three-letter ISO currency code, in lowercase. */ /**
* Three-letter ISO currency code, in lowercase. Must be a supported currency.
* ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
*
* example:
* EUR
*/
Currency;
/**
* The flag for prices that contain price components.
*/
is_composite_price: true;
/**
* The price creation date
*/
_created_at?: string;
/**
* The price id
*/
_id?: string;
/**
* The price autogenerated title
*/
_title?: string;
/**
* The price last update date
*/
_updated_at?: string;
/**
* The organization id the price belongs to
*/
_org_id?: string;
/**
* An arbitrary set of tags attached to the composite price
*/
_tags?: string[];
}
/**
* The shared properties for the coupon entity and coupon item entity
*/
export interface BaseCouponCommon {
[name: string]: any;
_id: EntityId /* uuid */;
/**
* The auto-generated title for the title
*/
_title: string;
/**
* Organization Id the entity belongs to
*/
_org: string;
/**
* The schema of the entity, for coupons it is always `coupon`
*/
_schema: "coupon";
_tags?: string[];
/**
* The creation date for the opportunity
*/
_created_at: string; // date-time
/**
* The date the coupon was last updated
*/
_updated_at: string; // date-time
name: string | null;
description?: string | null;
type: "fixed" | "percentage";
category: "discount" | "cashback";
/**
* Use if type is set to percentage. The percentage to be discounted, represented as a whole integer.
*/
percentage_value?: string | null;
/**
* Use if type is set to fixed. The fixed amount in cents to be discounted, represented as a whole integer.
*/
fixed_value?: number;
/**
* Use if type is set to fixed. The unit amount in cents to be discounted, represented as a decimal string with at most 12 decimal places.
*/
fixed_value_decimal?: string;
/**
* Use if type is set to fixed. Three-letter ISO currency code, in lowercase.
*/
fixed_value_currency?: /* Use if type is set to fixed. Three-letter ISO currency code, in lowercase. */ /**
* Three-letter ISO currency code, in lowercase. Must be a supported currency.
* ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
*
* example:
* EUR
*/
Currency;
cashback_period?: /* The cashback period, for now it's limited to either 0 months or 12 months */ CashbackPeriod;
active?: boolean;
/**
* Whether the coupon requires a promo code to be applied
*/
requires_promo_code?: boolean;
}
export interface BaseMarketPriceRecord {
/**
* Cost in Cents, e.g. 12.3 for 12,3 Cents = 0.123€.
* example:
* 12.3
*/
unit_amount: number;
/**
* Cost in decimal format, e.g. 0.123€.
* example:
* 0.123
*/
unit_amount_decimal: string;
unit_amount_currency: /**
* Three-letter ISO currency code, in lowercase. Must be a supported currency.
* ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
*
* example:
* EUR
*/
Currency;
}
/**
* Represents a price item
* example:
* {
* "$ref": "#/components/examples/price-item/value"
* }
*/
export interface BasePriceItem {
/**
* Total of all items before (discounts or) taxes are applied.
*/
amount_subtotal?: number;
/**
* Total of all items before (discounts or) taxes are applied, as a string with all the decimal places.
*/
amount_subtotal_decimal?: string;
/**
* Total of all items after (discounts and) taxes are applied.
*/
amount_total?: number;
/**
* Total of all items after (discounts and) taxes are applied, as a string with all the decimal places.
*/
amount_total_decimal?: string;
/**
* The cashback amount.
*/
cashback_amount?: number;
/**
* The cashback amount as a string with all the decimal places.
*/
cashback_amount_decimal?: string;
cashback_period?: /* The cashback period, for now it's limited to either 0 months or 12 months */ CashbackPeriod;
/**
* Total amount after cashback is applied.
*/
after_cashback_amount_total?: number;
/**
* Total amount after cashback is applied as a string with all the decimal places.
*/
after_cashback_amount_total_decimal?: string;
/**
* The discount amount.
*/
discount_amount?: number;
/**
* The discount amount as a string with all the decimal places.
*/
discount_amount_decimal?: string;
/**
* The discount percentage, if the applied coupon had a percentage type.
*/
discount_percentage?: number;
/**
* Total amount before discount is applied.
*/
before_discount_amount_total?: number;
/**
* Total amount before discount is applied as a string with all the decimal places.
*/
before_discount_amount_total_decimal?: string;
metadata?: /* A set of key-value pairs used to store meta data information about an entity. */ MetaData;
/**
* The quantity of products being purchased.
*/
quantity?: number;
/**
* The id of the product.
*/
product_id?: string;
/**
* The id of the price.
*/
price_id?: string;
/**
* An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
*/
description?: string;
/**
* The description for the product.
*/
product_description?: string;
/**
* The name for the product.
*/
product_name?: string;
price_mappings?: /**
* example:
* [
* {
* "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
* "frequency_unit": "weekly",
* "value": 1000.245,
* "name": "avg consumption",
* "metadata": {
* "journey_title": "energy journey",
* "step_name": "avg consumption picker"
* }
* }
* ]
*/
PriceInputMappings;
/**
* Specifies whether the price is considered `inclusive` of taxes or not.
*/
is_tax_inclusive?: boolean;
/**
* The snapshot of the product.
* example:
* {
* "$ref": "#/components/examples/product"
* }
*/
_product?: {
[name: string]: any;
/**
* The description for the product
*/
description?: string;
/**
* The product code
*/
code?: string;
/**
* The type of Product:
*
* | type | description |
* |----| ----|
* | `product` | Represents a physical good |
* | `service` | Represents a service or virtual product |
*
*/
type?: "product" | "service";
/**
* The product main name
*/
name?: string;
/**
* The product categories
*/
categories?: string[];
feature?: {
/**
* An arbitrary set of tags attached to a feature
*/
_tags?: string[];
feature?: string;
}[];
/**
* Stores references to products that can be cross sold with the current product.
*/
cross_sellable_products?: {
$relation?: EntityRelation[];
};
/**
* Stores references to a set of file images of the product
*/
product_images?: /* Stores references to a set of file images of the product */ {
$relation?: EntityRelation[];
} | File[];
/**
* Stores references to a set of files downloadable from the product.
* e.g: tech specifications, quality control sheets, privacy policy agreements
*
*/
product_downloads?: /**
* Stores references to a set of files downloadable from the product.
* e.g: tech specifications, quality control sheets, privacy policy agreements
*
*/
{
$relation?: EntityRelation[];
} | File[];
/**
* A set of [prices](/api/pricing#tag/simple_price_schema) or [composite prices](/api/pricing#tag/dynamic_price_schema) for the current product.
*/
price_options?: {
$relation?: EntityRelation[];
};
/**
* Stores references to the availability files that define where this product is available.
* These files are used when interacting with products via epilot Journeys, thought the AvailabilityCheck block.
*
*/
_availability_files?: File[];
/**
* The product id
*/
_id?: string;
/**
* The autogenerated product title
*/
_title?: string;
/**
* The organization id the product belongs to
*/
_org_id?: string;
/**
* The product creation date
*/
_created_at?: string;
/**
* The product last update date
*/
_updated_at?: string;
};
/**
* price item id
*/
_id?: string;
/**
* The unit amount value
*/
unit_amount?: number;
/**
* The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.
*/
unit_amount_decimal?: string;
/**
* The unit amount before any discount is applied
*/
before_discount_unit_amount?: number;
/**
* The unit amount before any discount is applied, represented as a decimal string with at most 12 decimal places.
*/
before_discount_unit_amount_decimal?: string;
/**
* The unit gross amount before any discount is applied
*/
before_discount_unit_amount_gross?: number;
/**
* The unit gross amount before any discount is applied, represented as a decimal string with at most 12 decimal places.
*/
before_discount_unit_amount_gross_decimal?: string;
/**
* The unit net amount before any discount is applied
*/
before_discount_unit_amount_net?: number;
/**
* The unit net amount before any discount is applied, represented as a decimal string with at most 12 decimal places.
*/
before_discount_unit_amount_net_decimal?: string;
/**
* The discount amount applied for each unit
*/
unit_discount_amount?: number;
/**
* The discount amount applied for each unit represented as a decimal string
*/
unit_discount_amount_decimal?: string;
/**
* The unit gross amount value.
*/
unit_amount_gross?: number;
/**
* The unit gross amount value.
*/
unit_amount_gross_decimal?: string;
/**
* Net unit amount without taxes or discounts.
*/
unit_amount_net?: number;
/**
* Net unit amount without taxes or discounts.
*/
unit_amount_net_decimal?: string;
/**
* The net discount amount applied for each unit
*/
unit_discount_amount_net?: number;
/**
* The net discount amount applied for each unit represented as a decimal string
*/
unit_discount_amount_net_decimal?: string;
/**
* The discount amount applied to the tax
*/
tax_discount_amount?: number;
/**
* The discount amount applied to the tax represented as a decimal string
*/
tax_discount_amount_decimal?: string;
/**
* The net discount amount applied
*/
discount_amount_net?: number;
/**
* The net discount amount applied represented as a decimal string
*/
discount_amount_net_decimal?: string;
/**
* Total tax amount for this line item.
*/
amount_tax?: number;
/**
* The tax amount before any discount is applied
*/
before_discount_tax_amount?: number;
/**
* The tax amount before any discount is applied represented as a decimal string
*/
before_discount_tax_amount_decimal?: string;
currency?: /**
* Three-letter ISO currency code, in lowercase. Must be a supported currency.
* ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
*
* example:
* EUR
*/
Currency;
/**
* The taxes applied to the price item.
*/
taxes?: (/* A tax amount associated with a specific tax rate. */ TaxAmount)[];
/**
* The sum of amounts of the price items by recurrence.
*/
recurrences?: (/* An amount associated with a specific recurrence. */ RecurrenceAmount)[];
/**
* The coupons applicable to the price item
*/
_coupons?: (/* The shared properties for the coupon entity and coupon item entity */ CouponItem)[];
/**
* When set to true on a `_price` displayed as OnRequest (`show_as_on_request: 'on_request'`) this flag means the price has been approved and can now be displayed to the customer. This flag is only valid for prices shown as 'on_request'.
*/
on_request_approved?: boolean;
}
/**
* Represents the common keys in BasePriceItem and BasePriceItemDto
*/
export interface BasePriceItemCommon {
metadata?: /* A set of key-value pairs used to store meta data information about an entity. */ MetaData;
/**
* The quantity of products being purchased.
*/
quantity?: number;
/**
* The id of the product.
*/
product_id?: string;
/**
* The id of the price.
*/
price_id?: string;
/**
* An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
*/
description?: string;
/**
* The description for the product.
*/
product_description?: string;
/**
* The name for the product.
*/
product_name?: string;
/**
* Price mapping information required to compute totals
*/
price_mappings?: /**
* example:
* [
* {
* "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
* "frequency_unit": "weekly",
* "value": 1000.245,
* "name": "avg consumption",
* "metadata": {
* "journey_title": "energy journey",
* "step_name": "avg consumption picker"
* }
* }
* ]
*/
PriceInputMappings;
/**
* Specifies whether the price is considered `inclusive` of taxes or not.
*/
is_tax_inclusive?: boolean;
/**
* The snapshot of the product.
* example:
* {
* "$ref": "#/components/examples/product"
* }
*/
_product?: {
[name: string]: any;
/**
* The description for the product
*/
description?: string;
/**
* The product code
*/
code?: string;
/**
* The type of Product:
*
* | type | description |
* |----| ----|
* | `product` | Represents a physical good |
* | `service` | Represents a service or virtual product |
*
*/
type?: "product" | "service";
/**
* The product main name
*/
name?: string;
/**
* The product categories
*/
categories?: string[];
feature?: {
/**
* An arbitrary set of tags attached to a feature
*/
_tags?: string[];
feature?: string;
}[];
/**
* Stores references to products that can be cross sold with the current product.
*/
cross_sellable_products?: {
$relation?: EntityRelation[];
};
/**
* Stores references to a set of file images of the product
*/
product_images?: /* Stores references to a set of file images of the product */ {
$relation?: EntityRelation[];
} | File[];
/**
* Stores references to a set of files downloadable from the product.
* e.g: tech specifications, quality control sheets, privacy policy agreements
*
*/
product_downloads?: /**
* Stores references to a set of files downloadable from the product.
* e.g: tech specifications, quality control sheets, privacy policy agreements
*
*/
{
$relation?: EntityRelation[];
} | File[];
/**
* A set of [prices](/api/pricing#tag/simple_price_schema) or [composite prices](/api/pricing#tag/dynamic_price_schema) for the current product.
*/
price_options?: {
$relation?: EntityRelation[];
};
/**
* Stores references to the availability files that define where this product is available.
* These files are used when interacting with products via epilot Journeys, thought the AvailabilityCheck block.
*
*/
_availability_files?: File[];
/**
* The product id
*/
_id?: string;
/**
* The autogenerated product title
*/
_title?: string;
/**
* The organization id the product belongs to
*/
_org_id?: string;
/**
* The product creation date
*/
_created_at?: string;
/**
* The product last update date
*/
_updated_at?: string;
};
}
/**
* Represents a valid base price item from a client.
*/
export interface BasePriceItemDto {
metadata?: /* A set of key-value pairs used to store meta data information about an entity. */ MetaData;
/**
* The quantity of products being purchased.
*/
quantity?: number;
/**
* The id of the product.
*/
product_id?: string;
/**
* The id of the price.
*/
price_id?: string;
/**
* An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
*/
description?: string;
/**
* The description for the product.
*/
product_description?: string;
/**
* The name for the product.
*/
product_name?: string;
price_mappings?: /**
* example:
* [
* {
* "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
* "frequency_unit": "weekly",
* "value": 1000.245,
* "name": "avg consumption",
* "metadata": {
* "journey_title": "energy journey",
* "step_name": "avg consumption picker"
* }
* }
* ]
*/
PriceInputMappings;
/**
* Specifies whether the price is considered `inclusive` of taxes or not.
*/
is_tax_inclusive?: boolean;
/**
* The snapshot of the product.
* example:
* {
* "$ref": "#/components/examples/product"
* }
*/
_product?: {
[name: string]: any;
/**
* The description for the product
*/
description?: string;
/**
* The product code
*/
code?: string;
/**
* The type of Product:
*
* | type | description |
* |----| ----|
* | `product` | Represents a physical good |
* | `service` | Represents a service or virtual product |
*
*/
type?: "product" | "service";
/**
* The product main name
*/
name?: string;
/**
* The product categories
*/
categories?: string[];
feature?: {
/**
* An arbitrary set of tags attached to a feature
*/
_tags?: string[];
feature?: string;
}[];
/**
* Stores references to products that can be cross sold with the current product.
*/
cross_sellable_products?: {
$relation?: EntityRelation[];
};
/**
* Stores references to a set of file images of the product
*/
product_images?: /* Stores references to a set of file images of the product */ {
$relation?: EntityRelation[];
} | File[];
/**
* Stores references to a set of files downloadable from the product.
* e.g: tech specifications, quality control sheets, privacy policy agreements
*
*/
product_downloads?: /**
* Stores references to a set of files downloadable from the product.
* e.g: tech specifications, quality control sheets, privacy policy agreements
*
*/
{
$relation?: EntityRelation[];
} | File[];
/**
* A set of [prices](/api/pricing#tag/simple_price_schema) or [composite prices](/api/pricing#tag/dynamic_price_schema) for the current product.
*/
price_options?: {
$relation?: EntityRelation[];
};
/**
* Stores references to the availability files that define where this product is available.
* These files are used when interacting with products via epilot Journeys, thought the AvailabilityCheck block.
*
*/
_availability_files?: File[];
/**
* The product id
*/
_id?: string;
/**
* The autogenerated product title
*/
_title?: string;
/**
* The organization id the product belongs to
*/
_org_id?: string;
/**
* The product creation date
*/
_created_at?: string;
/**
* The product last update date
*/
_updated_at?: string;
};
external_fees_mappings?: /**
* example:
* {
* "$ref": "#/components/examples/external-fee-mappings/value"
* }
*/
ExternalFeeMappings;
external_fees_metadata?: ExternalFeeMetadata;
external_price_metadata?: ExternalPriceMetadata;
_immutable_pricing_details?: /* The result from the calculation of a set of price items. */ PricingDetails;
/**
* The ids of the coupons applicable to the price item
*/
coupon_ids?: string[];
/**
* The taxes applied to the price item.
*/
taxes?: (/* A valid tax rate from a client. */ TaxAmountDto)[];
/**
* The taxes applied to the price item.
*/
recurrences?: (/* An amount associated with a specific recurrence. */ RecurrenceAmountDto)[];
/**
* The coupons applicable to the price item
*/
_coupons?: (/* The shared properties for the coupon entity and coupon item entity */ CouponItem)[];
}
export interface BasicAuthCredentials {
/**
* The username
* example:
* username
*/
username: string;
/**
* The password
* example:
* 123456
*/
password: string;
}
export interface BasicAuthIntegration {
/**
* The username
* example:
* username
*/
username: string;
/**
* The password
* example:
* 123456
*/
password: string;
auth_type?: "basic_auth";
/**
* The base URL
* example:
* https://api.example.com
*/
base_url?: string;
}
export type BillingPeriod = "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly";
/**
* Supports shopping for products and services until ready for checkout.
*/
export interface Cart {
/**
* Total of all items before (discounts or) taxes are applied.
*/
amount_subtotal?: number;
/**
* Total of all items before (discounts or) taxes are applied, as a string with all the decimal places.
*/
amount_subtotal_decimal?: string;
/**
* Total of all items after (discounts and) taxes are applied.
*/
amount_total?: number;
/**
* Total of all items after (discounts and) taxes are applied, as a string with all the decimal places.
*/
amount_total_decimal?: string;
/**
* The cashback amount.
*/
cashback_amount?: number;
/**
* The cashback amount as a string with all the decimal places.
*/
cashback_amount_decimal?: string;
cashback_period?: /* The cashback period, for now it's limited to either 0 months or 12 months */ CashbackPeriod;
/**
* Total amount after cashback is applied.
*/
after_cashback_amount_total?: number;
/**
* Total amount after cashback is applied as a string with all the decimal places.
*/
after_cashback_amount_total_decimal?: string;
/**
* The discount amount.
*/
discount_amount?: number;
/**
* The discount amount as a string with all the decimal places.
*/
discount_amount_decimal?: string;
/**
* The discount percentage, if the applied coupon had a percentage type.
*/
discount_percentage?: number;
/**
* Total amount before discount is applied.
*/
before_discount_amount_total?: number;
/**
* Total amount before discount is applied as a string with all the decimal places.
*/
before_discount_amount_total_decimal?: string;
/**
* The cart identifier
*/
id?: string;
/**
* The user's Organization Id the cart belongs to
*/
org_id?: string;
/**
* The status of the Cart:
* - open - the cart checkout is still in progress. Payment processing has not started
* - complete - the cart checkout is complete. Payment processing may still be in progress
* - expired - the cart checkout has expired. No further processing will occur
*
*/
status?: "open" | "complete" | "expired";
customer?: Customer;
billing_address?: Address;
delivery_address?: Address;
metadata?: /* A set of key-value pairs used to store meta data information about an entity. */ MetaData;
line_items?: /* Tracks a set of product prices, quantities, (discounts) and taxes. */ PriceItems;
total_details?: /* The total details with tax (and discount) aggregated totals. */ TotalDetails;
created_at?: string; // date-time
updated_at?: string; // date-time
}
/**
* A valid cart payload from a client.
*/
export interface CartDto {
metadata?: /* A set of key-value pairs used to store meta data information about an entity. */ MetaData;
customer?: Customer;
billing_address?: Address;
delivery_address?: Address;
/**
* type of source, e.g. journey or manual
* example:
* journey
*/
source_type?: string;
/**
* identifier for source e.g. journey ID
* example:
* ce99875f-fba9-4fe2-a8f9-afaf52059051
*/
source_id?: string;
source?: /* The order generation source */ OrderSource;
additional_addresses?: Address[];
payment_method?: /**
* A PaymentMethod represent your customer's payment instruments.
*
*/
PaymentMethod;
line_items: /* A valid set of product prices, quantities, (discounts) and taxes from a client. */ PriceItemsDto;
/**
* An array of file IDs, already upload into the File API, that are related with this cart
*/
files?: string[];
status?: /**
*
* | status | description |
* |-------------|-------|
* | `draft` | Starting state for all orders, at this point we can still edit the order |
* | `quote` | The order is in a quoting phase, bound to an expiration date |
* | `placed` | The order has been paid and can now be fulfilled (shipped, delivered, complete) or canceled |
* | `cancelled` | The order has been cancelled |
* | `completed` | The order is now closed and finalized |
*
*/
OrderStatus;
tags?: string[];
journey_data?: {
[name: string]: any;
};
consents?: {
[name: string]: any;
};
}
/**
* An amount associated with a specific cashback period.
*/
export interface CashbackAmount {
cashback_period: /* The cashback period, for now it's limited to either 0 months or 12 months */ CashbackPeriod;
/**
* The sum of all cashbacks for a specific cashback period
*/
amount_total: number;
}
export interface CashbackAmounts {
/**
* The cashback amount.
*/
cashback_amount?: number;
/**
* The cashback amount as a string with all the decimal places.
*/
cashback_amount_decimal?: string;
cashback_period?: /* The cashback period, for now it's limited to either 0 months or 12 months */ CashbackPeriod;
/**
* Total amount after cashback is applied.
*/
after_cashback_amount_total?: number;
/**
* Total amount after cashback is applied as a string with all the decimal places.
*/
after_cashback_amount_total_decimal?: string;
}
/**
* The cashback period, for now it's limited to either 0 months or 12 months
*/
export type CashbackPeriod = "0" | "12";
/**
* A catalog search payload
* example:
* {
* "q": "_id:1233432 OR _id:123432454 OR _id:23445433",
* "sort": "description ASC",
* "from": 0,
* "size": 200
* }
*/
export interface CatalogSearch {
/**
* The query to perform using lucene query syntax.
*/
q: string;
/**
* The sort expression to sort the results.
*/
sort?: string;
/**
* The index from which to query, used for pagination purposes. Defaults to 0
*/
from?: number;
/**
* The max size of the response, defaults to 2000.
*/
size?: number;
/**
* When true, enables entity hydration to resolve nested $relation references in-place.
*/
hydrate?: boolean;
availability?: /* Availability filters dimensions */ AvailabilityFilters;
}
/**
* The query result payload
* example:
* {
* "hits": 2,
* "results": [
* {
* "schema": "product",
* "description": "product a"
* },
* {
* "schema": "price",
* "unit_amount_decimal": "124.342343434"
* }
* ]
* }
*/
export interface CatalogSearchResult {
/**
* The number os results returned.
*/
hits?: number;
results?: (/**
* The product entity
* example:
* {
* "$ref": "#/components/examples/product"
* }
*/
Product | /**
* The price entity schema for simple pricing
* example:
* {
* "$ref": "#/components/examples/price"
* }
*/
Price | /**