> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # GetShippingRates # Package: shippingRates # Namespace: ShippingRates # Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/shipping-rates/shipping-rates-integration-service-plugin/get-shipping-rates.md ## Introduction This method retrieves applicable shipping rates for a delivery from your app. Wix calls this method when certain actions are performed on the cart and/or checkout. For example, when an item is added to the cart, or the shipping destination is changed. > __Note:__ Do not call the Estimate Cart Totals, Estimate Current Cart Totals or Get Checkout methods from your implementation code for Get Shipping Rates. Doing so will result in an error. --- ## REST API ### Schema ``` Method: getShippingRates Description: This method retrieves applicable shipping rates for a delivery from your app. Wix calls this method when certain actions are performed on the cart and/or checkout. For example, when an item is added to the cart, or the shipping destination is changed. > __Note:__ Do not call the Estimate Cart Totals, Estimate Current Cart Totals or Get Checkout methods from your implementation code for Get Shipping Rates. Doing so will result in an error. URL: null Method: POST Method parameters: param name: buyerContactDetails | type: FullAddressContactDetails | description: Full contact details for an address - name: firstName | type: string | description: Contact's first name. - name: lastName | type: string | description: Contact's last name. - name: phone | type: string | description: Contact's phone number. - name: company | type: string | description: Contact's company name. - name: email | type: string | description: Email associated with the address. - name: vatId | type: VatId | description: Tax info. Currently usable only in Brazil. - name: id | type: string | description: Customer's tax GUID. - name: type | type: VatType | description: Tax type. Supported values: + `CPF`: for individual tax payers + `CNPJ`: for corporations - enum: - UNSPECIFIED: - CPF: CPF - for individual tax payers. - CNPJ: CNPJ - for corporations param name: deliveryPreferences | type: DeliveryPreferences | description: delivery preferences, for example preferred delivery "code" (shippingOptionId). enrich the delivery providers with more data about the delivery - name: preferredCode | type: string | description: param name: extendedFields | type: ExtendedFields - name: namespaces | type: object | description: 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.md). param name: externalReferences | type: array | description: Reference to an external resource GUID. Used to link the purchase flow to a specific entity in an external system. Used for integration and tracking across different platforms. - name: appId | type: string | description: GUID of the app associated with the purchase flow. For example, the Wix Pay Links app GUID. - name: resourceId | type: string | description: Reference to an external resource GUID. Used to link the purchase flow to a specific entity in an external system. For example, a Wix Pay Link GUID. param name: lineItems | type: array | description: The line items to be shipped. - name: name | type: string | description: Item name. - name: quantity | type: integer | description: The number of items ordered. - name: catalogReference | type: CatalogReference | description: Reference to the item's origin catalog. - name: catalogItemId | type: string | description: GUID of the item within the catalog it belongs to. - name: appId | type: string | description: GUID of the app providing the catalog. You can get your app's GUID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/). For items from Wix catalogs, the following values always apply: + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"` + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"` - name: options | type: object | description: Additional item details in `key:value` pairs. Use this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items. For Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration.md) or [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration.md), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction.md). - name: physicalProperties | type: PhysicalProperties | description: Physical properties of the item. - name: weight | type: number | description: Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request. - name: sku | type: string | description: Stock-keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku). - name: shippable | type: boolean | description: Whether this line item is shippable. - name: price | type: string | description: Price of a single item after discounts. - name: totalPriceBeforeDiscount | type: string | description: Total line item price before discounts. - name: priceBeforeDiscount | type: string | description: Price of a single item before discounts. - name: totalPrice | type: string | description: Total line item price after discounts. This is equal to `price` multiplied by `quantity`. - name: deliveryDestinationIndex | type: integer | description: item delivery destination index in the shipping addresses list - name: deliveryOriginIndex | type: integer | description: where the item is delivered from index in the from addresses list - name: taxIncludedInPrice | type: boolean | description: whether tax is included in line item price param name: purchaseFlowId | type: purchaseFlowId | description: Persistent GUID that correlates between the various eCommerce elements: cart, checkout, and order. param name: shippingDestination | type: Address | description: Physical address - ONE-OF: - name: streetAddress | type: StreetAddress | description: Street name and number. - name: number | type: string | description: Street number. - name: name | type: string | description: Street name. - name: addressLine | type: string | description: Main address line, usually street and number as free text. - name: country | type: string | description: Country code. - name: subdivision | type: string | description: Subdivision shorthand. Usually, a short code (2 or 3 letters) that represents a state, region, prefecture, or province. e.g. NY - name: city | type: string | description: City name. - name: postalCode | type: string | description: Zip/postal code. - name: addressLine2 | type: string | description: Free text providing more detailed address info. Usually contains Apt, Suite, and Floor. param name: shippingOrigin | type: Address | description: Physical address - ONE-OF: - name: country | type: string | description: Country code. - name: subdivision | type: string | description: Subdivision shorthand. Usually, a short code (2 or 3 letters) that represents a state, region, prefecture, or province. e.g. NY - name: city | type: string | description: City name. - name: postalCode | type: string | description: Zip/postal code. - name: addressLine2 | type: string | description: Free text providing more detailed address info. Usually contains Apt, Suite, and Floor. param name: taxIncludedInPrices | type: taxIncludedInPrices | description: Whether tax is included in the items' prices. param name: weightUnit | type: WeightUnit - enum: UNSPECIFIED_WEIGHT_UNIT - Weight unit can't be classified due to an error. KG - Kilograms. LB - Pounds. Return type: GetShippingRatesResponse - name: shippingRates | type: array | description: Available shipping rates. These define the shipping rate options that are displayed to site visitors on the cart and checkout pages. - name: code | type: string | description: Unique code that acts as an GUID for a shipping rate. For example, `"usps_std_overnight"`. - name: title | type: string | description: Shipping rate title. For example, `"USPS Standard Overnight Delivery"`, `"Standard"`, or `"First-Class Package International"`. - name: logistics | type: DeliveryLogistics | description: Shipping logistics. - name: deliveryTime | type: string | description: When the item is expected to be delivered in free text. For example, `"3-5 business days"`. - name: instructions | type: string | description: Instructions for delivery. For example, for pickup: `"Ensure to come during business hours, and please don't park in the disabled spot"`. - name: pickupDetails | type: PickupDetails | description: Pickup details. Should be returned only if order is for pickup. - name: address | type: Address | description: Pickup address. - ONE-OF: - name: streetAddress | type: StreetAddress | description: Street name and number. - name: number | type: string | description: Street number. - name: name | type: string | description: Street name. - name: addressLine | type: string | description: Main address line, usually street and number as free text. - name: country | type: string | description: Country code. - name: subdivision | type: string | description: Subdivision shorthand. Usually, a short code (2 or 3 letters) that represents a state, region, prefecture, or province. e.g. NY - name: city | type: string | description: City name. - name: postalCode | type: string | description: Zip/postal code. - name: addressLine2 | type: string | description: Free text providing more detailed address info. Usually contains Apt, Suite, and Floor. - name: pickupMethod | type: PickupMethod | description: Pickup method. Supported values: + `"STORE_PICKUP"`: When pickup is from the merchant's brick and mortar store. + `"PICKUP_POINT"`: When item is shipped to a specified pickup point. - enum: STORE_PICKUP, PICKUP_POINT - name: cost | type: ShippingPrice | description: Shipping cost. - name: price | type: string | description: The shipping rate's price. Must align with the [currency's decimal separator](https://en.wikipedia.org/wiki/ISO_4217#Active_codes). - name: currency | type: string | description: Currency of the shipping rate price as a 3-letter [ISO-4217 currency code](https://en.wikipedia.org/wiki/ISO_4217). Must align with the `currency` passed to the function under the `metadata` field. - name: additionalCharges | type: array | description: Additional costs. For example, a handling fee for packaging fragile items. - name: type | type: ChargeType | description: Additional charge type. - enum: HANDLING_FEE - name: details | type: string | description: Details of the additional charge. For example, `"Handling fee of $5 applied for gift wrapping"`. - name: price | type: string | description: Cost of additional charge. For example, `12.5`. Possible Errors: HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: GENERIC_ERROR | Description: Generic shipping rate calculation error. Throw this error for cases the other errors don't cover. You can optionally provide error data to help debug the issue. Error data you provide appears in the monitoring log but is not exposed to the user. This error may block the site visitor from proceeding to checkout, so throw it only if there is no other way to proceed. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PARTIAL_ADDRESS | Description: Invalid address error. Throw this error when one or more fields in the address provided are invalid. This error tells Wix that more address details are needed to calculate the shipping rate. Wix may then prompt the user to provide more detailed address information. The error data must include the invalid fields in the address. For example: `ShippingDestination.subdivision`. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_POSTAL_CODE | Description: Invalid postal code error. Throw this error when an invalid postal code is provided in the request. This error tells Wix that a valid postal code is required to calculate the shipping rate. You can optionally provide error data to help debug the issue. Error data you provide appears in the monitoring log but is not exposed to the user. This error may block the site visitor from proceeding to checkout, so throw it only if there is no other way to proceed. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: MISSING_POSTAL_CODE | Description: Missing postal code error. Throw this error when a postal code is not provided in the request. This error tells Wix that a valid postal code is required to calculate the shipping rate. You can optionally provide error data to help debug the issue. Error data you provide appears in the monitoring log but is not exposed to the user. This error may block the site visitor from proceeding to checkout, so throw it only if there is no other way to proceed. ``` ### Examples ### Get shipping rates - decoded JWT The data payload will include the following object as an encoded JWT. For the purposes of this example, we show the request and response objects decoded. ```curl curl -X POST https://provider.example.com/v1/getRates \ -H 'user-agent: Wix' \ -H 'accept-encoding: gzip, deflate' \ -H 'content-type: text/plain; charset=utf-8' \ -d '{ "data": { "request": { "lineItems": [ { "physicalProperties": { "weight": 0.4, "sku": "", "shippable": true }, "name": "coffee mug", "quantity": 1, "price": "100.00", "catalogReference": { "catalogItemId": "50b7223c-80e6-3539-325e-4ecfe99770dc", "appId": "215238eb-22a5-4c36-9e7b-e7c08025e04e", "options": { "options": { "Size": "256", "Color": "blue" }, "variantId": "9d1bc95e-d6ed-4546-b89b-c61e334e2d5e" } } } ], "buyerContactDetails": { "phone": "123456789", "email": "janedoe@gmail.com" }, "taxIncludedInPrices": false, "weightUnit": "LB", "shippingDestination": { "country": "US", "subdivision": "US-NY", "city": "New York", "postalCode": "10011", "addressLine": "235 West 23rd Street", "addressLine2": "3rd floor", "countryFullname": "United States", "subdivisionFullname": "New York" }, "shippingOrigin": { "addressLine1": "34 Elizabeth Street", "addressLine2": "4th floor", "city": "Boston", "country": "US", "postalCode": "02108", "subdivision": "US-MA" } }, "metadata": { "instanceId": "9698acde-2e44-4656-9db3-f48c91da9828", "languages": [ "en" ], "currency": "USD", "requestId": "1670756264.11667254865110420", "identity": { "identityType": "ANONYMOUS_VISITOR", "anonymousVisitorId": "a02f16af-6174-4f3e-a1e1-6eed2735d67d" } }, "aud": "e6a6c88b-8ed1-465b-8c10-5bb0e9285e3f", "iss": "wix.com", "iat": 1670756264, "exp": 1674356264 } } } ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.shippingRates.ShippingRates.getShippingRates(request, metadata) Description: This method retrieves applicable shipping rates for a delivery from your app. Wix calls this method when certain actions are performed on the cart and/or checkout. For example, when an item is added to the cart, or the shipping destination is changed. > __Note:__ Do not call the Estimate Cart Totals, Estimate Current Cart Totals or Get Checkout methods from your implementation code for Get Shipping Rates. Doing so will result in an error. Method parameters: param name: metadata | type: Context | description: this message is not directly used by any service, it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform. e.g. SPIs, event-handlers, etc.. NOTE: this context object MUST be provided as the last argument in each Velo method signature. Example: ```typescript export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) { ... } ``` - name: requestId | type: string | description: A unique identifier of the request. You may print this GUID to your logs to help with future debugging and easier correlation with Wix's logs. - name: currency | type: string | description: [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code. - name: identity | type: IdentificationData | description: An object that describes the identity that triggered this request. - ONE-OF: - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site. - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site. - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.). - name: appId | type: string | description: GUID of an app. - name: languages | type: array | description: A string representing a language and region in the format of `"xx-XX"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash "-", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `"en-US"`. - name: instanceId | type: string | description: The service provider app's instance GUID. param name: request | type: GetShippingRatesRequest - name: lineItems | type: array | description: The line items to be shipped. - name: name | type: string | description: Item name. - name: quantity | type: integer | description: The number of items ordered. - name: catalogReference | type: CatalogReference | description: Reference to the item's origin catalog. - name: catalogItemId | type: string | description: GUID of the item within the catalog it belongs to. - name: appId | type: string | description: GUID of the app providing the catalog. You can get your app's GUID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/). For items from Wix catalogs, the following values always apply: + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"` + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"` - name: options | type: object | description: Additional item details in `key:value` pairs. Use this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items. For Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration.md) or [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration.md), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction.md). - name: physicalProperties | type: PhysicalProperties | description: Physical properties of the item. - name: weight | type: number | description: Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request. - name: sku | type: string | description: Stock-keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku). - name: shippable | type: boolean | description: Whether this line item is shippable. - name: price | type: string | description: Price of a single item after discounts. - name: totalPriceBeforeDiscount | type: string | description: Total line item price before discounts. - name: priceBeforeDiscount | type: string | description: Price of a single item before discounts. - name: totalPrice | type: string | description: Total line item price after discounts. This is equal to `price` multiplied by `quantity`. - name: deliveryDestinationIndex | type: integer | description: item delivery destination index in the shipping addresses list - name: deliveryOriginIndex | type: integer | description: where the item is delivered from index in the from addresses list - name: taxIncludedInPrice | type: boolean | description: whether tax is included in line item price - name: shippingDestination | type: Address | description: Address to ship to. - name: location | type: Location | description: none - name: latitude | type: number | description: none - name: longitude | type: number | description: none - name: streetAddress | type: StreetAddress | description: none - name: name | type: string | description: none - name: number | type: string | description: none - name: city | type: string | description: none - name: subdivision | type: string | description: none - name: country | type: string | description: none - name: postalCode | type: string | description: none - name: formatted | type: string | description: none - name: addressLine1 | type: string | description: none - name: addressLine2 | type: string | description: none - name: shippingOrigin | type: Address | description: Address item is shipped from. This is the site owner's business address. - name: buyerContactDetails | type: FullAddressContactDetails | description: Buyer's contact details. - name: firstName | type: string | description: Contact's first name. - name: lastName | type: string | description: Contact's last name. - name: phone | type: string | description: Contact's phone number. - name: company | type: string | description: Contact's company name. - name: email | type: string | description: Email associated with the address. - name: vatId | type: VatId | description: Tax info. Currently usable only in Brazil. - name: _id | type: string | description: Customer's tax GUID. - name: type | type: VatType | description: Tax type. Supported values: + `CPF`: for individual tax payers + `CNPJ`: for corporations - enum: - UNSPECIFIED: - CPF: CPF - for individual tax payers. - CNPJ: CNPJ - for corporations - name: weightUnit | type: WeightUnit | description: Weight measurement unit used for all items in the shipment. Supported values: + `"KG"`: kilograms + `"LB"`: pounds - enum: - UNSPECIFIED_WEIGHT_UNIT: Weight unit can't be classified due to an error. - KG: Kilograms. - LB: Pounds. - name: deliveryPreferences | type: DeliveryPreferences | description: List of delivery preferences, for example preferred delivery code (`shippingOptionId`). - name: preferredCode | type: string | description: - name: purchaseFlowId | type: string | description: Persistent GUID that correlates between the various eCommerce elements: cart, checkout, and order. - name: externalReferences | type: array | description: Reference to an external resource GUID. Used to link the purchase flow to a specific entity in an external system. Used for integration and tracking across different platforms. - name: appId | type: string | description: GUID of the app associated with the purchase flow. For example, the Wix Pay Links app GUID. - name: resourceId | type: string | description: Reference to an external resource GUID. Used to link the purchase flow to a specific entity in an external system. For example, a Wix Pay Link GUID. - name: extendedFields | type: ExtendedFields | description: [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: namespaces | type: object | description: 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.md). Return type: PROMISE - name: shippingRates | type: array | description: Available shipping rates. These define the shipping rate options that are displayed to site visitors on the cart and checkout pages. - name: code | type: string | description: Unique code that acts as an GUID for a shipping rate. For example, `"usps_std_overnight"`. - name: title | type: string | description: Shipping rate title. For example, `"USPS Standard Overnight Delivery"`, `"Standard"`, or `"First-Class Package International"`. - name: logistics | type: DeliveryLogistics | description: Shipping logistics. - name: deliveryTime | type: string | description: When the item is expected to be delivered in free text. For example, `"3-5 business days"`. - name: instructions | type: string | description: Instructions for delivery. For example, for pickup: `"Ensure to come during business hours, and please don't park in the disabled spot"`. - name: pickupDetails | type: PickupDetails | description: Pickup details. Should be returned only if order is for pickup. - name: address | type: Address | description: Pickup address. - name: location | type: Location | description: none - name: latitude | type: number | description: none - name: longitude | type: number | description: none - name: streetAddress | type: StreetAddress | description: none - name: name | type: string | description: none - name: number | type: string | description: none - name: city | type: string | description: none - name: subdivision | type: string | description: none - name: country | type: string | description: none - name: postalCode | type: string | description: none - name: formatted | type: string | description: none - name: addressLine1 | type: string | description: none - name: addressLine2 | type: string | description: none - name: pickupMethod | type: PickupMethod | description: Pickup method. Supported values: + `"STORE_PICKUP"`: When pickup is from the merchant's brick and mortar store. + `"PICKUP_POINT"`: When item is shipped to a specified pickup point. - enum: STORE_PICKUP, PICKUP_POINT - name: cost | type: ShippingPrice | description: Shipping cost. - name: price | type: string | description: The shipping rate's price. Must align with the [currency's decimal separator](https://en.wikipedia.org/wiki/ISO_4217#Active_codes). - name: currency | type: string | description: Currency of the shipping rate price as a 3-letter [ISO-4217 currency code](https://en.wikipedia.org/wiki/ISO_4217). Must align with the `currency` passed to the function under the `metadata` field. - name: additionalCharges | type: array | description: Additional costs. For example, a handling fee for packaging fragile items. - name: type | type: ChargeType | description: Additional charge type. - enum: HANDLING_FEE - name: details | type: string | description: Details of the additional charge. For example, `"Handling fee of $5 applied for gift wrapping"`. - name: price | type: string | description: Cost of additional charge. For example, `12.5`. Possible Errors: HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: GENERIC_ERROR | Description: Generic shipping rate calculation error. Throw this error for cases the other errors don't cover. You can optionally provide error data to help debug the issue. Error data you provide appears in the monitoring log but is not exposed to the user. This error may block the site visitor from proceeding to checkout, so throw it only if there is no other way to proceed. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PARTIAL_ADDRESS | Description: Invalid address error. Throw this error when one or more fields in the address provided are invalid. This error tells Wix that more address details are needed to calculate the shipping rate. Wix may then prompt the user to provide more detailed address information. The error data must include the invalid fields in the address. For example: `ShippingDestination.subdivision`. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_POSTAL_CODE | Description: Invalid postal code error. Throw this error when an invalid postal code is provided in the request. This error tells Wix that a valid postal code is required to calculate the shipping rate. You can optionally provide error data to help debug the issue. Error data you provide appears in the monitoring log but is not exposed to the user. This error may block the site visitor from proceeding to checkout, so throw it only if there is no other way to proceed. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: MISSING_POSTAL_CODE | Description: Missing postal code error. Throw this error when a postal code is not provided in the request. This error tells Wix that a valid postal code is required to calculate the shipping rate. You can optionally provide error data to help debug the issue. Error data you provide appears in the monitoring log but is not exposed to the user. This error may block the site visitor from proceeding to checkout, so throw it only if there is no other way to proceed. ``` ### Examples ### Example of a `shippingRates` return value ```javascript import { shippingRates } from '@wix/ecom/service-plugins'; shippingRates.provideHandlers({ getShippingRates: async ( payload ) => { const {request, metadata} = payload; // Use the `request` and `metadata` received from Wix and // apply custom logic. return { // Return your response exactly as documented to integrate with Wix. // Return value example: shippingRates: [ { code: "usps-international", title: "USPS - International", logistics: { deliveryTime: "2-5 days", }, cost: { price: "15", currency: "USD", additionalCharges: [ { price: "10", type: "HANDLING_FEE", details: "Handling fee of $5 applied for fragile items.", } ] } } ] } } }); ``` ### getShippingRates (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { shippingRates } from '@wix/ecom/service-plugins'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { shippingRates }, // Include the auth strategy and host as relevant }); async function getShippingRates(request,metadata) { const response = await myWixClient.shippingRates.getShippingRates(request,metadata); }; ``` ---