UNPKG

@commercelayer/sdk

Version:
1,157 lines (1,139 loc) 795 kB
import ApiClient, { ApiClientInitConfig } from './client.js'; import { StringKey, PositiveNumberRange, ObjectType } from './types.js'; type EventStoreType = 'event_stores'; type EventStoreRel = ResourceRel & { type: EventStoreType; }; type EventStoreSort = Pick<EventStore, 'id'> & ResourceSort; interface EventStore extends Resource { readonly type: EventStoreType; /** * The type of the affected resource. * @example ```"orders"``` */ resource_type?: string | null; /** * The ID of the affected resource. * @example ```"PzdJhdLdYV"``` */ resource_id?: string | null; /** * The type of change (one of create or update). * @example ```"update"``` */ event?: string | null; /** * The object changes payload. * @example ```{"status":["draft","placed"]}``` */ payload?: Record<string, any> | null; /** * Information about who triggered the change. * @example ```{"application":{"id":"DNOPYiZYpn","kind":"sales_channel","public":true},"owner":{"id":"yQQrBhLBmQ","type":"Customer"}}``` */ who?: Record<string, any> | null; } declare class EventStores extends ApiResource<EventStore> { static readonly TYPE: EventStoreType; isEventStore(resource: any): resource is EventStore; relationship(id: string | ResourceId | null): EventStoreRel; relationshipToMany(...ids: string[]): EventStoreRel[]; type(): EventStoreType; } declare const instance$23: EventStores; type TagType = 'tags'; type TagRel$l = ResourceRel & { type: TagType; }; type TagSort = Pick<Tag, 'id' | 'name'> & ResourceSort; interface Tag extends Resource { readonly type: TagType; /** * The tag name. * @example ```"new_campaign"``` */ name: string; event_stores?: EventStore[] | null; } interface TagCreate extends ResourceCreate { /** * The tag name. * @example ```"new_campaign"``` */ name: string; } interface TagUpdate extends ResourceUpdate { /** * The tag name. * @example ```"new_campaign"``` */ name?: string | null; } declare class Tags extends ApiResource<Tag> { static readonly TYPE: TagType; create(resource: TagCreate, params?: QueryParamsRetrieve<Tag>, options?: ResourcesConfig): Promise<Tag>; update(resource: TagUpdate, params?: QueryParamsRetrieve<Tag>, options?: ResourcesConfig): Promise<Tag>; delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>; event_stores(tagId: string | Tag, params?: QueryParamsList<EventStore>, options?: ResourcesConfig): Promise<ListResponse<EventStore>>; isTag(resource: any): resource is Tag; relationship(id: string | ResourceId | null): TagRel$l; relationshipToMany(...ids: string[]): TagRel$l[]; type(): TagType; } declare const instance$22: Tags; type VersionType = 'versions'; type VersionRel = ResourceRel & { type: VersionType; }; type VersionSort = Pick<Version, 'id'> & ResourceSort; interface Version extends Resource { readonly type: VersionType; /** * The type of the versioned resource. * @example ```"orders"``` */ resource_type?: string | null; /** * The versioned resource id. * @example ```"PzdJhdLdYV"``` */ resource_id?: string | null; /** * The event which generates the version. * @example ```"update"``` */ event?: string | null; /** * The object changes payload. * @example ```{"status":["draft","placed"]}``` */ changes?: Record<string, any> | null; /** * Information about who triggered the change. * @example ```{"application":{"id":"DNOPYiZYpn","kind":"sales_channel","public":true},"owner":{"id":"yQQrBhLBmQ","type":"Customer"}}``` */ who?: Record<string, any> | null; event_stores?: EventStore[] | null; } declare class Versions extends ApiResource<Version> { static readonly TYPE: VersionType; event_stores(versionId: string | Version, params?: QueryParamsList<EventStore>, options?: ResourcesConfig): Promise<ListResponse<EventStore>>; isVersion(resource: any): resource is Version; relationship(id: string | ResourceId | null): VersionRel; relationshipToMany(...ids: string[]): VersionRel[]; type(): VersionType; } declare const instance$21: Versions; type AdjustmentType = 'adjustments'; type AdjustmentRel$2 = ResourceRel & { type: AdjustmentType; }; type AdjustmentSort = Pick<Adjustment, 'id' | 'name' | 'currency_code' | 'amount_cents'> & ResourceSort; interface Adjustment extends Resource { readonly type: AdjustmentType; /** * The adjustment name. * @example ```"Additional service"``` */ name: string; /** * The international 3-letter currency code as defined by the ISO 4217 standard. * @example ```"EUR"``` */ currency_code: string; /** * The adjustment amount, in cents. * @example ```1500``` */ amount_cents: number; /** * The adjustment amount, float. * @example ```15``` */ amount_float: number; /** * The adjustment amount, formatted. * @example ```"€15,00"``` */ formatted_amount: string; /** * Indicates if negative adjustment amount is distributed for tax calculation. * @example ```true``` */ distribute_discount?: boolean | null; versions?: Version[] | null; event_stores?: EventStore[] | null; } interface AdjustmentCreate extends ResourceCreate { /** * The adjustment name. * @example ```"Additional service"``` */ name: string; /** * The international 3-letter currency code as defined by the ISO 4217 standard. * @example ```"EUR"``` */ currency_code: string; /** * The adjustment amount, in cents. * @example ```1500``` */ amount_cents: number; /** * Indicates if negative adjustment amount is distributed for tax calculation. * @example ```true``` */ distribute_discount?: boolean | null; } interface AdjustmentUpdate extends ResourceUpdate { /** * The adjustment name. * @example ```"Additional service"``` */ name?: string | null; /** * The international 3-letter currency code as defined by the ISO 4217 standard. * @example ```"EUR"``` */ currency_code?: string | null; /** * The adjustment amount, in cents. * @example ```1500``` */ amount_cents?: number | null; /** * Indicates if negative adjustment amount is distributed for tax calculation. * @example ```true``` */ distribute_discount?: boolean | null; } declare class Adjustments extends ApiResource<Adjustment> { static readonly TYPE: AdjustmentType; create(resource: AdjustmentCreate, params?: QueryParamsRetrieve<Adjustment>, options?: ResourcesConfig): Promise<Adjustment>; update(resource: AdjustmentUpdate, params?: QueryParamsRetrieve<Adjustment>, options?: ResourcesConfig): Promise<Adjustment>; delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>; versions(adjustmentId: string | Adjustment, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>; event_stores(adjustmentId: string | Adjustment, params?: QueryParamsList<EventStore>, options?: ResourcesConfig): Promise<ListResponse<EventStore>>; isAdjustment(resource: any): resource is Adjustment; relationship(id: string | ResourceId | null): AdjustmentRel$2; relationshipToMany(...ids: string[]): AdjustmentRel$2[]; type(): AdjustmentType; } declare const instance$20: Adjustments; type GeocoderType = 'geocoders'; type GeocoderRel$3 = ResourceRel & { type: GeocoderType; }; type GeocoderSort = Pick<Geocoder, 'id' | 'name'> & ResourceSort; interface Geocoder extends Resource { readonly type: GeocoderType; /** * The geocoder's internal name. * @example ```"Default geocoder"``` */ name: string; markets?: Market[] | null; addresses?: Address[] | null; attachments?: Attachment[] | null; event_stores?: EventStore[] | null; } declare class Geocoders extends ApiResource<Geocoder> { static readonly TYPE: GeocoderType; markets(geocoderId: string | Geocoder, params?: QueryParamsList<Market>, options?: ResourcesConfig): Promise<ListResponse<Market>>; addresses(geocoderId: string | Geocoder, params?: QueryParamsList<Address>, options?: ResourcesConfig): Promise<ListResponse<Address>>; attachments(geocoderId: string | Geocoder, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>>; event_stores(geocoderId: string | Geocoder, params?: QueryParamsList<EventStore>, options?: ResourcesConfig): Promise<ListResponse<EventStore>>; isGeocoder(resource: any): resource is Geocoder; relationship(id: string | ResourceId | null): GeocoderRel$3; relationshipToMany(...ids: string[]): GeocoderRel$3[]; type(): GeocoderType; } declare const instance$1$: Geocoders; type ShippingCategoryType = 'shipping_categories'; type ShippingCategoryRel$4 = ResourceRel & { type: ShippingCategoryType; }; type ShippingCategorySort = Pick<ShippingCategory, 'id' | 'name' | 'code'> & ResourceSort; interface ShippingCategory extends Resource { readonly type: ShippingCategoryType; /** * The shipping category name. * @example ```"Merchandise"``` */ name: string; /** * A string that you can use to identify the shipping category (must be unique within the environment). * @example ```"europe1"``` */ code?: string | null; skus?: Sku[] | null; attachments?: Attachment[] | null; versions?: Version[] | null; event_stores?: EventStore[] | null; } interface ShippingCategoryCreate extends ResourceCreate { /** * The shipping category name. * @example ```"Merchandise"``` */ name: string; /** * A string that you can use to identify the shipping category (must be unique within the environment). * @example ```"europe1"``` */ code?: string | null; } interface ShippingCategoryUpdate extends ResourceUpdate { /** * The shipping category name. * @example ```"Merchandise"``` */ name?: string | null; /** * A string that you can use to identify the shipping category (must be unique within the environment). * @example ```"europe1"``` */ code?: string | null; } declare class ShippingCategories extends ApiResource<ShippingCategory> { static readonly TYPE: ShippingCategoryType; create(resource: ShippingCategoryCreate, params?: QueryParamsRetrieve<ShippingCategory>, options?: ResourcesConfig): Promise<ShippingCategory>; update(resource: ShippingCategoryUpdate, params?: QueryParamsRetrieve<ShippingCategory>, options?: ResourcesConfig): Promise<ShippingCategory>; delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>; skus(shippingCategoryId: string | ShippingCategory, params?: QueryParamsList<Sku>, options?: ResourcesConfig): Promise<ListResponse<Sku>>; attachments(shippingCategoryId: string | ShippingCategory, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>>; versions(shippingCategoryId: string | ShippingCategory, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>; event_stores(shippingCategoryId: string | ShippingCategory, params?: QueryParamsList<EventStore>, options?: ResourcesConfig): Promise<ListResponse<EventStore>>; isShippingCategory(resource: any): resource is ShippingCategory; relationship(id: string | ResourceId | null): ShippingCategoryRel$4; relationshipToMany(...ids: string[]): ShippingCategoryRel$4[]; type(): ShippingCategoryType; } declare const instance$1_: ShippingCategories; type InventoryReturnLocationType = 'inventory_return_locations'; type InventoryReturnLocationRel = ResourceRel & { type: InventoryReturnLocationType; }; type StockLocationRel$a = ResourceRel & { type: StockLocationType; }; type InventoryModelRel$4 = ResourceRel & { type: InventoryModelType; }; type InventoryReturnLocationSort = Pick<InventoryReturnLocation, 'id' | 'priority'> & ResourceSort; interface InventoryReturnLocation extends Resource { readonly type: InventoryReturnLocationType; /** * The inventory return location priority within the associated invetory model. * @example ```1``` */ priority: number; stock_location?: StockLocation | null; inventory_model?: InventoryModel | null; versions?: Version[] | null; event_stores?: EventStore[] | null; } interface InventoryReturnLocationCreate extends ResourceCreate { /** * The inventory return location priority within the associated invetory model. * @example ```1``` */ priority: number; stock_location: StockLocationRel$a; inventory_model: InventoryModelRel$4; } interface InventoryReturnLocationUpdate extends ResourceUpdate { /** * The inventory return location priority within the associated invetory model. * @example ```1``` */ priority?: number | null; stock_location?: StockLocationRel$a | null; inventory_model?: InventoryModelRel$4 | null; } declare class InventoryReturnLocations extends ApiResource<InventoryReturnLocation> { static readonly TYPE: InventoryReturnLocationType; create(resource: InventoryReturnLocationCreate, params?: QueryParamsRetrieve<InventoryReturnLocation>, options?: ResourcesConfig): Promise<InventoryReturnLocation>; update(resource: InventoryReturnLocationUpdate, params?: QueryParamsRetrieve<InventoryReturnLocation>, options?: ResourcesConfig): Promise<InventoryReturnLocation>; delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>; stock_location(inventoryReturnLocationId: string | InventoryReturnLocation, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation>; inventory_model(inventoryReturnLocationId: string | InventoryReturnLocation, params?: QueryParamsRetrieve<InventoryModel>, options?: ResourcesConfig): Promise<InventoryModel>; versions(inventoryReturnLocationId: string | InventoryReturnLocation, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>; event_stores(inventoryReturnLocationId: string | InventoryReturnLocation, params?: QueryParamsList<EventStore>, options?: ResourcesConfig): Promise<ListResponse<EventStore>>; isInventoryReturnLocation(resource: any): resource is InventoryReturnLocation; relationship(id: string | ResourceId | null): InventoryReturnLocationRel; relationshipToMany(...ids: string[]): InventoryReturnLocationRel[]; type(): InventoryReturnLocationType; } declare const instance$1Z: InventoryReturnLocations; type InventoryModelType = 'inventory_models'; type InventoryModelRel$3 = ResourceRel & { type: InventoryModelType; }; type InventoryModelSort = Pick<InventoryModel, 'id' | 'name' | 'strategy' | 'stock_locations_cutoff' | 'stock_reservation_cutoff'> & ResourceSort; interface InventoryModel extends Resource { readonly type: InventoryModelType; /** * The inventory model's internal name. * @example ```"EU Inventory Model"``` */ name: string; /** * The inventory model's shipping strategy: one between 'no_split' (default), 'split_shipments', 'ship_from_primary' and 'ship_from_first_available_or_primary'. * @example ```"no_split"``` */ strategy?: string | null; /** * The maximum number of stock locations used for inventory computation. * @example ```3``` */ stock_locations_cutoff?: number | null; /** * The duration in seconds of the generated stock reservations. * @example ```3600``` */ stock_reservation_cutoff?: number | null; /** * Indicates if the the stock transfers must be put on hold automatically with the associated shipment. * @example ```true``` */ put_stock_transfers_on_hold?: boolean | null; /** * Indicates if the the stock will be decremented manually after the order approval. * @example ```true``` */ manual_stock_decrement?: boolean | null; inventory_stock_locations?: InventoryStockLocation[] | null; inventory_return_locations?: InventoryReturnLocation[] | null; attachments?: Attachment[] | null; versions?: Version[] | null; event_stores?: EventStore[] | null; } interface InventoryModelCreate extends ResourceCreate { /** * The inventory model's internal name. * @example ```"EU Inventory Model"``` */ name: string; /** * The inventory model's shipping strategy: one between 'no_split' (default), 'split_shipments', 'ship_from_primary' and 'ship_from_first_available_or_primary'. * @example ```"no_split"``` */ strategy?: string | null; /** * The maximum number of stock locations used for inventory computation. * @example ```3``` */ stock_locations_cutoff?: number | null; /** * The duration in seconds of the generated stock reservations. * @example ```3600``` */ stock_reservation_cutoff?: number | null; /** * Indicates if the the stock transfers must be put on hold automatically with the associated shipment. * @example ```true``` */ put_stock_transfers_on_hold?: boolean | null; /** * Indicates if the the stock will be decremented manually after the order approval. * @example ```true``` */ manual_stock_decrement?: boolean | null; } interface InventoryModelUpdate extends ResourceUpdate { /** * The inventory model's internal name. * @example ```"EU Inventory Model"``` */ name?: string | null; /** * The inventory model's shipping strategy: one between 'no_split' (default), 'split_shipments', 'ship_from_primary' and 'ship_from_first_available_or_primary'. * @example ```"no_split"``` */ strategy?: string | null; /** * The maximum number of stock locations used for inventory computation. * @example ```3``` */ stock_locations_cutoff?: number | null; /** * The duration in seconds of the generated stock reservations. * @example ```3600``` */ stock_reservation_cutoff?: number | null; /** * Indicates if the the stock transfers must be put on hold automatically with the associated shipment. * @example ```true``` */ put_stock_transfers_on_hold?: boolean | null; /** * Indicates if the the stock will be decremented manually after the order approval. * @example ```true``` */ manual_stock_decrement?: boolean | null; } declare class InventoryModels extends ApiResource<InventoryModel> { static readonly TYPE: InventoryModelType; create(resource: InventoryModelCreate, params?: QueryParamsRetrieve<InventoryModel>, options?: ResourcesConfig): Promise<InventoryModel>; update(resource: InventoryModelUpdate, params?: QueryParamsRetrieve<InventoryModel>, options?: ResourcesConfig): Promise<InventoryModel>; delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>; inventory_stock_locations(inventoryModelId: string | InventoryModel, params?: QueryParamsList<InventoryStockLocation>, options?: ResourcesConfig): Promise<ListResponse<InventoryStockLocation>>; inventory_return_locations(inventoryModelId: string | InventoryModel, params?: QueryParamsList<InventoryReturnLocation>, options?: ResourcesConfig): Promise<ListResponse<InventoryReturnLocation>>; attachments(inventoryModelId: string | InventoryModel, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>>; versions(inventoryModelId: string | InventoryModel, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>; event_stores(inventoryModelId: string | InventoryModel, params?: QueryParamsList<EventStore>, options?: ResourcesConfig): Promise<ListResponse<EventStore>>; isInventoryModel(resource: any): resource is InventoryModel; relationship(id: string | ResourceId | null): InventoryModelRel$3; relationshipToMany(...ids: string[]): InventoryModelRel$3[]; type(): InventoryModelType; } declare const instance$1Y: InventoryModels; type InventoryStockLocationType = 'inventory_stock_locations'; type InventoryStockLocationRel$1 = ResourceRel & { type: InventoryStockLocationType; }; type StockLocationRel$9 = ResourceRel & { type: StockLocationType; }; type InventoryModelRel$2 = ResourceRel & { type: InventoryModelType; }; type InventoryStockLocationSort = Pick<InventoryStockLocation, 'id' | 'priority' | 'on_hold'> & ResourceSort; interface InventoryStockLocation extends Resource { readonly type: InventoryStockLocationType; /** * The stock location priority within the associated invetory model. * @example ```1``` */ priority: number; /** * Indicates if the shipment should be put on hold if fulfilled from the associated stock location. This is useful to manage use cases like back-orders, pre-orders or personalized orders that need to be customized before being fulfilled. */ on_hold?: boolean | null; stock_location?: StockLocation | null; inventory_model?: InventoryModel | null; versions?: Version[] | null; event_stores?: EventStore[] | null; } interface InventoryStockLocationCreate extends ResourceCreate { /** * The stock location priority within the associated invetory model. * @example ```1``` */ priority: number; /** * Indicates if the shipment should be put on hold if fulfilled from the associated stock location. This is useful to manage use cases like back-orders, pre-orders or personalized orders that need to be customized before being fulfilled. */ on_hold?: boolean | null; stock_location: StockLocationRel$9; inventory_model: InventoryModelRel$2; } interface InventoryStockLocationUpdate extends ResourceUpdate { /** * The stock location priority within the associated invetory model. * @example ```1``` */ priority?: number | null; /** * Indicates if the shipment should be put on hold if fulfilled from the associated stock location. This is useful to manage use cases like back-orders, pre-orders or personalized orders that need to be customized before being fulfilled. */ on_hold?: boolean | null; stock_location?: StockLocationRel$9 | null; inventory_model?: InventoryModelRel$2 | null; } declare class InventoryStockLocations extends ApiResource<InventoryStockLocation> { static readonly TYPE: InventoryStockLocationType; create(resource: InventoryStockLocationCreate, params?: QueryParamsRetrieve<InventoryStockLocation>, options?: ResourcesConfig): Promise<InventoryStockLocation>; update(resource: InventoryStockLocationUpdate, params?: QueryParamsRetrieve<InventoryStockLocation>, options?: ResourcesConfig): Promise<InventoryStockLocation>; delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>; stock_location(inventoryStockLocationId: string | InventoryStockLocation, params?: QueryParamsRetrieve<StockLocation>, options?: ResourcesConfig): Promise<StockLocation>; inventory_model(inventoryStockLocationId: string | InventoryStockLocation, params?: QueryParamsRetrieve<InventoryModel>, options?: ResourcesConfig): Promise<InventoryModel>; versions(inventoryStockLocationId: string | InventoryStockLocation, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>; event_stores(inventoryStockLocationId: string | InventoryStockLocation, params?: QueryParamsList<EventStore>, options?: ResourcesConfig): Promise<ListResponse<EventStore>>; isInventoryStockLocation(resource: any): resource is InventoryStockLocation; relationship(id: string | ResourceId | null): InventoryStockLocationRel$1; relationshipToMany(...ids: string[]): InventoryStockLocationRel$1[]; type(): InventoryStockLocationType; } declare const instance$1X: InventoryStockLocations; type CustomerGroupType = 'customer_groups'; type CustomerGroupRel$3 = ResourceRel & { type: CustomerGroupType; }; type CustomerGroupSort = Pick<CustomerGroup, 'id' | 'name' | 'code'> & ResourceSort; interface CustomerGroup extends Resource { readonly type: CustomerGroupType; /** * The customer group's internal name. * @example ```"VIP"``` */ name: string; /** * A string that you can use to identify the customer group (must be unique within the environment). * @example ```"vip1"``` */ code?: string | null; customers?: Customer[] | null; markets?: Market[] | null; attachments?: Attachment[] | null; versions?: Version[] | null; event_stores?: EventStore[] | null; } interface CustomerGroupCreate extends ResourceCreate { /** * The customer group's internal name. * @example ```"VIP"``` */ name: string; /** * A string that you can use to identify the customer group (must be unique within the environment). * @example ```"vip1"``` */ code?: string | null; } interface CustomerGroupUpdate extends ResourceUpdate { /** * The customer group's internal name. * @example ```"VIP"``` */ name?: string | null; /** * A string that you can use to identify the customer group (must be unique within the environment). * @example ```"vip1"``` */ code?: string | null; } declare class CustomerGroups extends ApiResource<CustomerGroup> { static readonly TYPE: CustomerGroupType; create(resource: CustomerGroupCreate, params?: QueryParamsRetrieve<CustomerGroup>, options?: ResourcesConfig): Promise<CustomerGroup>; update(resource: CustomerGroupUpdate, params?: QueryParamsRetrieve<CustomerGroup>, options?: ResourcesConfig): Promise<CustomerGroup>; delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>; customers(customerGroupId: string | CustomerGroup, params?: QueryParamsList<Customer>, options?: ResourcesConfig): Promise<ListResponse<Customer>>; markets(customerGroupId: string | CustomerGroup, params?: QueryParamsList<Market>, options?: ResourcesConfig): Promise<ListResponse<Market>>; attachments(customerGroupId: string | CustomerGroup, params?: QueryParamsList<Attachment>, options?: ResourcesConfig): Promise<ListResponse<Attachment>>; versions(customerGroupId: string | CustomerGroup, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>; event_stores(customerGroupId: string | CustomerGroup, params?: QueryParamsList<EventStore>, options?: ResourcesConfig): Promise<ListResponse<EventStore>>; isCustomerGroup(resource: any): resource is CustomerGroup; relationship(id: string | ResourceId | null): CustomerGroupRel$3; relationshipToMany(...ids: string[]): CustomerGroupRel$3[]; type(): CustomerGroupType; } declare const instance$1W: CustomerGroups; type EventCallbackType = 'event_callbacks'; type EventCallbackRel = ResourceRel & { type: EventCallbackType; }; type EventCallbackSort = Pick<EventCallback, 'id' | 'response_code' | 'response_message'> & ResourceSort; interface EventCallback extends Resource { readonly type: EventCallbackType; /** * The URI of the callback, inherited by the associated webhook. * @example ```"https://yourapp.com/webhooks"``` */ callback_url: string; /** * The payload sent to the callback endpoint, including the event affected resource and the specified includes. * @example ```{"data":{"attributes":{"id":"PYWehaoXJj","type":"orders"}}}``` */ payload?: Record<string, any> | null; /** * The HTTP response code of the callback endpoint. * @example ```"200"``` */ response_code?: string | null; /** * The HTTP response message of the callback endpoint. * @example ```"OK"``` */ response_message?: string | null; webhook?: Webhook | null; event_stores?: EventStore[] | null; } declare class EventCallbacks extends ApiResource<EventCallback> { static readonly TYPE: EventCallbackType; webhook(eventCallbackId: string | EventCallback, params?: QueryParamsRetrieve<Webhook>, options?: ResourcesConfig): Promise<Webhook>; event_stores(eventCallbackId: string | EventCallback, params?: QueryParamsList<EventStore>, options?: ResourcesConfig): Promise<ListResponse<EventStore>>; isEventCallback(resource: any): resource is EventCallback; relationship(id: string | ResourceId | null): EventCallbackRel; relationshipToMany(...ids: string[]): EventCallbackRel[]; type(): EventCallbackType; } declare const instance$1V: EventCallbacks; type WebhookType = 'webhooks'; type WebhookRel = ResourceRel & { type: WebhookType; }; type WebhookSort = Pick<Webhook, 'id' | 'disabled_at' | 'circuit_state' | 'circuit_failure_count'> & ResourceSort; interface Webhook extends Resource { readonly type: WebhookType; /** * Unique name for the webhook. * @example ```"myorg-orders.place"``` */ name?: string | null; /** * The identifier of the resource/event that will trigger the webhook. * @example ```"orders.place"``` */ topic: string; /** * URI where the webhook subscription should send the POST request when the event occurs. * @example ```"https://yourapp.com/webhooks"``` */ callback_url: string; /** * List of related resources that should be included in the webhook body. * @example ```["customer","shipping_address","billing_address"]``` */ include_resources?: string[] | null; /** * Time at which this resource was disabled. * @example ```"2018-01-01T12:00:00.000Z"``` */ disabled_at?: string | null; /** * The circuit breaker state, by default it is 'closed'. It can become 'open' once the number of consecutive failures overlaps the specified threshold, in such case no further calls to the failing callback are made. * @example ```"closed"``` */ circuit_state?: string | null; /** * The number of consecutive failures recorded by the circuit breaker associated to this resource, will be reset on first successful call to callback. * @example ```5``` */ circuit_failure_count?: number | null; /** * The shared secret used to sign the external request payload. * @example ```"1c0994cc4e996e8c6ee56a2198f66f3c"``` */ shared_secret: string; last_event_callbacks?: EventCallback[] | null; versions?: Version[] | null; event_stores?: EventStore[] | null; } interface WebhookCreate extends ResourceCreate { /** * Unique name for the webhook. * @example ```"myorg-orders.place"``` */ name?: string | null; /** * The identifier of the resource/event that will trigger the webhook. * @example ```"orders.place"``` */ topic: string; /** * URI where the webhook subscription should send the POST request when the event occurs. * @example ```"https://yourapp.com/webhooks"``` */ callback_url: string; /** * List of related resources that should be included in the webhook body. * @example ```["customer","shipping_address","billing_address"]``` */ include_resources?: string[] | null; /** * Send this attribute if you want to mark this resource as disabled. * @example ```true``` */ _disable?: boolean | null; /** * Send this attribute if you want to mark this resource as enabled. * @example ```true``` */ _enable?: boolean | null; } interface WebhookUpdate extends ResourceUpdate { /** * Unique name for the webhook. * @example ```"myorg-orders.place"``` */ name?: string | null; /** * The identifier of the resource/event that will trigger the webhook. * @example ```"orders.place"``` */ topic?: string | null; /** * URI where the webhook subscription should send the POST request when the event occurs. * @example ```"https://yourapp.com/webhooks"``` */ callback_url?: string | null; /** * List of related resources that should be included in the webhook body. * @example ```["customer","shipping_address","billing_address"]``` */ include_resources?: string[] | null; /** * Send this attribute if you want to mark this resource as disabled. * @example ```true``` */ _disable?: boolean | null; /** * Send this attribute if you want to mark this resource as enabled. * @example ```true``` */ _enable?: boolean | null; /** * Send this attribute if you want to reset the circuit breaker associated to this resource to 'closed' state and zero failures count. Cannot be passed by sales channels. * @example ```true``` */ _reset_circuit?: boolean | null; } declare class Webhooks extends ApiResource<Webhook> { static readonly TYPE: WebhookType; create(resource: WebhookCreate, params?: QueryParamsRetrieve<Webhook>, options?: ResourcesConfig): Promise<Webhook>; update(resource: WebhookUpdate, params?: QueryParamsRetrieve<Webhook>, options?: ResourcesConfig): Promise<Webhook>; delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>; last_event_callbacks(webhookId: string | Webhook, params?: QueryParamsList<EventCallback>, options?: ResourcesConfig): Promise<ListResponse<EventCallback>>; versions(webhookId: string | Webhook, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>; event_stores(webhookId: string | Webhook, params?: QueryParamsList<EventStore>, options?: ResourcesConfig): Promise<ListResponse<EventStore>>; _disable(id: string | Webhook, params?: QueryParamsRetrieve<Webhook>, options?: ResourcesConfig): Promise<Webhook>; _enable(id: string | Webhook, params?: QueryParamsRetrieve<Webhook>, options?: ResourcesConfig): Promise<Webhook>; _reset_circuit(id: string | Webhook, params?: QueryParamsRetrieve<Webhook>, options?: ResourcesConfig): Promise<Webhook>; isWebhook(resource: any): resource is Webhook; relationship(id: string | ResourceId | null): WebhookRel; relationshipToMany(...ids: string[]): WebhookRel[]; type(): WebhookType; } declare const instance$1U: Webhooks; type EventType = 'events'; type EventRel = ResourceRel & { type: EventType; }; type EventSort = Pick<Event, 'id' | 'name'> & ResourceSort; interface Event extends Resource { readonly type: EventType; /** * The event's internal name. * @example ```"orders.create"``` */ name: string; webhooks?: Webhook[] | null; last_event_callbacks?: EventCallback[] | null; event_stores?: EventStore[] | null; } interface EventUpdate extends ResourceUpdate { /** * Send this attribute if you want to force webhooks execution for this event. Cannot be passed by sales channels. * @example ```true``` */ _trigger?: boolean | null; } declare class Events extends ApiResource<Event> { static readonly TYPE: EventType; update(resource: EventUpdate, params?: QueryParamsRetrieve<Event>, options?: ResourcesConfig): Promise<Event>; webhooks(eventId: string | Event, params?: QueryParamsList<Webhook>, options?: ResourcesConfig): Promise<ListResponse<Webhook>>; last_event_callbacks(eventId: string | Event, params?: QueryParamsList<EventCallback>, options?: ResourcesConfig): Promise<ListResponse<EventCallback>>; event_stores(eventId: string | Event, params?: QueryParamsList<EventStore>, options?: ResourcesConfig): Promise<ListResponse<EventStore>>; _trigger(id: string | Event, params?: QueryParamsRetrieve<Event>, options?: ResourcesConfig): Promise<Event>; isEvent(resource: any): resource is Event; relationship(id: string | ResourceId | null): EventRel; relationshipToMany(...ids: string[]): EventRel[]; type(): EventType; } declare const instance$1T: Events; type CustomerAddressType = 'customer_addresses'; type CustomerAddressRel = ResourceRel & { type: CustomerAddressType; }; type CustomerRel$8 = ResourceRel & { type: CustomerType; }; type AddressRel$5 = ResourceRel & { type: AddressType; }; type CustomerAddressSort = Pick<CustomerAddress, 'id'> & ResourceSort; interface CustomerAddress extends Resource { readonly type: CustomerAddressType; /** * Returns the associated address' name. * @example ```"John Smith, 2883 Geraldine Lane Apt.23, 10013 New York NY (US) (212) 646-338-1228"``` */ name?: string | null; /** * The email of the customer associated to the address. * @example ```"john@example.com"``` */ customer_email: string; customer?: Customer | null; address?: Address | null; events?: Event[] | null; versions?: Version[] | null; event_stores?: EventStore[] | null; } interface CustomerAddressCreate extends ResourceCreate { /** * The email of the customer associated to the address. * @example ```"john@example.com"``` */ customer_email: string; customer: CustomerRel$8; address: AddressRel$5; } interface CustomerAddressUpdate extends ResourceUpdate { customer?: CustomerRel$8 | null; address?: AddressRel$5 | null; } declare class CustomerAddresses extends ApiResource<CustomerAddress> { static readonly TYPE: CustomerAddressType; create(resource: CustomerAddressCreate, params?: QueryParamsRetrieve<CustomerAddress>, options?: ResourcesConfig): Promise<CustomerAddress>; update(resource: CustomerAddressUpdate, params?: QueryParamsRetrieve<CustomerAddress>, options?: ResourcesConfig): Promise<CustomerAddress>; delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>; customer(customerAddressId: string | CustomerAddress, params?: QueryParamsRetrieve<Customer>, options?: ResourcesConfig): Promise<Customer>; address(customerAddressId: string | CustomerAddress, params?: QueryParamsRetrieve<Address>, options?: ResourcesConfig): Promise<Address>; events(customerAddressId: string | CustomerAddress, params?: QueryParamsList<Event>, options?: ResourcesConfig): Promise<ListResponse<Event>>; versions(customerAddressId: string | CustomerAddress, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>; event_stores(customerAddressId: string | CustomerAddress, params?: QueryParamsList<EventStore>, options?: ResourcesConfig): Promise<ListResponse<EventStore>>; isCustomerAddress(resource: any): resource is CustomerAddress; relationship(id: string | ResourceId | null): CustomerAddressRel; relationshipToMany(...ids: string[]): CustomerAddressRel[]; type(): CustomerAddressType; } declare const instance$1S: CustomerAddresses; type PaymentGatewayType = 'payment_gateways'; type PaymentGatewayRel$1 = ResourceRel & { type: PaymentGatewayType; }; type PaymentGatewaySort = Pick<PaymentGateway, 'id' | 'name'> & ResourceSort; interface PaymentGateway extends Resource { readonly type: PaymentGatewayType; /** * The payment gateway's internal name. * @example ```"US payment gateway"``` */ name: string; payment_methods?: PaymentMethod[] | null; versions?: Version[] | null; event_stores?: EventStore[] | null; } declare class PaymentGateways extends ApiResource<PaymentGateway> { static readonly TYPE: PaymentGatewayType; payment_methods(paymentGatewayId: string | PaymentGateway, params?: QueryParamsList<PaymentMethod>, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>; versions(paymentGatewayId: string | PaymentGateway, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>; event_stores(paymentGatewayId: string | PaymentGateway, params?: QueryParamsList<EventStore>, options?: ResourcesConfig): Promise<ListResponse<EventStore>>; isPaymentGateway(resource: any): resource is PaymentGateway; relationship(id: string | ResourceId | null): PaymentGatewayRel$1; relationshipToMany(...ids: string[]): PaymentGatewayRel$1[]; type(): PaymentGatewayType; } declare const instance$1R: PaymentGateways; type AdyenPaymentType = 'adyen_payments'; type AdyenPaymentRel$3 = ResourceRel & { type: AdyenPaymentType; }; type OrderRel$k = ResourceRel & { type: OrderType; }; type AdyenPaymentSort = Pick<AdyenPayment, 'id'> & ResourceSort; interface AdyenPayment extends Resource { readonly type: AdyenPaymentType; /** * The public key linked to your API credential. * @example ```"xxxx-yyyy-zzzz"``` */ public_key?: string | null; /** * The merchant available payment methods for the assoiated order (i.e. country and amount). Required by the Adyen JS SDK. * @example ```{"foo":"bar"}``` */ payment_methods: Record<string, any>; /** * The Adyen payment request data, collected by client. * @example ```{"foo":"bar"}``` */ payment_request_data?: Record<string, any> | null; /** * The Adyen additional details request data, collected by client. * @example ```{"foo":"bar"}``` */ payment_request_details?: Record<string, any> | null; /** * The Adyen payment response, used by client (includes 'resultCode' and 'action'). * @example ```{"foo":"bar"}``` */ payment_response?: Record<string, any> | null; /** * Indicates if the order current amount differs form the one of the associated authorization. */ mismatched_amounts?: boolean | null; /** * The balance remaining on a shopper's gift card, must be computed by using its related trigger attribute. * @example ```1000``` */ balance?: number | null; /** * Information about the payment instrument used in the transaction. * @example ```{"issuer":"cl bank","card_type":"visa"}``` */ payment_instrument?: Record<string, any> | null; order?: Order | null; payment_gateway?: PaymentGateway | null; versions?: Version[] | null; event_stores?: EventStore[] | null; } interface AdyenPaymentCreate extends ResourceCreate { order: OrderRel$k; } interface AdyenPaymentUpdate extends ResourceUpdate { /** * The Adyen payment request data, collected by client. * @example ```{"foo":"bar"}``` */ payment_request_data?: Record<string, any> | null; /** * The Adyen additional details request data, collected by client. * @example ```{"foo":"bar"}``` */ payment_request_details?: Record<string, any> | null; /** * Send this attribute if you want to authorize the payment. * @example ```true``` */ _authorize?: boolean | null; /** * Send this attribute if you want to send additional details the payment request. * @example ```true``` */ _details?: boolean | null; /** * Send this attribute if you want retrieve the balance remaining on a shopper's gift card. * @example ```true``` */ _balance?: boolean | null; order?: OrderRel$k | null; } declare class AdyenPayments extends ApiResource<AdyenPayment> { static readonly TYPE: AdyenPaymentType; create(resource: AdyenPaymentCreate, params?: QueryParamsRetrieve<AdyenPayment>, options?: ResourcesConfig): Promise<AdyenPayment>; update(resource: AdyenPaymentUpdate, params?: QueryParamsRetrieve<AdyenPayment>, options?: ResourcesConfig): Promise<AdyenPayment>; delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>; order(adyenPaymentId: string | AdyenPayment, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order>; payment_gateway(adyenPaymentId: string | AdyenPayment, params?: QueryParamsRetrieve<PaymentGateway>, options?: ResourcesConfig): Promise<PaymentGateway>; versions(adyenPaymentId: string | AdyenPayment, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>; event_stores(adyenPaymentId: string | AdyenPayment, params?: QueryParamsList<EventStore>, options?: ResourcesConfig): Promise<ListResponse<EventStore>>; _authorize(id: string | AdyenPayment, params?: QueryParamsRetrieve<AdyenPayment>, options?: ResourcesConfig): Promise<AdyenPayment>; _details(id: string | AdyenPayment, params?: QueryParamsRetrieve<AdyenPayment>, options?: ResourcesConfig): Promise<AdyenPayment>; _balance(id: string | AdyenPayment, params?: QueryParamsRetrieve<AdyenPayment>, options?: ResourcesConfig): Promise<AdyenPayment>; isAdyenPayment(resource: any): resource is AdyenPayment; relationship(id: string | ResourceId | null): AdyenPaymentRel$3; relationshipToMany(...ids: string[]): AdyenPaymentRel$3[]; type(): AdyenPaymentType; } declare const instance$1Q: AdyenPayments; type AxervePaymentType = 'axerve_payments'; type AxervePaymentRel$3 = ResourceRel & { type: AxervePaymentType; }; type OrderRel$j = ResourceRel & { type: OrderType; }; type AxervePaymentSort = Pick<AxervePayment, 'id'> & ResourceSort; interface AxervePayment extends Resource { readonly type: AxervePaymentType; /** * The merchant login code. * @example ```"xxxx-yyyy-zzzz"``` */ login: string; /** * The URL where the payer is redirected after they approve the payment. * @example ```"https://yourdomain.com/thankyou"``` */ return_url: string; /** * The Axerve payment request data, collected by client. * @example ```{"foo":"bar"}``` */ payment_request_data?: Record<string, any> | null; /** * The IP adress of the client creating the payment. * @example ```"213.45.120.5"``` */ client_ip?: string | null; /** * The details of the buyer creating the payment. * @example ```{"cardHolder":{"email":"george.harrison@gmail.com"},"shippingAddress":{"firstName":"George"}}``` */ buyer_details?: Record<string, any> | null; /** * Requires the creation of a token to represent this payment, mandatory to use customer's wallet and order subscriptions. * @example ```true``` */ request_token?: boolean | null; /** * Indicates if the order current amount differs form the one of the associated authorization. */ mismatched_amounts?: boolean | null; /** * Information about the payment instrument used in the transaction. * @example ```{"issuer":"cl bank","card_type":"visa"}``` */ payment_instrument?: Record<string, any> | null; order?: Order | null; payment_gateway?: PaymentGateway | null; versions?: Version[] | null; event_stores?: EventStore[] | null; } interface AxervePaymentCreate extends ResourceCreate { /** * The URL where the payer is redirected after they approve the payment. * @example ```"https://yourdomain.com/thankyou"``` */ return_url: string; /** * The IP adress of the client creating the payment. * @example ```"213.45.120.5"``` */ client_ip?: string | null; /** * The details of the buyer creating the payment. * @example ```{"cardHolder":{"email":"george.harrison@gmail.com"},"shippingAddress":{"firstName":"George"}}``` */ buyer_details?: Record<string, any> | null; /** * Requires the creation of a token to represent this payment, mandatory to use customer's wallet and order subscriptions. * @example ```true``` */ request_token?: boolean | null; order: OrderRel$j; } interface AxervePaymentUpdate extends ResourceUpdate { /** * The Axerve payment request data, collected by client. * @example ```{"foo":"bar"}``` */ payment_request_data?: Record<string, any> | null; /** * Send this attribute if you want to update the payment with fresh order data. * @example ```true``` */ _update?: boolean | null; order?: OrderRel$j | null; } declare class AxervePayments extends ApiResource<AxervePayment> { static readonly TYPE: AxervePaymentType; create(resource: AxervePaymentCreate, params?: QueryParamsRetrieve<AxervePayment>, options?: ResourcesConfig): Promise<AxervePayment>; update(resource: AxervePaymentUpdate, params?: QueryParamsRetrieve<AxervePayment>, options?: ResourcesConfig): Promise<AxervePayment>; delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>; order(axervePaymentId: string | AxervePayment, params?: QueryParamsRetrieve<Order>, options?: ResourcesConfig): Promise<Order>; payment_gateway(axervePaymentId: string | AxervePayment, params?: QueryParamsRetrieve<PaymentGateway>, options?: ResourcesConfig): Promise<PaymentGateway>; versions(axervePaymentId: string | AxervePayment, params?: QueryParamsList<Version>, options?: ResourcesConfig): Promise<ListResponse<Version>>; event_stores(axervePaymentId: string | AxervePayment, params?: QueryParamsList<EventStore>, options?: ResourcesConfig): Promise<ListResponse<EventStore>>; _update(id: string | AxervePayment, params?: QueryParamsRetrieve<AxervePayment>, options?: ResourcesConfig): Promise<AxervePayment>; isAxervePayment(resource: any): resource is AxervePayment; relationship(id: string | ResourceId | null): AxervePaymentRel$3; relationshipToMany(...ids: string[]): AxervePaymentRel$3[]; type(): AxervePaymentType; } declare const instance$1P: AxervePayments; type BraintreePaymentType = 'braintree_payments'; type BraintreePaymentRel$3 = ResourceRel & { type: BraintreePaymentType; }; type OrderRel$i = ResourceRel & { type: OrderType; }; type BraintreePaymentSort = Pick<BraintreePayment, 'id'> & ResourceSort; interfa