export interface ShippoConfiguration { /** * ShippoConfiguration ID. * @readonly */ _id?: string | null; /** @readonly */ revision?: string | null; /** * Date and time the ShippoConfiguration was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the ShippoConfiguration was last updated. * @readonly */ _updatedDate?: Date | null; /** Associated delivery region ID. */ deliveryRegionId?: string | null; /** Settings of USPS domestic services. */ domesticServices?: DomesticServiceSettings[]; /** Settings of USPS international services. */ internationalServices?: InternationalServiceSettings[]; /** Package type. */ packageType?: PackageType; /** Package details. */ packageDetails?: PackageDetails; /** Location ID from OS location service. */ osLocationId?: string | null; /** * Ship from address materialized from OS location. * @readonly */ shipFromAddress?: Address; /** Backup weight. */ backupWeight?: string | null; /** Data extensions. */ extendedFields?: ExtendedFields; } export interface DomesticServiceSettings { /** USPS domestic service. */ service?: DomesticService; /** Service settings. */ serviceSettings?: ServiceSettings; } export declare enum DomesticService { UNKNOWN_DOMESTIC_SERVICE = "UNKNOWN_DOMESTIC_SERVICE", GROUND_ADVANTAGE = "GROUND_ADVANTAGE", PRIORITY_MAIL = "PRIORITY_MAIL", PRIORITY_MAIL_EXPRESS = "PRIORITY_MAIL_EXPRESS" } export interface ServiceSettings { /** Estimated delivery time. */ estimatedDeliveryTime?: string | null; /** Handling fee. */ handlingFee?: HandlingFee; /** Amount above which free delivery is offered. */ freeDeliveryMinimumAmount?: string | null; } export interface HandlingFee { /** Value that will be used to calculate the fee. For example, percentage fee with value 5% to calculate the fee. */ value?: string; /** How to calculate the fee: fixed amount or by percentage. */ calculationType?: CalculationType; } export declare enum CalculationType { UNKNOWN_TYPE = "UNKNOWN_TYPE", FIXED = "FIXED", PERCENTAGE = "PERCENTAGE" } export interface InternationalServiceSettings { /** USPS international service. */ service?: InternationalService; /** Service settings. */ serviceSettings?: ServiceSettings; } export declare enum InternationalService { UNKNOWN_INTERNATIONAL_SERVICE = "UNKNOWN_INTERNATIONAL_SERVICE", FIRST_CLASS_PACKAGE_INTERNATIONAL = "FIRST_CLASS_PACKAGE_INTERNATIONAL", PRIORITY_MAIL_INTERNATIONAL = "PRIORITY_MAIL_INTERNATIONAL", PRIORITY_MAIL_EXPRESS_INTERNATIONAL = "PRIORITY_MAIL_EXPRESS_INTERNATIONAL" } export declare enum PackageType { UNKNOWN_PACKAGE_TYPE = "UNKNOWN_PACKAGE_TYPE", CUSTOM = "CUSTOM", FLAT_RATE_ENVELOPE = "FLAT_RATE_ENVELOPE", PADDED_FLAT_RATE_ENVELOPE = "PADDED_FLAT_RATE_ENVELOPE", SMALL_FLAT_RATE_BOX = "SMALL_FLAT_RATE_BOX", MEDIUM_FLAT_RATE_BOX_1 = "MEDIUM_FLAT_RATE_BOX_1", MEDIUM_FLAT_RATE_BOX_2 = "MEDIUM_FLAT_RATE_BOX_2", LARGE_FLAT_RATE_BOX = "LARGE_FLAT_RATE_BOX" } export interface PackageDetails { /** * Package name. Must be set when package type is CUSTOM. * For other package types, it is read-only, and an exception will be thrown * if it set when creating a ShippoConfiguration. */ name?: string | null; /** * Package dimensions. Can only be set when package type is CUSTOM. * For other package types, it is read-only, and an exception will be thrown * if it set when creating a ShippoConfiguration. */ dimensions?: PackageDimensions; /** * Maximum number of products. Must be set when package type is NOT CUSTOM. * Otherwise, if the package type is CUSTOM, this field cannot be set and an * exception will be thrown if it is set when creating a ShippoConfiguration. */ maxNumberOfProducts?: string | null; } export interface PackageDimensions { /** Package length. */ length?: string; /** Package width. */ width?: string; /** Package height. */ height?: string; } /** Physical address */ export interface Address { /** Two-letter country code in [ISO-3166 alpha-2](https://www.iso.org/obp/ui/#search/code/) format. */ country?: string | null; /** Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://www.iso.org/standard/72483.html) format. */ subdivision?: string | null; /** City name. */ city?: string | null; /** Postal or zip code. */ postalCode?: string | null; /** Street address. */ streetAddress?: StreetAddress; /** Main address line (usually street name and number). */ addressLine1?: string | null; /** Free text providing more detailed address info. Usually contains apt, suite, floor. */ addressLine2?: string | null; /** * Country's full name. * @readonly */ countryFullname?: string | null; /** * Subdivision full-name. * @readonly */ subdivisionFullname?: string | null; } export interface StreetAddress { /** Street number. */ number?: string; /** Street name. */ name?: string; } export interface AddressLocation { /** Address latitude. */ latitude?: number | null; /** Address longitude. */ longitude?: number | null; } export interface ExtendedFields { /** * Extended field data. Each key corresponds to the namespace of the app that created the extended fields. * The value of each key is structured according to the schema defined when the extended fields were configured. * * You can only access fields for which you have the appropriate permissions. * * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields). */ namespaces?: Record>; } export interface CreateShippoConfigurationRequest { /** ShippoConfiguration to be created. */ shippoConfiguration: ShippoConfiguration; backupRate?: string | null; } export interface CreateShippoConfigurationResponse { /** The created ShippoConfiguration. */ shippoConfiguration?: ShippoConfiguration; } export interface GetShippoConfigurationRequest { /** ID of the ShippoConfiguration to retrieve. */ shippoConfigurationId: string; } export interface GetShippoConfigurationResponse { /** The requested ShippoConfiguration. */ shippoConfiguration?: ShippoConfiguration; } export interface UpdateShippoConfigurationRequest { /** ShippoConfiguration to be updated, may be partial. */ shippoConfiguration: ShippoConfiguration; } export interface UpdateShippoConfigurationResponse { /** Updated ShippoConfiguration. */ shippoConfiguration?: ShippoConfiguration; } export interface DeleteShippoConfigurationRequest { /** ID of the ShippoConfiguration to delete. */ shippoConfigurationId: string; } export interface DeleteShippoConfigurationResponse { } export interface QueryShippoConfigurationsRequest { /** WQL expression. */ query?: CursorQuery; } export interface CursorQuery extends CursorQueryPagingMethodOneOf { /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; /** * Filter object in the following format: * `"filter" : { * "fieldName1": "value1", * "fieldName2":{"$operator":"value2"} * }` * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` */ filter?: Record | null; /** * Sort object in the following format: * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` */ sort?: Sorting[]; } /** @oneof */ export interface CursorQueryPagingMethodOneOf { /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; } export interface Sorting { /** Name of the field to sort by. */ fieldName?: string; /** Sort order. */ order?: SortOrder; } export declare enum SortOrder { ASC = "ASC", DESC = "DESC" } export interface CursorPaging { /** Maximum number of items to return in the results. */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. * Not relevant for the first request. */ cursor?: string | null; } export interface QueryShippoConfigurationsResponse { /** List of ShippoConfigurations. */ shippoConfigurations?: ShippoConfiguration[]; /** Paging metadata. */ pagingMetadata?: CursorPagingMetadata; } export interface CursorPagingMetadata { /** Number of items returned in the response. */ count?: number | null; /** Cursor strings that point to the next page, previous page, or both. */ cursors?: Cursors; /** * Whether there are more pages to retrieve following the current page. * * + `true`: Another page of results can be retrieved. * + `false`: This is the last page. */ hasNext?: boolean | null; } export interface Cursors { /** Cursor string pointing to the next page in the list of results. */ next?: string | null; /** Cursor pointing to the previous page in the list of results. */ prev?: string | null; } export interface UpdateExtendedFieldsRequest { /** ID of the entity to update. */ _id: string; /** Identifier for the app whose extended fields are being updated. */ namespace: string; /** Data to update. Structured according to the [schema](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields#json-schema-for-extended-fields) defined when the extended fields were configured. */ namespaceData: Record | null; } export interface UpdateExtendedFieldsResponse { /** Updated ShippoConfiguration. */ shippoConfiguration?: ShippoConfiguration; } export interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ _id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * Example: created/updated/deleted/started/completed/email_opened */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * A sequence number defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ entityEventSequence?: string | null; } /** @oneof */ export interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } export interface EntityCreatedEvent { entity?: string; } export interface RestoreInfo { deletedDate?: Date | null; } export interface EntityUpdatedEvent { /** * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff. * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects. * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it. */ currentEntity?: string; } export interface EntityDeletedEvent { /** Entity that was deleted */ deletedEntity?: string | null; } export interface ActionEvent { body?: string; } export interface Empty { } export interface MessageEnvelope { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; } export interface IdentificationData extends IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; /** @readonly */ identityType?: WebhookIdentityType; } /** @oneof */ export interface IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; } export declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } interface HandlingFeeNonNullableFields { value: string; calculationType: CalculationType; } interface ServiceSettingsNonNullableFields { handlingFee?: HandlingFeeNonNullableFields; } interface DomesticServiceSettingsNonNullableFields { service: DomesticService; serviceSettings?: ServiceSettingsNonNullableFields; } interface InternationalServiceSettingsNonNullableFields { service: InternationalService; serviceSettings?: ServiceSettingsNonNullableFields; } interface PackageDimensionsNonNullableFields { length: string; width: string; height: string; } interface PackageDetailsNonNullableFields { dimensions?: PackageDimensionsNonNullableFields; } interface StreetAddressNonNullableFields { number: string; name: string; apt: string; } interface AddressNonNullableFields { streetAddress?: StreetAddressNonNullableFields; } export interface ShippoConfigurationNonNullableFields { domesticServices: DomesticServiceSettingsNonNullableFields[]; internationalServices: InternationalServiceSettingsNonNullableFields[]; packageType: PackageType; packageDetails?: PackageDetailsNonNullableFields; shipFromAddress?: AddressNonNullableFields; } export interface CreateShippoConfigurationResponseNonNullableFields { shippoConfiguration?: ShippoConfigurationNonNullableFields; } export interface GetShippoConfigurationResponseNonNullableFields { shippoConfiguration?: ShippoConfigurationNonNullableFields; } export interface UpdateShippoConfigurationResponseNonNullableFields { shippoConfiguration?: ShippoConfigurationNonNullableFields; } export interface QueryShippoConfigurationsResponseNonNullableFields { shippoConfigurations: ShippoConfigurationNonNullableFields[]; } export interface UpdateExtendedFieldsResponseNonNullableFields { shippoConfiguration?: ShippoConfigurationNonNullableFields; } export interface BaseEventMetadata { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; } export interface EventMetadata extends BaseEventMetadata { /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ _id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * Example: created/updated/deleted/started/completed/email_opened */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * A sequence number defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ entityEventSequence?: string | null; } export interface ShippoConfigurationCreatedEnvelope { entity: ShippoConfiguration; metadata: EventMetadata; } /** @webhook * @eventType wix.ecom.v1.shippo_configuration_created * @documentationMaturity preview */ export declare function onShippoConfigurationCreated(handler: (event: ShippoConfigurationCreatedEnvelope) => void | Promise): void; export interface ShippoConfigurationDeletedEnvelope { entity: ShippoConfiguration; metadata: EventMetadata; } /** @webhook * @eventType wix.ecom.v1.shippo_configuration_deleted * @documentationMaturity preview */ export declare function onShippoConfigurationDeleted(handler: (event: ShippoConfigurationDeletedEnvelope) => void | Promise): void; export interface ShippoConfigurationUpdatedEnvelope { entity: ShippoConfiguration; metadata: EventMetadata; } /** @webhook * @eventType wix.ecom.v1.shippo_configuration_updated * @documentationMaturity preview */ export declare function onShippoConfigurationUpdated(handler: (event: ShippoConfigurationUpdatedEnvelope) => void | Promise): void; /** * Creates a ShippoConfiguration. * @param shippoConfiguration - ShippoConfiguration to be created. * @public * @documentationMaturity preview * @requiredField shippoConfiguration * @requiredField shippoConfiguration.deliveryRegionId * @requiredField shippoConfiguration.osLocationId * @requiredField shippoConfiguration.packageDetails * @requiredField shippoConfiguration.packageDetails.dimensions.height * @requiredField shippoConfiguration.packageDetails.dimensions.length * @requiredField shippoConfiguration.packageDetails.dimensions.width * @requiredField shippoConfiguration.packageType * @permissionId ECOM.SHIPPO_CONFIGURATION_CREATE * @returns The created ShippoConfiguration. * @fqn wix.ecom.delivery.v1.ShippoService.CreateShippoConfiguration */ export declare function createShippoConfiguration(shippoConfiguration: ShippoConfiguration, options?: CreateShippoConfigurationOptions): Promise; export interface CreateShippoConfigurationOptions { backupRate?: string | null; } /** * Retrieves a ShippoConfiguration. * @param shippoConfigurationId - ID of the ShippoConfiguration to retrieve. * @public * @documentationMaturity preview * @requiredField shippoConfigurationId * @permissionId ECOM.SHIPPO_CONFIGURATION_READ * @returns The requested ShippoConfiguration. * @fqn wix.ecom.delivery.v1.ShippoService.GetShippoConfiguration */ export declare function getShippoConfiguration(shippoConfigurationId: string): Promise; /** * Updates a ShippoConfiguration. * @param _id - ShippoConfiguration ID. * @public * @documentationMaturity preview * @requiredField _id * @requiredField shippoConfiguration * @requiredField shippoConfiguration.revision * @permissionId ECOM.SHIPPO_CONFIGURATION_UPDATE * @returns Updated ShippoConfiguration. * @fqn wix.ecom.delivery.v1.ShippoService.UpdateShippoConfiguration */ export declare function updateShippoConfiguration(_id: string | null, shippoConfiguration: UpdateShippoConfiguration): Promise; export interface UpdateShippoConfiguration { /** * ShippoConfiguration ID. * @readonly */ _id?: string | null; /** @readonly */ revision?: string | null; /** * Date and time the ShippoConfiguration was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the ShippoConfiguration was last updated. * @readonly */ _updatedDate?: Date | null; /** Associated delivery region ID. */ deliveryRegionId?: string | null; /** Settings of USPS domestic services. */ domesticServices?: DomesticServiceSettings[]; /** Settings of USPS international services. */ internationalServices?: InternationalServiceSettings[]; /** Package type. */ packageType?: PackageType; /** Package details. */ packageDetails?: PackageDetails; /** Location ID from OS location service. */ osLocationId?: string | null; /** * Ship from address materialized from OS location. * @readonly */ shipFromAddress?: Address; /** Backup weight. */ backupWeight?: string | null; /** Data extensions. */ extendedFields?: ExtendedFields; } /** * Deletes a ShippoConfiguration. * @param shippoConfigurationId - ID of the ShippoConfiguration to delete. * @public * @documentationMaturity preview * @requiredField shippoConfigurationId * @permissionId ECOM.SHIPPO_CONFIGURATION_DELETE * @fqn wix.ecom.delivery.v1.ShippoService.DeleteShippoConfiguration */ export declare function deleteShippoConfiguration(shippoConfigurationId: string): Promise; /** * Retrieves a list of ShippoConfigurations, given the provided [paging, filtering, and sorting][1]. * * Up to 1,000 ShippoConfigurations can be returned per request. * * To learn how to query ShippoConfigurations, see [API Query Language][2]. * * [1]: https://dev.wix.com/api/rest/getting-started/sorting-and-paging * [2]: https://dev.wix.com/api/rest/getting-started/api-query-language * @public * @documentationMaturity preview * @permissionId ECOM.SHIPPO_CONFIGURATION_READ * @fqn wix.ecom.delivery.v1.ShippoService.QueryShippoConfigurations */ export declare function queryShippoConfigurations(): ShippoConfigurationsQueryBuilder; interface QueryCursorResult { cursors: Cursors; hasNext: () => boolean; hasPrev: () => boolean; length: number; pageSize: number; } export interface ShippoConfigurationsQueryResult extends QueryCursorResult { items: ShippoConfiguration[]; query: ShippoConfigurationsQueryBuilder; next: () => Promise; prev: () => Promise; } export interface ShippoConfigurationsQueryBuilder { /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ eq: (propertyName: '_id' | 'deliveryRegionId', value: any) => ShippoConfigurationsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ ne: (propertyName: '_id' | 'deliveryRegionId', value: any) => ShippoConfigurationsQueryBuilder; /** @param propertyName - Property whose value is compared with `string`. * @param string - String to compare against. Case-insensitive. * @documentationMaturity preview */ startsWith: (propertyName: '_id' | 'deliveryRegionId', value: string) => ShippoConfigurationsQueryBuilder; /** @param propertyName - Property whose value is compared with `values`. * @param values - List of values to compare against. * @documentationMaturity preview */ hasSome: (propertyName: '_id' | 'deliveryRegionId', value: any[]) => ShippoConfigurationsQueryBuilder; /** @documentationMaturity preview */ in: (propertyName: '_id' | 'deliveryRegionId', value: any) => ShippoConfigurationsQueryBuilder; /** @documentationMaturity preview */ exists: (propertyName: '_id' | 'deliveryRegionId', value: boolean) => ShippoConfigurationsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. * @documentationMaturity preview */ ascending: (...propertyNames: Array<'_id' | 'deliveryRegionId'>) => ShippoConfigurationsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. * @documentationMaturity preview */ descending: (...propertyNames: Array<'_id' | 'deliveryRegionId'>) => ShippoConfigurationsQueryBuilder; /** @param limit - Number of items to return, which is also the `pageSize` of the results object. * @documentationMaturity preview */ limit: (limit: number) => ShippoConfigurationsQueryBuilder; /** @param cursor - A pointer to specific record * @documentationMaturity preview */ skipTo: (cursor: string) => ShippoConfigurationsQueryBuilder; /** @documentationMaturity preview */ find: () => Promise; } /** * Updates extended fields of a ShippoConfiguration without incrementing revision * @param _id - ID of the entity to update. * @param namespace - Identifier for the app whose extended fields are being updated. * @public * @documentationMaturity preview * @requiredField _id * @requiredField namespace * @requiredField options * @requiredField options.namespaceData * @permissionId ECOM.SHIPPO_CONFIGURATION_UPDATE * @fqn wix.ecom.delivery.v1.ShippoService.UpdateExtendedFields */ export declare function updateExtendedFields(_id: string, namespace: string, options: UpdateExtendedFieldsOptions): Promise; export interface UpdateExtendedFieldsOptions { /** Data to update. Structured according to the [schema](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields#json-schema-for-extended-fields) defined when the extended fields were configured. */ namespaceData: Record | null; } export {};