From 256279c3727ff78fcd4c0bfe27f8893f719b0736 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Sat, 17 Feb 2024 21:55:55 -0800 Subject: [PATCH 01/20] docs: Update docs navigation structure and document test mode headers --- apps/www/docs/carriers/sdk/extension.mdx | 2 +- apps/www/docs/index.mdx | 6 +- .../docs/{ => product}/local-development.mdx | 0 apps/www/docs/product/orders.mdx | 2 +- apps/www/docs/{ => product}/quick-start.mdx | 0 .../resources/contributing.mdx} | 4 +- .../resources}/development.mdx | 2 +- apps/www/docs/{ => product/resources}/faq.mdx | 6 +- .../docs/{ => product/resources}/privacy.mdx | 0 .../docs/{ => product/resources}/support.mdx | 0 .../docs/{ => product/resources}/terms.mdx | 0 apps/www/docs/{ => product}/self-hosting.mdx | 8 +- .../docs/{ => product}/self-hosting/admin.mdx | 0 .../{ => product}/self-hosting/enterprise.mdx | 0 .../self-hosting/environment.mdx | 0 .../docs/{ => product}/self-hosting/oss.mdx | 21 ++- .../docs/{ => reference}/api/addresses.mdx | 0 .../{ => reference}/api/authentication.mdx | 27 +++- apps/www/docs/{ => reference}/api/batches.mdx | 0 .../www/docs/{ => reference}/api/carriers.mdx | 2 +- .../docs/{ => reference}/api/documents.mdx | 0 .../docs/{ => reference}/api/error-codes.mdx | 0 .../www/docs/{ => reference}/api/metadata.mdx | 0 apps/www/docs/{ => reference}/api/orders.mdx | 0 .../docs/{ => reference}/api/pagination.mdx | 0 apps/www/docs/{ => reference}/api/parcels.mdx | 0 .../docs/{ => reference}/api/shipments.mdx | 0 .../www/docs/{ => reference}/api/trackers.mdx | 8 +- .../www/docs/{ => reference}/api/webhooks.mdx | 0 .../management/connections.mdx | 0 .../docs/{ => reference}/management/data.mdx | 0 .../management/organizations.mdx | 0 .../{ => reference}/management/overview.mdx | 0 .../docs/{ => reference}/management/users.mdx | 0 apps/www/docusaurus.config.js | 127 +++++++++++++++++- apps/www/package.json | 1 + apps/www/sidebars.js | 90 +++++-------- package-lock.json | 37 +++++ 38 files changed, 261 insertions(+), 82 deletions(-) rename apps/www/docs/{ => product}/local-development.mdx (100%) rename apps/www/docs/{ => product}/quick-start.mdx (100%) rename apps/www/docs/{contributing/guidlines.mdx => product/resources/contributing.mdx} (92%) rename apps/www/docs/{contributing => product/resources}/development.mdx (98%) rename apps/www/docs/{ => product/resources}/faq.mdx (65%) rename apps/www/docs/{ => product/resources}/privacy.mdx (100%) rename apps/www/docs/{ => product/resources}/support.mdx (100%) rename apps/www/docs/{ => product/resources}/terms.mdx (100%) rename apps/www/docs/{ => product}/self-hosting.mdx (99%) rename apps/www/docs/{ => product}/self-hosting/admin.mdx (100%) rename apps/www/docs/{ => product}/self-hosting/enterprise.mdx (100%) rename apps/www/docs/{ => product}/self-hosting/environment.mdx (100%) rename apps/www/docs/{ => product}/self-hosting/oss.mdx (87%) rename apps/www/docs/{ => reference}/api/addresses.mdx (100%) rename apps/www/docs/{ => reference}/api/authentication.mdx (76%) rename apps/www/docs/{ => reference}/api/batches.mdx (100%) rename apps/www/docs/{ => reference}/api/carriers.mdx (98%) rename apps/www/docs/{ => reference}/api/documents.mdx (100%) rename apps/www/docs/{ => reference}/api/error-codes.mdx (100%) rename apps/www/docs/{ => reference}/api/metadata.mdx (100%) rename apps/www/docs/{ => reference}/api/orders.mdx (100%) rename apps/www/docs/{ => reference}/api/pagination.mdx (100%) rename apps/www/docs/{ => reference}/api/parcels.mdx (100%) rename apps/www/docs/{ => reference}/api/shipments.mdx (100%) rename apps/www/docs/{ => reference}/api/trackers.mdx (97%) rename apps/www/docs/{ => reference}/api/webhooks.mdx (100%) rename apps/www/docs/{ => reference}/management/connections.mdx (100%) rename apps/www/docs/{ => reference}/management/data.mdx (100%) rename apps/www/docs/{ => reference}/management/organizations.mdx (100%) rename apps/www/docs/{ => reference}/management/overview.mdx (100%) rename apps/www/docs/{ => reference}/management/users.mdx (100%) diff --git a/apps/www/docs/carriers/sdk/extension.mdx b/apps/www/docs/carriers/sdk/extension.mdx index dfa7c91721..c498d8c215 100644 --- a/apps/www/docs/carriers/sdk/extension.mdx +++ b/apps/www/docs/carriers/sdk/extension.mdx @@ -38,7 +38,7 @@ The package naming convention for extensions is `karrio.[carrier_name]` #### 1. Create a karrio extension package -Once you have [karrio installed for development](/contributing/development) on your machine, +Once you have [karrio installed for development](/product/resources/development) on your machine, You can run the following command to scafold a karrio extension for you carrier. ```terminal diff --git a/apps/www/docs/index.mdx b/apps/www/docs/index.mdx index f8d6f00211..9b909bcfcc 100644 --- a/apps/www/docs/index.mdx +++ b/apps/www/docs/index.mdx @@ -17,7 +17,7 @@ import CardGrid from "@site/src/components/CardGrid"; "group rounded-lg border border-slate-200 hover:border-indigo-700 p-10 mt-10 hover:shadow no-underline" } style={{ color: "var(--ifm-font-color-base)" }} - href="/quick-start" + href="/product/quick-start" >
diff --git a/apps/www/docs/local-development.mdx b/apps/www/docs/product/local-development.mdx similarity index 100% rename from apps/www/docs/local-development.mdx rename to apps/www/docs/product/local-development.mdx diff --git a/apps/www/docs/product/orders.mdx b/apps/www/docs/product/orders.mdx index 31b940f5da..779e81a1cb 100644 --- a/apps/www/docs/product/orders.mdx +++ b/apps/www/docs/product/orders.mdx @@ -64,7 +64,7 @@ _Optionally_ - **order_date (`optional`):** the date the order was created in your system. - **source (`optional`):** the source of the order. (e.g. Shopify, Magento, etc.) -Check out the [order API reference](/api#tag/Orders/operation/&&&&create) for more details. +Check out the [order API reference](/reference/openapi/#tag/Orders/operation/&&&&create) for more details. Considering the following shopify order sample: diff --git a/apps/www/docs/quick-start.mdx b/apps/www/docs/product/quick-start.mdx similarity index 100% rename from apps/www/docs/quick-start.mdx rename to apps/www/docs/product/quick-start.mdx diff --git a/apps/www/docs/contributing/guidlines.mdx b/apps/www/docs/product/resources/contributing.mdx similarity index 92% rename from apps/www/docs/contributing/guidlines.mdx rename to apps/www/docs/product/resources/contributing.mdx index ca4df4c4f6..5bb768d906 100644 --- a/apps/www/docs/contributing/guidlines.mdx +++ b/apps/www/docs/product/resources/contributing.mdx @@ -1,6 +1,6 @@ --- -id: guidlines -title: Guidelines +id: contributing +title: Contributing --- ## How to contribute diff --git a/apps/www/docs/contributing/development.mdx b/apps/www/docs/product/resources/development.mdx similarity index 98% rename from apps/www/docs/contributing/development.mdx rename to apps/www/docs/product/resources/development.mdx index c33bc309ec..536de41816 100644 --- a/apps/www/docs/contributing/development.mdx +++ b/apps/www/docs/product/resources/development.mdx @@ -318,4 +318,4 @@ We won't be able to assist with your Docker installation. Make sure you've read the warning about Windows 10 Home. Windows versions before Windows 10 are not officially supported. -If you encounter other problems, see [Support](/support). +If you encounter other problems, see [Support](/product/resources/support). diff --git a/apps/www/docs/faq.mdx b/apps/www/docs/product/resources/faq.mdx similarity index 65% rename from apps/www/docs/faq.mdx rename to apps/www/docs/product/resources/faq.mdx index dd9eefc1d4..a46319e889 100644 --- a/apps/www/docs/faq.mdx +++ b/apps/www/docs/product/resources/faq.mdx @@ -14,6 +14,10 @@ karrio server uses the carrier extensions detected by the karrio SDK to establis To write your own carrier integration, you need to create a carrier extension using the [karrio SDK framework](/carriers/sdk/extension). +## How can I spin up a sandbox for development? + +See [Local Developement](/product/local-development) guide for a simple docker compose setup without having to fork the entire repository. + ## How to set up the environment variables? -See [Configuration](/self-hosting/environment) guide. +See [Configuration](/product/self-hosting/environment) guide for full details on Karrio's deployment environment setup. diff --git a/apps/www/docs/privacy.mdx b/apps/www/docs/product/resources/privacy.mdx similarity index 100% rename from apps/www/docs/privacy.mdx rename to apps/www/docs/product/resources/privacy.mdx diff --git a/apps/www/docs/support.mdx b/apps/www/docs/product/resources/support.mdx similarity index 100% rename from apps/www/docs/support.mdx rename to apps/www/docs/product/resources/support.mdx diff --git a/apps/www/docs/terms.mdx b/apps/www/docs/product/resources/terms.mdx similarity index 100% rename from apps/www/docs/terms.mdx rename to apps/www/docs/product/resources/terms.mdx diff --git a/apps/www/docs/self-hosting.mdx b/apps/www/docs/product/self-hosting.mdx similarity index 99% rename from apps/www/docs/self-hosting.mdx rename to apps/www/docs/product/self-hosting.mdx index 2dcb562178..07e036960e 100644 --- a/apps/www/docs/self-hosting.mdx +++ b/apps/www/docs/product/self-hosting.mdx @@ -1,7 +1,7 @@ --- id: self-hosting title: Overview -slug: /guides/self-hosting +slug: /product/self-hosting --- There are several ways you can use karrio : @@ -10,11 +10,11 @@ There are several ways you can use karrio : You don't need to deploy anything. We will manage and scale your infrastructure. -- ### [Karrio Open-Source](/self-hosting/oss) +- ### [Karrio Open-Source](/product/self-hosting/oss) You're a large company with the need to self-host or an engineer looking to use the open-source version. -- ### [Karrio Enterprise](/self-hosting/enterprise) +- ### [Karrio Enterprise](/product/self-hosting/enterprise) Karrio Enterprise is built for large companies with significant data isolation requirements. It requires a contract, which includes Unlimited shipments each month, and dedicated support. @@ -1064,7 +1064,7 @@ Karrio offer the possibility to store the shipping data related to your shipping operations in a **database**. The karrio GraphQL API allows you to access, query and visualize that data. -> Learn more about Karrio GraphQL [here](/management). +> Learn more about Karrio GraphQL [here](/reference/management). ### Carrier Extensions diff --git a/apps/www/docs/self-hosting/admin.mdx b/apps/www/docs/product/self-hosting/admin.mdx similarity index 100% rename from apps/www/docs/self-hosting/admin.mdx rename to apps/www/docs/product/self-hosting/admin.mdx diff --git a/apps/www/docs/self-hosting/enterprise.mdx b/apps/www/docs/product/self-hosting/enterprise.mdx similarity index 100% rename from apps/www/docs/self-hosting/enterprise.mdx rename to apps/www/docs/product/self-hosting/enterprise.mdx diff --git a/apps/www/docs/self-hosting/environment.mdx b/apps/www/docs/product/self-hosting/environment.mdx similarity index 100% rename from apps/www/docs/self-hosting/environment.mdx rename to apps/www/docs/product/self-hosting/environment.mdx diff --git a/apps/www/docs/self-hosting/oss.mdx b/apps/www/docs/product/self-hosting/oss.mdx similarity index 87% rename from apps/www/docs/self-hosting/oss.mdx rename to apps/www/docs/product/self-hosting/oss.mdx index 14e342c588..11078bf2da 100644 --- a/apps/www/docs/self-hosting/oss.mdx +++ b/apps/www/docs/product/self-hosting/oss.mdx @@ -16,9 +16,10 @@ However, for more specific deployments, you can explore the other options. - A Linux Ubuntu Virtual Machine. - An instance with 2GB of RAM can handle approximately 100k events spread over a month - We highly recommend an instance with at least 4GB of RAM to handle any surges in event volume + - Custom domain with the following records for your instance - - Type `A` | Host `@` (or subdomain) | Value `Your instance IP`. - - Type `A` | Host `*` | Value `Your instance IP`. + - Type `A` | Host `api` | Value `Your instance IP`. + - Type `A` | Host `app` | Value `Your instance IP`. Karrio will automatically create an SSL certificate for your domain using LetsEncrypt @@ -44,19 +45,32 @@ Karrio will wait here on a couple of tasks that need to be completed, which shou Once this is complete, you should be able to see your Karrio dashboard on the domain you provided! + ### Customizing your deployment (optional) By default, the `docker-compose.yml` file that gets run comes with a series of default config values that should work for most deployments. -If you need to customize anything, you can take a look at the full list of [environment variables](/self-hosting/environment). +If you need to customize anything, you can take a look at the full list of [environment variables](/product/self-hosting/environment). After making any changes, simply restart the stack with `docker-compose``. Additionally, if you would like to run a different version of Karrio, you can change the tag for the web, worker, and plugins services. Check out [here](https://hub.docker.com/r/karrio/server/tags) for a list of all available tags. + ### Troubleshooting If you have already run the one-step deployment command above and something went wrong, this section covers a number of steps you can take to debug issues. + +#### Hanging issue + +If you see the following message `⏳ Waiting for Kario to boot (this will take a few minutes)` after more than 10 minutes, +it means that the deployment is hanging. + +Generally, this is due to DNS configuration issues. Please make sure that: +- your domain is correctly configured and that the DNS has propagated. +- An SSL certificate can be issued for your domain. (No SSL certificate already issued by a service like Cloudflare...) + + #### Checking that all containers are running We can use `docker ps` to check that all of our services are running. @@ -82,6 +96,7 @@ docker logs The best place to start looking is in the `karrio.api` container, which runs all the database migrations and will produce an error if any have failed. + ### Upgrading To upgrade, you can run the `upgrade-hobby` script from the Karrio repo. diff --git a/apps/www/docs/api/addresses.mdx b/apps/www/docs/reference/api/addresses.mdx similarity index 100% rename from apps/www/docs/api/addresses.mdx rename to apps/www/docs/reference/api/addresses.mdx diff --git a/apps/www/docs/api/authentication.mdx b/apps/www/docs/reference/api/authentication.mdx similarity index 76% rename from apps/www/docs/api/authentication.mdx rename to apps/www/docs/reference/api/authentication.mdx index 7deb384dcf..627e232f33 100644 --- a/apps/www/docs/api/authentication.mdx +++ b/apps/www/docs/reference/api/authentication.mdx @@ -32,7 +32,7 @@ There are two types of keys: a private key and a JSON Web Token. -- The JSON Web Token on the other hand are obtained by API request +- The JWT (JSON Web Token) on the other hand are obtained by API request
@@ -71,3 +71,28 @@ Karrio returns an key pair object in response to your API request. "access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjM2MTgyNTg1LCJpYXQiOjE2MzYxODE2ODUsImp0aSI6ImMyYWI5YTAzNTRkYTRlZTQ5ZjQ1ZDdlMmI4NWQ5ZGZkIiwidXNlcl9pZCI6MX0.X-MA-9Vi_zWJfvMWSaL8dNj7XOy8kPNz16gvbciLCIM" } ``` + +## Karrio environment + +The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. +In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in test_mode. + + +:::note [Request environments] + +Requests authenticate using **API Key** are already bound to the environment in which they were created. + +If you use the **JWT** to authenticate, you can specify the environment in which you want to make the request +using the `x-text-mode` header. + +```javascript +{ + ... + headers: { + "x-test-mode": true // or false for live mode + } + ... +} +``` + +::: diff --git a/apps/www/docs/api/batches.mdx b/apps/www/docs/reference/api/batches.mdx similarity index 100% rename from apps/www/docs/api/batches.mdx rename to apps/www/docs/reference/api/batches.mdx diff --git a/apps/www/docs/api/carriers.mdx b/apps/www/docs/reference/api/carriers.mdx similarity index 98% rename from apps/www/docs/api/carriers.mdx rename to apps/www/docs/reference/api/carriers.mdx index d500f798e3..bf344a2192 100644 --- a/apps/www/docs/api/carriers.mdx +++ b/apps/www/docs/reference/api/carriers.mdx @@ -39,7 +39,7 @@ retrieve the list of carrier accounts configured and accessible from your accoun :::info This API is read-only and does not allow you to create, update or delete carrier connections. -To programmatically create, update or delete carrier connections, use the [GraphQL management API](/management/connections). +To programmatically create, update or delete carrier connections, use the [GraphQL management API](/reference/management/connections). ::: diff --git a/apps/www/docs/api/documents.mdx b/apps/www/docs/reference/api/documents.mdx similarity index 100% rename from apps/www/docs/api/documents.mdx rename to apps/www/docs/reference/api/documents.mdx diff --git a/apps/www/docs/api/error-codes.mdx b/apps/www/docs/reference/api/error-codes.mdx similarity index 100% rename from apps/www/docs/api/error-codes.mdx rename to apps/www/docs/reference/api/error-codes.mdx diff --git a/apps/www/docs/api/metadata.mdx b/apps/www/docs/reference/api/metadata.mdx similarity index 100% rename from apps/www/docs/api/metadata.mdx rename to apps/www/docs/reference/api/metadata.mdx diff --git a/apps/www/docs/api/orders.mdx b/apps/www/docs/reference/api/orders.mdx similarity index 100% rename from apps/www/docs/api/orders.mdx rename to apps/www/docs/reference/api/orders.mdx diff --git a/apps/www/docs/api/pagination.mdx b/apps/www/docs/reference/api/pagination.mdx similarity index 100% rename from apps/www/docs/api/pagination.mdx rename to apps/www/docs/reference/api/pagination.mdx diff --git a/apps/www/docs/api/parcels.mdx b/apps/www/docs/reference/api/parcels.mdx similarity index 100% rename from apps/www/docs/api/parcels.mdx rename to apps/www/docs/reference/api/parcels.mdx diff --git a/apps/www/docs/api/shipments.mdx b/apps/www/docs/reference/api/shipments.mdx similarity index 100% rename from apps/www/docs/api/shipments.mdx rename to apps/www/docs/reference/api/shipments.mdx diff --git a/apps/www/docs/api/trackers.mdx b/apps/www/docs/reference/api/trackers.mdx similarity index 97% rename from apps/www/docs/api/trackers.mdx rename to apps/www/docs/reference/api/trackers.mdx index aed43694fe..330df9b9e0 100644 --- a/apps/www/docs/api/trackers.mdx +++ b/apps/www/docs/reference/api/trackers.mdx @@ -464,8 +464,8 @@ curl --request POST \ ## Tracking & Webhooks Karrio provides a simple way to track packages and get notified of changes. -You can use our [Tracking API](/api#tag/Trackers/operation/$$$$$$add) to track packages and -get notified via [Webhooks](/api#tag/Webhooks/operation/$$$$$$$list) when the status of a package changes. +You can use our [Tracking API](/reference/openapi#tag/Trackers/operation/$$$$$$add) to track packages and +get notified via [Webhooks](/reference/openapi#tag/Webhooks/operation/$$$$$$$list) when the status of a package changes. - To leverage that combination, create a webhook and subscribe to tracker related events @@ -722,7 +722,7 @@ Note that the event will only be sent when there is a data change
-_Learn more about the supported tracking [statuses](/api#tag/Trackers/operation/$$$$$$retrieves)_ +_Learn more about the supported tracking [statuses](/reference/openapi#tag/Trackers/operation/$$$$$$retrieves)_ ``` `pending` - pending @@ -755,5 +755,5 @@ For more advanced use cases, you can access the carrier's events details and raw ## Next steps -- To start integrating, [Checkout the Tracking Reference](/api#tag/Trackers). +- To start integrating, [Checkout the Tracking Reference](/reference/openapi#tag/Trackers). - Got a question? [Ask here](https://github.com/karrioapi/karrio/discussions). diff --git a/apps/www/docs/api/webhooks.mdx b/apps/www/docs/reference/api/webhooks.mdx similarity index 100% rename from apps/www/docs/api/webhooks.mdx rename to apps/www/docs/reference/api/webhooks.mdx diff --git a/apps/www/docs/management/connections.mdx b/apps/www/docs/reference/management/connections.mdx similarity index 100% rename from apps/www/docs/management/connections.mdx rename to apps/www/docs/reference/management/connections.mdx diff --git a/apps/www/docs/management/data.mdx b/apps/www/docs/reference/management/data.mdx similarity index 100% rename from apps/www/docs/management/data.mdx rename to apps/www/docs/reference/management/data.mdx diff --git a/apps/www/docs/management/organizations.mdx b/apps/www/docs/reference/management/organizations.mdx similarity index 100% rename from apps/www/docs/management/organizations.mdx rename to apps/www/docs/reference/management/organizations.mdx diff --git a/apps/www/docs/management/overview.mdx b/apps/www/docs/reference/management/overview.mdx similarity index 100% rename from apps/www/docs/management/overview.mdx rename to apps/www/docs/reference/management/overview.mdx diff --git a/apps/www/docs/management/users.mdx b/apps/www/docs/reference/management/users.mdx similarity index 100% rename from apps/www/docs/management/users.mdx rename to apps/www/docs/reference/management/users.mdx diff --git a/apps/www/docusaurus.config.js b/apps/www/docusaurus.config.js index 02e0504786..428b6cf15a 100644 --- a/apps/www/docusaurus.config.js +++ b/apps/www/docusaurus.config.js @@ -40,6 +40,129 @@ const config = { plugins: [ 'tailwind-loader', ...posthogPlugins, + [ + '@docusaurus/plugin-client-redirects', + { + redirects: [ + { + to: '/product/quick-start', + from: '/quick-start', + }, + { + to: '/product/local-development', + from: '/local-development', + }, + { + to: '/product/resources/faq', + from: '/faq', + }, + { + to: '/product/resources/support', + from: '/support', + }, + { + to: '/product/resources/privacy', + from: '/privacy', + }, + { + to: '/product/resources/terms', + from: '/terms', + }, + { + to: '/product/resources/contributing', + from: '/contributing/guidlines', + }, + { + to: '/product/resources/development', + from: '/contributing/development', + }, + { + to: '/product/self-hosting', + from: '/guides/self-hosting', + }, + { + to: '/product/self-hosting/oss', + from: '/self-hosting/oss', + }, + { + to: '/product/self-hosting/enterprise', + from: '/self-hosting/enterprise', + }, + { + to: '/product/self-hosting/administration', + from: '/self-hosting/administration', + }, + { + to: '/product/self-hosting/environment', + from: '/self-hosting/environment', + }, + { + to: '/reference/openapi', + from: '/api', + }, + { + to: '/reference/api/authentication', + from: '/api/authentication', + }, + { + to: '/reference/api/error-codes', + from: '/api/error-codes', + }, + { + to: '/reference/api/pagination', + from: '/api/pagination', + }, + { + to: '/reference/api/metadata', + from: '/api/metadata', + }, + { + to: '/reference/api/carriers', + from: '/api/carriers', + }, + { + to: '/reference/api/shipments', + from: '/api/shipments', + }, + { + to: '/reference/api/trackers', + from: '/api/trackers', + }, + { + to: '/reference/api/orders', + from: '/api/orders', + }, + { + to: '/reference/api/batches', + from: '/api/batches', + }, + { + to: '/reference/management', + from: '/management', + }, + { + to: '/reference/management/overview', + from: '/management/overview', + }, + { + to: '/reference/management/organizations', + from: '/management/organizations', + }, + { + to: '/reference/management/users', + from: '/management/users', + }, + { + to: '/reference/management/connections', + from: '/management/connections', + }, + { + to: '/reference/management/data', + from: '/management/data', + }, + ], + }, + ], ], presets: [ @@ -68,7 +191,7 @@ const config = { specs: [ { spec: 'https://raw.githubusercontent.com/karrioapi/karrio/main/schemas/openapi.yml', - route: '/api/', + route: '/reference/openapi/', }, ], // Theme Options for modifying how redoc renders them @@ -144,7 +267,7 @@ const config = { }, { label: 'OpenAPI', - href: '/api', + href: '/reference/openapi', }, { label: 'Carriers', diff --git a/apps/www/package.json b/apps/www/package.json index c95241e9bc..8eb9ffbca7 100644 --- a/apps/www/package.json +++ b/apps/www/package.json @@ -15,6 +15,7 @@ }, "dependencies": { "@docusaurus/core": "^3.1.1", + "@docusaurus/plugin-client-redirects": "^3.1.1", "@docusaurus/preset-classic": "^3.1.1", "@fortawesome/fontawesome-free": "^6.4.2", "@mdx-js/react": "^3.0.0", diff --git a/apps/www/sidebars.js b/apps/www/sidebars.js index b94430f1ec..c3de16644b 100644 --- a/apps/www/sidebars.js +++ b/apps/www/sidebars.js @@ -14,21 +14,14 @@ /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ const sidebars = { product: [ - { - type: 'category', - label: 'INTRODUCTION', - collapsed: false, - items: [ - 'quick-start', - 'local-development', - ], - }, { type: 'category', label: 'PRODUCT', collapsed: false, link: { type: 'doc', id: 'product' }, items: [ + 'product/quick-start', + 'product/local-development', 'product/connections', 'product/shipments', 'product/trackers', @@ -45,43 +38,26 @@ const sidebars = { label: 'SELF-HOSTING', collapsed: true, collapsible: true, - link: { type: 'doc', id: 'self-hosting' }, items: [ - 'self-hosting/oss', - 'self-hosting/enterprise', - { - type: 'category', - label: 'Configure', - collapsed: true, - collapsible: true, - items: [ - 'self-hosting/administration', - 'self-hosting/environment', - ], - }, + 'product/self-hosting', + 'product/self-hosting/oss', + 'product/self-hosting/enterprise', + 'product/self-hosting/administration', + 'product/self-hosting/environment', ], }, { type: 'category', - label: 'SEE ALSO', + label: 'ADDITIONAL RESOURCES', collapsed: true, collapsible: true, - link: { type: 'doc', id: 'faq' }, items: [ - 'faq', - 'support', - { - type: 'category', - label: 'Contributing', - collapsed: true, - collapsible: true, - items: [ - 'contributing/guidlines', - 'contributing/development', - ], - }, - "privacy", - "terms" + 'product/resources/faq', + 'product/resources/support', + 'product/resources/contributing', + 'product/resources/development', + "product/resources/privacy", + "product/resources/terms" ], }, ], @@ -89,7 +65,7 @@ const sidebars = { { type: 'link', label: 'API Reference', - href: '/api' + href: '/reference/openapi', }, { type: 'category', @@ -99,20 +75,18 @@ const sidebars = { title: 'Shipping API Guides', description: 'Learn how to use the Karrio Shipping APIs.', slug: '/reference', - keywords: ['guides'], + keywords: ['Shipping', 'REST', 'API'], }, items: [ - 'api/authentication', - 'api/error-codes', - 'api/pagination', - 'api/metadata', - 'api/carriers', - 'api/shipments', - 'api/trackers', - // 'api/addresses', - // 'api/parcels', - 'api/orders', - 'api/batches', + 'reference/api/authentication', + 'reference/api/error-codes', + 'reference/api/pagination', + 'reference/api/metadata', + 'reference/api/carriers', + 'reference/api/shipments', + 'reference/api/trackers', + 'reference/api/orders', + 'reference/api/batches', ], }, { @@ -122,15 +96,15 @@ const sidebars = { type: 'generated-index', title: 'Karrio Management API', description: 'Learn how to use the Karrio management GraphQL API.', - slug: '/management', - keywords: ['management', 'graphql'], + slug: '/reference/management', + keywords: ['Management', 'Graphql'], }, items: [ - 'management/overview', - 'management/organizations', - 'management/users', - 'management/connections', - 'management/data', + 'reference/management/overview', + 'reference/management/organizations', + 'reference/management/users', + 'reference/management/connections', + 'reference/management/data', ], }, ], diff --git a/package-lock.json b/package-lock.json index ee2936a8a5..d2cbbe0def 100644 --- a/package-lock.json +++ b/package-lock.json @@ -150,6 +150,7 @@ "version": "0.0.0", "dependencies": { "@docusaurus/core": "^3.1.1", + "@docusaurus/plugin-client-redirects": "^3.1.1", "@docusaurus/preset-classic": "^3.1.1", "@fortawesome/fontawesome-free": "^6.4.2", "@mdx-js/react": "^3.0.0", @@ -3938,6 +3939,42 @@ "react-dom": "*" } }, + "node_modules/@docusaurus/plugin-client-redirects": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-client-redirects/-/plugin-client-redirects-3.1.1.tgz", + "integrity": "sha512-J/1Z75XkO+BmUXHW17FrCIYZQ3b0IKaJECH6yCxW5RQ8NMMJ+SZCtPtx5oYoAd0VHersNiUu+ZAxfOqbsn1jKQ==", + "dependencies": { + "@docusaurus/core": "3.1.1", + "@docusaurus/logger": "3.1.1", + "@docusaurus/utils": "3.1.1", + "@docusaurus/utils-common": "3.1.1", + "@docusaurus/utils-validation": "3.1.1", + "eta": "^2.2.0", + "fs-extra": "^11.1.1", + "lodash": "^4.17.21", + "tslib": "^2.6.0" + }, + "engines": { + "node": ">=18.0" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, + "node_modules/@docusaurus/plugin-client-redirects/node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, "node_modules/@docusaurus/plugin-content-blog": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-blog/-/plugin-content-blog-3.1.1.tgz", From 0efe3ae11a2cdd3d582a40bb8aefb29d0480d942 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Sat, 17 Feb 2024 23:02:49 -0800 Subject: [PATCH 02/20] docs: add more details to carrier integration overview --- apps/www/sidebars.js | 2 +- .../CarrierIntegrationDetails/index.jsx | 124 +++++++++++++++--- 2 files changed, 105 insertions(+), 21 deletions(-) diff --git a/apps/www/sidebars.js b/apps/www/sidebars.js index c3de16644b..9395f0c039 100644 --- a/apps/www/sidebars.js +++ b/apps/www/sidebars.js @@ -64,7 +64,7 @@ const sidebars = { reference: [ { type: 'link', - label: 'API Reference', + label: 'OpenAPI', href: '/reference/openapi', }, { diff --git a/apps/www/src/components/CarrierIntegrationDetails/index.jsx b/apps/www/src/components/CarrierIntegrationDetails/index.jsx index 7c5a8ddf18..f05f863a56 100644 --- a/apps/www/src/components/CarrierIntegrationDetails/index.jsx +++ b/apps/www/src/components/CarrierIntegrationDetails/index.jsx @@ -4,33 +4,117 @@ import styles from "./styles.module.css"; const references = require("./references.json"); const CarrierIntegrationDetails = ({ children, id, integration = {} }) => { + const services = references.services[id]; + const options = references.options[id]; return (
-
{integration.description}
- -
-
- -
-
Capabilities
-
-
- {integration.features.map((feature, index) => ( -
-
{feature}
-
- ))} + {/* Overview */} +
+
+
Overview
+ {integration.status}
+ + + + + + + + + + + + + + + + + + +
Website{integration.website}
Documentation{integration.docs}
Supported Capabilities +
    + + {integration.features.map((feature, index) => ( +
  • {feature}
  • + ))} + +
+
+
{integration.description}
+ +
+ + {/* Capabilities */} +

Supported Capabilities

+
    + + {integration.features.map((feature, index) => ( +
  • {feature}
  • + ))} + +
+ + + {/* Environments */} + {/*

Environments

*/} + + + {/* Shipping Services */} + {!!services && <> +

Shipping Services

+ + + + + + + + + + + {Object.entries(services).map(([code, name], index) => ( + + + + + ))} + + +
API codeCarrier code
{code}{name}
+ } + + + {/* Shipping Options */} + {!!options && <> +

Shipping Options

+ + + + + + + + + + + + {Object.entries(options).map(([code, option], index) => ( + + + + + + ))} + + +
API codeCarrier codeType
{code}{option.code}{option.type}
+ } +
) }; From cb1efbed6351d13f544dfb772332c650ddd291a2 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Wed, 21 Feb 2024 16:12:18 -0800 Subject: [PATCH 03/20] chore(FedEx): Rename extension fedex -> fedex_ws for FedEx Web Service legacy integration before deprecation --- .../karrio/providers/fedex/pickup/__init__.py | 3 - modules/connectors/fedex/tests/__init__.py | 6 -- .../connectors/{fedex => fedex_ws}/README.md | 0 .../connectors/{fedex => fedex_ws}/generate | 0 .../karrio/mappers/fedex_ws}/__init__.py | 12 ++-- .../karrio/mappers/fedex_ws}/mapper.py | 4 +- .../karrio/mappers/fedex_ws}/proxy.py | 4 +- .../karrio/mappers/fedex_ws}/settings.py | 6 +- .../karrio/providers/fedex_ws}/__init__.py | 14 ++-- .../karrio/providers/fedex_ws}/address.py | 72 ++++++++++--------- .../karrio/providers/fedex_ws}/document.py | 8 +-- .../karrio/providers/fedex_ws}/error.py | 4 +- .../providers/fedex_ws/pickup/__init__.py | 12 ++++ .../fedex_ws}/pickup/availability.py | 4 +- .../providers/fedex_ws}/pickup/cancel.py | 6 +- .../providers/fedex_ws}/pickup/create.py | 10 +-- .../providers/fedex_ws}/pickup/update.py | 8 +-- .../karrio/providers/fedex_ws}/rate.py | 8 +-- .../providers/fedex_ws}/shipment/__init__.py | 4 +- .../providers/fedex_ws}/shipment/cancel.py | 6 +- .../providers/fedex_ws}/shipment/create.py | 8 +-- .../karrio/providers/fedex_ws}/tracking.py | 8 +-- .../karrio/providers/fedex_ws}/units.py | 0 .../karrio/providers/fedex_ws}/utils.py | 4 +- .../karrio/schemas/fedex_ws}/__init__.py | 0 .../address_validation_service_v4.py | 0 .../schemas/fedex_ws}/async_service_v4.py | 0 .../schemas/fedex_ws}/close_service_v5.py | 0 .../schemas/fedex_ws}/dgds_service_v5.py | 0 .../schemas/fedex_ws}/dgld_service_v1.py | 0 .../in_flight_shipment_service_v1.py | 0 .../schemas/fedex_ws}/location_service_v12.py | 0 .../fedex_ws}/open_ship_service_v18.py | 0 .../schemas/fedex_ws}/pickup_service_v22.py | 0 .../schemas/fedex_ws}/rate_service_v28.py | 0 .../schemas/fedex_ws}/ship_service_v26.py | 0 .../schemas/fedex_ws}/track_service_v19.py | 0 .../fedex_ws}/upload_document_service_v17.py | 0 ...availability_and_commitment_service_v15.py | 0 .../schemas/error_response.json | 0 .../schemas/paperless_request.json | 0 .../schemas/paperless_response.json | 0 .../schemas/rating_request.json | 0 .../schemas/rating_response.json | 0 .../schemas/shipping_cancel_request.json | 0 .../schemas/shipping_cancel_response.json | 0 .../schemas/shipping_request.json | 0 .../schemas/shipping_response.json | 0 .../schemas/tracking_request.json | 0 .../schemas/tracking_response.json | 0 .../connectors/{fedex => fedex_ws}/setup.py | 4 +- modules/connectors/fedex_ws/tests/__init__.py | 6 ++ .../tests/fedex_ws}/__init__.py | 0 .../tests/fedex_ws}/fixture.py | 2 +- .../tests/fedex_ws}/test_address.py | 6 +- .../tests/fedex_ws}/test_document.py | 4 +- .../tests/fedex_ws}/test_pickup.py | 12 ++-- .../tests/fedex_ws}/test_rate.py | 20 +++--- .../tests/fedex_ws}/test_shipment.py | 16 ++--- .../tests/fedex_ws}/test_tracking.py | 14 ++-- modules/core/karrio/server/core/tests.py | 2 +- .../models/{fedex.py => fedex_ws.py} | 12 ++-- ..._fedexsettings_fedexwssettings_and_more.py | 28 ++++++++ .../graph/karrio/server/graph/tests/base.py | 2 +- .../graph/tests/test_carrier_connections.py | 2 +- .../0044_alter_surcharge_carriers.py | 62 ++++++++++++++++ requirements.sdk.dev.txt | 2 +- requirements.server.dev.txt | 2 +- 68 files changed, 255 insertions(+), 152 deletions(-) delete mode 100644 modules/connectors/fedex/karrio/providers/fedex/pickup/__init__.py delete mode 100644 modules/connectors/fedex/tests/__init__.py rename modules/connectors/{fedex => fedex_ws}/README.md (100%) rename modules/connectors/{fedex => fedex_ws}/generate (100%) rename modules/connectors/{fedex/karrio/mappers/fedex => fedex_ws/karrio/mappers/fedex_ws}/__init__.py (58%) rename modules/connectors/{fedex/karrio/mappers/fedex => fedex_ws/karrio/mappers/fedex_ws}/mapper.py (97%) rename modules/connectors/{fedex/karrio/mappers/fedex => fedex_ws/karrio/mappers/fedex_ws}/proxy.py (96%) rename modules/connectors/{fedex/karrio/mappers/fedex => fedex_ws/karrio/mappers/fedex_ws}/settings.py (79%) rename modules/connectors/{fedex/karrio/providers/fedex => fedex_ws/karrio/providers/fedex_ws}/__init__.py (56%) rename modules/connectors/{fedex/karrio/providers/fedex => fedex_ws/karrio/providers/fedex_ws}/address.py (64%) rename modules/connectors/{fedex/karrio/providers/fedex => fedex_ws/karrio/providers/fedex_ws}/document.py (94%) rename modules/connectors/{fedex/karrio/providers/fedex => fedex_ws/karrio/providers/fedex_ws}/error.py (89%) create mode 100644 modules/connectors/fedex_ws/karrio/providers/fedex_ws/pickup/__init__.py rename modules/connectors/{fedex/karrio/providers/fedex => fedex_ws/karrio/providers/fedex_ws}/pickup/availability.py (95%) rename modules/connectors/{fedex/karrio/providers/fedex => fedex_ws/karrio/providers/fedex_ws}/pickup/cancel.py (93%) rename modules/connectors/{fedex/karrio/providers/fedex => fedex_ws/karrio/providers/fedex_ws}/pickup/create.py (94%) rename modules/connectors/{fedex/karrio/providers/fedex => fedex_ws/karrio/providers/fedex_ws}/pickup/update.py (88%) rename modules/connectors/{fedex/karrio/providers/fedex => fedex_ws/karrio/providers/fedex_ws}/rate.py (98%) rename modules/connectors/{fedex/karrio/providers/fedex => fedex_ws/karrio/providers/fedex_ws}/shipment/__init__.py (51%) rename modules/connectors/{fedex/karrio/providers/fedex => fedex_ws/karrio/providers/fedex_ws}/shipment/cancel.py (91%) rename modules/connectors/{fedex/karrio/providers/fedex => fedex_ws/karrio/providers/fedex_ws}/shipment/create.py (99%) rename modules/connectors/{fedex/karrio/providers/fedex => fedex_ws/karrio/providers/fedex_ws}/tracking.py (96%) rename modules/connectors/{fedex/karrio/providers/fedex => fedex_ws/karrio/providers/fedex_ws}/units.py (100%) rename modules/connectors/{fedex/karrio/providers/fedex => fedex_ws/karrio/providers/fedex_ws}/utils.py (93%) rename modules/connectors/{fedex/karrio/schemas/fedex => fedex_ws/karrio/schemas/fedex_ws}/__init__.py (100%) rename modules/connectors/{fedex/karrio/schemas/fedex => fedex_ws/karrio/schemas/fedex_ws}/address_validation_service_v4.py (100%) rename modules/connectors/{fedex/karrio/schemas/fedex => fedex_ws/karrio/schemas/fedex_ws}/async_service_v4.py (100%) rename modules/connectors/{fedex/karrio/schemas/fedex => fedex_ws/karrio/schemas/fedex_ws}/close_service_v5.py (100%) rename modules/connectors/{fedex/karrio/schemas/fedex => fedex_ws/karrio/schemas/fedex_ws}/dgds_service_v5.py (100%) rename modules/connectors/{fedex/karrio/schemas/fedex => fedex_ws/karrio/schemas/fedex_ws}/dgld_service_v1.py (100%) rename modules/connectors/{fedex/karrio/schemas/fedex => fedex_ws/karrio/schemas/fedex_ws}/in_flight_shipment_service_v1.py (100%) rename modules/connectors/{fedex/karrio/schemas/fedex => fedex_ws/karrio/schemas/fedex_ws}/location_service_v12.py (100%) rename modules/connectors/{fedex/karrio/schemas/fedex => fedex_ws/karrio/schemas/fedex_ws}/open_ship_service_v18.py (100%) rename modules/connectors/{fedex/karrio/schemas/fedex => fedex_ws/karrio/schemas/fedex_ws}/pickup_service_v22.py (100%) rename modules/connectors/{fedex/karrio/schemas/fedex => fedex_ws/karrio/schemas/fedex_ws}/rate_service_v28.py (100%) rename modules/connectors/{fedex/karrio/schemas/fedex => fedex_ws/karrio/schemas/fedex_ws}/ship_service_v26.py (100%) rename modules/connectors/{fedex/karrio/schemas/fedex => fedex_ws/karrio/schemas/fedex_ws}/track_service_v19.py (100%) rename modules/connectors/{fedex/karrio/schemas/fedex => fedex_ws/karrio/schemas/fedex_ws}/upload_document_service_v17.py (100%) rename modules/connectors/{fedex/karrio/schemas/fedex => fedex_ws/karrio/schemas/fedex_ws}/validation_availability_and_commitment_service_v15.py (100%) rename modules/connectors/{fedex => fedex_ws}/schemas/error_response.json (100%) rename modules/connectors/{fedex => fedex_ws}/schemas/paperless_request.json (100%) rename modules/connectors/{fedex => fedex_ws}/schemas/paperless_response.json (100%) rename modules/connectors/{fedex => fedex_ws}/schemas/rating_request.json (100%) rename modules/connectors/{fedex => fedex_ws}/schemas/rating_response.json (100%) rename modules/connectors/{fedex => fedex_ws}/schemas/shipping_cancel_request.json (100%) rename modules/connectors/{fedex => fedex_ws}/schemas/shipping_cancel_response.json (100%) rename modules/connectors/{fedex => fedex_ws}/schemas/shipping_request.json (100%) rename modules/connectors/{fedex => fedex_ws}/schemas/shipping_response.json (100%) rename modules/connectors/{fedex => fedex_ws}/schemas/tracking_request.json (100%) rename modules/connectors/{fedex => fedex_ws}/schemas/tracking_response.json (100%) rename modules/connectors/{fedex => fedex_ws}/setup.py (88%) create mode 100644 modules/connectors/fedex_ws/tests/__init__.py rename modules/connectors/{fedex/tests/fedex => fedex_ws/tests/fedex_ws}/__init__.py (100%) rename modules/connectors/{fedex/tests/fedex => fedex_ws/tests/fedex_ws}/fixture.py (80%) rename modules/connectors/{fedex/tests/fedex => fedex_ws/tests/fedex_ws}/test_address.py (97%) rename modules/connectors/{fedex/tests/fedex => fedex_ws/tests/fedex_ws}/test_document.py (97%) rename modules/connectors/{fedex/tests/fedex => fedex_ws/tests/fedex_ws}/test_pickup.py (98%) rename modules/connectors/{fedex/tests/fedex => fedex_ws/tests/fedex_ws}/test_rate.py (99%) rename modules/connectors/{fedex/tests/fedex => fedex_ws/tests/fedex_ws}/test_shipment.py (99%) rename modules/connectors/{fedex/tests/fedex => fedex_ws/tests/fedex_ws}/test_tracking.py (97%) rename modules/core/karrio/server/providers/extension/models/{fedex.py => fedex_ws.py} (67%) create mode 100644 modules/core/karrio/server/providers/migrations/0066_rename_fedexsettings_fedexwssettings_and_more.py create mode 100644 modules/pricing/karrio/server/pricing/migrations/0044_alter_surcharge_carriers.py diff --git a/modules/connectors/fedex/karrio/providers/fedex/pickup/__init__.py b/modules/connectors/fedex/karrio/providers/fedex/pickup/__init__.py deleted file mode 100644 index cecb06a5df..0000000000 --- a/modules/connectors/fedex/karrio/providers/fedex/pickup/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from karrio.providers.fedex.pickup.create import parse_pickup_response, pickup_request -from karrio.providers.fedex.pickup.update import parse_pickup_update_response, pickup_update_request -from karrio.providers.fedex.pickup.cancel import parse_pickup_cancel_response, pickup_cancel_request diff --git a/modules/connectors/fedex/tests/__init__.py b/modules/connectors/fedex/tests/__init__.py deleted file mode 100644 index 7f43c10a57..0000000000 --- a/modules/connectors/fedex/tests/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -from tests.feddex.test_rate import * -from tests.feddex.test_tracking import * -from tests.feddex.test_shipment import * -from tests.feddex.test_pickup import * -from tests.feddex.test_address import * -from tests.feddex.test_document import * diff --git a/modules/connectors/fedex/README.md b/modules/connectors/fedex_ws/README.md similarity index 100% rename from modules/connectors/fedex/README.md rename to modules/connectors/fedex_ws/README.md diff --git a/modules/connectors/fedex/generate b/modules/connectors/fedex_ws/generate similarity index 100% rename from modules/connectors/fedex/generate rename to modules/connectors/fedex_ws/generate diff --git a/modules/connectors/fedex/karrio/mappers/fedex/__init__.py b/modules/connectors/fedex_ws/karrio/mappers/fedex_ws/__init__.py similarity index 58% rename from modules/connectors/fedex/karrio/mappers/fedex/__init__.py rename to modules/connectors/fedex_ws/karrio/mappers/fedex_ws/__init__.py index 036f3dfad8..f83c7d4751 100644 --- a/modules/connectors/fedex/karrio/mappers/fedex/__init__.py +++ b/modules/connectors/fedex_ws/karrio/mappers/fedex_ws/__init__.py @@ -1,14 +1,14 @@ from karrio.core.metadata import Metadata -from karrio.mappers.fedex.mapper import Mapper -from karrio.mappers.fedex.proxy import Proxy -from karrio.mappers.fedex.settings import Settings -import karrio.providers.fedex.units as units +from karrio.mappers.fedex_ws.mapper import Mapper +from karrio.mappers.fedex_ws.proxy import Proxy +from karrio.mappers.fedex_ws.settings import Settings +import karrio.providers.fedex_ws.units as units METADATA = Metadata( - id="fedex", - label="FedEx", + id="fedex_ws", + label="FedEx Web Service", # Integrations Mapper=Mapper, Proxy=Proxy, diff --git a/modules/connectors/fedex/karrio/mappers/fedex/mapper.py b/modules/connectors/fedex_ws/karrio/mappers/fedex_ws/mapper.py similarity index 97% rename from modules/connectors/fedex/karrio/mappers/fedex/mapper.py rename to modules/connectors/fedex_ws/karrio/mappers/fedex_ws/mapper.py index b7358c174d..1249ac41d1 100644 --- a/modules/connectors/fedex/karrio/mappers/fedex/mapper.py +++ b/modules/connectors/fedex_ws/karrio/mappers/fedex_ws/mapper.py @@ -2,8 +2,8 @@ import karrio.lib as lib import karrio.api.mapper as mapper import karrio.core.models as models -import karrio.providers.fedex as provider -from karrio.mappers.fedex.settings import Settings +import karrio.providers.fedex_ws as provider +from karrio.mappers.fedex_ws.settings import Settings class Mapper(mapper.Mapper): diff --git a/modules/connectors/fedex/karrio/mappers/fedex/proxy.py b/modules/connectors/fedex_ws/karrio/mappers/fedex_ws/proxy.py similarity index 96% rename from modules/connectors/fedex/karrio/mappers/fedex/proxy.py rename to modules/connectors/fedex_ws/karrio/mappers/fedex_ws/proxy.py index 41389d0d8d..21441d167d 100644 --- a/modules/connectors/fedex/karrio/mappers/fedex/proxy.py +++ b/modules/connectors/fedex_ws/karrio/mappers/fedex_ws/proxy.py @@ -1,8 +1,8 @@ -from karrio.schemas.fedex.ship_service_v26 import TrackingId +from karrio.schemas.fedex_ws.ship_service_v26 import TrackingId import karrio.lib as lib import karrio.api.proxy as proxy -from karrio.mappers.fedex.settings import Settings +from karrio.mappers.fedex_ws.settings import Settings class Proxy(proxy.Proxy): diff --git a/modules/connectors/fedex/karrio/mappers/fedex/settings.py b/modules/connectors/fedex_ws/karrio/mappers/fedex_ws/settings.py similarity index 79% rename from modules/connectors/fedex/karrio/mappers/fedex/settings.py rename to modules/connectors/fedex_ws/karrio/mappers/fedex_ws/settings.py index 3fc74c24ba..b51a4facf9 100644 --- a/modules/connectors/fedex/karrio/mappers/fedex/settings.py +++ b/modules/connectors/fedex_ws/karrio/mappers/fedex_ws/settings.py @@ -1,7 +1,7 @@ """Karrio FedEx client settings.""" import attr -from karrio.providers.fedex.utils import Settings as BaseSettings +from karrio.providers.fedex_ws.utils import Settings as BaseSettings @attr.s(auto_attribs=True) @@ -17,10 +17,10 @@ class Settings(BaseSettings): id: str = None test_mode: bool = False - carrier_id: str = "fedex" + carrier_id: str = "fedex_ws" metadata: dict = {} config: dict = {} @property def carrier_name(self): - return "fedex" + return "fedex_ws" diff --git a/modules/connectors/fedex/karrio/providers/fedex/__init__.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/__init__.py similarity index 56% rename from modules/connectors/fedex/karrio/providers/fedex/__init__.py rename to modules/connectors/fedex_ws/karrio/providers/fedex_ws/__init__.py index 7948f165db..1a001c6d08 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/__init__.py +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/__init__.py @@ -1,9 +1,9 @@ -from karrio.providers.fedex.utils import Settings -from karrio.providers.fedex.address import ( +from karrio.providers.fedex_ws.utils import Settings +from karrio.providers.fedex_ws.address import ( parse_address_validation_response, address_validation_request, ) -from karrio.providers.fedex.pickup import ( +from karrio.providers.fedex_ws.pickup import ( parse_pickup_cancel_response, parse_pickup_update_response, parse_pickup_response, @@ -11,18 +11,18 @@ pickup_cancel_request, pickup_request, ) -from karrio.providers.fedex.tracking import ( +from karrio.providers.fedex_ws.tracking import ( parse_tracking_response, tracking_request, ) -from karrio.providers.fedex.rate import rate_request, parse_rate_response -from karrio.providers.fedex.shipment import ( +from karrio.providers.fedex_ws.rate import rate_request, parse_rate_response +from karrio.providers.fedex_ws.shipment import ( parse_shipment_cancel_response, parse_shipment_response, shipment_cancel_request, shipment_request, ) -from karrio.providers.fedex.document import ( +from karrio.providers.fedex_ws.document import ( parse_document_upload_response, document_upload_request, ) diff --git a/modules/connectors/fedex/karrio/providers/fedex/address.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/address.py similarity index 64% rename from modules/connectors/fedex/karrio/providers/fedex/address.py rename to modules/connectors/fedex_ws/karrio/providers/fedex_ws/address.py index f4f46bb011..316cba67aa 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/address.py +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/address.py @@ -1,5 +1,5 @@ from typing import Tuple, List -from karrio.schemas.fedex.address_validation_service_v4 import ( +from karrio.schemas.fedex_ws.address_validation_service_v4 import ( AddressValidationRequest as FedexAddressValidationRequest, AddressValidationReply, AddressToValidate, @@ -17,8 +17,8 @@ AddressValidationDetails, Address, ) -from karrio.providers.fedex.utils import Settings, default_request_serializer -from karrio.providers.fedex.error import parse_error_response +from karrio.providers.fedex_ws.utils import Settings, default_request_serializer +from karrio.providers.fedex_ws.error import parse_error_response import karrio.lib as lib @@ -44,16 +44,18 @@ def parse_address_validation_response( carrier_id=settings.carrier_id, carrier_name=settings.carrier_name, success=success, - complete_address=Address( - city=address.City, - state_code=address.StateOrProvinceCode, - country_code=address.CountryCode, - residential=address.Residential, - address_line1=next(iter(address.StreetLines), None), - address_line2=SF.concat_str(lines, join=True), - ) - if address is not None - else None, + complete_address=( + Address( + city=address.City, + state_code=address.StateOrProvinceCode, + country_code=address.CountryCode, + residential=address.Residential, + address_line1=next(iter(address.StreetLines), None), + address_line2=SF.concat_str(lines, join=True), + ) + if address is not None + else None + ), ) if success else None @@ -79,27 +81,29 @@ def address_validation_request( AddressesToValidate=[ AddressToValidate( ClientReferenceId=None, - Contact=Contact( - ContactId=None, - PersonName=address.person_name, - Title=None, - CompanyName=address.company_name, - PhoneNumber=address.phone_number, - PhoneExtension=None, - TollFreePhoneNumber=None, - PagerNumber=None, - FaxNumber=None, - EMailAddress=address.email, - ) - if any( - [ - address.person_name, - address.company_name, - address.phone_number, - address.email, - ] - ) - else None, + Contact=( + Contact( + ContactId=None, + PersonName=address.person_name, + Title=None, + CompanyName=address.company_name, + PhoneNumber=address.phone_number, + PhoneExtension=None, + TollFreePhoneNumber=None, + PagerNumber=None, + FaxNumber=None, + EMailAddress=address.email, + ) + if any( + [ + address.person_name, + address.company_name, + address.phone_number, + address.email, + ] + ) + else None + ), Address=FedexAddress( StreetLines=lib.join( address.street, diff --git a/modules/connectors/fedex/karrio/providers/fedex/document.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/document.py similarity index 94% rename from modules/connectors/fedex/karrio/providers/fedex/document.py rename to modules/connectors/fedex_ws/karrio/providers/fedex_ws/document.py index b2481befb0..372c887bbb 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/document.py +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/document.py @@ -1,11 +1,11 @@ -import karrio.schemas.fedex.upload_document_service_v17 as fedex +import karrio.schemas.fedex_ws.upload_document_service_v17 as fedex import base64 import typing import karrio.lib as lib import karrio.core.models as models -import karrio.providers.fedex.error as provider_error -import karrio.providers.fedex.units as provider_units -import karrio.providers.fedex.utils as provider_utils +import karrio.providers.fedex_ws.error as provider_error +import karrio.providers.fedex_ws.units as provider_units +import karrio.providers.fedex_ws.utils as provider_utils def parse_document_upload_response( diff --git a/modules/connectors/fedex/karrio/providers/fedex/error.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/error.py similarity index 89% rename from modules/connectors/fedex/karrio/providers/fedex/error.py rename to modules/connectors/fedex_ws/karrio/providers/fedex_ws/error.py index 8fb7701ccc..cb208bd002 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/error.py +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/error.py @@ -1,8 +1,8 @@ from typing import List, Optional -from karrio.schemas.fedex.rate_service_v28 import Notification +from karrio.schemas.fedex_ws.rate_service_v28 import Notification from karrio.core.models import Message from karrio.core.utils import Element, extract_fault, XP -from karrio.providers.fedex.utils import Settings +from karrio.providers.fedex_ws.utils import Settings def parse_error_response(response: Element, settings: Settings) -> List[Message]: diff --git a/modules/connectors/fedex_ws/karrio/providers/fedex_ws/pickup/__init__.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/pickup/__init__.py new file mode 100644 index 0000000000..ac652ce9c6 --- /dev/null +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/pickup/__init__.py @@ -0,0 +1,12 @@ +from karrio.providers.fedex_ws.pickup.create import ( + parse_pickup_response, + pickup_request, +) +from karrio.providers.fedex_ws.pickup.update import ( + parse_pickup_update_response, + pickup_update_request, +) +from karrio.providers.fedex_ws.pickup.cancel import ( + parse_pickup_cancel_response, + pickup_cancel_request, +) diff --git a/modules/connectors/fedex/karrio/providers/fedex/pickup/availability.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/pickup/availability.py similarity index 95% rename from modules/connectors/fedex/karrio/providers/fedex/pickup/availability.py rename to modules/connectors/fedex_ws/karrio/providers/fedex_ws/pickup/availability.py index 8d987b0db9..d105b7bb3a 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/pickup/availability.py +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/pickup/availability.py @@ -1,5 +1,5 @@ from datetime import datetime -from karrio.schemas.fedex.pickup_service_v22 import ( +from karrio.schemas.fedex_ws.pickup_service_v22 import ( PickupAvailabilityRequest, TransactionDetail, VersionId, @@ -20,7 +20,7 @@ XP, DF, ) -from karrio.providers.fedex.utils import Settings +from karrio.providers.fedex_ws.utils import Settings def pickup_availability_request( diff --git a/modules/connectors/fedex/karrio/providers/fedex/pickup/cancel.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/pickup/cancel.py similarity index 93% rename from modules/connectors/fedex/karrio/providers/fedex/pickup/cancel.py rename to modules/connectors/fedex_ws/karrio/providers/fedex_ws/pickup/cancel.py index bfa635f870..2f2a2e465d 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/pickup/cancel.py +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/pickup/cancel.py @@ -1,5 +1,5 @@ from typing import Tuple, List -from karrio.schemas.fedex.pickup_service_v22 import ( +from karrio.schemas.fedex_ws.pickup_service_v22 import ( CancelPickupRequest, TransactionDetail, VersionId, @@ -20,8 +20,8 @@ Element, XP, ) -from karrio.providers.fedex.error import parse_error_response -from karrio.providers.fedex.utils import Settings +from karrio.providers.fedex_ws.error import parse_error_response +from karrio.providers.fedex_ws.utils import Settings import karrio.lib as lib diff --git a/modules/connectors/fedex/karrio/providers/fedex/pickup/create.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/pickup/create.py similarity index 94% rename from modules/connectors/fedex/karrio/providers/fedex/pickup/create.py rename to modules/connectors/fedex_ws/karrio/providers/fedex_ws/pickup/create.py index a6b4a41b38..1af12629a5 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/pickup/create.py +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/pickup/create.py @@ -1,7 +1,7 @@ from datetime import datetime from typing import List, Tuple from functools import partial -from karrio.schemas.fedex.pickup_service_v22 import ( +from karrio.schemas.fedex_ws.pickup_service_v22 import ( PickupAvailabilityReply, CreatePickupRequest, TransactionDetail, @@ -33,10 +33,10 @@ DF, XP, ) -from karrio.providers.fedex.pickup.availability import pickup_availability_request -from karrio.providers.fedex.utils import Settings -from karrio.providers.fedex.units import PackagePresets -from karrio.providers.fedex.error import parse_error_response +from karrio.providers.fedex_ws.pickup.availability import pickup_availability_request +from karrio.providers.fedex_ws.utils import Settings +from karrio.providers.fedex_ws.units import PackagePresets +from karrio.providers.fedex_ws.error import parse_error_response import karrio.lib as lib diff --git a/modules/connectors/fedex/karrio/providers/fedex/pickup/update.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/pickup/update.py similarity index 88% rename from modules/connectors/fedex/karrio/providers/fedex/pickup/update.py rename to modules/connectors/fedex_ws/karrio/providers/fedex_ws/pickup/update.py index cb0149cbc4..a88071fbd8 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/pickup/update.py +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/pickup/update.py @@ -1,6 +1,6 @@ from typing import cast from functools import partial -from karrio.schemas.fedex.pickup_service_v22 import ( +from karrio.schemas.fedex_ws.pickup_service_v22 import ( CreatePickupReply, NotificationSeverityType, ) @@ -10,13 +10,13 @@ PickupUpdateRequest, PickupCancelRequest, ) -from karrio.providers.fedex.utils import Settings -from karrio.providers.fedex.pickup.create import ( +from karrio.providers.fedex_ws.utils import Settings +from karrio.providers.fedex_ws.pickup.create import ( _get_availability, _create_pickup, parse_pickup_response, ) -from karrio.providers.fedex.pickup.cancel import pickup_cancel_request +from karrio.providers.fedex_ws.pickup.cancel import pickup_cancel_request parse_pickup_update_response = parse_pickup_response diff --git a/modules/connectors/fedex/karrio/providers/fedex/rate.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/rate.py similarity index 98% rename from modules/connectors/fedex/karrio/providers/fedex/rate.py rename to modules/connectors/fedex_ws/karrio/providers/fedex_ws/rate.py index 06766aed69..89eafec0dc 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/rate.py +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/rate.py @@ -1,4 +1,4 @@ -from karrio.schemas.fedex.rate_service_v28 import ( +from karrio.schemas.fedex_ws.rate_service_v28 import ( RateRequest as FedexRateRequest, RateReplyDetail, TransactionDetail, @@ -22,9 +22,9 @@ import karrio.lib as lib import karrio.core.units as units import karrio.core.models as models -import karrio.providers.fedex.error as provider_error -import karrio.providers.fedex.units as provider_units -import karrio.providers.fedex.utils as provider_utils +import karrio.providers.fedex_ws.error as provider_error +import karrio.providers.fedex_ws.units as provider_units +import karrio.providers.fedex_ws.utils as provider_utils def parse_rate_response( diff --git a/modules/connectors/fedex/karrio/providers/fedex/shipment/__init__.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/shipment/__init__.py similarity index 51% rename from modules/connectors/fedex/karrio/providers/fedex/shipment/__init__.py rename to modules/connectors/fedex_ws/karrio/providers/fedex_ws/shipment/__init__.py index 4844a3103c..800787a080 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/shipment/__init__.py +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/shipment/__init__.py @@ -1,8 +1,8 @@ -from karrio.providers.fedex.shipment.create import ( +from karrio.providers.fedex_ws.shipment.create import ( parse_shipment_response, shipment_request, ) -from karrio.providers.fedex.shipment.cancel import ( +from karrio.providers.fedex_ws.shipment.cancel import ( parse_shipment_cancel_response, shipment_cancel_request, ) diff --git a/modules/connectors/fedex/karrio/providers/fedex/shipment/cancel.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/shipment/cancel.py similarity index 91% rename from modules/connectors/fedex/karrio/providers/fedex/shipment/cancel.py rename to modules/connectors/fedex_ws/karrio/providers/fedex_ws/shipment/cancel.py index 4b09687a49..645bb227d1 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/shipment/cancel.py +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/shipment/cancel.py @@ -1,5 +1,5 @@ from typing import List, Tuple -from karrio.schemas.fedex.ship_service_v26 import ( +from karrio.schemas.fedex_ws.ship_service_v26 import ( DeleteShipmentRequest, TrackingId, TransactionDetail, @@ -13,8 +13,8 @@ Serializable, create_envelope, ) -from karrio.providers.fedex.error import parse_error_response -from karrio.providers.fedex.utils import Settings, default_request_serializer +from karrio.providers.fedex_ws.error import parse_error_response +from karrio.providers.fedex_ws.utils import Settings, default_request_serializer import karrio.lib as lib diff --git a/modules/connectors/fedex/karrio/providers/fedex/shipment/create.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/shipment/create.py similarity index 99% rename from modules/connectors/fedex/karrio/providers/fedex/shipment/create.py rename to modules/connectors/fedex_ws/karrio/providers/fedex_ws/shipment/create.py index 395cade148..6bd16a5267 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/shipment/create.py +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/shipment/create.py @@ -1,13 +1,13 @@ -import karrio.schemas.fedex.ship_service_v26 as fedex +import karrio.schemas.fedex_ws.ship_service_v26 as fedex import typing import base64 import datetime import karrio.lib as lib import karrio.core.units as units import karrio.core.models as models -import karrio.providers.fedex.error as provider_error -import karrio.providers.fedex.units as provider_units -import karrio.providers.fedex.utils as provider_utils +import karrio.providers.fedex_ws.error as provider_error +import karrio.providers.fedex_ws.units as provider_units +import karrio.providers.fedex_ws.utils as provider_utils NOTIFICATION_EVENTS = [ diff --git a/modules/connectors/fedex/karrio/providers/fedex/tracking.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/tracking.py similarity index 96% rename from modules/connectors/fedex/karrio/providers/fedex/tracking.py rename to modules/connectors/fedex_ws/karrio/providers/fedex_ws/tracking.py index 740e9964eb..805d7ac1cd 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/tracking.py +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/tracking.py @@ -1,10 +1,10 @@ -import karrio.schemas.fedex.track_service_v19 as fedex +import karrio.schemas.fedex_ws.track_service_v19 as fedex import typing import karrio.lib as lib import karrio.core.models as models -import karrio.providers.fedex.error as provider_error -import karrio.providers.fedex.utils as provider_utils -import karrio.providers.fedex.units as provider_units +import karrio.providers.fedex_ws.error as provider_error +import karrio.providers.fedex_ws.utils as provider_utils +import karrio.providers.fedex_ws.units as provider_units estimated_date_formats = [ "%Y-%m-%dT%H:%M:%S%z", diff --git a/modules/connectors/fedex/karrio/providers/fedex/units.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/units.py similarity index 100% rename from modules/connectors/fedex/karrio/providers/fedex/units.py rename to modules/connectors/fedex_ws/karrio/providers/fedex_ws/units.py diff --git a/modules/connectors/fedex/karrio/providers/fedex/utils.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/utils.py similarity index 93% rename from modules/connectors/fedex/karrio/providers/fedex/utils.py rename to modules/connectors/fedex_ws/karrio/providers/fedex_ws/utils.py index bdb420d6df..99171c48cd 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/utils.py +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/utils.py @@ -1,7 +1,7 @@ from typing import Callable from karrio.core import Settings as BaseSettings from karrio.core.utils import Envelope, apply_namespaceprefix, XP -from karrio.schemas.fedex.rate_service_v28 import ( +from karrio.schemas.fedex_ws.rate_service_v28 import ( WebAuthenticationCredential, WebAuthenticationDetail, ClientDetail, @@ -36,7 +36,7 @@ def tracking_url(self): @property def connection_config(self) -> lib.units.Options: - from karrio.providers.fedex.units import ConnectionConfig + from karrio.providers.fedex_ws.units import ConnectionConfig return lib.to_connection_config( self.config or {}, diff --git a/modules/connectors/fedex/karrio/schemas/fedex/__init__.py b/modules/connectors/fedex_ws/karrio/schemas/fedex_ws/__init__.py similarity index 100% rename from modules/connectors/fedex/karrio/schemas/fedex/__init__.py rename to modules/connectors/fedex_ws/karrio/schemas/fedex_ws/__init__.py diff --git a/modules/connectors/fedex/karrio/schemas/fedex/address_validation_service_v4.py b/modules/connectors/fedex_ws/karrio/schemas/fedex_ws/address_validation_service_v4.py similarity index 100% rename from modules/connectors/fedex/karrio/schemas/fedex/address_validation_service_v4.py rename to modules/connectors/fedex_ws/karrio/schemas/fedex_ws/address_validation_service_v4.py diff --git a/modules/connectors/fedex/karrio/schemas/fedex/async_service_v4.py b/modules/connectors/fedex_ws/karrio/schemas/fedex_ws/async_service_v4.py similarity index 100% rename from modules/connectors/fedex/karrio/schemas/fedex/async_service_v4.py rename to modules/connectors/fedex_ws/karrio/schemas/fedex_ws/async_service_v4.py diff --git a/modules/connectors/fedex/karrio/schemas/fedex/close_service_v5.py b/modules/connectors/fedex_ws/karrio/schemas/fedex_ws/close_service_v5.py similarity index 100% rename from modules/connectors/fedex/karrio/schemas/fedex/close_service_v5.py rename to modules/connectors/fedex_ws/karrio/schemas/fedex_ws/close_service_v5.py diff --git a/modules/connectors/fedex/karrio/schemas/fedex/dgds_service_v5.py b/modules/connectors/fedex_ws/karrio/schemas/fedex_ws/dgds_service_v5.py similarity index 100% rename from modules/connectors/fedex/karrio/schemas/fedex/dgds_service_v5.py rename to modules/connectors/fedex_ws/karrio/schemas/fedex_ws/dgds_service_v5.py diff --git a/modules/connectors/fedex/karrio/schemas/fedex/dgld_service_v1.py b/modules/connectors/fedex_ws/karrio/schemas/fedex_ws/dgld_service_v1.py similarity index 100% rename from modules/connectors/fedex/karrio/schemas/fedex/dgld_service_v1.py rename to modules/connectors/fedex_ws/karrio/schemas/fedex_ws/dgld_service_v1.py diff --git a/modules/connectors/fedex/karrio/schemas/fedex/in_flight_shipment_service_v1.py b/modules/connectors/fedex_ws/karrio/schemas/fedex_ws/in_flight_shipment_service_v1.py similarity index 100% rename from modules/connectors/fedex/karrio/schemas/fedex/in_flight_shipment_service_v1.py rename to modules/connectors/fedex_ws/karrio/schemas/fedex_ws/in_flight_shipment_service_v1.py diff --git a/modules/connectors/fedex/karrio/schemas/fedex/location_service_v12.py b/modules/connectors/fedex_ws/karrio/schemas/fedex_ws/location_service_v12.py similarity index 100% rename from modules/connectors/fedex/karrio/schemas/fedex/location_service_v12.py rename to modules/connectors/fedex_ws/karrio/schemas/fedex_ws/location_service_v12.py diff --git a/modules/connectors/fedex/karrio/schemas/fedex/open_ship_service_v18.py b/modules/connectors/fedex_ws/karrio/schemas/fedex_ws/open_ship_service_v18.py similarity index 100% rename from modules/connectors/fedex/karrio/schemas/fedex/open_ship_service_v18.py rename to modules/connectors/fedex_ws/karrio/schemas/fedex_ws/open_ship_service_v18.py diff --git a/modules/connectors/fedex/karrio/schemas/fedex/pickup_service_v22.py b/modules/connectors/fedex_ws/karrio/schemas/fedex_ws/pickup_service_v22.py similarity index 100% rename from modules/connectors/fedex/karrio/schemas/fedex/pickup_service_v22.py rename to modules/connectors/fedex_ws/karrio/schemas/fedex_ws/pickup_service_v22.py diff --git a/modules/connectors/fedex/karrio/schemas/fedex/rate_service_v28.py b/modules/connectors/fedex_ws/karrio/schemas/fedex_ws/rate_service_v28.py similarity index 100% rename from modules/connectors/fedex/karrio/schemas/fedex/rate_service_v28.py rename to modules/connectors/fedex_ws/karrio/schemas/fedex_ws/rate_service_v28.py diff --git a/modules/connectors/fedex/karrio/schemas/fedex/ship_service_v26.py b/modules/connectors/fedex_ws/karrio/schemas/fedex_ws/ship_service_v26.py similarity index 100% rename from modules/connectors/fedex/karrio/schemas/fedex/ship_service_v26.py rename to modules/connectors/fedex_ws/karrio/schemas/fedex_ws/ship_service_v26.py diff --git a/modules/connectors/fedex/karrio/schemas/fedex/track_service_v19.py b/modules/connectors/fedex_ws/karrio/schemas/fedex_ws/track_service_v19.py similarity index 100% rename from modules/connectors/fedex/karrio/schemas/fedex/track_service_v19.py rename to modules/connectors/fedex_ws/karrio/schemas/fedex_ws/track_service_v19.py diff --git a/modules/connectors/fedex/karrio/schemas/fedex/upload_document_service_v17.py b/modules/connectors/fedex_ws/karrio/schemas/fedex_ws/upload_document_service_v17.py similarity index 100% rename from modules/connectors/fedex/karrio/schemas/fedex/upload_document_service_v17.py rename to modules/connectors/fedex_ws/karrio/schemas/fedex_ws/upload_document_service_v17.py diff --git a/modules/connectors/fedex/karrio/schemas/fedex/validation_availability_and_commitment_service_v15.py b/modules/connectors/fedex_ws/karrio/schemas/fedex_ws/validation_availability_and_commitment_service_v15.py similarity index 100% rename from modules/connectors/fedex/karrio/schemas/fedex/validation_availability_and_commitment_service_v15.py rename to modules/connectors/fedex_ws/karrio/schemas/fedex_ws/validation_availability_and_commitment_service_v15.py diff --git a/modules/connectors/fedex/schemas/error_response.json b/modules/connectors/fedex_ws/schemas/error_response.json similarity index 100% rename from modules/connectors/fedex/schemas/error_response.json rename to modules/connectors/fedex_ws/schemas/error_response.json diff --git a/modules/connectors/fedex/schemas/paperless_request.json b/modules/connectors/fedex_ws/schemas/paperless_request.json similarity index 100% rename from modules/connectors/fedex/schemas/paperless_request.json rename to modules/connectors/fedex_ws/schemas/paperless_request.json diff --git a/modules/connectors/fedex/schemas/paperless_response.json b/modules/connectors/fedex_ws/schemas/paperless_response.json similarity index 100% rename from modules/connectors/fedex/schemas/paperless_response.json rename to modules/connectors/fedex_ws/schemas/paperless_response.json diff --git a/modules/connectors/fedex/schemas/rating_request.json b/modules/connectors/fedex_ws/schemas/rating_request.json similarity index 100% rename from modules/connectors/fedex/schemas/rating_request.json rename to modules/connectors/fedex_ws/schemas/rating_request.json diff --git a/modules/connectors/fedex/schemas/rating_response.json b/modules/connectors/fedex_ws/schemas/rating_response.json similarity index 100% rename from modules/connectors/fedex/schemas/rating_response.json rename to modules/connectors/fedex_ws/schemas/rating_response.json diff --git a/modules/connectors/fedex/schemas/shipping_cancel_request.json b/modules/connectors/fedex_ws/schemas/shipping_cancel_request.json similarity index 100% rename from modules/connectors/fedex/schemas/shipping_cancel_request.json rename to modules/connectors/fedex_ws/schemas/shipping_cancel_request.json diff --git a/modules/connectors/fedex/schemas/shipping_cancel_response.json b/modules/connectors/fedex_ws/schemas/shipping_cancel_response.json similarity index 100% rename from modules/connectors/fedex/schemas/shipping_cancel_response.json rename to modules/connectors/fedex_ws/schemas/shipping_cancel_response.json diff --git a/modules/connectors/fedex/schemas/shipping_request.json b/modules/connectors/fedex_ws/schemas/shipping_request.json similarity index 100% rename from modules/connectors/fedex/schemas/shipping_request.json rename to modules/connectors/fedex_ws/schemas/shipping_request.json diff --git a/modules/connectors/fedex/schemas/shipping_response.json b/modules/connectors/fedex_ws/schemas/shipping_response.json similarity index 100% rename from modules/connectors/fedex/schemas/shipping_response.json rename to modules/connectors/fedex_ws/schemas/shipping_response.json diff --git a/modules/connectors/fedex/schemas/tracking_request.json b/modules/connectors/fedex_ws/schemas/tracking_request.json similarity index 100% rename from modules/connectors/fedex/schemas/tracking_request.json rename to modules/connectors/fedex_ws/schemas/tracking_request.json diff --git a/modules/connectors/fedex/schemas/tracking_response.json b/modules/connectors/fedex_ws/schemas/tracking_response.json similarity index 100% rename from modules/connectors/fedex/schemas/tracking_response.json rename to modules/connectors/fedex_ws/schemas/tracking_response.json diff --git a/modules/connectors/fedex/setup.py b/modules/connectors/fedex_ws/setup.py similarity index 88% rename from modules/connectors/fedex/setup.py rename to modules/connectors/fedex_ws/setup.py index 997efcab89..27c695aad7 100644 --- a/modules/connectors/fedex/setup.py +++ b/modules/connectors/fedex_ws/setup.py @@ -4,9 +4,9 @@ long_description = fh.read() setup( - name="karrio.fedex", + name="karrio.fedex_ws", version="2023.9.3", - description="Karrio - Fedex Shipping extension", + description="Karrio - Fedex Web Service Shipping extension", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/karrioapi/karrio", diff --git a/modules/connectors/fedex_ws/tests/__init__.py b/modules/connectors/fedex_ws/tests/__init__.py new file mode 100644 index 0000000000..5e1cf8b9b5 --- /dev/null +++ b/modules/connectors/fedex_ws/tests/__init__.py @@ -0,0 +1,6 @@ +from tests.fedex_ws.test_rate import * +from tests.fedex_ws.test_tracking import * +from tests.fedex_ws.test_shipment import * +from tests.fedex_ws.test_pickup import * +from tests.fedex_ws.test_address import * +from tests.fedex_ws.test_document import * diff --git a/modules/connectors/fedex/tests/fedex/__init__.py b/modules/connectors/fedex_ws/tests/fedex_ws/__init__.py similarity index 100% rename from modules/connectors/fedex/tests/fedex/__init__.py rename to modules/connectors/fedex_ws/tests/fedex_ws/__init__.py diff --git a/modules/connectors/fedex/tests/fedex/fixture.py b/modules/connectors/fedex_ws/tests/fedex_ws/fixture.py similarity index 80% rename from modules/connectors/fedex/tests/fedex/fixture.py rename to modules/connectors/fedex_ws/tests/fedex_ws/fixture.py index e67a6890ac..93400e31ba 100644 --- a/modules/connectors/fedex/tests/fedex/fixture.py +++ b/modules/connectors/fedex_ws/tests/fedex_ws/fixture.py @@ -1,6 +1,6 @@ import karrio -gateway = karrio.gateway["fedex"].create( +gateway = karrio.gateway["fedex_ws"].create( dict( user_key="user_key", password="password", diff --git a/modules/connectors/fedex/tests/fedex/test_address.py b/modules/connectors/fedex_ws/tests/fedex_ws/test_address.py similarity index 97% rename from modules/connectors/fedex/tests/fedex/test_address.py rename to modules/connectors/fedex_ws/tests/fedex_ws/test_address.py index 53125d5182..49c9c731cb 100644 --- a/modules/connectors/fedex/tests/fedex/test_address.py +++ b/modules/connectors/fedex_ws/tests/fedex_ws/test_address.py @@ -21,7 +21,7 @@ def test_create_AddressValidation_request(self): self.assertEqual(request.serialize(), AddressValidationRequestXML) def test_validate_address(self): - with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + with patch("karrio.mappers.fedex_ws.proxy.lib.request") as mock: mock.return_value = "" karrio.Address.validate(self.AddressValidationRequest).from_(gateway) @@ -31,7 +31,7 @@ def test_validate_address(self): ) def test_parse_address_validation_response(self): - with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + with patch("karrio.mappers.fedex_ws.proxy.lib.request") as mock: mock.return_value = AddressValidationResponseXML parsed_response = ( karrio.Address.validate(self.AddressValidationRequest) @@ -61,7 +61,7 @@ def test_parse_address_validation_response(self): ParsedAddressValidationResponse = [ { "carrier_id": "carrier_id", - "carrier_name": "fedex", + "carrier_name": "fedex_ws", "complete_address": { "address_line1": "Input Your Information", "city": "Input Your Information", diff --git a/modules/connectors/fedex/tests/fedex/test_document.py b/modules/connectors/fedex_ws/tests/fedex_ws/test_document.py similarity index 97% rename from modules/connectors/fedex/tests/fedex/test_document.py rename to modules/connectors/fedex_ws/tests/fedex_ws/test_document.py index 922b12a948..e482cfa483 100644 --- a/modules/connectors/fedex/tests/fedex/test_document.py +++ b/modules/connectors/fedex_ws/tests/fedex_ws/test_document.py @@ -22,7 +22,7 @@ def test_create_document_upload_request(self): self.assertEqual(request.serialize(), DocumentUploadRequest) def test_upload_document(self): - with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + with patch("karrio.mappers.fedex_ws.proxy.lib.request") as mock: mock.return_value = "" karrio.Document.upload(self.DocumentUploadRequest).from_(gateway) @@ -32,7 +32,7 @@ def test_upload_document(self): ) def test_parse_document_upload_response(self): - with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + with patch("karrio.mappers.fedex_ws.proxy.lib.request") as mock: mock.return_value = DocumentUploadResponse parsed_response = ( karrio.Document.upload(self.DocumentUploadRequest) diff --git a/modules/connectors/fedex/tests/fedex/test_pickup.py b/modules/connectors/fedex_ws/tests/fedex_ws/test_pickup.py similarity index 98% rename from modules/connectors/fedex/tests/fedex/test_pickup.py rename to modules/connectors/fedex_ws/tests/fedex_ws/test_pickup.py index 9666b036fa..076f5cefd2 100644 --- a/modules/connectors/fedex/tests/fedex/test_pickup.py +++ b/modules/connectors/fedex_ws/tests/fedex_ws/test_pickup.py @@ -46,7 +46,7 @@ def test_update_pickup_request(self): self.assertEqual(cancel_pickup_request.data.serialize(), PickupCancelRequestXML) def test_create_pickup(self): - with patch("karrio.mappers.fedex.proxy.lib.request") as mocks: + with patch("karrio.mappers.fedex_ws.proxy.lib.request") as mocks: mocks.side_effect = [PickupAvailabilityResponseXML, PickupResponseXML] karrio.Pickup.schedule(self.PickupRequest).from_(gateway) @@ -61,7 +61,7 @@ def test_create_pickup(self): ) def test_update_pickup(self): - with patch("karrio.mappers.fedex.proxy.lib.request") as mocks: + with patch("karrio.mappers.fedex_ws.proxy.lib.request") as mocks: mocks.side_effect = [ PickupAvailabilityResponseXML, PickupResponseXML, @@ -84,7 +84,7 @@ def test_update_pickup(self): ) def test_parse_pickup_reply(self): - with patch("karrio.mappers.fedex.proxy.lib.request") as mocks: + with patch("karrio.mappers.fedex_ws.proxy.lib.request") as mocks: mocks.side_effect = [PickupAvailabilityResponseXML, PickupResponseXML] parsed_response = ( karrio.Pickup.schedule(self.PickupRequest).from_(gateway).parse() @@ -93,7 +93,7 @@ def test_parse_pickup_reply(self): self.assertListEqual(DP.to_dict(parsed_response), ParsedPickupResponse) def test_parse_pickup_cancel_reply(self): - with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + with patch("karrio.mappers.fedex_ws.proxy.lib.request") as mock: mock.return_value = PickupCancelResponseXML parsed_response = ( karrio.Pickup.cancel(self.PickupCancelRequest).from_(gateway).parse() @@ -145,7 +145,7 @@ def test_parse_pickup_cancel_reply(self): ParsedPickupResponse = [ { "carrier_id": "carrier_id", - "carrier_name": "fedex", + "carrier_name": "fedex_ws", "confirmation_number": "0074698052", }, [], @@ -154,7 +154,7 @@ def test_parse_pickup_cancel_reply(self): ParsedPickupCancelResponse = [ { "carrier_id": "carrier_id", - "carrier_name": "fedex", + "carrier_name": "fedex_ws", "operation": "Cancel Pickup", "success": True, }, diff --git a/modules/connectors/fedex/tests/fedex/test_rate.py b/modules/connectors/fedex_ws/tests/fedex_ws/test_rate.py similarity index 99% rename from modules/connectors/fedex/tests/fedex/test_rate.py rename to modules/connectors/fedex_ws/tests/fedex_ws/test_rate.py index 6614511cf1..33d68b9cd6 100644 --- a/modules/connectors/fedex/tests/fedex/test_rate.py +++ b/modules/connectors/fedex_ws/tests/fedex_ws/test_rate.py @@ -42,7 +42,7 @@ def test_create_rate_request_with_preset_package(self): self.assertEqual(serialized_request, RateRequestUsingPackagePresetXML) - @patch("karrio.mappers.fedex.proxy.lib.request", return_value="") + @patch("karrio.mappers.fedex_ws.proxy.lib.request", return_value="") def test_get_rates(self, http_mock): Rating.fetch(self.RateRequest).from_(gateway) @@ -50,14 +50,14 @@ def test_get_rates(self, http_mock): self.assertEqual(url, f"{gateway.settings.server_url}/rate") def test_parse_rate_response(self): - with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + with patch("karrio.mappers.fedex_ws.proxy.lib.request") as mock: mock.return_value = RateResponseXml parsed_response = Rating.fetch(self.RateRequest).from_(gateway).parse() self.assertListEqual(DP.to_dict(parsed_response), ParsedRateResponse) def test_parse_rate_error_response(self): - with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + with patch("karrio.mappers.fedex_ws.proxy.lib.request") as mock: mock.return_value = RateErrorResponseXml parsed_response = Rating.fetch(self.RateRequest).from_(gateway).parse() @@ -85,7 +85,7 @@ def test_parse_rate_error_response(self): [ { "carrier_id": "carrier_id", - "carrier_name": "fedex", + "carrier_name": "fedex_ws", "currency": "CAD", "extra_charges": [ {"amount": 245.35, "currency": "CAD", "name": "Base charge"}, @@ -103,7 +103,7 @@ def test_parse_rate_error_response(self): }, { "carrier_id": "carrier_id", - "carrier_name": "fedex", + "carrier_name": "fedex_ws", "currency": "CAD", "extra_charges": [ {"amount": 229.15, "currency": "CAD", "name": "Base charge"}, @@ -121,7 +121,7 @@ def test_parse_rate_error_response(self): }, { "carrier_id": "carrier_id", - "carrier_name": "fedex", + "carrier_name": "fedex_ws", "currency": "CAD", "extra_charges": [ {"amount": 208.55, "currency": "CAD", "name": "Base charge"}, @@ -139,7 +139,7 @@ def test_parse_rate_error_response(self): }, { "carrier_id": "carrier_id", - "carrier_name": "fedex", + "carrier_name": "fedex_ws", "currency": "CAD", "extra_charges": [ {"amount": 195.2, "currency": "CAD", "name": "Base charge"}, @@ -157,7 +157,7 @@ def test_parse_rate_error_response(self): }, { "carrier_id": "carrier_id", - "carrier_name": "fedex", + "carrier_name": "fedex_ws", "currency": "CAD", "extra_charges": [ {"amount": 124.7, "currency": "CAD", "name": "Base charge"}, @@ -175,7 +175,7 @@ def test_parse_rate_error_response(self): }, { "carrier_id": "carrier_id", - "carrier_name": "fedex", + "carrier_name": "fedex_ws", "currency": "CAD", "extra_charges": [ {"amount": 27.99, "currency": "CAD", "name": "Base charge"}, @@ -199,7 +199,7 @@ def test_parse_rate_error_response(self): [], [ { - "carrier_name": "fedex", + "carrier_name": "fedex_ws", "carrier_id": "carrier_id", "code": "873", "message": "All specified account numbers must match. ", diff --git a/modules/connectors/fedex/tests/fedex/test_shipment.py b/modules/connectors/fedex_ws/tests/fedex_ws/test_shipment.py similarity index 99% rename from modules/connectors/fedex/tests/fedex/test_shipment.py rename to modules/connectors/fedex_ws/tests/fedex_ws/test_shipment.py index b488a282a0..dc4c3c80ac 100644 --- a/modules/connectors/fedex/tests/fedex/test_shipment.py +++ b/modules/connectors/fedex_ws/tests/fedex_ws/test_shipment.py @@ -54,14 +54,14 @@ def test_create_cancel_shipment_request(self): self.assertEqual(request.serialize(), ShipmentCancelRequestXML) - @patch("karrio.mappers.fedex.proxy.lib.request", return_value="") + @patch("karrio.mappers.fedex_ws.proxy.lib.request", return_value="") def test_create_shipment(self, http_mock): Shipment.create(self.ShipmentRequest).from_(gateway) url = http_mock.call_args[1]["url"] self.assertEqual(url, f"{gateway.settings.server_url}/ship") - @patch("karrio.mappers.fedex.proxy.lib.request", return_value="") + @patch("karrio.mappers.fedex_ws.proxy.lib.request", return_value="") def test_cancel_shipment(self, http_mock): Shipment.cancel(self.ShipmentCancelRequest).from_(gateway) @@ -69,7 +69,7 @@ def test_cancel_shipment(self, http_mock): self.assertEqual(url, f"{gateway.settings.server_url}/ship") def test_parse_shipment_response(self): - with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + with patch("karrio.mappers.fedex_ws.proxy.lib.request") as mock: mock.return_value = ShipmentResponseXML parsed_response = ( Shipment.create(self.ShipmentRequest).from_(gateway).parse() @@ -78,7 +78,7 @@ def test_parse_shipment_response(self): self.assertListEqual(DP.to_dict(parsed_response), ParsedShipmentResponse) def test_parse_multi_piece_shipment_response(self): - with patch("karrio.mappers.fedex.proxy.lib.request") as mocks: + with patch("karrio.mappers.fedex_ws.proxy.lib.request") as mocks: mocks.side_effect = [ShipmentResponseXML, ShipmentResponseXML] parsed_response = ( Shipment.create(self.MultiPieceShipmentRequest).from_(gateway).parse() @@ -90,7 +90,7 @@ def test_parse_multi_piece_shipment_response(self): ) def test_parse_shipment_cancel_response(self): - with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + with patch("karrio.mappers.fedex_ws.proxy.lib.request") as mock: mock.return_value = ShipmentResponseXML parsed_response = ( Shipment.cancel(self.ShipmentCancelRequest).from_(gateway).parse() @@ -184,7 +184,7 @@ def test_parse_shipment_cancel_response(self): ParsedShipmentResponse = [ { - "carrier_name": "fedex", + "carrier_name": "fedex_ws", "carrier_id": "carrier_id", "tracking_number": "794604790138", "shipment_identifier": "794604790138", @@ -199,7 +199,7 @@ def test_parse_shipment_cancel_response(self): ParsedMultiPieceShipmentResponse = [ { - "carrier_name": "fedex", + "carrier_name": "fedex_ws", "carrier_id": "carrier_id", "tracking_number": "794604790138", "shipment_identifier": "794604790138", @@ -215,7 +215,7 @@ def test_parse_shipment_cancel_response(self): ParsedShipmentCancelResponse = [ { "carrier_id": "carrier_id", - "carrier_name": "fedex", + "carrier_name": "fedex_ws", "operation": "Cancel Shipment", "success": True, }, diff --git a/modules/connectors/fedex/tests/fedex/test_tracking.py b/modules/connectors/fedex_ws/tests/fedex_ws/test_tracking.py similarity index 97% rename from modules/connectors/fedex/tests/fedex/test_tracking.py rename to modules/connectors/fedex_ws/tests/fedex_ws/test_tracking.py index 7ea8d295ff..f837a9496c 100644 --- a/modules/connectors/fedex/tests/fedex/test_tracking.py +++ b/modules/connectors/fedex_ws/tests/fedex_ws/test_tracking.py @@ -20,7 +20,7 @@ def test_create_tracking_request(self): self.assertEqual(request.serialize(), TrackingRequestXML) - @patch("karrio.mappers.fedex.proxy.lib.request", return_value="") + @patch("karrio.mappers.fedex_ws.proxy.lib.request", return_value="") def test_get_tracking(self, http_mock): Tracking.fetch(self.TrackRequest).from_(gateway) @@ -28,21 +28,21 @@ def test_get_tracking(self, http_mock): self.assertEqual(url, f"{gateway.settings.server_url}/track") def test_parse_tracking_response(self): - with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + with patch("karrio.mappers.fedex_ws.proxy.lib.request") as mock: mock.return_value = TrackingResponseXML parsed_response = Tracking.fetch(self.TrackRequest).from_(gateway).parse() self.assertListEqual(DP.to_dict(parsed_response), ParsedTrackingResponse) def test_tracking_auth_error_parsing(self): - with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + with patch("karrio.mappers.fedex_ws.proxy.lib.request") as mock: mock.return_value = TrackingAuthErrorXML parsed_response = Tracking.fetch(self.TrackRequest).from_(gateway).parse() self.assertEqual(DP.to_dict(parsed_response), DP.to_dict(ParsedAuthError)) def test_parse_error_tracking_response(self): - with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + with patch("karrio.mappers.fedex_ws.proxy.lib.request") as mock: mock.return_value = TrackingErrorResponseXML parsed_response = Tracking.fetch(self.TrackRequest).from_(gateway).parse() @@ -59,7 +59,7 @@ def test_parse_error_tracking_response(self): [], [ { - "carrier_name": "fedex", + "carrier_name": "fedex_ws", "carrier_id": "carrier_id", "code": "1000", "message": "Authentication Failed", @@ -71,7 +71,7 @@ def test_parse_error_tracking_response(self): [ { "carrier_id": "carrier_id", - "carrier_name": "fedex", + "carrier_name": "fedex_ws", "delivered": False, "estimated_delivery": "2016-11-17", "events": [ @@ -116,7 +116,7 @@ def test_parse_error_tracking_response(self): [], [ { - "carrier_name": "fedex", + "carrier_name": "fedex_ws", "carrier_id": "carrier_id", "code": "6035", "message": "Invalid tracking numbers. Please check the following numbers " diff --git a/modules/core/karrio/server/core/tests.py b/modules/core/karrio/server/core/tests.py index 84b8a72920..1d06fceeb0 100644 --- a/modules/core/karrio/server/core/tests.py +++ b/modules/core/karrio/server/core/tests.py @@ -41,7 +41,7 @@ def setUp(self) -> None: account_number="000000", created_by=self.user, ) - self.fedex_carrier = MODELS["fedex"].objects.create( + self.fedex_carrier = MODELS["fedex_ws"].objects.create( carrier_id="fedex_express", test_mode=True, user_key="test", diff --git a/modules/core/karrio/server/providers/extension/models/fedex.py b/modules/core/karrio/server/providers/extension/models/fedex_ws.py similarity index 67% rename from modules/core/karrio/server/providers/extension/models/fedex.py rename to modules/core/karrio/server/providers/extension/models/fedex_ws.py index 5a6aaad14e..4064e81499 100644 --- a/modules/core/karrio/server/providers/extension/models/fedex.py +++ b/modules/core/karrio/server/providers/extension/models/fedex_ws.py @@ -2,11 +2,11 @@ from karrio.server.providers.models.carrier import Carrier, COUNTRIES -class FedexSettings(Carrier): +class FedexWSSettings(Carrier): class Meta: - db_table = "fedex-settings" - verbose_name = "FedEx Settings" - verbose_name_plural = "FedEx Settings" + db_table = "fedex-ws-settings" + verbose_name = "FedEx Web Service Settings" + verbose_name_plural = "FedEx Web Service Settings" password = models.CharField(max_length=200) meter_number = models.CharField(max_length=200) @@ -18,7 +18,7 @@ class Meta: @property def carrier_name(self) -> str: - return "fedex" + return "fedex_ws" -SETTINGS = FedexSettings +SETTINGS = FedexWSSettings diff --git a/modules/core/karrio/server/providers/migrations/0066_rename_fedexsettings_fedexwssettings_and_more.py b/modules/core/karrio/server/providers/migrations/0066_rename_fedexsettings_fedexwssettings_and_more.py new file mode 100644 index 0000000000..6ca1178392 --- /dev/null +++ b/modules/core/karrio/server/providers/migrations/0066_rename_fedexsettings_fedexwssettings_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 4.2.10 on 2024-02-22 00:08 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("providers", "0065_servicelevel_carrier_service_code_and_more"), + ] + + operations = [ + migrations.RenameModel( + old_name="FedexSettings", + new_name="FedexWSSettings", + ), + migrations.AlterModelOptions( + name="fedexwssettings", + options={ + "verbose_name": "FedEx Web Service Settings", + "verbose_name_plural": "FedEx Web Service Settings", + }, + ), + migrations.AlterModelTable( + name="fedexwssettings", + table="fedex-ws-settings", + ), + ] diff --git a/modules/graph/karrio/server/graph/tests/base.py b/modules/graph/karrio/server/graph/tests/base.py index 75b67e68e2..d5ab2c74d5 100644 --- a/modules/graph/karrio/server/graph/tests/base.py +++ b/modules/graph/karrio/server/graph/tests/base.py @@ -50,7 +50,7 @@ def setUp(self) -> None: account_number="000000", created_by=self.user, ) - self.fedex_carrier = MODELS["fedex"].objects.create( + self.fedex_carrier = MODELS["fedex_ws"].objects.create( carrier_id="fedex_express", test_mode=False, user_key="test", diff --git a/modules/graph/karrio/server/graph/tests/test_carrier_connections.py b/modules/graph/karrio/server/graph/tests/test_carrier_connections.py index 49500da339..87d1ab431b 100644 --- a/modules/graph/karrio/server/graph/tests/test_carrier_connections.py +++ b/modules/graph/karrio/server/graph/tests/test_carrier_connections.py @@ -132,7 +132,7 @@ def test_update_user_connection(self): { "id": ANY, "carrier_id": "fedex_express", - "carrier_name": "fedex", + "carrier_name": "fedex_ws", "test_mode": False, "active": True, }, diff --git a/modules/pricing/karrio/server/pricing/migrations/0044_alter_surcharge_carriers.py b/modules/pricing/karrio/server/pricing/migrations/0044_alter_surcharge_carriers.py new file mode 100644 index 0000000000..c6a523a83d --- /dev/null +++ b/modules/pricing/karrio/server/pricing/migrations/0044_alter_surcharge_carriers.py @@ -0,0 +1,62 @@ +# Generated by Django 4.2.10 on 2024-02-21 23:54 + +from django.db import migrations +import karrio.server.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ("pricing", "0043_alter_surcharge_services"), + ] + + operations = [ + migrations.AlterField( + model_name="surcharge", + name="carriers", + field=karrio.server.core.fields.MultiChoiceField( + blank=True, + choices=[ + ("allied_express", "allied_express"), + ("allied_express_local", "allied_express_local"), + ("amazon_shipping", "amazon_shipping"), + ("aramex", "aramex"), + ("asendia_us", "asendia_us"), + ("australiapost", "australiapost"), + ("boxknight", "boxknight"), + ("bpost", "bpost"), + ("canadapost", "canadapost"), + ("canpar", "canpar"), + ("chronopost", "chronopost"), + ("colissimo", "colissimo"), + ("dhl_express", "dhl_express"), + ("dhl_parcel_de", "dhl_parcel_de"), + ("dhl_poland", "dhl_poland"), + ("dhl_universal", "dhl_universal"), + ("dicom", "dicom"), + ("dpd", "dpd"), + ("dpdhl", "dpdhl"), + ("easypost", "easypost"), + ("eshipper", "eshipper"), + ("fedex_ws", "fedex_ws"), + ("freightcom", "freightcom"), + ("generic", "generic"), + ("geodis", "geodis"), + ("laposte", "laposte"), + ("locate2u", "locate2u"), + ("nationex", "nationex"), + ("purolator", "purolator"), + ("roadie", "roadie"), + ("royalmail", "royalmail"), + ("sendle", "sendle"), + ("tnt", "tnt"), + ("ups", "ups"), + ("usps", "usps"), + ("usps_international", "usps_international"), + ("zoom2u", "zoom2u"), + ], + help_text="\n The list of carriers you want to apply the surcharge to.\n
\n Note that by default, the surcharge is applied to all carriers\n ", + null=True, + ), + ), + ] diff --git a/requirements.sdk.dev.txt b/requirements.sdk.dev.txt index 9737d2ef5e..7eca631bd9 100644 --- a/requirements.sdk.dev.txt +++ b/requirements.sdk.dev.txt @@ -19,7 +19,7 @@ -e ./modules/connectors/dicom -e ./modules/connectors/dpd -e ./modules/connectors/dpdhl --e ./modules/connectors/fedex +-e ./modules/connectors/fedex_ws -e ./modules/connectors/generic -e ./modules/connectors/geodis -e ./modules/connectors/laposte diff --git a/requirements.server.dev.txt b/requirements.server.dev.txt index 798e1d5fda..e47cbe4051 100644 --- a/requirements.server.dev.txt +++ b/requirements.server.dev.txt @@ -22,7 +22,7 @@ Django==4.2.10 -e ./modules/connectors/dicom -e ./modules/connectors/dpd -e ./modules/connectors/dpdhl --e ./modules/connectors/fedex +-e ./modules/connectors/fedex_ws -e ./modules/connectors/generic -e ./modules/connectors/geodis -e ./modules/connectors/laposte From 2eb5b2ad72d8c6990bdba13f0370f814b2ff4b32 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Wed, 21 Feb 2024 16:31:38 -0800 Subject: [PATCH 04/20] chore: Cherry pick new fedex extension from https://github.com/karrioapi/karrio/pull/500 --- modules/connectors/fedex/README.md | 31 + modules/connectors/fedex/generate | 23 + .../fedex/karrio/mappers/fedex/__init__.py | 19 + .../fedex/karrio/mappers/fedex/mapper.py | 61 + .../fedex/karrio/mappers/fedex/proxy.py | 91 ++ .../fedex/karrio/mappers/fedex/settings.py | 23 + .../fedex/karrio/providers/fedex/__init__.py | 16 + .../fedex/karrio/providers/fedex/document.py | 88 ++ .../fedex/karrio/providers/fedex/error.py | 55 + .../fedex/karrio/providers/fedex/rate.py | 247 +++ .../providers/fedex/shipment/__init__.py | 9 + .../karrio/providers/fedex/shipment/cancel.py | 46 + .../karrio/providers/fedex/shipment/create.py | 575 +++++++ .../fedex/karrio/providers/fedex/tracking.py | 130 ++ .../fedex/karrio/providers/fedex/units.py | 386 +++++ .../fedex/karrio/providers/fedex/utils.py | 96 ++ .../fedex/karrio/schemas/fedex/__init__.py | 0 .../karrio/schemas/fedex/cancel_request.py | 17 + .../karrio/schemas/fedex/cancel_response.py | 25 + .../karrio/schemas/fedex/error_response.py | 16 + .../karrio/schemas/fedex/paperless_request.py | 30 + .../schemas/fedex/paperless_response.py | 21 + .../karrio/schemas/fedex/rating_request.py | 478 ++++++ .../karrio/schemas/fedex/rating_response.py | 189 +++ .../karrio/schemas/fedex/shipping_request.py | 731 +++++++++ .../karrio/schemas/fedex/shipping_response.py | 556 +++++++ .../karrio/schemas/fedex/tracking_request.py | 23 + .../karrio/schemas/fedex/tracking_response.py | 350 +++++ .../fedex/schemas/cancel_request.json | 9 + .../fedex/schemas/cancel_response.json | 16 + .../fedex/schemas/error_response.json | 10 + .../fedex/schemas/paperless_request.json | 19 + .../fedex/schemas/paperless_response.json | 12 + .../fedex/schemas/rating_request.json | 459 ++++++ .../fedex/schemas/rating_response.json | 1149 ++++++++++++++ .../fedex/schemas/shipping_request.json | 1178 +++++++++++++++ .../fedex/schemas/shipping_response.json | 521 +++++++ .../fedex/schemas/tracking_request.json | 14 + .../fedex/schemas/tracking_response.json | 459 ++++++ modules/connectors/fedex/setup.py | 26 + modules/connectors/fedex/tests/__init__.py | 4 + .../connectors/fedex/tests/fedex/__init__.py | 0 .../connectors/fedex/tests/fedex/fixture.py | 25 + .../fedex/tests/fedex/test_document.py | 103 ++ .../connectors/fedex/tests/fedex/test_rate.py | 1340 +++++++++++++++++ .../fedex/tests/fedex/test_shipment.py | 1285 ++++++++++++++++ .../fedex/tests/fedex/test_tracking.py | 596 ++++++++ 47 files changed, 11557 insertions(+) create mode 100644 modules/connectors/fedex/README.md create mode 100755 modules/connectors/fedex/generate create mode 100644 modules/connectors/fedex/karrio/mappers/fedex/__init__.py create mode 100644 modules/connectors/fedex/karrio/mappers/fedex/mapper.py create mode 100644 modules/connectors/fedex/karrio/mappers/fedex/proxy.py create mode 100644 modules/connectors/fedex/karrio/mappers/fedex/settings.py create mode 100644 modules/connectors/fedex/karrio/providers/fedex/__init__.py create mode 100644 modules/connectors/fedex/karrio/providers/fedex/document.py create mode 100644 modules/connectors/fedex/karrio/providers/fedex/error.py create mode 100644 modules/connectors/fedex/karrio/providers/fedex/rate.py create mode 100644 modules/connectors/fedex/karrio/providers/fedex/shipment/__init__.py create mode 100644 modules/connectors/fedex/karrio/providers/fedex/shipment/cancel.py create mode 100644 modules/connectors/fedex/karrio/providers/fedex/shipment/create.py create mode 100644 modules/connectors/fedex/karrio/providers/fedex/tracking.py create mode 100644 modules/connectors/fedex/karrio/providers/fedex/units.py create mode 100644 modules/connectors/fedex/karrio/providers/fedex/utils.py create mode 100644 modules/connectors/fedex/karrio/schemas/fedex/__init__.py create mode 100644 modules/connectors/fedex/karrio/schemas/fedex/cancel_request.py create mode 100644 modules/connectors/fedex/karrio/schemas/fedex/cancel_response.py create mode 100644 modules/connectors/fedex/karrio/schemas/fedex/error_response.py create mode 100644 modules/connectors/fedex/karrio/schemas/fedex/paperless_request.py create mode 100644 modules/connectors/fedex/karrio/schemas/fedex/paperless_response.py create mode 100644 modules/connectors/fedex/karrio/schemas/fedex/rating_request.py create mode 100644 modules/connectors/fedex/karrio/schemas/fedex/rating_response.py create mode 100644 modules/connectors/fedex/karrio/schemas/fedex/shipping_request.py create mode 100644 modules/connectors/fedex/karrio/schemas/fedex/shipping_response.py create mode 100644 modules/connectors/fedex/karrio/schemas/fedex/tracking_request.py create mode 100644 modules/connectors/fedex/karrio/schemas/fedex/tracking_response.py create mode 100644 modules/connectors/fedex/schemas/cancel_request.json create mode 100644 modules/connectors/fedex/schemas/cancel_response.json create mode 100644 modules/connectors/fedex/schemas/error_response.json create mode 100644 modules/connectors/fedex/schemas/paperless_request.json create mode 100644 modules/connectors/fedex/schemas/paperless_response.json create mode 100644 modules/connectors/fedex/schemas/rating_request.json create mode 100644 modules/connectors/fedex/schemas/rating_response.json create mode 100644 modules/connectors/fedex/schemas/shipping_request.json create mode 100644 modules/connectors/fedex/schemas/shipping_response.json create mode 100644 modules/connectors/fedex/schemas/tracking_request.json create mode 100644 modules/connectors/fedex/schemas/tracking_response.json create mode 100644 modules/connectors/fedex/setup.py create mode 100644 modules/connectors/fedex/tests/__init__.py create mode 100644 modules/connectors/fedex/tests/fedex/__init__.py create mode 100644 modules/connectors/fedex/tests/fedex/fixture.py create mode 100644 modules/connectors/fedex/tests/fedex/test_document.py create mode 100644 modules/connectors/fedex/tests/fedex/test_rate.py create mode 100644 modules/connectors/fedex/tests/fedex/test_shipment.py create mode 100644 modules/connectors/fedex/tests/fedex/test_tracking.py diff --git a/modules/connectors/fedex/README.md b/modules/connectors/fedex/README.md new file mode 100644 index 0000000000..1dd1872421 --- /dev/null +++ b/modules/connectors/fedex/README.md @@ -0,0 +1,31 @@ + +# karrio.fedex + +This package is a FedEx extension of the [karrio](https://pypi.org/project/karrio) multi carrier shipping SDK. + +## Requirements + +`Python 3.7+` + +## Installation + +```bash +pip install karrio.fedex +``` + +## Usage + +```python +import karrio +from karrio.mappers.fedex.settings import Settings + + +# Initialize a carrier gateway +fedex = karrio.gateway["fedex"].create( + Settings( + ... + ) +) +``` + +Check the [Karrio Mutli-carrier SDK docs](https://docs.karrio.io) for Shipping API requests diff --git a/modules/connectors/fedex/generate b/modules/connectors/fedex/generate new file mode 100755 index 0000000000..47149688fd --- /dev/null +++ b/modules/connectors/fedex/generate @@ -0,0 +1,23 @@ +SCHEMAS=./schemas +LIB_MODULES=./karrio/schemas/fedex +find "${LIB_MODULES}" -name "*.py" -exec rm -r {} \; +touch "${LIB_MODULES}/__init__.py" + +quicktype () { + echo "Generating $1..." + docker run -it -v $PWD:/app -e SCHEMAS=/app/schemas -e LIB_MODULES=/app/karrio/schemas/fedex \ + karrio/tools /quicktype/script/quicktype --no-uuids --no-date-times --no-enums --src-lang json --lang jstruct \ + --no-nice-property-names --all-properties-optional --type-as-suffix $@ +} + +quicktype --src="${SCHEMAS}/error_response.json" --out="${LIB_MODULES}/error_response.py" +quicktype --src="${SCHEMAS}/paperless_request.json" --out="${LIB_MODULES}/paperless_request.py" +quicktype --src="${SCHEMAS}/paperless_response.json" --out="${LIB_MODULES}/paperless_response.py" +quicktype --src="${SCHEMAS}/rating_request.json" --out="${LIB_MODULES}/rating_request.py" +quicktype --src="${SCHEMAS}/rating_response.json" --out="${LIB_MODULES}/rating_response.py" +quicktype --src="${SCHEMAS}/shipping_request.json" --out="${LIB_MODULES}/shipping_request.py" +quicktype --src="${SCHEMAS}/shipping_response.json" --out="${LIB_MODULES}/shipping_response.py" +quicktype --src="${SCHEMAS}/tracking_request.json" --out="${LIB_MODULES}/tracking_request.py" +quicktype --src="${SCHEMAS}/tracking_response.json" --out="${LIB_MODULES}/tracking_response.py" +quicktype --src="${SCHEMAS}/cancel_request.json" --out="${LIB_MODULES}/cancel_request.py" +quicktype --src="${SCHEMAS}/cancel_response.json" --out="${LIB_MODULES}/cancel_response.py" diff --git a/modules/connectors/fedex/karrio/mappers/fedex/__init__.py b/modules/connectors/fedex/karrio/mappers/fedex/__init__.py new file mode 100644 index 0000000000..9e5e437a99 --- /dev/null +++ b/modules/connectors/fedex/karrio/mappers/fedex/__init__.py @@ -0,0 +1,19 @@ + +from karrio.core.metadata import Metadata + +from karrio.mappers.fedex.mapper import Mapper +from karrio.mappers.fedex.proxy import Proxy +from karrio.mappers.fedex.settings import Settings +import karrio.providers.fedex.units as units + + +METADATA = Metadata( + id="fedex", + label="FedEx", + # Integrations + Mapper=Mapper, + Proxy=Proxy, + Settings=Settings, + # Data Units + is_hub=False +) diff --git a/modules/connectors/fedex/karrio/mappers/fedex/mapper.py b/modules/connectors/fedex/karrio/mappers/fedex/mapper.py new file mode 100644 index 0000000000..3b95c86f21 --- /dev/null +++ b/modules/connectors/fedex/karrio/mappers/fedex/mapper.py @@ -0,0 +1,61 @@ +"""Karrio FedEx client mapper.""" + +import typing +import karrio.lib as lib +import karrio.api.mapper as mapper +import karrio.core.models as models +import karrio.providers.fedex as provider +import karrio.mappers.fedex.settings as provider_settings + + +class Mapper(mapper.Mapper): + settings: provider_settings.Settings + + def create_rate_request(self, payload: models.RateRequest) -> lib.Serializable: + return provider.rate_request(payload, self.settings) + + def create_tracking_request( + self, payload: models.TrackingRequest + ) -> lib.Serializable: + return provider.tracking_request(payload, self.settings) + + def create_shipment_request( + self, payload: models.ShipmentRequest + ) -> lib.Serializable: + return provider.shipment_request(payload, self.settings) + + def create_cancel_shipment_request( + self, payload: models.ShipmentCancelRequest + ) -> lib.Serializable: + return provider.shipment_cancel_request(payload, self.settings) + + def create_document_upload_request( + self, payload: models.DocumentUploadRequest + ) -> lib.Serializable: + return provider.document_upload_request(payload, self.settings) + + def parse_cancel_shipment_response( + self, response: lib.Deserializable + ) -> typing.Tuple[models.ConfirmationDetails, typing.List[models.Message]]: + return provider.parse_shipment_cancel_response(response, self.settings) + + def parse_rate_response( + self, response: lib.Deserializable + ) -> typing.Tuple[typing.List[models.RateDetails], typing.List[models.Message]]: + return provider.parse_rate_response(response, self.settings) + + def parse_shipment_response( + self, response: lib.Deserializable + ) -> typing.Tuple[models.ShipmentDetails, typing.List[models.Message]]: + return provider.parse_shipment_response(response, self.settings) + + def parse_tracking_response( + self, response: lib.Deserializable + ) -> typing.Tuple[typing.List[models.TrackingDetails], typing.List[models.Message]]: + return provider.parse_tracking_response(response, self.settings) + + def parse_document_upload_response( + self, + response: lib.Deserializable, + ) -> typing.Tuple[models.DocumentUploadDetails, typing.List[models.Message]]: + return provider.parse_document_upload_response(response, self.settings) diff --git a/modules/connectors/fedex/karrio/mappers/fedex/proxy.py b/modules/connectors/fedex/karrio/mappers/fedex/proxy.py new file mode 100644 index 0000000000..3f8fdf2984 --- /dev/null +++ b/modules/connectors/fedex/karrio/mappers/fedex/proxy.py @@ -0,0 +1,91 @@ +import urllib.parse +import karrio.lib as lib +import karrio.api.proxy as proxy +from karrio.mappers.fedex.settings import Settings + + +class Proxy(proxy.Proxy): + settings: Settings + + def get_rates(self, request: lib.Serializable) -> lib.Deserializable: + response = self._send_request("/rate", request) + + return lib.Deserializable(response, lib.to_dict, request.ctx) + + def get_tracking(self, request: lib.Serializable) -> lib.Deserializable: + response = self._send_request("/track/v1/trackingnumbers", request) + + return lib.Deserializable(response, lib.to_dict) + + def create_shipment(self, request: lib.Serializable) -> lib.Deserializable: + requests = request.serialize() + responses = [self._send_request("/ship", lib.Serializable(requests[0]))] + master_id = ( + lib.to_dict(responses[0]) + .get("output", {}) + .get("transactionShipments", [{}])[0] + .get("masterTrackingNumber") + ) + + if len(requests) > 1 and master_id is not None: + responses += lib.run_asynchronously( + lambda _: self._send_request( + "/ship", + lib.Serializable( + request.replace( + "[MASTER_ID_TYPE]", master_id.TrackingIdType + ).replace("[MASTER_TRACKING_ID]", master_id.TrackingNumber), + ), + ), + requests[1:], + ) + + return lib.Deserializable( + responses, + lambda __: [lib.to_dict(_) for _ in __], + ) + + def cancel_shipment(self, request: lib.Serializable) -> lib.Deserializable: + response = self._send_request("/ship", request) + + return lib.Deserializable(response, lib.to_dict) + + def upload_document(self, requests: lib.Serializable) -> lib.Deserializable: + response = lib.run_asynchronously( + lambda _: self._send_request( + url=( + "https://documentapitest.prod.fedex.com/sandbox/documents/v1/etds/upload" + if self.settings.test_mode + else "https://documentapi.prod.fedex.com/documents/v1/etds/upload" + ), + request=lib.Serializable(_, urllib.parse.urlencode), + headers={"content-Type": "multipart/form-data"}, + ), + requests.serialize(), + ) + + return lib.Deserializable( + response, + lambda __: [lib.to_dict(_) for _ in __], + ) + + def _send_request( + self, + path: str = "/", + request: lib.Serializable = None, + method: str = "POST", + headers: dict = None, + url: str = None, + ) -> str: + return lib.request( + url=url or f"{self.settings.server_url}{path}", + trace=self.trace_as("json"), + method=method, + headers={ + "content-Type": "application/json", + "authorization": f"Bearer {self.settings.access_token}", + "x-locale": self.settings.connection_config.locale.state or "en_US", + **(headers or {}), + }, + **({"data": lib.to_json(request.serialize())} if request else {}), + ) diff --git a/modules/connectors/fedex/karrio/mappers/fedex/settings.py b/modules/connectors/fedex/karrio/mappers/fedex/settings.py new file mode 100644 index 0000000000..f76b7134be --- /dev/null +++ b/modules/connectors/fedex/karrio/mappers/fedex/settings.py @@ -0,0 +1,23 @@ +"""Karrio FedEx client settings.""" + +import attr +import jstruct +import karrio.lib as lib +import karrio.providers.fedex.utils as provider_utils + + +@attr.s(auto_attribs=True) +class Settings(provider_utils.Settings): + """FedEx connection settings.""" + + api_key: str # type:ignore + secret_key: str # type:ignore + account_number: str = None + + cache: lib.Cache = jstruct.JStruct[lib.Cache, False, dict(default=lib.Cache())] + account_country_code: str = None + carrier_id: str = "fedex" + test_mode: bool = False + metadata: dict = {} + config: dict = {} + id: str = None diff --git a/modules/connectors/fedex/karrio/providers/fedex/__init__.py b/modules/connectors/fedex/karrio/providers/fedex/__init__.py new file mode 100644 index 0000000000..b683b388e3 --- /dev/null +++ b/modules/connectors/fedex/karrio/providers/fedex/__init__.py @@ -0,0 +1,16 @@ +from karrio.providers.fedex.utils import Settings +from karrio.providers.fedex.tracking import ( + parse_tracking_response, + tracking_request, +) +from karrio.providers.fedex.rate import rate_request, parse_rate_response +from karrio.providers.fedex.shipment import ( + parse_shipment_cancel_response, + parse_shipment_response, + shipment_cancel_request, + shipment_request, +) +from karrio.providers.fedex.document import ( + parse_document_upload_response, + document_upload_request, +) diff --git a/modules/connectors/fedex/karrio/providers/fedex/document.py b/modules/connectors/fedex/karrio/providers/fedex/document.py new file mode 100644 index 0000000000..d28888f3b7 --- /dev/null +++ b/modules/connectors/fedex/karrio/providers/fedex/document.py @@ -0,0 +1,88 @@ +import karrio.schemas.fedex.paperless_request as fedex +import time +import typing +import karrio.lib as lib +import karrio.core.models as models +import karrio.providers.fedex.error as provider_error +import karrio.providers.fedex.units as provider_units +import karrio.providers.fedex.utils as provider_utils + + +def parse_document_upload_response( + _response: lib.Deserializable[typing.List[dict]], + settings: provider_utils.Settings, +) -> typing.Tuple[models.DocumentUploadDetails, typing.List[models.Message]]: + responses = _response.deserialize() + + metas = [_["output"]["meta"] for _ in responses if _.get("output", {}).get("meta")] + details = _extract_details(metas, settings) if len(metas) > 0 else None + errors = provider_error.parse_error_response([_ for _ in responses], settings) + + return details, errors + + +def _extract_details( + metas: typing.List[dict], + settings: provider_utils.Settings, +) -> models.DocumentUploadDetails: + return models.DocumentUploadDetails( + carrier_id=settings.carrier_id, + carrier_name=settings.carrier_id, + documents=[ + models.DocumentDetails( + doc_id=meta["docId"], + file_name=meta["docId"], + ) + for meta in metas + ], + meta=dict(), + ) + + +def document_upload_request( + payload: models.DocumentUploadRequest, + settings: provider_utils.Settings, +) -> lib.Serializable: + document_files = lib.to_document_files(payload.document_files) + options = lib.to_upload_options( + payload.options, + provider_units.DocumentUploadOption, + ) + shipment_date = lib.fdatetime( + payload.shipment_date or time.strftime("%Y-%m-%d"), + current_format="%Y-%m-%d", + output_format="%Y%m%dT%H%M%S", + ) + + request = [ + fedex.PaperlessRequestType( + document=fedex.DocumentType( + workflowName=( + "ETDPreshipment" + if options.pre_shipment.state + else "ETDPostshipment" + ), + carrierCode=options.fedex_carrier_code.state, + name=document.doc_name, + contentType=document.doc_format, + meta=fedex.MetaType( + shipDocumentType=( + provider_units.UploadDocumentType.map(document.doc_type).value + or provider_units.UploadDocumentType.other.value + ), + formCode=None, + trackingNumber=payload.tracking_number, + shipmentDate=shipment_date, + originCountryCode=options.origin_country_code.state, + destinationCountryCode=options.destination_country_code.state, + ), + ), + attachment=document.doc_file, + ) + for document in document_files + ] + + return lib.Serializable( + request, + lambda __: [lib.to_dict(_) for _ in __], + ) diff --git a/modules/connectors/fedex/karrio/providers/fedex/error.py b/modules/connectors/fedex/karrio/providers/fedex/error.py new file mode 100644 index 0000000000..2a18b745e6 --- /dev/null +++ b/modules/connectors/fedex/karrio/providers/fedex/error.py @@ -0,0 +1,55 @@ +import typing +import karrio.lib as lib +import karrio.core.models as models +from karrio.providers.fedex.utils import Settings + + +def parse_error_response( + response: typing.Union[typing.List[dict], dict], + settings: Settings, + **details, +) -> typing.List[models.Message]: + responses = response if isinstance(response, list) else [response] + errors: typing.List[dict] = sum( + [ + [ + *(result["errors"] if "errors" in result else []), + *( + result["output"]["alerts"] + if "alerts" in result.get("output", {}) + and not isinstance(result["output"]["alerts"], str) + else [] + ), + *( + [ + { + **result["error"], + "tracking_number": result.get("trackingNumberInfo", {}).get( + "trackingNumber" + ), + } + ] + if "error" in result + else [] + ), + ] + for result in responses + ], + [], + ) + + return [ + models.Message( + carrier_name=settings.carrier_name, + carrier_id=settings.carrier_id, + code=error.get("code"), + message=error.get("message"), + details=lib.to_dict( + { + **details, + "tracking_number": error.get("tracking_number"), + } + ), + ) + for error in errors + ] diff --git a/modules/connectors/fedex/karrio/providers/fedex/rate.py b/modules/connectors/fedex/karrio/providers/fedex/rate.py new file mode 100644 index 0000000000..4af4b0c979 --- /dev/null +++ b/modules/connectors/fedex/karrio/providers/fedex/rate.py @@ -0,0 +1,247 @@ +import karrio.schemas.fedex.rating_request as fedex +import karrio.schemas.fedex.rating_response as rating +import typing +import datetime +import karrio.lib as lib +import karrio.core.units as units +import karrio.core.models as models +import karrio.providers.fedex.error as error +import karrio.providers.fedex.utils as provider_utils +import karrio.providers.fedex.units as provider_units + + +def parse_rate_response( + _response: lib.Deserializable[dict], + settings: provider_utils.Settings, +) -> typing.Tuple[typing.List[models.RateDetails], typing.List[models.Message]]: + response = _response.deserialize() + messages = error.parse_error_response(response, settings) + rates = [ + _extract_details(rate, settings, ctx=_response.ctx) + for rate in (response.get("output", {}).get("rateReplyDetails") or []) + ] + + return rates, messages + + +def _extract_details( + data: dict, + settings: provider_utils.Settings, + ctx: dict = {}, +) -> models.RateDetails: + # fmt: off + # rate = lib.to_object(rating.RateReplyDetailType, data) + rate = rating.RateReplyDetailType(**data) + service = provider_units.ShippingService.map(rate.serviceType) + details: rating.RatedShipmentDetailType = ( + next((_ for _ in rate.ratedShipmentDetails if _.rateType == "PREFERRED_CURRENCY"), None) or + next((_ for _ in rate.ratedShipmentDetails if _.rateType == "ACCOUNT"), None) or + rate.ratedShipmentDetails[0] + ) + charges = [ + ("Base Charge", lib.to_money(details.totalBaseCharge)), + ("Discounts", lib.to_money(details.totalDiscounts)), + ("VAT Charge", lib.to_money(details.totalVatCharge)), + ("Duties and Taxes", lib.to_money(details.totalDutiesAndTaxes)), + *[(_.description, lib.to_money(_.amount)) for _ in details.shipmentRateDetail.surCharges or []], + ] + total_charge = lib.to_money( + details.totalNetChargeWithDutiesAndTaxes + or details.totalNetCharge + ) + estimated_delivery = lib.to_date(getattr(rate.operationalDetail, "commitDate", None), "%Y-%m-%dT%H:%M:%S") + shipping_date = lib.to_date(ctx.get("shipment_date") or datetime.datetime.now()) + transit_day_list = ( + (shipping_date + datetime.timedelta(x + 1) for x in range((estimated_delivery.date() - shipping_date.date()).days)) + if estimated_delivery is not None + else None + ) + transit_days = ( + sum(1 for day in transit_day_list if day.weekday() < 5) + if transit_day_list is not None + else None + ) + # fmt: on + + return models.RateDetails( + carrier_id=settings.carrier_id, + carrier_name=settings.carrier_name, + service=service.name_or_key, + total_charge=total_charge, + currency=details.currency, + transit_days=transit_days, + estimated_delivery=lib.fdate(estimated_delivery), + extra_charges=[ + models.ChargeDetails( + name=name, + amount=amount, + currency=details.currency, + ) + for name, amount in charges + ], + meta=dict( + service_name=service.name or rate.serviceName, + transit_time=getattr(rate.operationalDetail, "transitTime", None), + ), + ) + + +def rate_request( + payload: models.RateRequest, + settings: provider_utils.Settings, +) -> lib.Serializable: + shipper = lib.to_address(payload.shipper) + recipient = lib.to_address(payload.recipient) + service = lib.to_services(payload.services, provider_units.ShippingService).first + packages = lib.to_packages( + payload.parcels, + required=["weight"], + presets=provider_units.PackagePresets, + ) + options = lib.to_shipping_options( + payload.options, + package_options=packages.options, + initializer=provider_units.shipping_options_initializer, + ) + request_types = ["LIST"] + ([] if "currency" not in options else ["PREFERRED"]) + shipment_date = lib.to_date(options.shipment_date.state or datetime.datetime.now()) + compute_options = lambda _options: [ + option for _, option in _options.items() if _options.state is not False + ] + + request = fedex.RatingRequestType( + accountNumber=fedex.RatingRequestAccountNumberType( + value=settings.account_number, + ), + rateRequestControlParameters=fedex.RateRequestControlParametersType( + returnTransitTimes=True, + servicesNeededOnRateFailure=True, + variableOptions=( + [option.code for option in compute_options(options)] + if any(compute_options(options)) + else None + ), + rateSortOrder="COMMITASCENDING", + ), + requestedShipment=fedex.RequestedShipmentType( + shipper=fedex.ShipperClassType( + address=fedex.ResponsiblePartyAddressType( + streetLines=shipper.address_lines, + city=shipper.city, + stateOrProvinceCode=shipper.state_code, + postalCode=shipper.postal_code, + countryCode=shipper.country_code, + residential=shipper.residential, + ) + ), + recipient=fedex.ShipperClassType( + address=fedex.ResponsiblePartyAddressType( + streetLines=recipient.address_lines, + city=recipient.city, + stateOrProvinceCode=recipient.state_code, + postalCode=recipient.postal_code, + countryCode=recipient.country_code, + residential=recipient.residential, + ) + ), + serviceType=getattr(service, "value", None), + emailNotificationDetail=None, + preferredCurrency=options.currency, + rateRequestType=request_types, + shipDateStamp=lib.fdate(shipment_date, "%Y-%m-%d"), + pickupType="DROPOFF_AT_FEDEX_LOCATION", + requestedPackageLineItems=[ + fedex.RequestedPackageLineItemType( + subPackagingType=package.packaging_type, + groupPackageCount=1, + contentRecord=[], + declaredValue=package.options.declared_value, + weight=fedex.WeightType( + units=package.weight.unit, + value=package.weight.value, + ), + dimensions=( + fedex.DimensionsType( + length=package.length.map( + provider_units.MeasurementOptions + ).value, + width=package.width.map( + provider_units.MeasurementOptions + ).value, + height=package.height.map( + provider_units.MeasurementOptions + ).value, + units=package.dimension_unit.value, + ) + if ( + # only set dimensions if the packaging type is set to your_packaging + package.has_dimensions + and provider_units.PackagingType.map( + package.packaging_type or "your_packaging" + ).value + == provider_units.PackagingType.your_packaging.value + ) + else None + ), + variableHandlingChargeDetail=None, + packageSpecialServices=( + fedex.PackageSpecialServicesType( + specialServiceTypes=[ + option.code + for option in compute_options(package.options) + ], + signatureOptionType=None, + alcoholDetail=None, + dangerousGoodsDetail=None, + packageCODDetail=None, + pieceCountVerificationBoxCount=None, + batteryDetails=None, + dryIceWeight=None, + ) + if any(compute_options(package.options)) + else None + ), + ) + for package in packages + ], + documentShipment=packages.is_document, + variableHandlingChargeDetail=None, + packagingType=provider_units.PackagingType.map( + packages.package_type or "your_packaging" + ).value, + totalWeight=packages.weight.LB, + shipmentSpecialServices=( + fedex.ShipmentSpecialServicesType( + returnShipmentDetail=None, + deliveryOnInvoiceAcceptanceDetail=None, + internationalTrafficInArmsRegulationsDetail=None, + pendingShipmentDetail=None, + holdAtLocationDetail=None, + shipmentCODDetail=None, + shipmentDryIceDetail=None, + internationalControlledExportDetail=None, + homeDeliveryPremiumDetail=None, + specialServiceTypes=( + [option.code for option in compute_options(packages.options)] + if any(compute_options(packages.options)) + else None + ), + ) + if any(options.items()) + else None + ), + customsClearanceDetail=None, + groupShipment=None, + serviceTypeDetail=None, + smartPostInfoDetail=None, + expressFreightDetail=None, + groundShipment=None, + ), + carrierCodes=None, + ) + + return lib.Serializable( + request, + lib.to_dict, + dict(shipment_date=shipment_date), + ) diff --git a/modules/connectors/fedex/karrio/providers/fedex/shipment/__init__.py b/modules/connectors/fedex/karrio/providers/fedex/shipment/__init__.py new file mode 100644 index 0000000000..4095407d7e --- /dev/null +++ b/modules/connectors/fedex/karrio/providers/fedex/shipment/__init__.py @@ -0,0 +1,9 @@ + +from karrio.providers.fedex.shipment.create import ( + parse_shipment_response, + shipment_request, +) +from karrio.providers.fedex.shipment.cancel import ( + parse_shipment_cancel_response, + shipment_cancel_request, +) diff --git a/modules/connectors/fedex/karrio/providers/fedex/shipment/cancel.py b/modules/connectors/fedex/karrio/providers/fedex/shipment/cancel.py new file mode 100644 index 0000000000..4d69a70d21 --- /dev/null +++ b/modules/connectors/fedex/karrio/providers/fedex/shipment/cancel.py @@ -0,0 +1,46 @@ +import karrio.schemas.fedex.cancel_request as fedex +import typing +import karrio.lib as lib +import karrio.core.models as models +import karrio.providers.fedex.error as error +import karrio.providers.fedex.utils as provider_utils +import karrio.providers.fedex.units as provider_units + + +def parse_shipment_cancel_response( + _response: lib.Deserializable[dict], + settings: provider_utils.Settings, +) -> typing.Tuple[models.ConfirmationDetails, typing.List[models.Message]]: + response = _response.deserialize() + messages = error.parse_error_response(response, settings) + success = lib.failsafe(lambda: response["output"]["cancelledShipment"]) + + confirmation = ( + models.ConfirmationDetails( + carrier_id=settings.carrier_id, + carrier_name=settings.carrier_name, + operation="Cancel Shipment", + success=success, + ) + if success is True + else None + ) + + return confirmation, messages + + +def shipment_cancel_request( + payload: models.ShipmentCancelRequest, + settings: provider_utils.Settings, +) -> lib.Serializable: + request = fedex.CancelRequestType( + accountNumber=fedex.AccountNumberType( + value=settings.account_number, + ), + emailShipment=None, + senderCountryCode=None, + deletionControl="DELETE_ALL_PACKAGES", + trackingNumber=payload.shipment_identifier, + ) + + return lib.Serializable(request, lib.to_dict) diff --git a/modules/connectors/fedex/karrio/providers/fedex/shipment/create.py b/modules/connectors/fedex/karrio/providers/fedex/shipment/create.py new file mode 100644 index 0000000000..501d56c9d6 --- /dev/null +++ b/modules/connectors/fedex/karrio/providers/fedex/shipment/create.py @@ -0,0 +1,575 @@ +import karrio.schemas.fedex.shipping_request as fedex +import karrio.schemas.fedex.shipping_response as shipping +import typing +import datetime +import karrio.lib as lib +import karrio.core.units as units +import karrio.core.models as models +import karrio.providers.fedex.error as provider_error +import karrio.providers.fedex.utils as provider_utils +import karrio.providers.fedex.units as provider_units + + +def parse_shipment_response( + _response: lib.Deserializable[typing.List[dict]], + settings: provider_utils.Settings, +) -> typing.Tuple[typing.List[models.RateDetails], typing.List[models.Message]]: + responses = _response.deserialize() + + shipment = lib.to_multi_piece_shipment( + [ + ( + f"{_}", + ( + _extract_details( + response["output"]["transactionShipments"][0], + settings, + ctx=_response.ctx, + ) + if response.get("errors") is None + and response.get("output") is not None + and response.get("output").get("transactionShipments") is not None + else None + ), + ) + for _, response in enumerate(responses, start=1) + ] + ) + messages: typing.List[models.Message] = sum( + [ + provider_error.parse_error_response(response, settings) + for response in responses + ], + start=[], + ) + + return shipment, messages + + +def _extract_details( + data: dict, + settings: provider_utils.Settings, + ctx: dict = {}, +) -> models.ShipmentDetails: + # fmt: off + shipment = lib.to_object(shipping.TransactionShipmentType, data) + service = provider_units.ShippingService.map(shipment.serviceType) + + tracking_number = shipment.masterTrackingNumber + invoices = [_ for _ in shipment.shipmentDocuments if "INVOICE" in _.contentType] + labels = [_ for _ in shipment.shipmentDocuments if "LABEL" in _.contentType] + + invoice_type = invoices[0].docType if len(invoices) > 0 else "PDF" + invoice = ( + lib.bundle_base64([_.encodedLabel for _ in invoices], invoice_type) + if len(invoices) > 0 + else None + ) + + label_type = labels[0].docType if len(labels) > 0 else "PDF" + label = ( + lib.bundle_base64([_.encodedLabel for _ in labels], label_type) + if len(labels) > 0 + else None + ) + # fmt: on + + return models.ShipmentDetails( + carrier_id=settings.carrier_id, + carrier_name=settings.carrier_name, + tracking_number=tracking_number, + shipment_identifier=tracking_number, + label_type=label_type, + docs=models.Documents(label=label, invoice=invoice), + meta=dict( + service_name=service.name_or_key, + carrier_tracking_link=settings.tracking_url.format(tracking_number), + trackingIdType=shipment.pieceResponses[0].trackingIdType, + serviceCategory=shipment.pieceResponses[0].serviceCategory, + ), + ) + + +def shipment_request( + payload: models.ShipmentRequest, + settings: provider_utils.Settings, +) -> lib.Serializable: + shipper = lib.to_address(payload.shipper) + recipient = lib.to_address(payload.recipient) + service = provider_units.ShippingService.map(payload.service).value_or_key + options = lib.to_shipping_options( + payload.options, + initializer=provider_units.shipping_options_initializer, + ) + packages = lib.to_packages( + payload.parcels, + required=["weight"], + options=payload.options, + presets=provider_units.PackagePresets, + shipping_options_initializer=provider_units.shipping_options_initializer, + ) + weight_unit, dim_unit = ( + provider_units.COUNTRY_PREFERED_UNITS.get(payload.shipper.country_code) + or packages.compatible_units + ) + customs = lib.to_customs_info( + payload.customs, + shipper=payload.shipper, + recipient=payload.recipient, + weight_unit=weight_unit.value, + ) + + payment = payload.payment or models.Payment( + paid_by="sender", account_number=settings.account_number + ) + shipment_date = lib.to_date(options.shipment_date.state or datetime.datetime.now()) + label_type, label_format = provider_units.LabelType.map( + payload.label_type or "PDF_4x6" + ).value + compute_options = lambda _options: [ + option for _, option in _options.items() if _options.state is not False + ] + billing_address = lib.to_address( + payload.billing_address + or dict( + sender=payload.shipper, + recipient=payload.recipient, + third_party=payload.billing_address, + )[payment.paid_by] + ) + duty_billing_address = lib.to_address( + customs.duty_billing_address + or dict( + sender=payload.shipper, + recipient=payload.recipient, + third_party=customs.duty_billing_address, + ).get(customs.duty.paid_by) + ) + + requests = [ + fedex.ShippingRequestType( + mergeLabelDocOption=None, + requestedShipment=fedex.RequestedShipmentType( + shipDatestamp=lib.fdate(shipment_date, "%Y-%m-%d"), + totalDeclaredValue=( + fedex.TotalDeclaredValueType( + amount=lib.to_money(package.options.declared_value.state), + currency=package.options.currency.state, + ) + if package.options.declared_value.state + else None + ), + shipper=fedex.ShipperType( + accountNumber=settings.account_number, + address=fedex.AddressType( + streetLines=shipper.address_lines, + city=shipper.city, + stateOrProvinceCode=shipper.state_code, + postalCode=shipper.postal_code, + countryCode=shipper.country_code, + residential=shipper.residential, + ), + contact=fedex.ResponsiblePartyContactType( + personName=shipper.contact, + emailAddress=shipper.email, + phoneNumber=shipper.phone_number, + phoneExtension=None, + companyName=shipper.company_name, + faxNumber=None, + ), + tins=( + fedex.TinType(number=shipper.tax_id) + if shipper.has_tax_info + else [] + ), + deliveryInstructions=None, + ), + soldTo=fedex.ShipperType( + address=fedex.AddressType( + streetLines=recipient.address_lines, + city=recipient.city, + stateOrProvinceCode=recipient.state_code, + postalCode=recipient.postal_code, + countryCode=recipient.country_code, + residential=recipient.residential, + ), + contact=fedex.ResponsiblePartyContactType( + personName=recipient.contact, + emailAddress=recipient.email, + phoneNumber=recipient.phone_number, + phoneExtension=None, + companyName=recipient.company_name, + faxNumber=None, + ), + tins=( + fedex.TinType(number=recipient.tax_id) + if recipient.has_tax_info + else [] + ), + deliveryInstructions=None, + ), + recipients=[ + fedex.ShipperType( + address=fedex.AddressType( + streetLines=recipient.address_lines, + city=recipient.city, + stateOrProvinceCode=recipient.state_code, + postalCode=recipient.postal_code, + countryCode=recipient.country_code, + residential=recipient.residential, + ), + contact=fedex.ResponsiblePartyContactType( + personName=recipient.contact, + emailAddress=recipient.email, + phoneNumber=recipient.phone_number, + phoneExtension=None, + companyName=recipient.company_name, + faxNumber=None, + ), + tins=( + fedex.TinType(number=recipient.tax_id) + if recipient.has_tax_info + else [] + ), + deliveryInstructions=None, + ) + ], + recipientLocationNumber=None, + pickupType="DROPOFF_AT_FEDEX_LOCATION", + serviceType=service, + packagingType=provider_units.PackagingType.map( + packages.package_type or "your_packaging" + ).value, + totalWeight=package.weight.value, + origin=None, + shippingChargesPayment=fedex.ShippingChargesPaymentType( + paymentType=provider_units.PaymentType.map( + payment.paid_by + ).value_or_key, + payor=( + fedex.PayorType( + responsibleParty=fedex.ResponsiblePartyType( + address=( + fedex.AddressType( + streetLines=billing_address.address_lines, + city=billing_address.city, + stateOrProvinceCode=billing_address.state_code, + postalCode=billing_address.postal_code, + countryCode=billing_address.country_code, + residential=billing_address.residential, + ) + if billing_address.address is not None + else None + ), + contact=( + fedex.ResponsiblePartyContactType( + personName=billing_address.contact, + emailAddress=billing_address.email, + phoneNumber=billing_address.phone_number, + phoneExtension=None, + companyName=billing_address.company_name, + faxNumber=None, + ) + if billing_address.address is not None + else None + ), + accountNumber=payment.account_number, + tins=( + fedex.TinType(number=billing_address.tax_id) + if billing_address.has_tax_info + else [] + ), + ), + ) + if billing_address.address is None + else None + ), + ), + shipmentSpecialServices=( + fedex.ShipmentSpecialServicesType( + specialServiceTypes=( + [option.code for option in compute_options(package.options)] + if compute_options(package.options) + else None + ), + etdDetail=( + fedex.EtdDetailType( + attributes=( + None + if package.options.doc_files.state + or package.options.doc_references.state + else ["POST_SHIPMENT_UPLOAD_REQUESTED"] + ), + attachedDocuments=( + [ + fedex.AttachedDocumentType( + documentType=( + provider_units.UploadDocumentType.map( + doc["doc_name"] + ).value + or "COMMERCIAL_INVOICE" + ), + documentReference=( + payload.reference + or getattr(payload, "id", None), + ), + description=None, + documentId=None, + ) + for doc in options.doc_files.state + ] + if (options.doc_files.state or []) + else None + ), + requestedDocumentTypes=["COMMERCIAL_INVOICE"], + ) + if options.fedex_electronic_trade_documents.state + else None + ), + returnShipmentDetail=None, + deliveryOnInvoiceAcceptanceDetail=None, + internationalTrafficInArmsRegulationsDetail=None, + pendingShipmentDetail=None, + holdAtLocationDetail=None, + shipmentCODDetail=None, + shipmentDryIceDetail=None, + internationalControlledExportDetail=None, + homeDeliveryPremiumDetail=None, + ) + if any(options.items()) + else None + ), + emailNotificationDetail=None, + expressFreightDetail=None, + variableHandlingChargeDetail=None, + customsClearanceDetail=( + fedex.CustomsClearanceDetailType( + regulatoryControls=None, + brokers=[], + commercialInvoice=fedex.CommercialInvoiceType( + originatorName=(shipper.company_name or shipper.contact), + comments=None, + customerReferences=( + [ + fedex.CustomerReferenceType( + customerReferenceType="INVOICE_NUMBER", + value=customs.invoice, + ) + ] + if customs.invoice is not None + else None + ), + taxesOrMiscellaneousCharge=None, + taxesOrMiscellaneousChargeType=None, + freightCharge=None, + packingCosts=None, + handlingCosts=None, + declarationStatement=None, + termsOfSale=provider_units.Incoterm.map( + customs.incoterm or "DDU" + ).value, + specialInstructions=None, + shipmentPurpose=provider_units.PurposeType.map( + customs.content_type or "other" + ).value, + emailNotificationDetail=None, + ), + freightOnValue=None, + dutiesPayment=fedex.DutiesPaymentType( + payor=fedex.PayorType( + responsibleParty=fedex.ResponsiblePartyType( + address=fedex.AddressType( + streetLines=duty_billing_address.address_lines, + city=duty_billing_address.city, + stateOrProvinceCode=duty_billing_address.state_code, + postalCode=duty_billing_address.postal_code, + countryCode=duty_billing_address.country_code, + residential=duty_billing_address.residential, + ), + contact=fedex.ResponsiblePartyContactType( + personName=duty_billing_address.contact, + emailAddress=duty_billing_address.email, + phoneNumber=duty_billing_address.phone_number, + phoneExtension=None, + companyName=duty_billing_address.company_name, + faxNumber=None, + ), + accountNumber=customs.duty.account_number, + tins=( + fedex.TinType( + number=duty_billing_address.tax_id + ) + if duty_billing_address.has_tax_info + else [] + ), + ) + ), + paymentType=provider_units.PaymentType.map( + getattr(customs.duty, "paid_by", None) or "sender" + ).value, + ), + commodities=[ + fedex.CommodityType( + unitPrice=( + fedex.TotalDeclaredValueType( + amount=lib.to_money(item.value_amount), + currency=( + item.value_currency + or packages.options.currency.state + or customs.duty.currency + ), + ) + if item.value_amount + else None + ), + additionalMeasures=[], + numberOfPieces=item.quantity, + quantity=item.quantity, + quantityUnits="EA", + customsValue=None, + countryOfManufacture=( + item.origin_country or shipper.country_code + ), + cIMarksAndNumbers=None, + harmonizedCode=item.hs_code, + description=lib.text( + item.title or item.description or "N/A", max=35 + ), + name=None, + weight=fedex.WeightType( + units=weight_unit.value, + value=item.weight, + ), + exportLicenseNumber=None, + exportLicenseExpirationDate=None, + partNumber=item.sku, + purpose=None, + usmcaDetail=None, + ) + for item in customs.commodities + ], + isDocumentOnly=package.parcel.is_document, + recipientCustomsId=None, + customsOption=None, + importerOfRecord=None, + generatedDocumentLocale=None, + exportDetail=None, + totalCustomsValue=None, + partiesToTransactionAreRelated=None, + declarationStatementDetail=None, + insuranceCharge=None, + ) + if payload.customs is not None + else None + ), + smartPostInfoDetail=None, + blockInsightVisibility=None, + labelSpecification=fedex.LabelSpecificationType( + labelFormatType="COMMON2D", + labelOrder="SHIPPING_LABEL_FIRST", + customerSpecifiedDetail=None, + printedLabelOrigin=None, + labelStockType=label_format, + labelRotation=None, + imageType=label_type, + labelPrintingOrientation=None, + returnedDispositionDetail=None, + ), + shippingDocumentSpecification=( + fedex.ShippingDocumentSpecificationType( + generalAgencyAgreementDetail=None, + returnInstructionsDetail=None, + op900Detail=None, + usmcaCertificationOfOriginDetail=None, + usmcaCommercialInvoiceCertificationOfOriginDetail=None, + shippingDocumentTypes=["COMMERCIAL_INVOICE"], + certificateOfOrigin=None, + commercialInvoiceDetail=None, + ) + if ( + customs.commercial_invoice is True + and not options.fedex_electronic_trade_documents.state + ) + else None + ), + rateRequestType=None, + preferredCurrency=package.options.currency.state, + totalPackageCount=len(packages), + masterTrackingId=( + fedex.MasterTrackingIDType( + formId=None, + trackingIdType="[MASTER_ID_TYPE]", + uspsApplicationId=None, + trackingNumber="[MASTER_TRACKING_ID]", + ) + if package_index > 1 + else None + ), + requestedPackageLineItems=[ + fedex.RequestedPackageLineItemType( + sequenceNumber=package_index, + subPackagingType=None, + customerReferences=[], + declaredValue=None, + weight=fedex.WeightType( + units=package.weight.unit, + value=package.weight.value, + ), + dimensions=( + fedex.DimensionsType( + length=package.length.value, + width=package.width.value, + height=package.height.value, + units=dim_unit.value, + ) + if ( + # only set dimensions if the packaging type is set to your_packaging + package.has_dimensions + and provider_units.PackagingType.map( + package.packaging_type or "your_packaging" + ).value + == provider_units.PackagingType.your_packaging.value + ) + else None + ), + groupPackageCount=None, + itemDescriptionForClearance=None, + contentRecord=[], + itemDescription=package.parcel.description, + variableHandlingChargeDetail=None, + packageSpecialServices=fedex.PackageSpecialServicesType( + specialServiceTypes=["SIGNATURE_OPTION"], + priorityAlertDetail=None, + signatureOptionType=( + package.options.fedex_signature_option.state + or "SERVICE_DEFAULT" + ), + signatureOptionDetail=None, + alcoholDetail=None, + dangerousGoodsDetail=None, + packageCODDetail=None, + pieceCountVerificationBoxCount=None, + batteryDetails=[], + dryIceWeight=None, + ), + trackingNumber=None, + ) + ], + ), + labelResponseOptions="LABEL", + accountNumber=fedex.AccountNumberType(value=settings.account_number), + shipAction="CONFIRM", + processingOptionType=None, + oneLabelAtATime=None, + ) + for package_index, package in typing.cast( + typing.List[typing.Tuple[int, units.Package]], + enumerate(packages, 1), + ) + ] + + return lib.Serializable( + requests, + lambda __: [lib.to_dict(_) for _ in __], + dict(shipment_date=shipment_date), + ) diff --git a/modules/connectors/fedex/karrio/providers/fedex/tracking.py b/modules/connectors/fedex/karrio/providers/fedex/tracking.py new file mode 100644 index 0000000000..fbb21603be --- /dev/null +++ b/modules/connectors/fedex/karrio/providers/fedex/tracking.py @@ -0,0 +1,130 @@ +import karrio.schemas.fedex.tracking_request as fedex +import karrio.schemas.fedex.tracking_response as tracking +import typing +import karrio.lib as lib +import karrio.core.models as models +import karrio.providers.fedex.error as provider_error +import karrio.providers.fedex.utils as provider_utils +import karrio.providers.fedex.units as provider_units + + +def parse_tracking_response( + _response: lib.Deserializable[dict], + settings: provider_utils.Settings, +) -> typing.Tuple[typing.List[models.TrackingDetails], typing.List[models.Message]]: + response = _response.deserialize() + + results = response.get("output", {}).get("completeTrackResults") or [] + details = [ + _extract_details(result, settings) + for result in results + if result.get("trackResults") is not None + and result["trackResults"][0].get("scanEvents") is not None + ] + messages: typing.List[models.Message] = sum( + [ + provider_error.parse_error_response( + result.get("trackResults"), + settings, + tracking_number=result.get("trackingNumber"), + ) + for result in results + if result.get("trackResults") is not None + ], + start=provider_error.parse_error_response(response, settings), + ) + + return details, messages + + +def _extract_details( + result: dict, + settings: provider_utils.Settings, +) -> typing.Optional[models.TrackingDetails]: + package = lib.to_object(tracking.CompleteTrackResultType, result) + + detail = package.trackResults[0] + estimated_delivery = lib.failsafe( + lambda: ( + detail.standardTransitTimeWindow.window.begins + or detail.estimatedDeliveryTimeWindow.window.begins + ) + ) + + status = next( + ( + status.name + for status in list(provider_units.TrackingStatus) + if detail.latestStatusDetail.code in status.value + ), + provider_units.TrackingStatus.in_transit.name, + ) + + return models.TrackingDetails( + carrier_name=settings.carrier_name, + carrier_id=settings.carrier_id, + tracking_number=package.trackingNumber, + delivered=(status == "delivered"), + status=status, + events=[ + models.TrackingEvent( + date=lib.fdate(e.date, "%Y-%m-%dT%H:%M:%S%z"), + time=lib.ftime(e.date, "%Y-%m-%dT%H:%M:%S%z"), + code=e.eventType, + location=( + lib.join( + e.scanLocation.city, + e.scanLocation.stateOrProvinceCode, + e.scanLocation.postalCode, + e.scanLocation.countryCode, + join=True, + separator=", ", + ) + if e.scanLocation + else e.locationType + ), + description=(lib.text(e.exceptionDescription) or e.eventDescription), + ) + for e in detail.scanEvents + ], + estimated_delivery=lib.fdate(estimated_delivery, "%Y-%m-%dT%H:%M:%S"), + info=models.TrackingInfo( + carrier_tracking_link=settings.tracking_url.format(package.trackingNumber), + shipment_service=lib.failsafe(lambda: detail.serviceDetail.description), + package_weight_unit=lib.failsafe( + lambda: detail.shipmentDetails.weight[0].unit + ), + package_weight=lib.failsafe( + lambda: lib.to_decimal(detail.shipmentDetails.weight[0].value) + ), + shipment_destination_country=lib.failsafe( + lambda: detail.destinationLocation.locationContactAndAddress.address.countryCode + ), + shipment_origin_country=lib.failsafe( + lambda: detail.originLocation.locationContactAndAddress.address.countryCode + ), + ), + ) + + +def tracking_request( + payload: models.TrackingRequest, + settings: provider_utils.Settings, +) -> lib.Serializable: + request = fedex.TrackingRequestType( + includeDetailedScans=True, + trackingInfo=[ + fedex.TrackingInfoType( + shipDateBegin=None, + shipDateEnd=None, + trackingNumberInfo=fedex.TrackingNumberInfoType( + trackingNumber=tracking_number, + carrierCode=None, + trackingNumberUniqueId=None, + ), + ) + for tracking_number in payload.tracking_numbers + ], + ) + + return lib.Serializable(request, lib.to_dict) diff --git a/modules/connectors/fedex/karrio/providers/fedex/units.py b/modules/connectors/fedex/karrio/providers/fedex/units.py new file mode 100644 index 0000000000..da2161a9e7 --- /dev/null +++ b/modules/connectors/fedex/karrio/providers/fedex/units.py @@ -0,0 +1,386 @@ +import karrio.lib as lib +import karrio.core.units as units + +PRESET_DEFAULTS = dict( + dimension_unit="IN", + weight_unit="LB", +) +MeasurementOptions = units.MeasurementOptionsType( + min_in=1, + min_cm=1, +) +COUNTRY_PREFERED_UNITS = dict( + US=(units.WeightUnit.LB, units.DimensionUnit.IN), +) + + +class PackagePresets(lib.Enum): + fedex_envelope_legal_size = units.PackagePreset( + **dict(weight=1.0, width=9.5, height=15.5, length=1, packaging_type="envelope"), + **PRESET_DEFAULTS + ) + fedex_envelope_without_pouch = units.PackagePreset( + **dict(weight=1.0, width=9.5, height=15.5, length=1, packaging_type="envelope"), + **PRESET_DEFAULTS + ) + fedex_padded_pak = units.PackagePreset( + **dict(weight=2.2, width=11.75, height=14.75, length=1, packaging_type="pak"), + **PRESET_DEFAULTS + ) + fedex_polyethylene_pak = units.PackagePreset( + **dict(weight=2.2, width=12.0, height=15.5, length=1, packaging_type="pak"), + **PRESET_DEFAULTS + ) + fedex_clinical_pak = units.PackagePreset( + **dict(weight=2.2, width=13.5, height=18.0, length=1, packaging_type="pak"), + **PRESET_DEFAULTS + ) + fedex_un_3373_pak = units.PackagePreset( + **dict(weight=2.2, width=13.5, height=18.0, length=1, packaging_type="pak"), + **PRESET_DEFAULTS + ) + fedex_small_box = units.PackagePreset( + **dict( + weight=20.0, + width=12.25, + height=10.9, + length=1.5, + packaging_type="small_box", + ), + **PRESET_DEFAULTS + ) + fedex_medium_box = units.PackagePreset( + **dict( + weight=20.0, + width=13.25, + height=11.5, + length=2.38, + packaging_type="medium_box", + ), + **PRESET_DEFAULTS + ) + fedex_large_box = units.PackagePreset( + **dict( + weight=20.0, + width=17.88, + height=12.38, + length=3.0, + packaging_type="large_box", + ), + **PRESET_DEFAULTS + ) + fedex_extra_large_box = units.PackagePreset( + **dict( + weight=20.0, + width=11.88, + height=11.00, + length=10.75, + packaging_type="extra_large_box", + ), + **PRESET_DEFAULTS + ) + fedex_10_kg_box = units.PackagePreset( + **dict( + weight=10.0, + width=15.81, + height=12.94, + length=10.19, + packaging_type="medium_box", + ), + **PRESET_DEFAULTS + ) + fedex_25_kg_box = units.PackagePreset( + **dict( + weight=25.0, + width=21.56, + height=16.56, + length=13.19, + packaging_type="medium_box", + ), + **PRESET_DEFAULTS + ) + fedex_tube = units.PackagePreset( + **dict(weight=20.0, width=38.0, height=6.0, length=6.0, packaging_type="tube"), + **PRESET_DEFAULTS + ) + fedex_envelope = fedex_envelope_legal_size + fedex_pak = fedex_padded_pak + + +class LabelType(lib.Enum): + PDF_4x6 = ("PDF", "STOCK_4X6") + PDF_4x6_75 = ("PDF", "STOCK_4X6.75") + PDF_4x8 = ("PDF", "STOCK_4X8") + PDF_4x9 = ("PDF", "STOCK_4X9") + ZPL_4x6 = ("ZPLII", "STOCK_4X6") + ZPL_4x6_75 = ("ZPLII", "STOCK_4X6.75") + ZPL_4x8 = ("ZPLII", "STOCK_4X8") + ZPL_4x9 = ("ZPLII", "STOCK_4X9") + + """ Unified Label type mapping """ + PDF = PDF_4x6 + ZPL = ZPL_4x6 + + +class Incoterm(lib.Enum): + DDP = "DDP" + DDU = "DDU" + DAP = "DAP" + DAT = "DAT" + EXW = "EXW" + CPT = "CPT" + C_F = "C&F" + CIP = "CIP" + CIF = "CIF" + FCA = "FCA" + FOB = "FOB" + + +class PurposeType(lib.Enum): + gift = "GIFT" + not_sold = "NOT_SOLD" + personal_effects = "PERSONAL_EFFECTS" + repair_and_return = "REPAIR_AND_RETURN" + sample = "SAMPLE" + sold = "SOLD" + other = None + + """ Unified Content type mapping """ + documents = other + merchandise = sold + return_merchandise = repair_and_return + + +class PackagingType(lib.Enum): + fedex_envelope = "FEDEX_ENVELOPE" + fedex_box = "FEDEX_BOX" + fedex_small_box = "FEDEX_SMALL_BOX" + fedex_medium_box = "FEDEX_MEDIUM_BOX" + fedex_large_box = "FEDEX_LARGE_BOX" + fedex_extra_large_box = "FEDEX_EXTRA_LARGE_BOX" + fedex_10kg_box = "FEDEX_10KG_BOX" + fedex_25kg_box = "FEDEX_25KG_BOX" + fedex_pak = "FEDEX_PAK" + fedex_tube = "FEDEX_TUBE" + your_packaging = "YOUR_PACKAGING" + + """ Unified Packaging type mapping """ + envelope = fedex_envelope + pak = fedex_pak + tube = fedex_tube + pallet = your_packaging + small_box = fedex_small_box + medium_box = fedex_medium_box + large_box = fedex_large_box + extra_large_box = fedex_extra_large_box + + +class PaymentType(lib.Enum): + account = "ACCOUNT" + collect = "COLLECT" + recipient = "RECIPIENT" + sender = "SENDER" + third_party = "THIRD_PARTY" + + +class ConnectionConfig(lib.Enum): + locale = lib.OptionEnum("locale") + label_type = lib.OptionEnum("label_type") + shipping_options = lib.OptionEnum("shipping_options", list) + shipping_services = lib.OptionEnum("shipping_services", list) + + +class ShippingService(lib.Enum): + fedex_international_priority_express = "FEDEX_INTERNATIONAL_PRIORITY_EXPRESS" + fedex_international_first = "INTERNATIONAL_FIRST" + fedex_international_priority = "FEDEX_INTERNATIONAL_PRIORITY" + fedex_international_economy = "INTERNATIONAL_ECONOMY" + fedex_ground = "FEDEX_GROUND" + fedex_cargo_mail = "FEDEX_CARGO_MAIL" + fedex_cargo_international_premium = "FEDEX_CARGO_INTERNATIONAL_PREMIUM" + fedex_first_overnight = "FIRST_OVERNIGHT" + fedex_first_overnight_freight = "FIRST_OVERNIGHT_FREIGHT" + fedex_1_day_freight = "FEDEX_1_DAY_FREIGHT" + fedex_2_day_freight = "FEDEX_2_DAY_FREIGHT" + fedex_3_day_freight = "FEDEX_3_DAY_FREIGHT" + fedex_international_priority_freight = "INTERNATIONAL_PRIORITY_FREIGHT" + fedex_international_economy_freight = "INTERNATIONAL_ECONOMY_FREIGHT" + fedex_cargo_airport_to_airport = "FEDEX_CARGO_AIRPORT_TO_AIRPORT" + fedex_international_priority_distribution = "INTERNATIONAL_PRIORITY_DISTRIBUTION" + fedex_ip_direct_distribution_freight = "FEDEX_IP_DIRECT_DISTRIBUTION_FREIGHT" + fedex_intl_ground_distribution = "INTL_GROUND_DISTRIBUTION" + fedex_ground_home_delivery = "GROUND_HOME_DELIVERY" + fedex_smart_post = "SMART_POST" + fedex_priority_overnight = "PRIORITY_OVERNIGHT" + fedex_standard_overnight = "STANDARD_OVERNIGHT" + fedex_2_day = "FEDEX_2_DAY" + fedex_2_day_am = "FEDEX_2_DAY_AM" + fedex_express_saver = "FEDEX_EXPRESS_SAVER" + fedex_same_day = "SAME_DAY" + fedex_same_day_city = "SAME_DAY_CITY" + fedex_one_day_freight = "FEDEX_ONE_DAY_FREIGHT" + fedex_international_economy_distribution = "INTERNATIONAL_ECONOMY_DISTRIBUTION" + fedex_international_connect_plus = "FEDEX_INTERNATIONAL_CONNECT_PLUS" + fedex_international_distribution_freight = "INTERNATIONAL_DISTRIBUTION_FREIGHT" + fedex_regional_economy = "FEDEX_REGIONAL_ECONOMY" + fedex_next_day_freight = "FEDEX_NEXT_DAY_FREIGHT" + fedex_next_day = "FEDEX_NEXT_DAY" + fedex_next_day_10am = "FEDEX_NEXT_DAY_10AM" + fedex_next_day_12pm = "FEDEX_NEXT_DAY_12PM" + fedex_next_day_end_of_day = "FEDEX_NEXT_DAY_END_OF_DAY" + fedex_distance_deferred = "FEDEX_DISTANCE_DEFERRED" + + +class RatingOption(lib.Enum): + fedex_one_rate = lib.OptionEnum("FEDEX_ONE_RATE", bool) + fedex_freight_guarantee = lib.OptionEnum("FREIGHT_GUARANTEE", bool) + fedex_saturday_delivery = lib.OptionEnum("SATURDAY_DELIVERY", bool) + fedex_smart_post_allowed_indicia = lib.OptionEnum( + "SMART_POST_ALLOWED_INDICIA", bool + ) + fedex_smart_post_hub_id = lib.OptionEnum("SMART_POST_HUB_ID", bool) + + +class ShippingOption(lib.Enum): + # fmt: off + + fedex_appointment = lib.OptionEnum("APPOINTMENT", bool) + fedex_broker_select_option = lib.OptionEnum("BROKER_SELECT_OPTION", bool) + fedex_call_before_delivery = lib.OptionEnum("CALL_BEFORE_DELIVERY", bool) + fedex_cod = lib.OptionEnum("COD", float) + fedex_custom_delivery_window = lib.OptionEnum("CUSTOM_DELIVERY_WINDOW", bool) + fedex_cut_flowers = lib.OptionEnum("CUT_FLOWERS", bool) + fedex_do_not_break_down_pallets = lib.OptionEnum("DO_NOT_BREAK_DOWN_PALLETS", bool) + fedex_do_not_stack_pallets = lib.OptionEnum("DO_NOT_STACK_PALLETS", bool) + fedex_dry_ice = lib.OptionEnum("DRY_ICE", bool) + fedex_east_coast_special = lib.OptionEnum("EAST_COAST_SPECIAL", bool) + fedex_exclude_from_consolidation = lib.OptionEnum("EXCLUDE_FROM_CONSOLIDATION", bool) + fedex_extreme_length = lib.OptionEnum("EXTREME_LENGTH", bool) + fedex_inside_delivery = lib.OptionEnum("INSIDE_DELIVERY", bool) + fedex_inside_pickup = lib.OptionEnum("INSIDE_PICKUP", bool) + fedex_international_controlled_export_service = lib.OptionEnum("INTERNATIONAL_CONTROLLED_EXPORT_SERVICE", bool) + fedex_one_rate = lib.OptionEnum("FEDEX_ONE_RATE", bool) + fedex_third_party_consignee = lib.OptionEnum("THIRD_PARTY_CONSIGNEE", bool) + fedex_electronic_trade_documents = lib.OptionEnum("ELECTRONIC_TRADE_DOCUMENTS", bool) + fedex_food = lib.OptionEnum("FOOD", bool) + fedex_future_day_shipment = lib.OptionEnum("FUTURE_DAY_SHIPMENT", bool) + fedex_hold_at_location = lib.OptionEnum("HOLD_AT_LOCATION", bool) + fedex_international_traffic_in_arms_regulations = lib.OptionEnum("INTERNATIONAL_TRAFFIC_IN_ARMS_REGULATIONS", bool) + fedex_liftgate_delivery = lib.OptionEnum("LIFTGATE_DELIVERY", bool) + fedex_liftgate_pickup = lib.OptionEnum("LIFTGATE_PICKUP", bool) + fedex_limited_access_delivery = lib.OptionEnum("LIMITED_ACCESS_DELIVERY", bool) + fedex_limited_access_pickup = lib.OptionEnum("LIMITED_ACCESS_PICKUP", bool) + fedex_over_length = lib.OptionEnum("OVER_LENGTH", bool) + fedex_pending_shipment = lib.OptionEnum("PENDING_SHIPMENT", bool) + fedex_pharmacy_delivery = lib.OptionEnum("PHARMACY_DELIVERY", bool) + fedex_poison = lib.OptionEnum("POISON", bool) + fedex_home_delivery_premium = lib.OptionEnum("HOME_DELIVERY_PREMIUM", bool) + fedex_protection_from_freezing = lib.OptionEnum("PROTECTION_FROM_FREEZING", bool) + fedex_returns_clearance = lib.OptionEnum("RETURNS_CLEARANCE", bool) + fedex_return_shipment = lib.OptionEnum("RETURN_SHIPMENT", bool) + fedex_saturday_delivery = lib.OptionEnum("SATURDAY_DELIVERY", bool) + fedex_saturday_pickup = lib.OptionEnum("SATURDAY_PICKUP", bool) + fedex_event_notification = lib.OptionEnum("EVENT_NOTIFICATION", bool) + fedex_delivery_on_invoice_acceptance = lib.OptionEnum("DELIVERY_ON_INVOICE_ACCEPTANCE", bool) + fedex_top_load = lib.OptionEnum("TOP_LOAD", bool) + fedex_freight_guarantee = lib.OptionEnum("FREIGHT_GUARANTEE", bool) + + """ Package Options """ + + fedex_alcohol = lib.OptionEnum("ALCOHOL", bool) + fedex_battery = lib.OptionEnum("BATTERY", bool) + fedex_dangerous_goods = lib.OptionEnum("DANGEROUS_GOODS", bool) + fedex_priority_alert = lib.OptionEnum("PRIORITY_ALERT", bool) + fedex_priority_alert_plus = lib.OptionEnum("PRIORITY_ALERT_PLUS", bool) + fedex_non_standard_container = lib.OptionEnum("NON_STANDARD_CONTAINER", bool) + fedex_piece_count_verification = lib.OptionEnum("PIECE_COUNT_VERIFICATION", bool) + fedex_signature_option = lib.OptionEnum("SIGNATURE_OPTION", bool) + fedex_evening = lib.OptionEnum("EVENING", bool) + fedex_date_certain = lib.OptionEnum("DATE_CERTAIN", bool) + + """ Unified Option type mapping """ + cash_on_delivery = fedex_cod + dangerous_good = fedex_dangerous_goods + notification = fedex_event_notification + paperless_trade = fedex_electronic_trade_documents + doc_files = lib.OptionEnum("doc_files", lib.to_dict) + doc_references = lib.OptionEnum("WEIGHING", lib.to_dict) + + # fmt: on + + +def shipping_options_initializer( + options: dict, + package_options: units.Options = None, + option_type: lib.Enum = ShippingOption, +) -> units.Options: + """ + Apply default values to the given options. + """ + _options = options.copy() + _add_signature = "fedex_signature_option" not in options + + if package_options is not None: + _options.update(package_options.content) + + if _add_signature: + _options.update( + dict( + fedex_signature_option=( + "ADULT" + if _options.get("signature_confirmation") + else "SERVICE_DEFAULT" + ) + ) + ) + + def items_filter(key: str) -> bool: + return key in option_type and key not in ["doc_files", "doc_references"] # type: ignore + + return units.ShippingOptions(_options, option_type, items_filter=items_filter) + + +class RateType(lib.Enum): + payor_account_package = "PAYOR_ACCOUNT_PACKAGE" + payor_account_shipment = "PAYOR_ACCOUNT_SHIPMENT" + payor_list_package = "PAYOR_LIST_PACKAGE" + payor_list_shipment = "PAYOR_LIST_SHIPMENT" + preferred_account_package = "PREFERRED_ACCOUNT_PACKAGE" + preferred_account_shipment = "PREFERRED_ACCOUNT_SHIPMENT" + preferred_list_package = "PREFERRED_LIST_PACKAGE" + preferred_list_shipment = "PREFERRED_LIST_SHIPMENT" + + +class UploadDocumentType(lib.Enum): + fedex_usmca_commercial_invoice_certification_of_origin = ( + "USMCA_COMMERCIAL_INVOICE_CERTIFICATION_OF_ORIGIN" + ) + fedex_usmca_certification_of_origin = "USMCA_CERTIFICATION_OF_ORIGIN" + fedex_certificate_of_origin = "CERTIFICATE_OF_ORIGIN" + fedex_commercial_invoice = "COMMERCIAL_INVOICE" + fedex_pro_forma_invoice = "PRO_FORMA_INVOICE" + fedex_net_rate_sheet = "NET_RATE_SHEET" + fedex_etd_label = "ETD_LABEL" + fedex_other = "OTHER" + + """ Unified upload document type mapping """ + certificate_of_origin = fedex_certificate_of_origin + commercial_invoice = fedex_commercial_invoice + pro_forma_invoice = fedex_pro_forma_invoice + packing_list = fedex_other + other = fedex_other + + +class DocumentUploadOption(lib.Enum): + fedex_carrier_code = lib.OptionEnum("carrierCode", str) + pre_shipment = lib.OptionEnum("pre_shipment", bool) + + +class TrackingStatus(lib.Enum): + on_hold = ["DE", "SE"] + delivered = ["DL"] + in_transit = ["IT", "IX"] + delivery_failed = ["CA", "RS"] + delivery_delayed = ["DY", "DD"] + out_for_delivery = ["AD", "ED", "OD"] + ready_for_pickup = ["HL"] diff --git a/modules/connectors/fedex/karrio/providers/fedex/utils.py b/modules/connectors/fedex/karrio/providers/fedex/utils.py new file mode 100644 index 0000000000..bad7a08c85 --- /dev/null +++ b/modules/connectors/fedex/karrio/providers/fedex/utils.py @@ -0,0 +1,96 @@ +import jstruct +import datetime +import urllib.parse +import karrio.lib as lib +import karrio.core as core +import karrio.core.errors as errors + + +class Settings(core.Settings): + """FedEx connection settings.""" + + api_key: str + secret_key: str + account_number: str = None + + cache: lib.Cache = jstruct.JStruct[lib.Cache] + account_country_code: str = None + metadata: dict = {} + config: dict = {} + id: str = None + + @property + def carrier_name(self): + return "fedex" + + @property + def server_url(self): + return ( + "https://apis-sandbox.fedex.com" + if self.test_mode + else "https://apis.fedex.com" + ) + + @property + def tracking_url(self): + return "https://www.fedex.com/fedextrack/?trknbr={}" + + @property + def connection_config(self) -> lib.units.Options: + from karrio.providers.fedex.units import ConnectionConfig + + return lib.to_connection_config( + self.config or {}, + option_type=ConnectionConfig, + ) + + @property + def access_token(self): + """Retrieve the access_token using the api_key|secret_key pair + or collect it from the cache if an unexpired access_token exist. + """ + cache_key = f"{self.carrier_name}|{self.api_key}|{self.secret_key}" + now = datetime.datetime.now() + datetime.timedelta(minutes=30) + + auth = self.cache.get(cache_key) or {} + token = auth.get("access_token") + expiry = lib.to_date(auth.get("expiry"), current_format="%Y-%m-%d %H:%M:%S") + + if token is not None and expiry is not None and expiry > now: + return token + + self.cache.set(cache_key, lambda: login(self)) + new_auth = self.cache.get(cache_key) + + return new_auth["access_token"] + + +def login(settings: Settings): + import karrio.providers.fedex.error as error + + result = lib.request( + url=f"{settings.server_url}/oauth/token", + method="POST", + headers={ + "content-Type": "application/x-www-form-urlencoded", + }, + data=urllib.parse.urlencode( + dict( + grant_type="client_credentials", + client_id=settings.api_key, + client_secret=settings.secret_key, + ) + ), + ) + + response = lib.to_dict(result) + messages = error.parse_error_response(response, settings) + + if any(messages): + raise errors.ShippingSDKError(messages) + + expiry = datetime.datetime.now() + datetime.timedelta( + seconds=float(response.get("expires_in", 0)) + ) + + return {**response, "expiry": lib.fdatetime(expiry)} diff --git a/modules/connectors/fedex/karrio/schemas/fedex/__init__.py b/modules/connectors/fedex/karrio/schemas/fedex/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/modules/connectors/fedex/karrio/schemas/fedex/cancel_request.py b/modules/connectors/fedex/karrio/schemas/fedex/cancel_request.py new file mode 100644 index 0000000000..4dcc3cdd4e --- /dev/null +++ b/modules/connectors/fedex/karrio/schemas/fedex/cancel_request.py @@ -0,0 +1,17 @@ +from attr import s +from typing import Optional +from jstruct import JStruct + + +@s(auto_attribs=True) +class AccountNumberType: + value: Optional[str] = None + + +@s(auto_attribs=True) +class CancelRequestType: + accountNumber: Optional[AccountNumberType] = JStruct[AccountNumberType] + emailShipment: Optional[bool] = None + senderCountryCode: Optional[str] = None + deletionControl: Optional[str] = None + trackingNumber: Optional[str] = None diff --git a/modules/connectors/fedex/karrio/schemas/fedex/cancel_response.py b/modules/connectors/fedex/karrio/schemas/fedex/cancel_response.py new file mode 100644 index 0000000000..ba543d0061 --- /dev/null +++ b/modules/connectors/fedex/karrio/schemas/fedex/cancel_response.py @@ -0,0 +1,25 @@ +from attr import s +from typing import Optional, List +from jstruct import JList, JStruct + + +@s(auto_attribs=True) +class AlertType: + code: Optional[str] = None + alertType: Optional[str] = None + message: Optional[str] = None + + +@s(auto_attribs=True) +class OutputType: + cancelledShipment: Optional[bool] = None + cancelledHistory: Optional[bool] = None + successMessage: Optional[str] = None + alerts: List[AlertType] = JList[AlertType] + + +@s(auto_attribs=True) +class CancelResponseType: + transactionId: Optional[str] = None + customerTransactionId: Optional[str] = None + output: Optional[OutputType] = JStruct[OutputType] diff --git a/modules/connectors/fedex/karrio/schemas/fedex/error_response.py b/modules/connectors/fedex/karrio/schemas/fedex/error_response.py new file mode 100644 index 0000000000..ca926e3f85 --- /dev/null +++ b/modules/connectors/fedex/karrio/schemas/fedex/error_response.py @@ -0,0 +1,16 @@ +from attr import s +from typing import Optional, List +from jstruct import JList + + +@s(auto_attribs=True) +class ErrorType: + code: Optional[str] = None + message: Optional[str] = None + + +@s(auto_attribs=True) +class ErrorResponseType: + transactionId: Optional[str] = None + customerTransactionId: Optional[str] = None + errors: List[ErrorType] = JList[ErrorType] diff --git a/modules/connectors/fedex/karrio/schemas/fedex/paperless_request.py b/modules/connectors/fedex/karrio/schemas/fedex/paperless_request.py new file mode 100644 index 0000000000..fc0460ca34 --- /dev/null +++ b/modules/connectors/fedex/karrio/schemas/fedex/paperless_request.py @@ -0,0 +1,30 @@ +from attr import s +from typing import Optional +from jstruct import JStruct + + +@s(auto_attribs=True) +class MetaType: + shipDocumentType: Optional[str] = None + formCode: Optional[str] = None + trackingNumber: Optional[str] = None + shipmentDate: Optional[str] = None + originLocationCode: Optional[str] = None + originCountryCode: Optional[str] = None + destinationLocationCode: Optional[str] = None + destinationCountryCode: Optional[str] = None + + +@s(auto_attribs=True) +class DocumentType: + workflowName: Optional[str] = None + carrierCode: Optional[str] = None + name: Optional[str] = None + contentType: Optional[str] = None + meta: Optional[MetaType] = JStruct[MetaType] + + +@s(auto_attribs=True) +class PaperlessRequestType: + document: Optional[DocumentType] = JStruct[DocumentType] + attachment: Optional[str] = None diff --git a/modules/connectors/fedex/karrio/schemas/fedex/paperless_response.py b/modules/connectors/fedex/karrio/schemas/fedex/paperless_response.py new file mode 100644 index 0000000000..5343d7a03d --- /dev/null +++ b/modules/connectors/fedex/karrio/schemas/fedex/paperless_response.py @@ -0,0 +1,21 @@ +from attr import s +from typing import Optional, List +from jstruct import JStruct + + +@s(auto_attribs=True) +class MetaType: + documentType: Optional[str] = None + docId: Optional[str] = None + folderId: List[str] = [] + + +@s(auto_attribs=True) +class OutputType: + meta: Optional[MetaType] = JStruct[MetaType] + + +@s(auto_attribs=True) +class PaperlessResponseType: + output: Optional[OutputType] = JStruct[OutputType] + customerTransactionId: Optional[str] = None diff --git a/modules/connectors/fedex/karrio/schemas/fedex/rating_request.py b/modules/connectors/fedex/karrio/schemas/fedex/rating_request.py new file mode 100644 index 0000000000..84fee7cb57 --- /dev/null +++ b/modules/connectors/fedex/karrio/schemas/fedex/rating_request.py @@ -0,0 +1,478 @@ +from attr import s +from typing import Optional, List, Any +from jstruct import JStruct, JList + + +@s(auto_attribs=True) +class RatingRequestAccountNumberType: + value: Optional[str] = None + + +@s(auto_attribs=True) +class RateRequestControlParametersType: + returnTransitTimes: Optional[bool] = None + servicesNeededOnRateFailure: Optional[bool] = None + variableOptions: Optional[str] = None + rateSortOrder: Optional[str] = None + + +@s(auto_attribs=True) +class RecipientAccountNumberType: + value: Optional[int] = None + + +@s(auto_attribs=True) +class BrokerAddressType: + streetLines: List[str] = [] + countryCode: Optional[str] = None + + +@s(auto_attribs=True) +class RecipientContactType: + companyName: Optional[str] = None + faxNumber: Optional[str] = None + personName: Optional[str] = None + phoneNumber: Optional[str] = None + + +@s(auto_attribs=True) +class BrokerClassType: + accountNumber: Optional[RecipientAccountNumberType] = JStruct[RecipientAccountNumberType] + address: Optional[BrokerAddressType] = JStruct[BrokerAddressType] + contact: Optional[RecipientContactType] = JStruct[RecipientContactType] + + +@s(auto_attribs=True) +class BrokerAddressClassType: + streetLines: List[str] = [] + city: Optional[str] = None + stateOrProvinceCode: Optional[str] = None + postalCode: Optional[int] = None + countryCode: Optional[str] = None + residential: Optional[bool] = None + classification: Optional[str] = None + geographicCoordinates: Optional[str] = None + urbanizationCode: Optional[str] = None + countryName: Optional[str] = None + + +@s(auto_attribs=True) +class BrokerType: + broker: Optional[BrokerClassType] = JStruct[BrokerClassType] + type: Optional[str] = None + brokerCommitTimestamp: Optional[str] = None + brokerCommitDayOfWeek: Optional[str] = None + brokerLocationId: Optional[str] = None + brokerAddress: Optional[BrokerAddressClassType] = JStruct[BrokerAddressClassType] + brokerToDestinationDays: Optional[int] = None + + +@s(auto_attribs=True) +class CommercialInvoiceType: + shipmentPurpose: Optional[str] = None + + +@s(auto_attribs=True) +class FixedValueType: + amount: Optional[int] = None + currency: Optional[str] = None + + +@s(auto_attribs=True) +class WeightType: + units: Optional[str] = None + value: Optional[int] = None + + +@s(auto_attribs=True) +class CommodityType: + description: Optional[str] = None + weight: Optional[WeightType] = JStruct[WeightType] + quantity: Optional[int] = None + customsValue: Optional[FixedValueType] = JStruct[FixedValueType] + unitPrice: Optional[FixedValueType] = JStruct[FixedValueType] + numberOfPieces: Optional[int] = None + countryOfManufacture: Optional[str] = None + quantityUnits: Optional[str] = None + name: Optional[str] = None + harmonizedCode: Optional[str] = None + partNumber: Optional[str] = None + + +@s(auto_attribs=True) +class ResponsiblePartyAddressType: + streetLines: List[str] = [] + city: Optional[str] = None + stateOrProvinceCode: Optional[str] = None + postalCode: Optional[int] = None + countryCode: Optional[str] = None + residential: Optional[bool] = None + + +@s(auto_attribs=True) +class ResponsiblePartyContactType: + personName: Optional[str] = None + emailAddress: Optional[str] = None + phoneNumber: Optional[str] = None + phoneExtension: Optional[str] = None + companyName: Optional[str] = None + faxNumber: Optional[str] = None + + +@s(auto_attribs=True) +class ResponsiblePartyType: + address: Optional[ResponsiblePartyAddressType] = JStruct[ResponsiblePartyAddressType] + contact: Optional[ResponsiblePartyContactType] = JStruct[ResponsiblePartyContactType] + accountNumber: Optional[RatingRequestAccountNumberType] = JStruct[RatingRequestAccountNumberType] + + +@s(auto_attribs=True) +class PayorType: + responsibleParty: Optional[ResponsiblePartyType] = JStruct[ResponsiblePartyType] + + +@s(auto_attribs=True) +class DutiesPaymentType: + payor: Optional[PayorType] = JStruct[PayorType] + paymentType: Optional[str] = None + + +@s(auto_attribs=True) +class CustomsClearanceDetailType: + brokers: List[BrokerType] = JList[BrokerType] + commercialInvoice: Optional[CommercialInvoiceType] = JStruct[CommercialInvoiceType] + freightOnValue: Optional[str] = None + dutiesPayment: Optional[DutiesPaymentType] = JStruct[DutiesPaymentType] + commodities: List[CommodityType] = JList[CommodityType] + + +@s(auto_attribs=True) +class PrintedReferenceType: + printedReferenceType: Optional[str] = None + value: Optional[str] = None + + +@s(auto_attribs=True) +class EmailNotificationDetailRecipientType: + emailAddress: Optional[str] = None + notificationEventType: List[str] = [] + smsDetail: Any = None + notificationFormatType: Optional[str] = None + emailNotificationRecipientType: Optional[str] = None + notificationType: Optional[str] = None + locale: Optional[str] = None + + +@s(auto_attribs=True) +class EmailNotificationDetailType: + recipients: List[EmailNotificationDetailRecipientType] = JList[EmailNotificationDetailRecipientType] + personalMessage: Optional[str] = None + PrintedReference: Optional[PrintedReferenceType] = JStruct[PrintedReferenceType] + + +@s(auto_attribs=True) +class ExpressFreightDetailType: + bookingConfirmationNumber: Optional[str] = None + shippersLoadAndCount: Optional[int] = None + + +@s(auto_attribs=True) +class ShipperClassType: + address: Optional[ResponsiblePartyAddressType] = JStruct[ResponsiblePartyAddressType] + + +@s(auto_attribs=True) +class ContentRecordType: + itemNumber: Optional[str] = None + receivedQuantity: Optional[int] = None + description: Optional[str] = None + partNumber: Optional[str] = None + + +@s(auto_attribs=True) +class DimensionsType: + length: Optional[int] = None + width: Optional[int] = None + height: Optional[int] = None + units: Optional[str] = None + + +@s(auto_attribs=True) +class AlcoholDetailType: + alcoholRecipientType: Optional[str] = None + shipperAgreementType: Optional[str] = None + + +@s(auto_attribs=True) +class BatteryDetailType: + material: Optional[str] = None + regulatorySubType: Optional[str] = None + packing: Optional[str] = None + + +@s(auto_attribs=True) +class NumberType: + areaCode: Optional[str] = None + extension: Optional[str] = None + countryCode: Optional[str] = None + personalIdentificationNumber: Optional[str] = None + localNumber: Optional[str] = None + + +@s(auto_attribs=True) +class HazardousCommodityType: + innerReceptacles: List[Any] = [] + + +@s(auto_attribs=True) +class PackagingType: + count: Optional[int] = None + units: Optional[str] = None + + +@s(auto_attribs=True) +class ContainerType: + offeror: Optional[str] = None + hazardousCommodities: List[HazardousCommodityType] = JList[HazardousCommodityType] + numberOfContainers: Optional[int] = None + containerType: Optional[str] = None + emergencyContactNumber: Optional[NumberType] = JStruct[NumberType] + packaging: Optional[PackagingType] = JStruct[PackagingType] + packingType: Optional[str] = None + radioactiveContainerClass: Optional[str] = None + + +@s(auto_attribs=True) +class DangerousGoodsDetailType: + offeror: Optional[str] = None + accessibility: Optional[str] = None + emergencyContactNumber: Optional[str] = None + options: List[str] = [] + containers: List[ContainerType] = JList[ContainerType] + packaging: Optional[PackagingType] = JStruct[PackagingType] + + +@s(auto_attribs=True) +class CodCollectionAmountType: + amount: Optional[float] = None + currency: Optional[str] = None + + +@s(auto_attribs=True) +class PackageCODDetailType: + codCollectionAmount: Optional[CodCollectionAmountType] = JStruct[CodCollectionAmountType] + codCollectionType: Optional[str] = None + + +@s(auto_attribs=True) +class PackageSpecialServicesType: + specialServiceTypes: List[str] = [] + signatureOptionType: List[str] = [] + alcoholDetail: Optional[AlcoholDetailType] = JStruct[AlcoholDetailType] + dangerousGoodsDetail: Optional[DangerousGoodsDetailType] = JStruct[DangerousGoodsDetailType] + packageCODDetail: Optional[PackageCODDetailType] = JStruct[PackageCODDetailType] + pieceCountVerificationBoxCount: Optional[int] = None + batteryDetails: List[BatteryDetailType] = JList[BatteryDetailType] + dryIceWeight: Optional[WeightType] = JStruct[WeightType] + + +@s(auto_attribs=True) +class VariableHandlingChargeDetailType: + rateType: Optional[str] = None + percentValue: Optional[int] = None + rateLevelType: Optional[str] = None + fixedValue: Optional[FixedValueType] = JStruct[FixedValueType] + rateElementBasis: Optional[str] = None + + +@s(auto_attribs=True) +class RequestedPackageLineItemType: + subPackagingType: Optional[str] = None + groupPackageCount: Optional[int] = None + contentRecord: List[ContentRecordType] = JList[ContentRecordType] + declaredValue: Optional[FixedValueType] = JStruct[FixedValueType] + weight: Optional[WeightType] = JStruct[WeightType] + dimensions: Optional[DimensionsType] = JStruct[DimensionsType] + variableHandlingChargeDetail: Optional[VariableHandlingChargeDetailType] = JStruct[VariableHandlingChargeDetailType] + packageSpecialServices: Optional[PackageSpecialServicesType] = JStruct[PackageSpecialServicesType] + + +@s(auto_attribs=True) +class ServiceTypeDetailType: + carrierCode: Optional[str] = None + description: Optional[str] = None + serviceName: Optional[str] = None + serviceCategory: Optional[str] = None + + +@s(auto_attribs=True) +class DeliveryOnInvoiceAcceptanceDetailType: + recipient: Optional[BrokerClassType] = JStruct[BrokerClassType] + + +@s(auto_attribs=True) +class TionContactAndAddressType: + address: Optional[ResponsiblePartyAddressType] = JStruct[ResponsiblePartyAddressType] + contact: Optional[ResponsiblePartyContactType] = JStruct[ResponsiblePartyContactType] + + +@s(auto_attribs=True) +class HoldAtLocationDetailType: + locationId: Optional[str] = None + locationContactAndAddress: Optional[TionContactAndAddressType] = JStruct[TionContactAndAddressType] + locationType: Optional[str] = None + + +@s(auto_attribs=True) +class HomeDeliveryPremiumDetailType: + phoneNumber: Optional[NumberType] = JStruct[NumberType] + shipTimestamp: Optional[str] = None + homedeliveryPremiumType: Optional[str] = None + + +@s(auto_attribs=True) +class InternationalControlledExportDetailType: + type: Optional[str] = None + + +@s(auto_attribs=True) +class InternationalTrafficInArmsRegulationsDetailType: + licenseOrExemptionNumber: Optional[int] = None + + +@s(auto_attribs=True) +class DocumentReferenceType: + documentType: Optional[str] = None + customerReference: Optional[str] = None + description: Optional[str] = None + documentId: Optional[int] = None + + +@s(auto_attribs=True) +class LocaleType: + country: Optional[str] = None + language: Optional[str] = None + + +@s(auto_attribs=True) +class ProcessingOptionsType: + options: List[str] = [] + + +@s(auto_attribs=True) +class EmailLabelDetailRecipientType: + emailAddress: Optional[str] = None + optionsRequested: Optional[ProcessingOptionsType] = JStruct[ProcessingOptionsType] + role: Optional[str] = None + locale: Optional[LocaleType] = JStruct[LocaleType] + + +@s(auto_attribs=True) +class EmailLabelDetailType: + recipients: List[EmailLabelDetailRecipientType] = JList[EmailLabelDetailRecipientType] + message: Optional[str] = None + + +@s(auto_attribs=True) +class RecommendedDocumentSpecificationType: + types: List[str] = [] + + +@s(auto_attribs=True) +class ShipmentDryIceDetailType: + totalWeight: Optional[WeightType] = JStruct[WeightType] + packageCount: Optional[int] = None + + +@s(auto_attribs=True) +class PendingShipmentDetailType: + pendingShipmentType: Optional[str] = None + processingOptions: Optional[ProcessingOptionsType] = JStruct[ProcessingOptionsType] + recommendedDocumentSpecification: Optional[RecommendedDocumentSpecificationType] = JStruct[RecommendedDocumentSpecificationType] + emailLabelDetail: Optional[EmailLabelDetailType] = JStruct[EmailLabelDetailType] + documentReferences: List[DocumentReferenceType] = JList[DocumentReferenceType] + expirationTimeStamp: Optional[str] = None + shipmentDryIceDetail: Optional[ShipmentDryIceDetailType] = JStruct[ShipmentDryIceDetailType] + + +@s(auto_attribs=True) +class ReturnShipmentDetailType: + returnType: Optional[str] = None + + +@s(auto_attribs=True) +class AddTransportationChargesDetailType: + rateType: Optional[str] = None + rateLevelType: Optional[str] = None + chargeLevelType: Optional[str] = None + chargeType: Optional[str] = None + + +@s(auto_attribs=True) +class CodRecipientType: + accountNumber: Optional[RecipientAccountNumberType] = JStruct[RecipientAccountNumberType] + + +@s(auto_attribs=True) +class ShipmentCODDetailType: + addTransportationChargesDetail: Optional[AddTransportationChargesDetailType] = JStruct[AddTransportationChargesDetailType] + codRecipient: Optional[CodRecipientType] = JStruct[CodRecipientType] + remitToName: Optional[str] = None + codCollectionType: Optional[str] = None + financialInstitutionContactAndAddress: Optional[TionContactAndAddressType] = JStruct[TionContactAndAddressType] + returnReferenceIndicatorType: Optional[str] = None + + +@s(auto_attribs=True) +class ShipmentSpecialServicesType: + returnShipmentDetail: Optional[ReturnShipmentDetailType] = JStruct[ReturnShipmentDetailType] + deliveryOnInvoiceAcceptanceDetail: Optional[DeliveryOnInvoiceAcceptanceDetailType] = JStruct[DeliveryOnInvoiceAcceptanceDetailType] + internationalTrafficInArmsRegulationsDetail: Optional[InternationalTrafficInArmsRegulationsDetailType] = JStruct[InternationalTrafficInArmsRegulationsDetailType] + pendingShipmentDetail: Optional[PendingShipmentDetailType] = JStruct[PendingShipmentDetailType] + holdAtLocationDetail: Optional[HoldAtLocationDetailType] = JStruct[HoldAtLocationDetailType] + shipmentCODDetail: Optional[ShipmentCODDetailType] = JStruct[ShipmentCODDetailType] + shipmentDryIceDetail: Optional[ShipmentDryIceDetailType] = JStruct[ShipmentDryIceDetailType] + internationalControlledExportDetail: Optional[InternationalControlledExportDetailType] = JStruct[InternationalControlledExportDetailType] + homeDeliveryPremiumDetail: Optional[HomeDeliveryPremiumDetailType] = JStruct[HomeDeliveryPremiumDetailType] + specialServiceTypes: List[str] = [] + + +@s(auto_attribs=True) +class SmartPostInfoDetailType: + ancillaryEndorsement: Optional[str] = None + hubId: Optional[int] = None + indicia: Optional[str] = None + specialServices: Optional[str] = None + + +@s(auto_attribs=True) +class RequestedShipmentType: + shipper: Optional[ShipperClassType] = JStruct[ShipperClassType] + recipient: Optional[ShipperClassType] = JStruct[ShipperClassType] + serviceType: Optional[str] = None + emailNotificationDetail: Optional[EmailNotificationDetailType] = JStruct[EmailNotificationDetailType] + preferredCurrency: Optional[str] = None + rateRequestType: List[str] = [] + shipDateStamp: Optional[str] = None + pickupType: Optional[str] = None + requestedPackageLineItems: List[RequestedPackageLineItemType] = JList[RequestedPackageLineItemType] + documentShipment: Optional[bool] = None + variableHandlingChargeDetail: Optional[VariableHandlingChargeDetailType] = JStruct[VariableHandlingChargeDetailType] + packagingType: Optional[str] = None + totalPackageCount: Optional[int] = None + totalWeight: Optional[float] = None + shipmentSpecialServices: Optional[ShipmentSpecialServicesType] = JStruct[ShipmentSpecialServicesType] + customsClearanceDetail: Optional[CustomsClearanceDetailType] = JStruct[CustomsClearanceDetailType] + groupShipment: Optional[bool] = None + serviceTypeDetail: Optional[ServiceTypeDetailType] = JStruct[ServiceTypeDetailType] + smartPostInfoDetail: Optional[SmartPostInfoDetailType] = JStruct[SmartPostInfoDetailType] + expressFreightDetail: Optional[ExpressFreightDetailType] = JStruct[ExpressFreightDetailType] + groundShipment: Optional[bool] = None + + +@s(auto_attribs=True) +class RatingRequestType: + accountNumber: Optional[RatingRequestAccountNumberType] = JStruct[RatingRequestAccountNumberType] + rateRequestControlParameters: Optional[RateRequestControlParametersType] = JStruct[RateRequestControlParametersType] + requestedShipment: Optional[RequestedShipmentType] = JStruct[RequestedShipmentType] + carrierCodes: List[str] = [] diff --git a/modules/connectors/fedex/karrio/schemas/fedex/rating_response.py b/modules/connectors/fedex/karrio/schemas/fedex/rating_response.py new file mode 100644 index 0000000000..23fb3e5d76 --- /dev/null +++ b/modules/connectors/fedex/karrio/schemas/fedex/rating_response.py @@ -0,0 +1,189 @@ +from attr import s +from typing import Optional, List +from jstruct import JStruct, JList + + +@s(auto_attribs=True) +class AlertType: + code: Optional[str] = None + message: Optional[str] = None + alertType: Optional[str] = None + + +@s(auto_attribs=True) +class DateDetailType: + dayOfWeek: Optional[str] = None + dayCxsFormat: Optional[str] = None + + +@s(auto_attribs=True) +class CommitType: + dateDetail: Optional[DateDetailType] = JStruct[DateDetailType] + + +@s(auto_attribs=True) +class CustomerMessageType: + code: Optional[str] = None + message: Optional[str] = None + + +@s(auto_attribs=True) +class OperationalDetailType: + originLocationIds: Optional[str] = None + commitDays: Optional[str] = None + serviceCode: Optional[str] = None + airportId: Optional[str] = None + scac: Optional[str] = None + originServiceAreas: Optional[str] = None + deliveryDay: Optional[str] = None + originLocationNumbers: Optional[int] = None + destinationPostalCode: Optional[int] = None + commitDate: Optional[str] = None + astraDescription: Optional[str] = None + deliveryDate: Optional[str] = None + deliveryEligibilities: Optional[str] = None + ineligibleForMoneyBackGuarantee: Optional[bool] = None + maximumTransitTime: Optional[str] = None + astraPlannedServiceLevel: Optional[str] = None + destinationLocationIds: Optional[str] = None + destinationLocationStateOrProvinceCodes: Optional[str] = None + transitTime: Optional[str] = None + packagingCode: Optional[str] = None + destinationLocationNumbers: Optional[int] = None + publishedDeliveryTime: Optional[str] = None + countryCodes: Optional[str] = None + stateOrProvinceCodes: Optional[str] = None + ursaPrefixCode: Optional[int] = None + ursaSuffixCode: Optional[str] = None + destinationServiceAreas: Optional[str] = None + originPostalCodes: Optional[int] = None + customTransitTime: Optional[str] = None + + +@s(auto_attribs=True) +class BillingWeightType: + units: Optional[str] = None + value: Optional[float] = None + + +@s(auto_attribs=True) +class SurchargeType: + type: Optional[str] = None + description: Optional[str] = None + amount: Optional[float] = None + level: Optional[str] = None + + +@s(auto_attribs=True) +class PackageRateDetailType: + rateType: Optional[str] = None + ratedWeightMethod: Optional[str] = None + baseCharge: Optional[float] = None + netFreight: Optional[float] = None + totalSurcharges: Optional[float] = None + netFedExCharge: Optional[float] = None + totalTaxes: Optional[float] = None + netCharge: Optional[float] = None + totalRebates: Optional[float] = None + billingWeight: Optional[BillingWeightType] = JStruct[BillingWeightType] + totalFreightDiscounts: Optional[float] = None + surcharges: List[SurchargeType] = JList[SurchargeType] + currency: Optional[str] = None + + +@s(auto_attribs=True) +class RatedPackageType: + groupNumber: Optional[float] = None + effectiveNetDiscount: Optional[float] = None + packageRateDetail: Optional[PackageRateDetailType] = JStruct[PackageRateDetailType] + + +@s(auto_attribs=True) +class NameType: + type: Optional[str] = None + encoding: Optional[str] = None + value: Optional[str] = None + + +@s(auto_attribs=True) +class ServiceDescriptionType: + serviceId: Optional[str] = None + serviceType: Optional[str] = None + code: Optional[str] = None + names: List[NameType] = JList[NameType] + operatingOrgCodes: List[str] = [] + description: Optional[str] = None + astraDescription: Optional[str] = None + serviceCategory: Optional[str] = None + + +@s(auto_attribs=True) +class CurrencyExchangeRateType: + fromCurrency: Optional[str] = None + intoCurrency: Optional[str] = None + rate: Optional[float] = None + + +@s(auto_attribs=True) +class ShipmentRateDetailType: + rateZone: Optional[str] = None + dimDivisor: Optional[float] = None + fuelSurchargePercent: Optional[float] = None + totalSurcharges: Optional[float] = None + totalFreightDiscount: Optional[float] = None + surCharges: List[SurchargeType] = JList[SurchargeType] + pricingCode: Optional[str] = None + currencyExchangeRate: Optional[CurrencyExchangeRateType] = JStruct[CurrencyExchangeRateType] + totalBillingWeight: Optional[BillingWeightType] = JStruct[BillingWeightType] + currency: Optional[str] = None + + +@s(auto_attribs=True) +class RatedShipmentDetailType: + rateType: Optional[str] = None + ratedWeightMethod: Optional[str] = None + totalDiscounts: Optional[float] = None + totalBaseCharge: Optional[float] = None + totalNetCharge: Optional[float] = None + totalVatCharge: Optional[float] = None + totalNetFedExCharge: Optional[float] = None + totalDutiesAndTaxes: Optional[float] = None + totalNetChargeWithDutiesAndTaxes: Optional[float] = None + totalDutiesTaxesAndFees: Optional[float] = None + totalAncillaryFeesAndTaxes: Optional[float] = None + shipmentRateDetail: Optional[ShipmentRateDetailType] = JStruct[ShipmentRateDetailType] + currency: Optional[str] = None + ratedPackages: List[RatedPackageType] = JList[RatedPackageType] + anonymouslyAllowable: Optional[bool] = None + operationalDetail: Optional[OperationalDetailType] = JStruct[OperationalDetailType] + signatureOptionType: Optional[str] = None + serviceDescription: Optional[ServiceDescriptionType] = JStruct[ServiceDescriptionType] + + +@s(auto_attribs=True) +class RateReplyDetailType: + serviceType: Optional[str] = None + serviceName: Optional[str] = None + packagingType: Optional[str] = None + customerMessages: List[CustomerMessageType] = JList[CustomerMessageType] + ratedShipmentDetails: List[RatedShipmentDetailType] = JList[RatedShipmentDetailType] + anonymouslyAllowable: Optional[bool] = None + operationalDetail: Optional[OperationalDetailType] = JStruct[OperationalDetailType] + signatureOptionType: Optional[str] = None + serviceDescription: Optional[ServiceDescriptionType] = JStruct[ServiceDescriptionType] + commit: Optional[CommitType] = JStruct[CommitType] + + +@s(auto_attribs=True) +class OutputType: + rateReplyDetails: List[RateReplyDetailType] = JList[RateReplyDetailType] + quoteDate: Optional[str] = None + encoded: Optional[bool] = None + alerts: List[AlertType] = JList[AlertType] + + +@s(auto_attribs=True) +class RatingResponseType: + transactionId: Optional[str] = None + customerTransactionId: Optional[str] = None + output: Optional[OutputType] = JStruct[OutputType] diff --git a/modules/connectors/fedex/karrio/schemas/fedex/shipping_request.py b/modules/connectors/fedex/karrio/schemas/fedex/shipping_request.py new file mode 100644 index 0000000000..551477eca0 --- /dev/null +++ b/modules/connectors/fedex/karrio/schemas/fedex/shipping_request.py @@ -0,0 +1,731 @@ +from attr import s +from typing import Optional, List +from jstruct import JStruct, JList + + +@s(auto_attribs=True) +class AccountNumberType: + value: Optional[str] = None + + +@s(auto_attribs=True) +class AddressType: + streetLines: List[str] = [] + city: Optional[str] = None + stateOrProvinceCode: Optional[str] = None + postalCode: Optional[int] = None + countryCode: Optional[str] = None + residential: Optional[bool] = None + + +@s(auto_attribs=True) +class BrokerContactType: + personName: Optional[str] = None + emailAddress: Optional[str] = None + phoneNumber: Optional[int] = None + phoneExtension: Optional[int] = None + companyName: Optional[str] = None + faxNumber: Optional[int] = None + + +@s(auto_attribs=True) +class TinType: + number: Optional[str] = None + tinType: Optional[str] = None + usage: Optional[str] = None + effectiveDate: Optional[str] = None + expirationDate: Optional[str] = None + + +@s(auto_attribs=True) +class BrokerBrokerType: + address: Optional[AddressType] = JStruct[AddressType] + contact: Optional[BrokerContactType] = JStruct[BrokerContactType] + accountNumber: Optional[AccountNumberType] = JStruct[AccountNumberType] + tins: List[TinType] = JList[TinType] + deliveryInstructions: Optional[str] = None + + +@s(auto_attribs=True) +class BrokerElementType: + broker: Optional[BrokerBrokerType] = JStruct[BrokerBrokerType] + type: Optional[str] = None + + +@s(auto_attribs=True) +class CustomerReferenceType: + customerReferenceType: Optional[str] = None + value: Optional[int] = None + + +@s(auto_attribs=True) +class CommercialInvoiceEmailNotificationDetailType: + emailAddress: Optional[str] = None + type: Optional[str] = None + recipientType: Optional[str] = None + + +@s(auto_attribs=True) +class TotalDeclaredValueType: + amount: Optional[float] = None + currency: Optional[str] = None + + +@s(auto_attribs=True) +class CommercialInvoiceType: + originatorName: Optional[str] = None + comments: List[str] = [] + customerReferences: List[CustomerReferenceType] = JList[CustomerReferenceType] + taxesOrMiscellaneousCharge: Optional[TotalDeclaredValueType] = JStruct[TotalDeclaredValueType] + taxesOrMiscellaneousChargeType: Optional[str] = None + freightCharge: Optional[TotalDeclaredValueType] = JStruct[TotalDeclaredValueType] + packingCosts: Optional[TotalDeclaredValueType] = JStruct[TotalDeclaredValueType] + handlingCosts: Optional[TotalDeclaredValueType] = JStruct[TotalDeclaredValueType] + declarationStatement: Optional[str] = None + termsOfSale: Optional[str] = None + specialInstructions: Optional[str] = None + shipmentPurpose: Optional[str] = None + emailNotificationDetail: Optional[CommercialInvoiceEmailNotificationDetailType] = JStruct[CommercialInvoiceEmailNotificationDetailType] + + +@s(auto_attribs=True) +class AdditionalMeasureType: + quantity: Optional[float] = None + units: Optional[str] = None + + +@s(auto_attribs=True) +class CustomsValueType: + amount: Optional[str] = None + currency: Optional[str] = None + + +@s(auto_attribs=True) +class UsmcaDetailType: + originCriterion: Optional[str] = None + + +@s(auto_attribs=True) +class WeightType: + units: Optional[str] = None + value: Optional[float] = None + + +@s(auto_attribs=True) +class CommodityType: + unitPrice: Optional[TotalDeclaredValueType] = JStruct[TotalDeclaredValueType] + additionalMeasures: List[AdditionalMeasureType] = JList[AdditionalMeasureType] + numberOfPieces: Optional[int] = None + quantity: Optional[int] = None + quantityUnits: Optional[str] = None + customsValue: Optional[CustomsValueType] = JStruct[CustomsValueType] + countryOfManufacture: Optional[str] = None + cIMarksAndNumbers: Optional[int] = None + harmonizedCode: Optional[str] = None + description: Optional[str] = None + name: Optional[str] = None + weight: Optional[WeightType] = JStruct[WeightType] + exportLicenseNumber: Optional[int] = None + exportLicenseExpirationDate: Optional[str] = None + partNumber: Optional[int] = None + purpose: Optional[str] = None + usmcaDetail: Optional[UsmcaDetailType] = JStruct[UsmcaDetailType] + + +@s(auto_attribs=True) +class CustomsOptionType: + description: Optional[str] = None + type: Optional[str] = None + + +@s(auto_attribs=True) +class UsmcaLowValueStatementDetailType: + countryOfOriginLowValueDocumentRequested: Optional[bool] = None + customsRole: Optional[str] = None + + +@s(auto_attribs=True) +class DeclarationStatementDetailType: + usmcaLowValueStatementDetail: Optional[UsmcaLowValueStatementDetailType] = JStruct[UsmcaLowValueStatementDetailType] + + +@s(auto_attribs=True) +class BillingDetailsType: + billingCode: Optional[str] = None + billingType: Optional[str] = None + aliasId: Optional[str] = None + accountNickname: Optional[str] = None + accountNumber: Optional[str] = None + accountNumberCountryCode: Optional[str] = None + + +@s(auto_attribs=True) +class ResponsiblePartyContactType: + personName: Optional[str] = None + emailAddress: Optional[str] = None + phoneNumber: Optional[str] = None + phoneExtension: Optional[str] = None + companyName: Optional[str] = None + faxNumber: Optional[str] = None + + +@s(auto_attribs=True) +class ResponsiblePartyType: + address: Optional[AddressType] = JStruct[AddressType] + contact: Optional[ResponsiblePartyContactType] = JStruct[ResponsiblePartyContactType] + accountNumber: Optional[AccountNumberType] = JStruct[AccountNumberType] + tins: List[TinType] = JList[TinType] + + +@s(auto_attribs=True) +class PayorType: + responsibleParty: Optional[ResponsiblePartyType] = JStruct[ResponsiblePartyType] + + +@s(auto_attribs=True) +class DutiesPaymentType: + payor: Optional[PayorType] = JStruct[PayorType] + billingDetails: Optional[BillingDetailsType] = JStruct[BillingDetailsType] + paymentType: Optional[str] = None + + +@s(auto_attribs=True) +class DestinationControlDetailType: + endUser: Optional[str] = None + statementTypes: Optional[str] = None + destinationCountries: List[str] = [] + + +@s(auto_attribs=True) +class ExportDetailType: + destinationControlDetail: Optional[DestinationControlDetailType] = JStruct[DestinationControlDetailType] + b13AFilingOption: Optional[str] = None + exportComplianceStatement: Optional[str] = None + permitNumber: Optional[int] = None + + +@s(auto_attribs=True) +class ShipperType: + address: Optional[AddressType] = JStruct[AddressType] + contact: Optional[ResponsiblePartyContactType] = JStruct[ResponsiblePartyContactType] + accountNumber: Optional[AccountNumberType] = JStruct[AccountNumberType] + tins: List[TinType] = JList[TinType] + deliveryInstructions: Optional[str] = None + + +@s(auto_attribs=True) +class RecipientCustomsIDType: + type: Optional[str] = None + value: Optional[int] = None + + +@s(auto_attribs=True) +class CustomsClearanceDetailType: + regulatoryControls: Optional[str] = None + brokers: List[BrokerElementType] = JList[BrokerElementType] + commercialInvoice: Optional[CommercialInvoiceType] = JStruct[CommercialInvoiceType] + freightOnValue: Optional[str] = None + dutiesPayment: Optional[DutiesPaymentType] = JStruct[DutiesPaymentType] + commodities: List[CommodityType] = JList[CommodityType] + isDocumentOnly: Optional[bool] = None + recipientCustomsId: Optional[RecipientCustomsIDType] = JStruct[RecipientCustomsIDType] + customsOption: Optional[CustomsOptionType] = JStruct[CustomsOptionType] + importerOfRecord: Optional[ShipperType] = JStruct[ShipperType] + generatedDocumentLocale: Optional[str] = None + exportDetail: Optional[ExportDetailType] = JStruct[ExportDetailType] + totalCustomsValue: Optional[TotalDeclaredValueType] = JStruct[TotalDeclaredValueType] + partiesToTransactionAreRelated: Optional[bool] = None + declarationStatementDetail: Optional[DeclarationStatementDetailType] = JStruct[DeclarationStatementDetailType] + insuranceCharge: Optional[TotalDeclaredValueType] = JStruct[TotalDeclaredValueType] + + +@s(auto_attribs=True) +class EmailNotificationRecipientType: + name: Optional[str] = None + emailNotificationRecipientType: Optional[str] = None + emailAddress: Optional[str] = None + notificationFormatType: Optional[str] = None + notificationType: Optional[str] = None + locale: Optional[str] = None + notificationEventType: List[str] = [] + + +@s(auto_attribs=True) +class RequestedShipmentEmailNotificationDetailType: + aggregationType: Optional[str] = None + emailNotificationRecipients: List[EmailNotificationRecipientType] = JList[EmailNotificationRecipientType] + personalMessage: Optional[str] = None + + +@s(auto_attribs=True) +class ExpressFreightDetailType: + bookingConfirmationNumber: Optional[str] = None + shippersLoadAndCount: Optional[int] = None + packingListEnclosed: Optional[bool] = None + + +@s(auto_attribs=True) +class AdditionalLabelType: + type: Optional[str] = None + count: Optional[int] = None + + +@s(auto_attribs=True) +class SpecificationType: + zoneNumber: Optional[int] = None + header: Optional[str] = None + dataField: Optional[str] = None + literalValue: Optional[str] = None + justification: Optional[str] = None + + +@s(auto_attribs=True) +class BarcodedType: + symbology: Optional[str] = None + specification: Optional[SpecificationType] = JStruct[SpecificationType] + + +@s(auto_attribs=True) +class Zone001Type: + docTabZoneSpecifications: List[SpecificationType] = JList[SpecificationType] + + +@s(auto_attribs=True) +class DocTabContentType: + docTabContentType: Optional[str] = None + zone001: Optional[Zone001Type] = JStruct[Zone001Type] + barcoded: Optional[BarcodedType] = JStruct[BarcodedType] + + +@s(auto_attribs=True) +class RegulatoryLabelType: + generationOptions: Optional[str] = None + type: Optional[str] = None + + +@s(auto_attribs=True) +class CustomerSpecifiedDetailType: + maskedData: List[str] = [] + regulatoryLabels: List[RegulatoryLabelType] = JList[RegulatoryLabelType] + additionalLabels: List[AdditionalLabelType] = JList[AdditionalLabelType] + docTabContent: Optional[DocTabContentType] = JStruct[DocTabContentType] + + +@s(auto_attribs=True) +class OriginType: + address: Optional[AddressType] = JStruct[AddressType] + contact: Optional[ResponsiblePartyContactType] = JStruct[ResponsiblePartyContactType] + + +@s(auto_attribs=True) +class LabelSpecificationType: + labelFormatType: Optional[str] = None + labelOrder: Optional[str] = None + customerSpecifiedDetail: Optional[CustomerSpecifiedDetailType] = JStruct[CustomerSpecifiedDetailType] + printedLabelOrigin: Optional[OriginType] = JStruct[OriginType] + labelStockType: Optional[str] = None + labelRotation: Optional[str] = None + imageType: Optional[str] = None + labelPrintingOrientation: Optional[str] = None + returnedDispositionDetail: Optional[bool] = None + + +@s(auto_attribs=True) +class MasterTrackingIDType: + formId: Optional[str] = None + trackingIdType: Optional[str] = None + uspsApplicationId: Optional[int] = None + trackingNumber: Optional[str] = None + + +@s(auto_attribs=True) +class ContentRecordType: + itemNumber: Optional[int] = None + receivedQuantity: Optional[int] = None + description: Optional[str] = None + partNumber: Optional[int] = None + + +@s(auto_attribs=True) +class DimensionsType: + length: Optional[int] = None + width: Optional[int] = None + height: Optional[int] = None + units: Optional[str] = None + + +@s(auto_attribs=True) +class AlcoholDetailType: + alcoholRecipientType: Optional[str] = None + shipperAgreementType: Optional[str] = None + + +@s(auto_attribs=True) +class BatteryDetailType: + batteryPackingType: Optional[str] = None + batteryRegulatoryType: Optional[str] = None + batteryMaterialType: Optional[str] = None + + +@s(auto_attribs=True) +class DangerousGoodsDetailType: + cargoAircraftOnly: Optional[bool] = None + accessibility: Optional[str] = None + options: List[str] = [] + + +@s(auto_attribs=True) +class PackageCODDetailType: + codCollectionAmount: Optional[TotalDeclaredValueType] = JStruct[TotalDeclaredValueType] + + +@s(auto_attribs=True) +class PriorityAlertDetailType: + enhancementTypes: List[str] = [] + content: List[str] = [] + + +@s(auto_attribs=True) +class SignatureOptionDetailType: + signatureReleaseNumber: Optional[int] = None + + +@s(auto_attribs=True) +class PackageSpecialServicesType: + specialServiceTypes: List[str] = [] + signatureOptionType: Optional[str] = None + priorityAlertDetail: Optional[PriorityAlertDetailType] = JStruct[PriorityAlertDetailType] + signatureOptionDetail: Optional[SignatureOptionDetailType] = JStruct[SignatureOptionDetailType] + alcoholDetail: Optional[AlcoholDetailType] = JStruct[AlcoholDetailType] + dangerousGoodsDetail: Optional[DangerousGoodsDetailType] = JStruct[DangerousGoodsDetailType] + packageCODDetail: Optional[PackageCODDetailType] = JStruct[PackageCODDetailType] + pieceCountVerificationBoxCount: Optional[int] = None + batteryDetails: List[BatteryDetailType] = JList[BatteryDetailType] + dryIceWeight: Optional[WeightType] = JStruct[WeightType] + + +@s(auto_attribs=True) +class VariableHandlingChargeDetailType: + rateType: Optional[str] = None + percentValue: Optional[float] = None + rateLevelType: Optional[str] = None + fixedValue: Optional[TotalDeclaredValueType] = JStruct[TotalDeclaredValueType] + rateElementBasis: Optional[str] = None + + +@s(auto_attribs=True) +class RequestedPackageLineItemType: + sequenceNumber: Optional[int] = None + subPackagingType: Optional[str] = None + customerReferences: List[CustomerReferenceType] = JList[CustomerReferenceType] + declaredValue: Optional[TotalDeclaredValueType] = JStruct[TotalDeclaredValueType] + weight: Optional[WeightType] = JStruct[WeightType] + dimensions: Optional[DimensionsType] = JStruct[DimensionsType] + groupPackageCount: Optional[int] = None + itemDescriptionForClearance: Optional[str] = None + contentRecord: List[ContentRecordType] = JList[ContentRecordType] + itemDescription: Optional[str] = None + variableHandlingChargeDetail: Optional[VariableHandlingChargeDetailType] = JStruct[VariableHandlingChargeDetailType] + packageSpecialServices: Optional[PackageSpecialServicesType] = JStruct[PackageSpecialServicesType] + trackingNumber: Optional[int] = None + + +@s(auto_attribs=True) +class DeliveryOnInvoiceAcceptanceDetailType: + recipient: Optional[ShipperType] = JStruct[ShipperType] + + +@s(auto_attribs=True) +class AttachedDocumentType: + documentType: Optional[str] = None + documentReference: Optional[str] = None + description: Optional[str] = None + documentId: Optional[str] = None + + +@s(auto_attribs=True) +class EtdDetailType: + attributes: List[str] = [] + attachedDocuments: List[AttachedDocumentType] = JList[AttachedDocumentType] + requestedDocumentTypes: List[str] = [] + + +@s(auto_attribs=True) +class HoldAtLocationDetailType: + locationId: Optional[str] = None + locationContactAndAddress: Optional[OriginType] = JStruct[OriginType] + locationType: Optional[str] = None + + +@s(auto_attribs=True) +class PhoneNumberType: + areaCode: Optional[int] = None + localNumber: Optional[int] = None + extension: Optional[int] = None + personalIdentificationNumber: Optional[int] = None + + +@s(auto_attribs=True) +class HomeDeliveryPremiumDetailType: + phoneNumber: Optional[PhoneNumberType] = JStruct[PhoneNumberType] + deliveryDate: Optional[str] = None + homedeliveryPremiumType: Optional[str] = None + + +@s(auto_attribs=True) +class InternationalControlledExportDetailType: + licenseOrPermitExpirationDate: Optional[str] = None + licenseOrPermitNumber: Optional[int] = None + entryNumber: Optional[int] = None + foreignTradeZoneCode: Optional[str] = None + type: Optional[str] = None + + +@s(auto_attribs=True) +class InternationalTrafficInArmsRegulationsDetailType: + licenseOrExemptionNumber: Optional[int] = None + + +@s(auto_attribs=True) +class ProcessingOptionsType: + options: List[str] = [] + + +@s(auto_attribs=True) +class RecipientType: + emailAddress: Optional[str] = None + optionsRequested: Optional[ProcessingOptionsType] = JStruct[ProcessingOptionsType] + role: Optional[str] = None + locale: Optional[str] = None + + +@s(auto_attribs=True) +class EmailLabelDetailType: + recipients: List[RecipientType] = JList[RecipientType] + message: Optional[str] = None + + +@s(auto_attribs=True) +class RecommendedDocumentSpecificationType: + types: Optional[str] = None + + +@s(auto_attribs=True) +class PendingShipmentDetailType: + pendingShipmentType: Optional[str] = None + processingOptions: Optional[ProcessingOptionsType] = JStruct[ProcessingOptionsType] + recommendedDocumentSpecification: Optional[RecommendedDocumentSpecificationType] = JStruct[RecommendedDocumentSpecificationType] + emailLabelDetail: Optional[EmailLabelDetailType] = JStruct[EmailLabelDetailType] + attachedDocuments: List[AttachedDocumentType] = JList[AttachedDocumentType] + expirationTimeStamp: Optional[str] = None + + +@s(auto_attribs=True) +class ReturnAssociationDetailType: + shipDatestamp: Optional[str] = None + trackingNumber: Optional[int] = None + + +@s(auto_attribs=True) +class ReturnEmailDetailType: + merchantPhoneNumber: Optional[str] = None + allowedSpecialService: List[str] = [] + + +@s(auto_attribs=True) +class RmaType: + reason: Optional[str] = None + + +@s(auto_attribs=True) +class ReturnShipmentDetailType: + returnEmailDetail: Optional[ReturnEmailDetailType] = JStruct[ReturnEmailDetailType] + rma: Optional[RmaType] = JStruct[RmaType] + returnAssociationDetail: Optional[ReturnAssociationDetailType] = JStruct[ReturnAssociationDetailType] + returnType: Optional[str] = None + + +@s(auto_attribs=True) +class AddTransportationChargesDetailType: + rateType: Optional[str] = None + rateLevelType: Optional[str] = None + chargeLevelType: Optional[str] = None + chargeType: Optional[str] = None + + +@s(auto_attribs=True) +class ShipmentCODDetailType: + addTransportationChargesDetail: Optional[AddTransportationChargesDetailType] = JStruct[AddTransportationChargesDetailType] + codRecipient: Optional[ShipperType] = JStruct[ShipperType] + remitToName: Optional[str] = None + codCollectionType: Optional[str] = None + financialInstitutionContactAndAddress: Optional[OriginType] = JStruct[OriginType] + codCollectionAmount: Optional[TotalDeclaredValueType] = JStruct[TotalDeclaredValueType] + returnReferenceIndicatorType: Optional[str] = None + shipmentCodAmount: Optional[TotalDeclaredValueType] = JStruct[TotalDeclaredValueType] + + +@s(auto_attribs=True) +class ShipmentDryIceDetailType: + totalWeight: Optional[WeightType] = JStruct[WeightType] + packageCount: Optional[int] = None + + +@s(auto_attribs=True) +class ShipmentSpecialServicesType: + specialServiceTypes: List[str] = [] + etdDetail: Optional[EtdDetailType] = JStruct[EtdDetailType] + returnShipmentDetail: Optional[ReturnShipmentDetailType] = JStruct[ReturnShipmentDetailType] + deliveryOnInvoiceAcceptanceDetail: Optional[DeliveryOnInvoiceAcceptanceDetailType] = JStruct[DeliveryOnInvoiceAcceptanceDetailType] + internationalTrafficInArmsRegulationsDetail: Optional[InternationalTrafficInArmsRegulationsDetailType] = JStruct[InternationalTrafficInArmsRegulationsDetailType] + pendingShipmentDetail: Optional[PendingShipmentDetailType] = JStruct[PendingShipmentDetailType] + holdAtLocationDetail: Optional[HoldAtLocationDetailType] = JStruct[HoldAtLocationDetailType] + shipmentCODDetail: Optional[ShipmentCODDetailType] = JStruct[ShipmentCODDetailType] + shipmentDryIceDetail: Optional[ShipmentDryIceDetailType] = JStruct[ShipmentDryIceDetailType] + internationalControlledExportDetail: Optional[InternationalControlledExportDetailType] = JStruct[InternationalControlledExportDetailType] + homeDeliveryPremiumDetail: Optional[HomeDeliveryPremiumDetailType] = JStruct[HomeDeliveryPremiumDetailType] + + +@s(auto_attribs=True) +class ShippingChargesPaymentType: + paymentType: Optional[str] = None + payor: Optional[PayorType] = JStruct[PayorType] + + +@s(auto_attribs=True) +class CustomerImageUsageType: + id: Optional[str] = None + type: Optional[str] = None + providedImageType: Optional[str] = None + + +@s(auto_attribs=True) +class EMailRecipientType: + emailAddress: Optional[str] = None + recipientType: Optional[str] = None + + +@s(auto_attribs=True) +class EMailDetailType: + eMailRecipients: List[EMailRecipientType] = JList[EMailRecipientType] + locale: Optional[str] = None + grouping: Optional[str] = None + + +@s(auto_attribs=True) +class DispositionType: + eMailDetail: Optional[EMailDetailType] = JStruct[EMailDetailType] + dispositionType: Optional[str] = None + + +@s(auto_attribs=True) +class DocumentFormatType: + provideInstructions: Optional[bool] = None + optionsRequested: Optional[ProcessingOptionsType] = JStruct[ProcessingOptionsType] + stockType: Optional[str] = None + dispositions: List[DispositionType] = JList[DispositionType] + locale: Optional[str] = None + docType: Optional[str] = None + + +@s(auto_attribs=True) +class CertificateOfOriginType: + customerImageUsages: List[CustomerImageUsageType] = JList[CustomerImageUsageType] + documentFormat: Optional[DocumentFormatType] = JStruct[DocumentFormatType] + + +@s(auto_attribs=True) +class GeneralAgencyAgreementDetailType: + documentFormat: Optional[DocumentFormatType] = JStruct[DocumentFormatType] + + +@s(auto_attribs=True) +class Op900DetailType: + customerImageUsages: List[CustomerImageUsageType] = JList[CustomerImageUsageType] + signatureName: Optional[str] = None + documentFormat: Optional[DocumentFormatType] = JStruct[DocumentFormatType] + + +@s(auto_attribs=True) +class ReturnInstructionsDetailType: + customText: Optional[str] = None + documentFormat: Optional[DocumentFormatType] = JStruct[DocumentFormatType] + + +@s(auto_attribs=True) +class BlanketPeriodType: + begins: Optional[str] = None + ends: Optional[str] = None + + +@s(auto_attribs=True) +class UsmcaCCertificationOfOriginDetailType: + customerImageUsages: List[CustomerImageUsageType] = JList[CustomerImageUsageType] + documentFormat: Optional[DocumentFormatType] = JStruct[DocumentFormatType] + certifierSpecification: Optional[str] = None + importerSpecification: Optional[str] = None + producerSpecification: Optional[str] = None + producer: Optional[ShipperType] = JStruct[ShipperType] + blanketPeriod: Optional[BlanketPeriodType] = JStruct[BlanketPeriodType] + certifierJobTitle: Optional[str] = None + + +@s(auto_attribs=True) +class ShippingDocumentSpecificationType: + generalAgencyAgreementDetail: Optional[GeneralAgencyAgreementDetailType] = JStruct[GeneralAgencyAgreementDetailType] + returnInstructionsDetail: Optional[ReturnInstructionsDetailType] = JStruct[ReturnInstructionsDetailType] + op900Detail: Optional[Op900DetailType] = JStruct[Op900DetailType] + usmcaCertificationOfOriginDetail: Optional[UsmcaCCertificationOfOriginDetailType] = JStruct[UsmcaCCertificationOfOriginDetailType] + usmcaCommercialInvoiceCertificationOfOriginDetail: Optional[UsmcaCCertificationOfOriginDetailType] = JStruct[UsmcaCCertificationOfOriginDetailType] + shippingDocumentTypes: List[str] = [] + certificateOfOrigin: Optional[CertificateOfOriginType] = JStruct[CertificateOfOriginType] + commercialInvoiceDetail: Optional[CertificateOfOriginType] = JStruct[CertificateOfOriginType] + + +@s(auto_attribs=True) +class SmartPostInfoDetailType: + ancillaryEndorsement: Optional[str] = None + hubId: Optional[int] = None + indicia: Optional[str] = None + specialServices: Optional[str] = None + + +@s(auto_attribs=True) +class RequestedShipmentType: + shipDatestamp: Optional[str] = None + totalDeclaredValue: Optional[TotalDeclaredValueType] = JStruct[TotalDeclaredValueType] + shipper: Optional[ShipperType] = JStruct[ShipperType] + soldTo: Optional[ShipperType] = JStruct[ShipperType] + recipients: List[ShipperType] = JList[ShipperType] + recipientLocationNumber: Optional[int] = None + pickupType: Optional[str] = None + serviceType: Optional[str] = None + packagingType: Optional[str] = None + totalWeight: Optional[float] = None + origin: Optional[OriginType] = JStruct[OriginType] + shippingChargesPayment: Optional[ShippingChargesPaymentType] = JStruct[ShippingChargesPaymentType] + shipmentSpecialServices: Optional[ShipmentSpecialServicesType] = JStruct[ShipmentSpecialServicesType] + emailNotificationDetail: Optional[RequestedShipmentEmailNotificationDetailType] = JStruct[RequestedShipmentEmailNotificationDetailType] + expressFreightDetail: Optional[ExpressFreightDetailType] = JStruct[ExpressFreightDetailType] + variableHandlingChargeDetail: Optional[VariableHandlingChargeDetailType] = JStruct[VariableHandlingChargeDetailType] + customsClearanceDetail: Optional[CustomsClearanceDetailType] = JStruct[CustomsClearanceDetailType] + smartPostInfoDetail: Optional[SmartPostInfoDetailType] = JStruct[SmartPostInfoDetailType] + blockInsightVisibility: Optional[bool] = None + labelSpecification: Optional[LabelSpecificationType] = JStruct[LabelSpecificationType] + shippingDocumentSpecification: Optional[ShippingDocumentSpecificationType] = JStruct[ShippingDocumentSpecificationType] + rateRequestType: List[str] = [] + preferredCurrency: Optional[str] = None + totalPackageCount: Optional[int] = None + masterTrackingId: Optional[MasterTrackingIDType] = JStruct[MasterTrackingIDType] + requestedPackageLineItems: List[RequestedPackageLineItemType] = JList[RequestedPackageLineItemType] + + +@s(auto_attribs=True) +class ShippingRequestType: + mergeLabelDocOption: Optional[str] = None + requestedShipment: Optional[RequestedShipmentType] = JStruct[RequestedShipmentType] + labelResponseOptions: Optional[str] = None + accountNumber: Optional[AccountNumberType] = JStruct[AccountNumberType] + shipAction: Optional[str] = None + processingOptionType: Optional[str] = None + oneLabelAtATime: Optional[bool] = None diff --git a/modules/connectors/fedex/karrio/schemas/fedex/shipping_response.py b/modules/connectors/fedex/karrio/schemas/fedex/shipping_response.py new file mode 100644 index 0000000000..39e93b4f81 --- /dev/null +++ b/modules/connectors/fedex/karrio/schemas/fedex/shipping_response.py @@ -0,0 +1,556 @@ +from attr import s +from typing import Optional, List, Any +from jstruct import JList, JStruct + + +@s(auto_attribs=True) +class AlertType: + code: Optional[str] = None + alertType: Optional[str] = None + message: Optional[str] = None + + +@s(auto_attribs=True) +class AccessorDetailType: + password: Optional[str] = None + role: Optional[str] = None + emailLabelUrl: Optional[str] = None + userId: Optional[str] = None + + +@s(auto_attribs=True) +class AccessDetailType: + accessorDetails: List[AccessorDetailType] = JList[AccessorDetailType] + + +@s(auto_attribs=True) +class UploadDocumentReferenceDetailType: + documentType: Optional[str] = None + documentReference: Optional[str] = None + description: Optional[str] = None + documentId: Optional[str] = None + + +@s(auto_attribs=True) +class CompletedEtdDetailType: + folderId: Optional[str] = None + type: Optional[str] = None + uploadDocumentReferenceDetails: List[UploadDocumentReferenceDetailType] = JList[UploadDocumentReferenceDetailType] + + +@s(auto_attribs=True) +class AddressType: + streetLines: List[str] = [] + city: Optional[str] = None + stateOrProvinceCode: Optional[str] = None + postalCode: Optional[int] = None + countryCode: Optional[str] = None + residential: Optional[bool] = None + + +@s(auto_attribs=True) +class ContactType: + personName: Optional[str] = None + tollFreePhoneNumber: Optional[int] = None + emailAddress: Optional[str] = None + phoneNumber: Optional[int] = None + phoneExtension: Optional[int] = None + faxNumber: Optional[int] = None + pagerNumber: Optional[int] = None + companyName: Optional[str] = None + title: Optional[str] = None + + +@s(auto_attribs=True) +class HoldingLocationType: + address: Optional[AddressType] = JStruct[AddressType] + contact: Optional[ContactType] = JStruct[ContactType] + + +@s(auto_attribs=True) +class CompletedHoldAtLocationDetailType: + holdingLocationType: Optional[str] = None + holdingLocation: Optional[HoldingLocationType] = JStruct[HoldingLocationType] + + +@s(auto_attribs=True) +class WeightType: + units: Optional[str] = None + value: Optional[int] = None + + +@s(auto_attribs=True) +class HazardousCommodityDescriptionType: + sequenceNumber: Optional[int] = None + packingInstructions: Optional[str] = None + subsidiaryClasses: List[str] = [] + labelText: Optional[str] = None + tunnelRestrictionCode: Optional[str] = None + specialProvisions: Optional[str] = None + properShippingNameAndDescription: Optional[str] = None + technicalName: Optional[str] = None + symbols: Optional[str] = None + authorization: Optional[str] = None + attributes: List[str] = [] + id: Optional[int] = None + packingGroup: Optional[str] = None + properShippingName: Optional[str] = None + hazardClass: Optional[str] = None + + +@s(auto_attribs=True) +class NetExplosiveDetailType: + amount: Optional[int] = None + units: Optional[str] = None + type: Optional[str] = None + + +@s(auto_attribs=True) +class PackingDetailsType: + packingInstructions: Optional[str] = None + cargoAircraftOnly: Optional[bool] = None + + +@s(auto_attribs=True) +class OptionsDescriptionType: + sequenceNumber: Optional[int] = None + processingOptions: List[str] = [] + subsidiaryClasses: List[str] = [] + labelText: Optional[str] = None + technicalName: Optional[str] = None + packingDetails: Optional[PackingDetailsType] = JStruct[PackingDetailsType] + authorization: Optional[str] = None + reportableQuantity: Optional[bool] = None + percentage: Optional[float] = None + id: Optional[int] = None + packingGroup: Optional[str] = None + properShippingName: Optional[str] = None + hazardClass: Optional[str] = None + + +@s(auto_attribs=True) +class QuantityType: + quantityType: Optional[str] = None + amount: Optional[float] = None + units: Optional[str] = None + + +@s(auto_attribs=True) +class InnerReceptacleType: + quantity: Optional[QuantityType] = JStruct[QuantityType] + + +@s(auto_attribs=True) +class OptionsOptionsType: + labelTextOption: Optional[str] = None + customerSuppliedLabelText: Optional[str] = None + + +@s(auto_attribs=True) +class HazardousCommodityOptionsType: + quantity: Optional[QuantityType] = JStruct[QuantityType] + innerReceptacles: List[InnerReceptacleType] = JList[InnerReceptacleType] + options: Optional[OptionsOptionsType] = JStruct[OptionsOptionsType] + description: Optional[OptionsDescriptionType] = JStruct[OptionsDescriptionType] + + +@s(auto_attribs=True) +class HazardousCommodityType: + quantity: Optional[QuantityType] = JStruct[QuantityType] + options: Optional[HazardousCommodityOptionsType] = JStruct[HazardousCommodityOptionsType] + description: Optional[HazardousCommodityDescriptionType] = JStruct[HazardousCommodityDescriptionType] + netExplosiveDetail: Optional[NetExplosiveDetailType] = JStruct[NetExplosiveDetailType] + massPoints: Optional[int] = None + + +@s(auto_attribs=True) +class ContainerType: + qvalue: Optional[int] = None + hazardousCommodities: List[HazardousCommodityType] = JList[HazardousCommodityType] + + +@s(auto_attribs=True) +class HazardousPackageDetailType: + regulation: Optional[str] = None + accessibility: Optional[str] = None + labelType: Optional[str] = None + containers: List[ContainerType] = JList[ContainerType] + cargoAircraftOnly: Optional[bool] = None + referenceId: Optional[int] = None + radioactiveTransportIndex: Optional[float] = None + + +@s(auto_attribs=True) +class BarcodeType: + type: Optional[str] = None + value: Optional[str] = None + + +@s(auto_attribs=True) +class BarcodesType: + binaryBarcodes: List[BarcodeType] = JList[BarcodeType] + stringBarcodes: List[BarcodeType] = JList[BarcodeType] + + +@s(auto_attribs=True) +class OperationalInstructionType: + number: Optional[int] = None + content: Optional[str] = None + + +@s(auto_attribs=True) +class CompletedPackageDetailOperationalDetailType: + astraHandlingText: Optional[str] = None + barcodes: Optional[BarcodesType] = JStruct[BarcodesType] + operationalInstructions: List[OperationalInstructionType] = JList[OperationalInstructionType] + + +@s(auto_attribs=True) +class SurchargeType: + amount: Optional[str] = None + surchargeType: Optional[str] = None + level: Optional[str] = None + description: Optional[str] = None + + +@s(auto_attribs=True) +class PackageRateDetailType: + ratedWeightMethod: Optional[str] = None + totalFreightDiscounts: Optional[float] = None + totalTaxes: Optional[float] = None + minimumChargeType: Optional[str] = None + baseCharge: Optional[float] = None + totalRebates: Optional[float] = None + rateType: Optional[str] = None + billingWeight: Optional[WeightType] = JStruct[WeightType] + netFreight: Optional[float] = None + surcharges: List[SurchargeType] = JList[SurchargeType] + totalSurcharges: Optional[float] = None + netFedExCharge: Optional[float] = None + netCharge: Optional[float] = None + currency: Optional[str] = None + + +@s(auto_attribs=True) +class PackageRatingType: + effectiveNetDiscount: Optional[int] = None + actualRateType: Optional[str] = None + packageRateDetails: List[PackageRateDetailType] = JList[PackageRateDetailType] + + +@s(auto_attribs=True) +class TrackingIDType: + formId: Optional[str] = None + trackingIdType: Optional[str] = None + uspsApplicationId: Optional[int] = None + trackingNumber: Optional[str] = None + + +@s(auto_attribs=True) +class CompletedPackageDetailType: + sequenceNumber: Optional[int] = None + operationalDetail: Optional[CompletedPackageDetailOperationalDetailType] = JStruct[CompletedPackageDetailOperationalDetailType] + signatureOption: Optional[str] = None + trackingIds: List[TrackingIDType] = JList[TrackingIDType] + groupNumber: Optional[int] = None + oversizeClass: Optional[str] = None + packageRating: Optional[PackageRatingType] = JStruct[PackageRatingType] + dryIceWeight: Optional[WeightType] = JStruct[WeightType] + hazardousPackageDetail: Optional[HazardousPackageDetailType] = JStruct[HazardousPackageDetailType] + + +@s(auto_attribs=True) +class GenerationDetailType: + type: Optional[str] = None + minimumCopiesRequired: Optional[int] = None + letterhead: Optional[str] = None + electronicSignature: Optional[str] = None + + +@s(auto_attribs=True) +class DocumentRequirementsType: + requiredDocuments: List[str] = [] + prohibitedDocuments: List[str] = [] + generationDetails: List[GenerationDetailType] = JList[GenerationDetailType] + + +@s(auto_attribs=True) +class LicenseOrPermitDetailType: + number: Optional[int] = None + effectiveDate: Optional[str] = None + expirationDate: Optional[str] = None + + +@s(auto_attribs=True) +class AdrLicenseType: + licenseOrPermitDetail: Optional[LicenseOrPermitDetailType] = JStruct[LicenseOrPermitDetailType] + + +@s(auto_attribs=True) +class ProcessingOptionsType: + options: List[str] = [] + + +@s(auto_attribs=True) +class DryIceDetailType: + totalWeight: Optional[WeightType] = JStruct[WeightType] + packageCount: Optional[int] = None + processingOptions: Optional[ProcessingOptionsType] = JStruct[ProcessingOptionsType] + + +@s(auto_attribs=True) +class HazardousSummaryDetailType: + smallQuantityExceptionPackageCount: Optional[int] = None + + +@s(auto_attribs=True) +class HazardousShipmentDetailType: + hazardousSummaryDetail: Optional[HazardousSummaryDetailType] = JStruct[HazardousSummaryDetailType] + adrLicense: Optional[AdrLicenseType] = JStruct[AdrLicenseType] + dryIceDetail: Optional[DryIceDetailType] = JStruct[DryIceDetailType] + + +@s(auto_attribs=True) +class CompletedShipmentDetailOperationalDetailType: + originServiceArea: Optional[str] = None + serviceCode: Optional[str] = None + airportId: Optional[str] = None + postalCode: Optional[int] = None + scac: Optional[str] = None + deliveryDay: Optional[str] = None + originLocationId: Optional[int] = None + countryCode: Optional[str] = None + astraDescription: Optional[str] = None + originLocationNumber: Optional[int] = None + deliveryDate: Optional[str] = None + deliveryEligibilities: List[str] = [] + ineligibleForMoneyBackGuarantee: Optional[bool] = None + maximumTransitTime: Optional[str] = None + destinationLocationStateOrProvinceCode: Optional[str] = None + astraPlannedServiceLevel: Optional[str] = None + destinationLocationId: Optional[str] = None + transitTime: Optional[str] = None + stateOrProvinceCode: Optional[str] = None + destinationLocationNumber: Optional[int] = None + packagingCode: Optional[str] = None + commitDate: Optional[str] = None + publishedDeliveryTime: Optional[str] = None + ursaSuffixCode: Optional[str] = None + ursaPrefixCode: Optional[str] = None + destinationServiceArea: Optional[str] = None + commitDay: Optional[str] = None + customTransitTime: Optional[str] = None + + +@s(auto_attribs=True) +class NameType: + type: Optional[str] = None + encoding: Optional[str] = None + value: Optional[str] = None + + +@s(auto_attribs=True) +class ServiceDescriptionType: + serviceType: Optional[str] = None + code: Optional[int] = None + names: List[NameType] = JList[NameType] + operatingOrgCodes: List[str] = [] + astraDescription: Optional[str] = None + description: Optional[str] = None + serviceId: Optional[str] = None + serviceCategory: Optional[str] = None + + +@s(auto_attribs=True) +class CurrencyExchangeRateType: + rate: Optional[float] = None + fromCurrency: Optional[str] = None + intoCurrency: Optional[str] = None + + +@s(auto_attribs=True) +class FreightDiscountType: + amount: Optional[float] = None + rateDiscountType: Optional[str] = None + percent: Optional[float] = None + description: Optional[str] = None + + +@s(auto_attribs=True) +class TaxType: + amount: Optional[int] = None + level: Optional[str] = None + description: Optional[str] = None + type: Optional[str] = None + + +@s(auto_attribs=True) +class ShipmentRateDetailType: + rateZone: Optional[str] = None + ratedWeightMethod: Optional[str] = None + totalDutiesTaxesAndFees: Optional[float] = None + pricingCode: Optional[str] = None + totalFreightDiscounts: Optional[float] = None + totalTaxes: Optional[float] = None + totalDutiesAndTaxes: Optional[float] = None + totalAncillaryFeesAndTaxes: Optional[float] = None + taxes: List[TaxType] = JList[TaxType] + totalRebates: Optional[float] = None + fuelSurchargePercent: Optional[float] = None + currencyExchangeRate: Optional[CurrencyExchangeRateType] = JStruct[CurrencyExchangeRateType] + totalNetFreight: Optional[float] = None + totalNetFedExCharge: Optional[float] = None + shipmentLegRateDetails: List[Any] = [] + dimDivisor: Optional[int] = None + rateType: Optional[str] = None + surcharges: List[SurchargeType] = JList[SurchargeType] + totalSurcharges: Optional[float] = None + totalBillingWeight: Optional[WeightType] = JStruct[WeightType] + freightDiscounts: List[FreightDiscountType] = JList[FreightDiscountType] + rateScale: Optional[str] = None + totalNetCharge: Optional[float] = None + totalBaseCharge: Optional[float] = None + totalNetChargeWithDutiesAndTaxes: Optional[float] = None + currency: Optional[str] = None + + +@s(auto_attribs=True) +class ShipmentRatingType: + actualRateType: Optional[str] = None + shipmentRateDetails: List[ShipmentRateDetailType] = JList[ShipmentRateDetailType] + + +@s(auto_attribs=True) +class CompletedShipmentDetailType: + completedPackageDetails: List[CompletedPackageDetailType] = JList[CompletedPackageDetailType] + operationalDetail: Optional[CompletedShipmentDetailOperationalDetailType] = JStruct[CompletedShipmentDetailOperationalDetailType] + carrierCode: Optional[str] = None + completedHoldAtLocationDetail: Optional[CompletedHoldAtLocationDetailType] = JStruct[CompletedHoldAtLocationDetailType] + completedEtdDetail: Optional[CompletedEtdDetailType] = JStruct[CompletedEtdDetailType] + packagingDescription: Optional[str] = None + masterTrackingId: Optional[TrackingIDType] = JStruct[TrackingIDType] + serviceDescription: Optional[ServiceDescriptionType] = JStruct[ServiceDescriptionType] + usDomestic: Optional[bool] = None + hazardousShipmentDetail: Optional[HazardousShipmentDetailType] = JStruct[HazardousShipmentDetailType] + shipmentRating: Optional[ShipmentRatingType] = JStruct[ShipmentRatingType] + documentRequirements: Optional[DocumentRequirementsType] = JStruct[DocumentRequirementsType] + exportComplianceStatement: Optional[str] = None + accessDetail: Optional[AccessDetailType] = JStruct[AccessDetailType] + + +@s(auto_attribs=True) +class CustomerReferenceType: + customerReferenceType: Optional[str] = None + value: Optional[int] = None + + +@s(auto_attribs=True) +class DocumentType: + contentKey: Optional[str] = None + copiesToPrint: Optional[int] = None + contentType: Optional[str] = None + trackingNumber: Optional[str] = None + docType: Optional[str] = None + alerts: List[AlertType] = JList[AlertType] + encodedLabel: Optional[str] = None + url: Optional[str] = None + + +@s(auto_attribs=True) +class TransactionDetailType: + transactionDetails: Optional[str] = None + transactionId: Optional[int] = None + + +@s(auto_attribs=True) +class PieceResponseType: + netChargeAmount: Optional[float] = None + transactionDetails: List[TransactionDetailType] = JList[TransactionDetailType] + packageDocuments: List[DocumentType] = JList[DocumentType] + acceptanceTrackingNumber: Optional[str] = None + serviceCategory: Optional[str] = None + listCustomerTotalCharge: Optional[str] = None + deliveryTimestamp: Optional[str] = None + trackingIdType: Optional[str] = None + additionalChargesDiscount: Optional[float] = None + netListRateAmount: Optional[float] = None + baseRateAmount: Optional[float] = None + packageSequenceNumber: Optional[int] = None + netDiscountAmount: Optional[float] = None + codcollectionAmount: Optional[float] = None + masterTrackingNumber: Optional[str] = None + acceptanceType: Optional[str] = None + trackingNumber: Optional[str] = None + successful: Optional[bool] = None + customerReferences: List[CustomerReferenceType] = JList[CustomerReferenceType] + + +@s(auto_attribs=True) +class ParameterType: + id: Optional[str] = None + value: Optional[str] = None + + +@s(auto_attribs=True) +class AdvisoryType: + code: Optional[str] = None + text: Optional[str] = None + parameters: List[ParameterType] = JList[ParameterType] + localizedText: Optional[str] = None + + +@s(auto_attribs=True) +class WaiverType: + advisories: List[AdvisoryType] = JList[AdvisoryType] + description: Optional[str] = None + id: Optional[str] = None + + +@s(auto_attribs=True) +class ProhibitionType: + derivedHarmonizedCode: Optional[str] = None + advisory: Optional[AdvisoryType] = JStruct[AdvisoryType] + commodityIndex: Optional[int] = None + source: Optional[str] = None + categories: List[str] = [] + type: Optional[str] = None + waiver: Optional[WaiverType] = JStruct[WaiverType] + status: Optional[str] = None + + +@s(auto_attribs=True) +class RegulatoryAdvisoryType: + prohibitions: List[ProhibitionType] = JList[ProhibitionType] + + +@s(auto_attribs=True) +class ShipmentAdvisoryDetailsType: + regulatoryAdvisory: Optional[RegulatoryAdvisoryType] = JStruct[RegulatoryAdvisoryType] + + +@s(auto_attribs=True) +class TransactionShipmentType: + serviceType: Optional[str] = None + shipDatestamp: Optional[str] = None + serviceCategory: Optional[str] = None + shipmentDocuments: List[DocumentType] = JList[DocumentType] + pieceResponses: List[PieceResponseType] = JList[PieceResponseType] + serviceName: Optional[str] = None + alerts: List[AlertType] = JList[AlertType] + completedShipmentDetail: Optional[CompletedShipmentDetailType] = JStruct[CompletedShipmentDetailType] + shipmentAdvisoryDetails: Optional[ShipmentAdvisoryDetailsType] = JStruct[ShipmentAdvisoryDetailsType] + masterTrackingNumber: Optional[str] = None + + +@s(auto_attribs=True) +class OutputType: + transactionShipments: List[TransactionShipmentType] = JList[TransactionShipmentType] + alerts: List[AlertType] = JList[AlertType] + jobId: Optional[str] = None + + +@s(auto_attribs=True) +class ShippingResponseType: + transactionId: Optional[str] = None + customerTransactionId: Optional[str] = None + output: Optional[OutputType] = JStruct[OutputType] diff --git a/modules/connectors/fedex/karrio/schemas/fedex/tracking_request.py b/modules/connectors/fedex/karrio/schemas/fedex/tracking_request.py new file mode 100644 index 0000000000..839075a366 --- /dev/null +++ b/modules/connectors/fedex/karrio/schemas/fedex/tracking_request.py @@ -0,0 +1,23 @@ +from attr import s +from typing import Optional, List +from jstruct import JStruct, JList + + +@s(auto_attribs=True) +class TrackingNumberInfoType: + trackingNumber: Optional[str] = None + carrierCode: Optional[str] = None + trackingNumberUniqueId: Optional[str] = None + + +@s(auto_attribs=True) +class TrackingInfoType: + shipDateBegin: Optional[str] = None + shipDateEnd: Optional[str] = None + trackingNumberInfo: Optional[TrackingNumberInfoType] = JStruct[TrackingNumberInfoType] + + +@s(auto_attribs=True) +class TrackingRequestType: + includeDetailedScans: Optional[bool] = None + trackingInfo: List[TrackingInfoType] = JList[TrackingInfoType] diff --git a/modules/connectors/fedex/karrio/schemas/fedex/tracking_response.py b/modules/connectors/fedex/karrio/schemas/fedex/tracking_response.py new file mode 100644 index 0000000000..e9b52341f3 --- /dev/null +++ b/modules/connectors/fedex/karrio/schemas/fedex/tracking_response.py @@ -0,0 +1,350 @@ +from attr import s +from typing import Optional, List +from jstruct import JList, JStruct + + +@s(auto_attribs=True) +class PackageIdentifierType: + type: Optional[str] = None + value: Optional[str] = None + trackingNumberUniqueId: Optional[str] = None + + +@s(auto_attribs=True) +class AdditionalTrackingInfoType: + hasAssociatedShipments: Optional[bool] = None + nickname: Optional[str] = None + packageIdentifiers: List[PackageIdentifierType] = JList[PackageIdentifierType] + shipmentNotes: Optional[str] = None + + +@s(auto_attribs=True) +class AvailableImageType: + size: Optional[str] = None + type: Optional[str] = None + + +@s(auto_attribs=True) +class ReasonDetailType: + description: Optional[str] = None + type: Optional[str] = None + + +@s(auto_attribs=True) +class ConsolidationDetailType: + timeStamp: Optional[str] = None + consolidationID: Optional[int] = None + reasonDetail: Optional[ReasonDetailType] = JStruct[ReasonDetailType] + packageCount: Optional[int] = None + eventType: Optional[str] = None + + +@s(auto_attribs=True) +class EstimatedDeliveryTimeWindowWindowType: + begins: Optional[str] = None + ends: Optional[str] = None + + +@s(auto_attribs=True) +class EstimatedDeliveryTimeWindowElementType: + description: Optional[str] = None + window: Optional[EstimatedDeliveryTimeWindowWindowType] = JStruct[EstimatedDeliveryTimeWindowWindowType] + type: Optional[str] = None + + +@s(auto_attribs=True) +class RequestedAppointmentDetailType: + date: Optional[str] = None + window: List[EstimatedDeliveryTimeWindowElementType] = JList[EstimatedDeliveryTimeWindowElementType] + + +@s(auto_attribs=True) +class CustomDeliveryOptionType: + requestedAppointmentDetail: Optional[RequestedAppointmentDetailType] = JStruct[RequestedAppointmentDetailType] + description: Optional[str] = None + type: Optional[str] = None + status: Optional[str] = None + + +@s(auto_attribs=True) +class DateAndTimeType: + dateTime: Optional[str] = None + type: Optional[str] = None + + +@s(auto_attribs=True) +class LastUpdatedDestinationAddressType: + addressClassification: Optional[str] = None + residential: Optional[bool] = None + streetLines: List[str] = [] + city: Optional[str] = None + urbanizationCode: Optional[str] = None + stateOrProvinceCode: Optional[str] = None + postalCode: Optional[int] = None + countryCode: Optional[str] = None + countryName: Optional[str] = None + + +@s(auto_attribs=True) +class DeliveryOptionEligibilityDetailType: + option: Optional[str] = None + eligibility: Optional[str] = None + + +@s(auto_attribs=True) +class DeliveryDetailsType: + receivedByName: Optional[str] = None + destinationServiceArea: Optional[str] = None + destinationServiceAreaDescription: Optional[str] = None + locationDescription: Optional[str] = None + actualDeliveryAddress: Optional[LastUpdatedDestinationAddressType] = JStruct[LastUpdatedDestinationAddressType] + deliveryToday: Optional[bool] = None + locationType: Optional[str] = None + signedByName: Optional[str] = None + officeOrderDeliveryMethod: Optional[str] = None + deliveryAttempts: Optional[int] = None + deliveryOptionEligibilityDetails: List[DeliveryOptionEligibilityDetailType] = JList[DeliveryOptionEligibilityDetailType] + + +@s(auto_attribs=True) +class ContactType: + personName: Optional[str] = None + phoneNumber: Optional[int] = None + companyName: Optional[str] = None + + +@s(auto_attribs=True) +class RecipientInformationType: + contact: Optional[ContactType] = JStruct[ContactType] + address: Optional[LastUpdatedDestinationAddressType] = JStruct[LastUpdatedDestinationAddressType] + + +@s(auto_attribs=True) +class LocationType: + locationId: Optional[str] = None + locationContactAndAddress: Optional[RecipientInformationType] = JStruct[RecipientInformationType] + locationType: Optional[str] = None + + +@s(auto_attribs=True) +class DistanceToDestinationType: + units: Optional[str] = None + value: Optional[float] = None + + +@s(auto_attribs=True) +class ParameterListType: + value: Optional[str] = None + key: Optional[str] = None + + +@s(auto_attribs=True) +class ErrorType: + code: Optional[str] = None + parameterList: List[ParameterListType] = JList[ParameterListType] + message: Optional[str] = None + + +@s(auto_attribs=True) +class InformationNoteType: + code: Optional[str] = None + description: Optional[str] = None + + +@s(auto_attribs=True) +class AncillaryDetailType: + reason: Optional[int] = None + reasonDescription: Optional[str] = None + action: Optional[str] = None + actionDescription: Optional[str] = None + + +@s(auto_attribs=True) +class DelayDetailType: + type: Optional[str] = None + subType: Optional[str] = None + status: Optional[str] = None + + +@s(auto_attribs=True) +class LatestStatusDetailType: + scanLocation: Optional[LastUpdatedDestinationAddressType] = JStruct[LastUpdatedDestinationAddressType] + code: Optional[str] = None + derivedCode: Optional[str] = None + ancillaryDetails: List[AncillaryDetailType] = JList[AncillaryDetailType] + statusByLocale: Optional[str] = None + description: Optional[str] = None + delayDetail: Optional[DelayDetailType] = JStruct[DelayDetailType] + + +@s(auto_attribs=True) +class DeclaredValueType: + currency: Optional[str] = None + value: Optional[float] = None + + +@s(auto_attribs=True) +class DimensionType: + length: Optional[int] = None + width: Optional[int] = None + height: Optional[int] = None + units: Optional[str] = None + + +@s(auto_attribs=True) +class WeightType: + unit: Optional[str] = None + value: Optional[str] = None + + +@s(auto_attribs=True) +class WeightAndDimensionsType: + weight: List[WeightType] = JList[WeightType] + dimensions: List[DimensionType] = JList[DimensionType] + + +@s(auto_attribs=True) +class PackageDetailsType: + physicalPackagingType: Optional[str] = None + sequenceNumber: Optional[int] = None + undeliveredCount: Optional[int] = None + packagingDescription: Optional[ReasonDetailType] = JStruct[ReasonDetailType] + count: Optional[int] = None + weightAndDimensions: Optional[WeightAndDimensionsType] = JStruct[WeightAndDimensionsType] + packageContent: List[str] = [] + contentPieceCount: Optional[int] = None + declaredValue: Optional[DeclaredValueType] = JStruct[DeclaredValueType] + + +@s(auto_attribs=True) +class PieceCountType: + count: Optional[int] = None + description: Optional[str] = None + type: Optional[str] = None + + +@s(auto_attribs=True) +class ReturnDetailType: + authorizationName: Optional[str] = None + reasonDetail: List[ReasonDetailType] = JList[ReasonDetailType] + + +@s(auto_attribs=True) +class ScanEventType: + date: Optional[str] = None + derivedStatus: Optional[str] = None + scanLocation: Optional[LastUpdatedDestinationAddressType] = JStruct[LastUpdatedDestinationAddressType] + locationId: Optional[str] = None + locationType: Optional[str] = None + exceptionDescription: Optional[str] = None + eventDescription: Optional[str] = None + eventType: Optional[str] = None + derivedStatusCode: Optional[str] = None + exceptionCode: Optional[str] = None + delayDetail: Optional[DelayDetailType] = JStruct[DelayDetailType] + + +@s(auto_attribs=True) +class ServiceCommitMessageType: + message: Optional[str] = None + type: Optional[str] = None + + +@s(auto_attribs=True) +class ServiceDetailType: + description: Optional[str] = None + shortDescription: Optional[str] = None + type: Optional[str] = None + + +@s(auto_attribs=True) +class ContentType: + itemNumber: Optional[str] = None + receivedQuantity: Optional[int] = None + description: Optional[str] = None + partNumber: Optional[str] = None + + +@s(auto_attribs=True) +class SplitShipmentType: + pieceCount: Optional[int] = None + statusDescription: Optional[str] = None + timestamp: Optional[str] = None + statusCode: Optional[str] = None + + +@s(auto_attribs=True) +class ShipmentDetailsType: + contents: List[ContentType] = JList[ContentType] + beforePossessionStatus: Optional[bool] = None + weight: List[WeightType] = JList[WeightType] + contentPieceCount: Optional[int] = None + splitShipments: List[SplitShipmentType] = JList[SplitShipmentType] + + +@s(auto_attribs=True) +class SpecialHandlingType: + description: Optional[str] = None + type: Optional[str] = None + paymentType: Optional[str] = None + + +@s(auto_attribs=True) +class TrackingNumberInfoType: + trackingNumber: Optional[str] = None + carrierCode: Optional[str] = None + trackingNumberUniqueId: Optional[str] = None + + +@s(auto_attribs=True) +class TrackResultType: + trackingNumberInfo: Optional[TrackingNumberInfoType] = JStruct[TrackingNumberInfoType] + additionalTrackingInfo: Optional[AdditionalTrackingInfoType] = JStruct[AdditionalTrackingInfoType] + distanceToDestination: Optional[DistanceToDestinationType] = JStruct[DistanceToDestinationType] + consolidationDetail: List[ConsolidationDetailType] = JList[ConsolidationDetailType] + meterNumber: Optional[int] = None + returnDetail: Optional[ReturnDetailType] = JStruct[ReturnDetailType] + serviceDetail: Optional[ServiceDetailType] = JStruct[ServiceDetailType] + destinationLocation: Optional[LocationType] = JStruct[LocationType] + latestStatusDetail: Optional[LatestStatusDetailType] = JStruct[LatestStatusDetailType] + serviceCommitMessage: Optional[ServiceCommitMessageType] = JStruct[ServiceCommitMessageType] + informationNotes: List[InformationNoteType] = JList[InformationNoteType] + error: Optional[ErrorType] = JStruct[ErrorType] + specialHandlings: List[SpecialHandlingType] = JList[SpecialHandlingType] + availableImages: List[AvailableImageType] = JList[AvailableImageType] + deliveryDetails: Optional[DeliveryDetailsType] = JStruct[DeliveryDetailsType] + scanEvents: List[ScanEventType] = JList[ScanEventType] + dateAndTimes: List[DateAndTimeType] = JList[DateAndTimeType] + packageDetails: Optional[PackageDetailsType] = JStruct[PackageDetailsType] + goodsClassificationCode: Optional[str] = None + holdAtLocation: Optional[LocationType] = JStruct[LocationType] + customDeliveryOptions: List[CustomDeliveryOptionType] = JList[CustomDeliveryOptionType] + estimatedDeliveryTimeWindow: Optional[EstimatedDeliveryTimeWindowElementType] = JStruct[EstimatedDeliveryTimeWindowElementType] + pieceCounts: List[PieceCountType] = JList[PieceCountType] + originLocation: Optional[LocationType] = JStruct[LocationType] + recipientInformation: Optional[RecipientInformationType] = JStruct[RecipientInformationType] + standardTransitTimeWindow: Optional[EstimatedDeliveryTimeWindowElementType] = JStruct[EstimatedDeliveryTimeWindowElementType] + shipmentDetails: Optional[ShipmentDetailsType] = JStruct[ShipmentDetailsType] + reasonDetail: Optional[ReasonDetailType] = JStruct[ReasonDetailType] + availableNotifications: List[str] = [] + shipperInformation: Optional[RecipientInformationType] = JStruct[RecipientInformationType] + lastUpdatedDestinationAddress: Optional[LastUpdatedDestinationAddressType] = JStruct[LastUpdatedDestinationAddressType] + + +@s(auto_attribs=True) +class CompleteTrackResultType: + trackingNumber: Optional[str] = None + trackResults: List[TrackResultType] = JList[TrackResultType] + + +@s(auto_attribs=True) +class OutputType: + completeTrackResults: List[CompleteTrackResultType] = JList[CompleteTrackResultType] + alerts: Optional[str] = None + + +@s(auto_attribs=True) +class TrackingResponseType: + transactionId: Optional[str] = None + customerTransactionId: Optional[str] = None + output: Optional[OutputType] = JStruct[OutputType] diff --git a/modules/connectors/fedex/schemas/cancel_request.json b/modules/connectors/fedex/schemas/cancel_request.json new file mode 100644 index 0000000000..5d90c5b5de --- /dev/null +++ b/modules/connectors/fedex/schemas/cancel_request.json @@ -0,0 +1,9 @@ +{ + "accountNumber": { + "value": "Your account number" + }, + "emailShipment": "false", + "senderCountryCode": "US", + "deletionControl": "DELETE_ALL_PACKAGES", + "trackingNumber": "794953555571" +} \ No newline at end of file diff --git a/modules/connectors/fedex/schemas/cancel_response.json b/modules/connectors/fedex/schemas/cancel_response.json new file mode 100644 index 0000000000..d7d6efa7d1 --- /dev/null +++ b/modules/connectors/fedex/schemas/cancel_response.json @@ -0,0 +1,16 @@ +{ + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "output": { + "cancelledShipment": true, + "cancelledHistory": true, + "successMessage": "Success", + "alerts": [ + { + "code": "SHIP.RECIPIENT.POSTALCITY.MISMATCH", + "alertType": "NOTE", + "message": "Recipient Postal-City Mismatch." + } + ] + } +} \ No newline at end of file diff --git a/modules/connectors/fedex/schemas/error_response.json b/modules/connectors/fedex/schemas/error_response.json new file mode 100644 index 0000000000..50a59e7ca9 --- /dev/null +++ b/modules/connectors/fedex/schemas/error_response.json @@ -0,0 +1,10 @@ +{ + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "TRACKING.TRACKINGNUMBER.EMPTY", + "message": "Please provide tracking number." + } + ] +} diff --git a/modules/connectors/fedex/schemas/paperless_request.json b/modules/connectors/fedex/schemas/paperless_request.json new file mode 100644 index 0000000000..865465d0b7 --- /dev/null +++ b/modules/connectors/fedex/schemas/paperless_request.json @@ -0,0 +1,19 @@ +{ + "document": { + "workflowName": "ETDPostshipment", + "carrierCode": "FDXE", + "name": "file.txt", + "contentType": "text/plain", + "meta": { + "shipDocumentType": "COMMERCIAL_INVOICE", + "formCode": "USMCA", + "trackingNumber": "794791292805", + "shipmentDate": "2021-02-17T00:00:00", + "originLocationCode": "GVTKK", + "originCountryCode": "US", + "destinationLocationCode": "JNUA", + "destinationCountryCode": "IN" + } + }, + "attachment": "file.txt" +} diff --git a/modules/connectors/fedex/schemas/paperless_response.json b/modules/connectors/fedex/schemas/paperless_response.json new file mode 100644 index 0000000000..3497ef2d68 --- /dev/null +++ b/modules/connectors/fedex/schemas/paperless_response.json @@ -0,0 +1,12 @@ +{ + "output": { + "meta": { + "documentType": "CO", + "docId": "090493e181586308", + "folderId": [ + "0b0493e1812f8921" + ] + } + }, + "customerTransactionId": "XXXX_XXX123XXXXX" +} \ No newline at end of file diff --git a/modules/connectors/fedex/schemas/rating_request.json b/modules/connectors/fedex/schemas/rating_request.json new file mode 100644 index 0000000000..00e635b2ff --- /dev/null +++ b/modules/connectors/fedex/schemas/rating_request.json @@ -0,0 +1,459 @@ +{ + "accountNumber": { + "value": "Your account number" + }, + "rateRequestControlParameters": { + "returnTransitTimes": false, + "servicesNeededOnRateFailure": true, + "variableOptions": "FREIGHT_GUARANTEE", + "rateSortOrder": "SERVICENAMETRADITIONAL" + }, + "requestedShipment": { + "shipper": { + "address": { + "streetLines": [ + "1550 Union Blvd", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "TN", + "postalCode": "65247", + "countryCode": "US", + "residential": false + } + }, + "recipient": { + "address": { + "streetLines": [ + "1550 Union Blvd", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "TN", + "postalCode": "65247", + "countryCode": "US", + "residential": false + } + }, + "serviceType": "STANDARD_OVERNIGHT", + "emailNotificationDetail": { + "recipients": [ + { + "emailAddress": "string", + "notificationEventType": [ + "ON_DELIVERY" + ], + "smsDetail": null, + "notificationFormatType": "HTML", + "emailNotificationRecipientType": "BROKER", + "notificationType": "EMAIL", + "locale": "string" + } + ], + "personalMessage": "string", + "PrintedReference": { + "printedReferenceType": "BILL_OF_LADING", + "value": "string" + } + }, + "preferredCurrency": "USD", + "rateRequestType": [ + "ACCOUNT", + "LIST" + ], + "shipDateStamp": "2019-09-05", + "pickupType": "DROPOFF_AT_FEDEX_LOCATION", + "requestedPackageLineItems": [ + { + "subPackagingType": "BAG", + "groupPackageCount": 1, + "contentRecord": [ + { + "itemNumber": "string", + "receivedQuantity": 0, + "description": "string", + "partNumber": "string" + } + ], + "declaredValue": { + "amount": "100", + "currency": "USD" + }, + "weight": { + "units": "LB", + "value": 22 + }, + "dimensions": { + "length": 10, + "width": 8, + "height": 2, + "units": "IN" + }, + "variableHandlingChargeDetail": { + "rateType": "ACCOUNT", + "percentValue": 0, + "rateLevelType": "BUNDLED_RATE", + "fixedValue": { + "amount": "100", + "currency": "USD" + }, + "rateElementBasis": "NET_CHARGE" + }, + "packageSpecialServices": { + "specialServiceTypes": [ + "DANGEROUS_GOODS" + ], + "signatureOptionType": [ + "NO_SIGNATURE_REQUIRED" + ], + "alcoholDetail": { + "alcoholRecipientType": "LICENSEE", + "shipperAgreementType": "Retailer" + }, + "dangerousGoodsDetail": { + "offeror": "Offeror Name", + "accessibility": "ACCESSIBLE", + "emergencyContactNumber": "3268545905", + "options": [ + "BATTERY" + ], + "containers": [ + { + "offeror": "Offeror Name", + "hazardousCommodities": [ + { + "innerReceptacles": [] + } + ], + "numberOfContainers": 10, + "containerType": "Copper Box", + "emergencyContactNumber": { + "areaCode": "202", + "extension": "3245", + "countryCode": "US", + "personalIdentificationNumber": "9545678", + "localNumber": "23456" + }, + "packaging": { + "count": 20, + "units": "Liter" + }, + "packingType": "ALL_PACKED_IN_ONE", + "radioactiveContainerClass": "EXCEPTED_PACKAGE" + } + ], + "packaging": { + "count": 20, + "units": "Liter" + } + }, + "packageCODDetail": { + "codCollectionAmount": { + "amount": 12.45, + "currency": "USD" + }, + "codCollectionType": "ANY" + }, + "pieceCountVerificationBoxCount": 0, + "batteryDetails": [ + { + "material": "LITHIUM_METAL", + "regulatorySubType": "IATA_SECTION_II", + "packing": "CONTAINED_IN_EQUIPMENT" + } + ], + "dryIceWeight": { + "units": "LB", + "value": 10 + } + } + } + ], + "documentShipment": false, + "variableHandlingChargeDetail": { + "rateType": "ACCOUNT", + "percentValue": 0, + "rateLevelType": "BUNDLED_RATE", + "fixedValue": { + "amount": "100", + "currency": "USD" + }, + "rateElementBasis": "NET_CHARGE" + }, + "packagingType": "YOUR_PACKAGING", + "totalPackageCount": 3, + "totalWeight": 87.5, + "shipmentSpecialServices": { + "returnShipmentDetail": { + "returnType": "PRINT_RETURN_LABEL" + }, + "deliveryOnInvoiceAcceptanceDetail": { + "recipient": { + "accountNumber": { + "value": 123456789 + }, + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 30" + ], + "countryCode": "US" + }, + "contact": { + "companyName": "FedEx", + "faxNumber": "9013577890", + "personName": "John Taylor", + "phoneNumber": "9013577890" + } + } + }, + "internationalTrafficInArmsRegulationsDetail": { + "licenseOrExemptionNumber": "432345" + }, + "pendingShipmentDetail": { + "pendingShipmentType": "EMAIL", + "processingOptions": { + "options": [ + "ALLOW_MODIFICATIONS" + ] + }, + "recommendedDocumentSpecification": { + "types": [ + "ANTIQUE_STATEMENT_EUROPEAN_UNION" + ] + }, + "emailLabelDetail": { + "recipients": [ + { + "emailAddress": "string", + "optionsRequested": { + "options": [ + "PRODUCE_PAPERLESS_SHIPPING_FORMAT" + ] + }, + "role": "SHIPMENT_COMPLETOR", + "locale": { + "country": "string", + "language": "string" + } + } + ], + "message": "string" + }, + "documentReferences": [ + { + "documentType": "CERTIFICATE_OF_ORIGIN", + "customerReference": "string", + "description": "ShippingDocumentSpecification", + "documentId": "98123" + } + ], + "expirationTimeStamp": "2012-12-31", + "shipmentDryIceDetail": { + "totalWeight": { + "units": "LB", + "value": 10 + }, + "packageCount": 12 + } + }, + "holdAtLocationDetail": { + "locationId": "YBZA", + "locationContactAndAddress": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "38127", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "person name", + "emailAddress": "email address", + "phoneNumber": "phone number", + "phoneExtension": "phone extension", + "companyName": "company name", + "faxNumber": "fax number" + } + }, + "locationType": "FEDEX_ONSITE" + }, + "shipmentCODDetail": { + "addTransportationChargesDetail": { + "rateType": "ACCOUNT", + "rateLevelType": "BUNDLED_RATE", + "chargeLevelType": "CURRENT_PACKAGE", + "chargeType": "COD_SURCHARGE" + }, + "codRecipient": { + "accountNumber": { + "value": 123456789 + } + }, + "remitToName": "FedEx", + "codCollectionType": "ANY", + "financialInstitutionContactAndAddress": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "38127", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "person name", + "emailAddress": "email address", + "phoneNumber": "phone number", + "phoneExtension": "phone extension", + "companyName": "company name", + "faxNumber": "fax number" + } + }, + "returnReferenceIndicatorType": "INVOICE" + }, + "shipmentDryIceDetail": { + "totalWeight": { + "units": "LB", + "value": 10 + }, + "packageCount": 12 + }, + "internationalControlledExportDetail": { + "type": "DEA_036" + }, + "homeDeliveryPremiumDetail": { + "phoneNumber": { + "areaCode": "areaCode", + "extension": "extension", + "countryCode": "countryCode", + "personalIdentificationNumber": "personalIdentificationNumber", + "localNumber": "localNumber" + }, + "shipTimestamp": "2020-04-24", + "homedeliveryPremiumType": "APPOINTMENT" + }, + "specialServiceTypes": [ + "BROKER_SELECT_OPTION" + ] + }, + "customsClearanceDetail": { + "brokers": [ + { + "broker": { + "accountNumber": { + "value": 123456789 + }, + "address": null, + "contact": null + }, + "type": "EXPORT", + "brokerCommitTimestamp": "2019-07-22", + "brokerCommitDayOfWeek": "SUNDAY", + "brokerLocationId": "brokerLocationId", + "brokerAddress": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false, + "classification": "residential", + "geographicCoordinates": "geographicCoordinates", + "urbanizationCode": "code", + "countryName": "India" + }, + "brokerToDestinationDays": 10 + } + ], + "commercialInvoice": { + "shipmentPurpose": "GIFT" + }, + "freightOnValue": "CARRIER_RISK", + "dutiesPayment": { + "payor": { + "responsibleParty": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneNumber": "1234567890", + "phoneExtension": "phone extension", + "companyName": "Fedex", + "faxNumber": "fax number" + }, + "accountNumber": { + "value": "123456789" + } + } + }, + "paymentType": "SENDER" + }, + "commodities": [ + { + "description": "DOCUMENTS", + "weight": { + "units": "LB", + "value": 22 + }, + "quantity": 1, + "customsValue": { + "amount": "100", + "currency": "USD" + }, + "unitPrice": { + "amount": "100", + "currency": "USD" + }, + "numberOfPieces": 1, + "countryOfManufacture": "US", + "quantityUnits": "PCS", + "name": "DOCUMENTS", + "harmonizedCode": "080211", + "partNumber": "P1" + } + ] + }, + "groupShipment": true, + "serviceTypeDetail": { + "carrierCode": "FDXE", + "description": "string", + "serviceName": "string", + "serviceCategory": "string" + }, + "smartPostInfoDetail": { + "ancillaryEndorsement": "ADDRESS_CORRECTION", + "hubId": "5531", + "indicia": "MEDIA_MAIL", + "specialServices": "USPS_DELIVERY_CONFIRMATION" + }, + "expressFreightDetail": { + "bookingConfirmationNumber": "string", + "shippersLoadAndCount": 0 + }, + "groundShipment": false + }, + "carrierCodes": [ + "FDXE" + ] +} \ No newline at end of file diff --git a/modules/connectors/fedex/schemas/rating_response.json b/modules/connectors/fedex/schemas/rating_response.json new file mode 100644 index 0000000000..648abd14c5 --- /dev/null +++ b/modules/connectors/fedex/schemas/rating_response.json @@ -0,0 +1,1149 @@ +{ + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "output": { + "rateReplyDetails": [ + { + "serviceType": "INTERNATIONAL_FIRST", + "serviceName": "FedEx International First", + "packagingType": "YOUR_PACKAGING", + "customerMessages": [ + { + "code": "SERVICE.TYPE.INTERNATIONAL.MESSAGE", + "message": "Rate does not include duties & taxes, clearance entry fees or other import fees. The payor of duties/taxes/fees will be responsible for any applicable Clearance Entry Fees." + }, + { + "code": "EDT.DETAILS.MISSING", + "message": "The harmonized code for the commodity at array index 1 is missing or invalid; estimated duties and taxes were not returned." + } + ], + "ratedShipmentDetails": [ + { + "rateType": "ACCOUNT", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 403.2, + "totalNetCharge": 445.54, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 445.54, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 445.54, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA003O", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 42.34, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 42.34 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "CAD", + "rate": 1.0 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22.0 + }, + "currency": "CAD" + }, + "currency": "CAD" + }, + { + "rateType": "LIST", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 403.2, + "totalNetCharge": 445.54, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 445.54, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 445.54, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA003O", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 42.34, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 42.34 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "CAD", + "rate": 1.0 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22.0 + }, + "currency": "CAD" + }, + "currency": "CAD" + }, + { + "rateType": "PREFERRED_INCENTIVE", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 308.71, + "totalNetCharge": 341.13, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 341.13, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 341.13, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA003O", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 32.42, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 32.42 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "USD", + "rate": 0.77 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22.0 + }, + "currency": "USD" + }, + "currency": "USD" + }, + { + "rateType": "PREFERRED_CURRENCY", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 308.71, + "totalNetCharge": 341.13, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 341.13, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 341.13, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA003O", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 32.42, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 32.42 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "USD", + "rate": 0.77 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "USD" + }, + "currency": "USD" + } + ], + "anonymouslyAllowable": true, + "operationalDetail": { + "originLocationIds": "COSA", + "commitDays": "", + "serviceCode": "92", + "airportId": "MEM", + "scac": "", + "originServiceAreas": "AM", + "deliveryDay": "TUE", + "originLocationNumbers": 1162, + "destinationPostalCode": "38125", + "commitDate": "2019-07-22T08:30:00", + "astraDescription": "INTL1ST", + "deliveryDate": "", + "deliveryEligibilities": "", + "ineligibleForMoneyBackGuarantee": false, + "maximumTransitTime": "", + "astraPlannedServiceLevel": "", + "destinationLocationIds": "EHTA", + "destinationLocationStateOrProvinceCodes": "CT", + "transitTime": "THREE_DAYS", + "packagingCode": "02", + "destinationLocationNumbers": 892, + "publishedDeliveryTime": "06:30:00", + "countryCodes": "US", + "stateOrProvinceCodes": "TX", + "ursaPrefixCode": "82", + "ursaSuffixCode": "EHTA", + "destinationServiceAreas": "AA", + "originPostalCodes": "75063", + "customTransitTime": "" + }, + "signatureOptionType": "SERVICE_DEFAULT", + "serviceDescription": { + "serviceId": "EP1000000007", + "serviceType": "INTERNATIONAL_FIRST", + "code": "06", + "names": [ + { + "type": "long", + "encoding": "utf-8", + "value": "FedEx International First®" + }, + { + "type": "long", + "encoding": "ascii", + "value": "FedEx International First" + }, + { + "type": "medium", + "encoding": "utf-8", + "value": "FedEx International First®" + }, + { + "type": "medium", + "encoding": "ascii", + "value": "FedEx International First" + }, + { + "type": "short", + "encoding": "utf-8", + "value": "FO" + }, + { + "type": "short", + "encoding": "ascii", + "value": "FO" + }, + { + "type": "abbrv", + "encoding": "ascii", + "value": "FO" + } + ], + "operatingOrgCodes": [ + "FXE" + ], + "serviceCategory": "parcel", + "description": "International First", + "astraDescription": "INTL1ST" + }, + "commit": { + "dateDetail": { + "dayOfWeek": "THU", + "dayCxsFormat": "2020-07-16T10:30:00" + } + } + }, + { + "serviceType": "INTERNATIONAL_PRIORITY", + "serviceName": "FedEx International Priority", + "packagingType": "YOUR_PACKAGING", + "customerMessages": [ + { + "code": "SERVICE.TYPE.INTERNATIONAL.MESSAGE", + "message": "Rate does not include duties & taxes, clearance entry fees or other import fees. The payor of duties/taxes/fees will be responsible for any applicable Clearance Entry Fees." + }, + { + "code": "EDT.DETAILS.MISSING", + "message": "The harmonized code for the commodity at array index 1 is missing or invalid; estimated duties and taxes were not returned." + } + ], + "ratedShipmentDetails": [ + { + "rateType": "ACCOUNT", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 312.35, + "totalNetCharge": 345.15, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 345.15, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 345.15, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA003O", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 32.8, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 32.8 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "CAD", + "rate": 1 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "CAD" + }, + "currency": "CAD" + }, + { + "rateType": "LIST", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 78.99, + "totalNetCharge": 87.28, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 87.28, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 87.28, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA1520", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 8.29, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 8.29 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "CAD", + "rate": 1 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "CAD" + }, + "currency": "CAD" + }, + { + "rateType": "PREFERRED_INCENTIVE", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 60.48, + "totalNetCharge": 66.83, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 66.83, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 66.83, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA1520", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 6.3, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 6.35 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "USD", + "rate": 0.77 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "USD" + }, + "currency": "USD" + }, + { + "rateType": "PREFERRED_CURRENCY", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 239.15, + "totalNetCharge": 264.26, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 264.26, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 264.26, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA003O", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 25.11, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 25.11 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "USD", + "rate": 0.77 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "USD" + }, + "currency": "USD" + } + ], + "anonymouslyAllowable": true, + "operationalDetail": { + "ineligibleForMoneyBackGuarantee": false, + "astraDescription": "IP", + "airportId": "MEM", + "serviceCode": "01", + "originLocationIds": "COSA", + "commitDays": "", + "scac": "", + "originServiceAreas": "AM", + "deliveryDay": "TUE", + "originLocationNumbers": 1162, + "destinationPostalCode": "38125", + "commitDate": "2019-07-22T08:30:00", + "deliveryDate": "", + "deliveryEligibilities": "", + "maximumTransitTime": "", + "astraPlannedServiceLevel": "", + "destinationLocationIds": "EHTA", + "destinationLocationStateOrProvinceCodes": "CT", + "transitTime": "THREE_DAYS", + "packagingCode": "02", + "destinationLocationNumbers": 892, + "publishedDeliveryTime": "06:30:00", + "countryCodes": "US", + "stateOrProvinceCodes": "TX", + "ursaPrefixCode": "82", + "ursaSuffixCode": "EHTA", + "destinationServiceAreas": "AA", + "originPostalCodes": "75063", + "customTransitTime": "" + }, + "signatureOptionType": "SERVICE_DEFAULT", + "serviceDescription": { + "serviceId": "EP1000000001", + "serviceType": "INTERNATIONAL_PRIORITY", + "code": "01", + "names": [ + { + "type": "long", + "encoding": "utf-8", + "value": "FedEx International Priority®" + }, + { + "type": "long", + "encoding": "ascii", + "value": "FedEx International Priority" + }, + { + "type": "medium", + "encoding": "utf-8", + "value": "FedEx International Priority®" + }, + { + "type": "medium", + "encoding": "ascii", + "value": "FedEx International Priority" + }, + { + "type": "short", + "encoding": "utf-8", + "value": "IP" + }, + { + "type": "short", + "encoding": "ascii", + "value": "IP" + }, + { + "type": "abbrv", + "encoding": "ascii", + "value": "IP" + } + ], + "operatingOrgCodes": [ + "FXE" + ], + "serviceCategory": "parcel", + "description": "International Priority", + "astraDescription": "IP" + }, + "commit": { + "dateDetail": { + "dayOfWeek": "FRI", + "dayCxsFormat": "2020-07-16T10:30:00" + } + } + }, + { + "serviceType": "INTERNATIONAL_ECONOMY", + "serviceName": "FedEx International Economy", + "packagingType": "YOUR_PACKAGING", + "customerMessages": [ + { + "code": "SERVICE.TYPE.INTERNATIONAL.MESSAGE", + "message": "Rate does not include duties & taxes, clearance entry fees or other import fees. The payor of duties/taxes/fees will be responsible for any applicable Clearance Entry Fees." + }, + { + "code": "EDT.DETAILS.MISSING", + "message": "The harmonized code for the commodity at array index 1 is missing or invalid; estimated duties and taxes were not returned." + } + ], + "ratedShipmentDetails": [ + { + "rateType": "ACCOUNT", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 189.65, + "totalNetCharge": 209.56, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 209.56, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 209.56, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA003O", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 19.91, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 19.91 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "CAD", + "rate": 1 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "CAD" + }, + "currency": "CAD" + }, + { + "rateType": "LIST", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 48.56, + "totalNetCharge": 53.66, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 53.66, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 53.66, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA1520", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 5.1, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 5.1 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "CAD", + "rate": 1 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "CAD" + }, + "currency": "CAD" + }, + { + "rateType": "PREFERRED_INCENTIVE", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 37.18, + "totalNetCharge": 41.08, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 41.08, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 41.08, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA1520", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 3.9, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 3.9 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "USD", + "rate": 0.77 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "USD" + }, + "currency": "USD" + }, + { + "rateType": "PREFERRED_CURRENCY", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 145.21, + "totalNetCharge": 160.45, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 160.45, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 160.45, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA003O", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 15.24, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 15.24 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "USD", + "rate": 0.77 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "USD" + }, + "currency": "USD" + } + ], + "anonymouslyAllowable": true, + "operationalDetail": { + "ineligibleForMoneyBackGuarantee": false, + "astraDescription": "IE", + "airportId": "MEM", + "serviceCode": "03", + "originLocationIds": "COSA", + "originServiceAreas": "AM", + "deliveryDay": "TUE", + "originLocationNumbers": 1162, + "destinationPostalCode": "38125", + "destinationLocationIds": "EHTA", + "destinationLocationStateOrProvinceCodes": "CT", + "transitTime": "THREE_DAYS", + "packagingCode": "02", + "destinationLocationNumbers": 892, + "publishedDeliveryTime": "06:30:00", + "countryCodes": "US", + "stateOrProvinceCodes": "TX", + "ursaPrefixCode": "82", + "ursaSuffixCode": "EHTA", + "destinationServiceAreas": "AA", + "originPostalCodes": "75063" + }, + "signatureOptionType": "SERVICE_DEFAULT", + "serviceDescription": { + "serviceId": "EP1000000004", + "serviceType": "INTERNATIONAL_ECONOMY", + "code": "03", + "names": [ + { + "type": "long", + "encoding": "utf-8", + "value": "FedEx International Economy®" + }, + { + "type": "long", + "encoding": "ascii", + "value": "FedEx International Economy" + }, + { + "type": "medium", + "encoding": "utf-8", + "value": "FedEx International Economy®" + }, + { + "type": "medium", + "encoding": "ascii", + "value": "FedEx International Economy" + }, + { + "type": "short", + "encoding": "utf-8", + "value": "IE" + }, + { + "type": "short", + "encoding": "ascii", + "value": "IE" + }, + { + "type": "abbrv", + "encoding": "ascii", + "value": "IE" + } + ], + "operatingOrgCodes": [ + "FXE" + ], + "serviceCategory": "parcel", + "description": "International Two Day", + "astraDescription": "IE" + } + }, + { + "serviceType": "FEDEX_GROUND", + "serviceName": "FedEx International Ground�", + "packagingType": "YOUR_PACKAGING", + "customerMessages": [ + { + "code": "SERVICE.TYPE.INTERNATIONAL.MESSAGE", + "message": "Rate does not include duties & taxes, clearance entry fees or other import fees. The payor of duties/taxes/fees will be responsible for any applicable Clearance Entry Fees." + }, + { + "code": "EDT.DETAILS.MISSING", + "message": "The harmonized code for the commodity at array index 1 is missing or invalid; estimated duties and taxes were not returned." + } + ], + "ratedShipmentDetails": [ + { + "rateType": "ACCOUNT", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 2.79, + "totalBaseCharge": 49.85, + "totalNetCharge": 53.59, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 53.59, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 53.59, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "52", + "dimDivisor": 0.0, + "fuelSurchargePercent": 7.5, + "totalSurcharges": 3.74, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "level": "PACKAGE", + "amount": 3.74 + } + ], + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "CAD" + }, + "ratedPackages": [ + { + "groupNumber": 0.0, + "effectiveNetDiscount": 2.79, + "packageRateDetail": { + "rateType": "PAYOR_ACCOUNT_PACKAGE", + "ratedWeightMethod": "ACTUAL", + "baseCharge": 49.85, + "netFreight": 49.85, + "totalSurcharges": 3.74, + "netFedExCharge": 53.59, + "totalTaxes": 0.0, + "netCharge": 53.59, + "totalRebates": 0.0, + "billingWeight": { + "units": "LB", + "value": 22 + }, + "totalFreightDiscounts": 0.0, + "surcharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "level": "PACKAGE", + "amount": 3.74 + } + ], + "currency": "CAD" + } + } + ], + "currency": "CAD" + }, + { + "rateType": "PREFERRED_INCENTIVE", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 40.16, + "totalNetCharge": 43.17, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 43.17, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 43.17, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "52", + "dimDivisor": 0.0, + "fuelSurchargePercent": 7.5, + "totalSurcharges": 3.01, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "level": "PACKAGE", + "amount": 3.01 + } + ], + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "USD", + "rate": 0.77 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "USD" + }, + "ratedPackages": [ + { + "groupNumber": 0.0, + "effectiveNetDiscount": 0.0, + "packageRateDetail": { + "rateType": "PREFERRED_LIST_PACKAGE", + "ratedWeightMethod": "ACTUAL", + "baseCharge": 40.16, + "netFreight": 40.16, + "totalSurcharges": 3.01, + "netFedExCharge": 43.17, + "totalTaxes": 0.0, + "netCharge": 43.17, + "totalRebates": 0.0, + "billingWeight": { + "units": "LB", + "value": 22 + }, + "totalFreightDiscounts": 0.0, + "surcharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "level": "PACKAGE", + "amount": 3.01 + } + ], + "currency": "USD" + } + } + ] + }, + { + "rateType": "PREFERRED_CURRENCY", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 38.17, + "totalNetCharge": 41.03, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 41.03, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 41.03, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "52", + "dimDivisor": 0.0, + "fuelSurchargePercent": 7.5, + "totalSurcharges": 2.86, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "level": "PACKAGE", + "amount": 2.86 + } + ], + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "USD", + "rate": 0.77 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "USD" + }, + "ratedPackages": [ + { + "groupNumber": 0.0, + "effectiveNetDiscount": 0.0, + "packageRateDetail": { + "rateType": "PREFERRED_ACCOUNT_PACKAGE", + "ratedWeightMethod": "ACTUAL", + "baseCharge": 38.17, + "netFreight": 38.17, + "totalSurcharges": 2.86, + "netFedExCharge": 41.03, + "totalTaxes": 0.0, + "netCharge": 41.03, + "totalRebates": 0.0, + "billingWeight": { + "units": "LB", + "value": 22 + }, + "totalFreightDiscounts": 0.0, + "surcharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "level": "PACKAGE", + "amount": 2.86 + } + ], + "currency": "USD" + } + } + ], + "currency": "USD" + }, + { + "rateType": "LIST", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 52.45, + "totalNetCharge": 56.38, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 56.38, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 56.38, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "52", + "dimDivisor": 0.0, + "fuelSurchargePercent": 7.5, + "totalSurcharges": 3.93, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "level": "PACKAGE", + "amount": 3.93 + } + ], + "totalBillingWeight": { + "units": "LB", + "value": 2 + }, + "currency": "CAD" + }, + "ratedPackages": [ + { + "groupNumber": 0.0, + "effectiveNetDiscount": 0.0, + "packageRateDetail": { + "rateType": "PAYOR_LIST_PACKAGE", + "ratedWeightMethod": "ACTUAL", + "baseCharge": 52.45, + "netFreight": 52.45, + "totalSurcharges": 3.93, + "netFedExCharge": 56.38, + "totalTaxes": 0.0, + "netCharge": 56.38, + "totalRebates": 0.0, + "billingWeight": { + "units": "LB", + "value": 22 + }, + "totalFreightDiscounts": 0.0, + "surcharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "level": "PACKAGE", + "amount": 3.93 + } + ], + "currency": "CAD" + } + } + ], + "currency": "CAD", + "anonymouslyAllowable": true, + "operationalDetail": { + "ineligibleForMoneyBackGuarantee": false, + "astraDescription": "FXG", + "airportId": "MEM", + "serviceCode": "92", + "originLocationIds": "COSA", + "commitDays": "", + "scac": "", + "originServiceAreas": "AM", + "deliveryDay": "TUE", + "originLocationNumbers": 1162, + "destinationPostalCode": "38125", + "commitDate": "2019-07-22T08:30:00", + "deliveryDate": "", + "deliveryEligibilities": "", + "maximumTransitTime": "", + "astraPlannedServiceLevel": "", + "destinationLocationIds": "EHTA", + "destinationLocationStateOrProvinceCodes": "CT", + "transitTime": "THREE_DAYS", + "packagingCode": "02", + "destinationLocationNumbers": 892, + "publishedDeliveryTime": "06:30:00", + "countryCodes": "US", + "stateOrProvinceCodes": "TX", + "ursaPrefixCode": "82", + "ursaSuffixCode": "EHTA", + "destinationServiceAreas": "AA", + "originPostalCodes": "75063", + "customTransitTime": "" + }, + "signatureOptionType": "SERVICE_DEFAULT", + "serviceDescription": { + "serviceId": "EP1000000135", + "serviceType": "FEDEX_GROUND", + "code": "92", + "names": [ + { + "type": "long", + "encoding": "utf-8", + "value": "FedEx International Ground®" + }, + { + "type": "long", + "encoding": "ascii", + "value": "FedEx International Ground" + }, + { + "type": "medium", + "encoding": "utf-8", + "value": "International Ground®" + }, + { + "type": "medium", + "encoding": "ascii", + "value": "International Ground" + }, + { + "type": "short", + "encoding": "utf-8", + "value": "IG" + }, + { + "type": "short", + "encoding": "ascii", + "value": "IG" + }, + { + "type": "abbrv", + "encoding": "ascii", + "value": "SG" + } + ], + "operatingOrgCodes": [ + "FXG" + ], + "description": "FedEx Ground", + "astraDescription": "FXG" + } + } + ] + } + ], + "quoteDate": "2019-09-06", + "encoded": false, + "alerts": [ + { + "code": "MONEYBACKGUARANTEE.NOT.ELIGIBLE", + "message": "We are unable to process this request. Please try again later or contact FedEx Customer Service.", + "alertType": "NOTE" + } + ] + } +} \ No newline at end of file diff --git a/modules/connectors/fedex/schemas/shipping_request.json b/modules/connectors/fedex/schemas/shipping_request.json new file mode 100644 index 0000000000..dbb6d79374 --- /dev/null +++ b/modules/connectors/fedex/schemas/shipping_request.json @@ -0,0 +1,1178 @@ +{ + "mergeLabelDocOption": "LABELS_AND_DOCS", + "requestedShipment": { + "shipDatestamp": "2019-10-14", + "totalDeclaredValue": { + "amount": 12.45, + "currency": "USD" + }, + "shipper": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneExtension": "91", + "phoneNumber": "XXXX567890", + "companyName": "Fedex" + }, + "tins": [ + { + "number": "XXX567", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + ] + }, + "soldTo": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneExtension": "91", + "phoneNumber": "1234567890", + "companyName": "Fedex" + }, + "tins": [ + { + "number": "123567", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + ], + "accountNumber": { + "value": "Your account number" + } + }, + "recipients": [ + { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneExtension": "000", + "phoneNumber": "XXXX345671", + "companyName": "FedEx" + }, + "tins": [ + { + "number": "123567", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + ], + "deliveryInstructions": "Delivery Instructions" + } + ], + "recipientLocationNumber": "1234567", + "pickupType": "USE_SCHEDULED_PICKUP", + "serviceType": "PRIORITY_OVERNIGHT", + "packagingType": "YOUR_PACKAGING", + "totalWeight": 20.6, + "origin": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "38127", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "person name", + "emailAddress": "email address", + "phoneNumber": "phone number", + "phoneExtension": "phone extension", + "companyName": "company name", + "faxNumber": "fax number" + } + }, + "shippingChargesPayment": { + "paymentType": "SENDER", + "payor": { + "responsibleParty": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneNumber": "XXXX567890", + "phoneExtension": "phone extension", + "companyName": "Fedex", + "faxNumber": "fax number" + }, + "accountNumber": { + "value": "Your account number" + } + } + } + }, + "shipmentSpecialServices": { + "specialServiceTypes": [ + "THIRD_PARTY_CONSIGNEE", + "PROTECTION_FROM_FREEZING" + ], + "etdDetail": { + "attributes": [ + "POST_SHIPMENT_UPLOAD_REQUESTED" + ], + "attachedDocuments": [ + { + "documentType": "PRO_FORMA_INVOICE", + "documentReference": "DocumentReference", + "description": "PRO FORMA INVOICE", + "documentId": "090927d680038c61" + } + ], + "requestedDocumentTypes": [ + "VICS_BILL_OF_LADING", + "GENERAL_AGENCY_AGREEMENT" + ] + }, + "returnShipmentDetail": { + "returnEmailDetail": { + "merchantPhoneNumber": "19012635656", + "allowedSpecialService": [ + "SATURDAY_DELIVERY" + ] + }, + "rma": { + "reason": "Wrong Size or Color" + }, + "returnAssociationDetail": { + "shipDatestamp": "2019-10-01", + "trackingNumber": "123456789" + }, + "returnType": "PRINT_RETURN_LABEL" + }, + "deliveryOnInvoiceAcceptanceDetail": { + "recipient": { + "address": { + "streetLines": [ + "23, RUE JOSEPH-DE MA", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneExtension": "000", + "phoneNumber": "1234567890", + "companyName": "Fedex" + }, + "tins": [ + { + "number": "123567", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + ], + "deliveryInstructions": "Delivery Instructions" + } + }, + "internationalTrafficInArmsRegulationsDetail": { + "licenseOrExemptionNumber": "9871234" + }, + "pendingShipmentDetail": { + "pendingShipmentType": "EMAIL", + "processingOptions": { + "options": [ + "ALLOW_MODIFICATIONS" + ] + }, + "recommendedDocumentSpecification": { + "types": "ANTIQUE_STATEMENT_EUROPEAN_UNION" + }, + "emailLabelDetail": { + "recipients": [ + { + "emailAddress": "neena@fedex.com", + "optionsRequested": { + "options": [ + "PRODUCE_PAPERLESS_SHIPPING_FORMAT", + "SUPPRESS_ACCESS_EMAILS" + ] + }, + "role": "SHIPMENT_COMPLETOR", + "locale": "en_US" + } + ], + "message": "your optional message" + }, + "attachedDocuments": [ + { + "documentType": "PRO_FORMA_INVOICE", + "documentReference": "DocumentReference", + "description": "PRO FORMA INVOICE", + "documentId": "090927d680038c61" + } + ], + "expirationTimeStamp": "2020-01-01" + }, + "holdAtLocationDetail": { + "locationId": "YBZA", + "locationContactAndAddress": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "38127", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "person name", + "emailAddress": "email address", + "phoneNumber": "phone number", + "phoneExtension": "phone extension", + "companyName": "company name", + "faxNumber": "fax number" + } + }, + "locationType": "FEDEX_ONSITE" + }, + "shipmentCODDetail": { + "addTransportationChargesDetail": { + "rateType": "ACCOUNT", + "rateLevelType": "BUNDLED_RATE", + "chargeLevelType": "CURRENT_PACKAGE", + "chargeType": "COD_SURCHARGE" + }, + "codRecipient": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneExtension": "000", + "phoneNumber": "XXXX345671", + "companyName": "Fedex" + }, + "accountNumber": { + "value": "Your account number" + }, + "tins": [ + { + "number": "123567", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + ] + }, + "remitToName": "remitToName", + "codCollectionType": "ANY", + "financialInstitutionContactAndAddress": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "38127", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "person name", + "emailAddress": "email address", + "phoneNumber": "phone number", + "phoneExtension": "phone extension", + "companyName": "company name", + "faxNumber": "fax number" + } + }, + "codCollectionAmount": { + "amount": 12.45, + "currency": "USD" + }, + "returnReferenceIndicatorType": "INVOICE", + "shipmentCodAmount": { + "amount": 12.45, + "currency": "USD" + } + }, + "shipmentDryIceDetail": { + "totalWeight": { + "units": "LB", + "value": 10 + }, + "packageCount": 12 + }, + "internationalControlledExportDetail": { + "licenseOrPermitExpirationDate": "2019-12-03", + "licenseOrPermitNumber": "11", + "entryNumber": "125", + "foreignTradeZoneCode": "US", + "type": "WAREHOUSE_WITHDRAWAL" + }, + "homeDeliveryPremiumDetail": { + "phoneNumber": { + "areaCode": "901", + "localNumber": "3575012", + "extension": "200", + "personalIdentificationNumber": "98712345" + }, + "deliveryDate": "2019-06-26", + "homedeliveryPremiumType": "APPOINTMENT" + } + }, + "emailNotificationDetail": { + "aggregationType": "PER_PACKAGE", + "emailNotificationRecipients": [ + { + "name": "Joe Smith", + "emailNotificationRecipientType": "SHIPPER", + "emailAddress": "jsmith3@aol.com", + "notificationFormatType": "TEXT", + "notificationType": "EMAIL", + "locale": "en_US", + "notificationEventType": [ + "ON_PICKUP_DRIVER_ARRIVED", + "ON_SHIPMENT" + ] + } + ], + "personalMessage": "your personal message here" + }, + "expressFreightDetail": { + "bookingConfirmationNumber": "123456789812", + "shippersLoadAndCount": 123, + "packingListEnclosed": true + }, + "variableHandlingChargeDetail": { + "rateType": "PREFERRED_CURRENCY", + "percentValue": 12.45, + "rateLevelType": "INDIVIDUAL_PACKAGE_RATE", + "fixedValue": { + "amount": 24.45, + "currency": "USD" + }, + "rateElementBasis": "NET_CHARGE_EXCLUDING_TAXES" + }, + "customsClearanceDetail": { + "regulatoryControls": "NOT_IN_FREE_CIRCULATION", + "brokers": [ + { + "broker": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneNumber": "1234567890", + "phoneExtension": 91, + "companyName": "Fedex", + "faxNumber": 1234567 + }, + "accountNumber": { + "value": "Your account number" + }, + "tins": [ + { + "number": "number", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + ], + "deliveryInstructions": "deliveryInstructions" + }, + "type": "IMPORT" + } + ], + "commercialInvoice": { + "originatorName": "originator Name", + "comments": [ + "optional comments for the commercial invoice" + ], + "customerReferences": [ + { + "customerReferenceType": "INVOICE_NUMBER", + "value": "3686" + } + ], + "taxesOrMiscellaneousCharge": { + "amount": 12.45, + "currency": "USD" + }, + "taxesOrMiscellaneousChargeType": "COMMISSIONS", + "freightCharge": { + "amount": 12.45, + "currency": "USD" + }, + "packingCosts": { + "amount": 12.45, + "currency": "USD" + }, + "handlingCosts": { + "amount": 12.45, + "currency": "USD" + }, + "declarationStatement": "declarationStatement", + "termsOfSale": "FCA", + "specialInstructions": "specialInstructions\"", + "shipmentPurpose": "REPAIR_AND_RETURN", + "emailNotificationDetail": { + "emailAddress": "neena@fedex.com", + "type": "EMAILED", + "recipientType": "SHIPPER" + } + }, + "freightOnValue": "OWN_RISK", + "dutiesPayment": { + "payor": { + "responsibleParty": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "38127", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneNumber": "1234567890", + "phoneExtension": "phone extension", + "companyName": "Fedex", + "faxNumber": "fax number" + }, + "accountNumber": { + "value": "Your account number" + }, + "tins": [ + { + "number": "number", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + }, + { + "number": "number", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + ] + } + }, + "billingDetails": { + "billingCode": "billingCode", + "billingType": "billingType", + "aliasId": "aliasId", + "accountNickname": "accountNickname", + "accountNumber": "Your account number", + "accountNumberCountryCode": "US" + }, + "paymentType": "SENDER" + }, + "commodities": [ + { + "unitPrice": { + "amount": 12.45, + "currency": "USD" + }, + "additionalMeasures": [ + { + "quantity": 12.45, + "units": "KG" + } + ], + "numberOfPieces": 12, + "quantity": 125, + "quantityUnits": "Ea", + "customsValue": { + "amount": "1556.25", + "currency": "USD" + }, + "countryOfManufacture": "US", + "cIMarksAndNumbers": "87123", + "harmonizedCode": "0613", + "description": "description", + "name": "non-threaded rivets", + "weight": { + "units": "KG", + "value": 68 + }, + "exportLicenseNumber": "26456", + "exportLicenseExpirationDate": "2019-08-24T14:15:22Z", + "partNumber": "167", + "purpose": "BUSINESS", + "usmcaDetail": { + "originCriterion": "A" + } + } + ], + "isDocumentOnly": true, + "recipientCustomsId": { + "type": "PASSPORT", + "value": "123" + }, + "customsOption": { + "description": "Description", + "type": "COURTESY_RETURN_LABEL" + }, + "importerOfRecord": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneExtension": "000", + "phoneNumber": "XXXX345671", + "companyName": "Fedex" + }, + "accountNumber": { + "value": "Your account number" + }, + "tins": [ + { + "number": "123567", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + ] + }, + "generatedDocumentLocale": "en_US", + "exportDetail": { + "destinationControlDetail": { + "endUser": "dest country user", + "statementTypes": "DEPARTMENT_OF_COMMERCE", + "destinationCountries": [ + "USA", + "India" + ] + }, + "b13AFilingOption": "NOT_REQUIRED", + "exportComplianceStatement": "12345678901234567", + "permitNumber": "12345" + }, + "totalCustomsValue": { + "amount": 12.45, + "currency": "USD" + }, + "partiesToTransactionAreRelated": true, + "declarationStatementDetail": { + "usmcaLowValueStatementDetail": { + "countryOfOriginLowValueDocumentRequested": true, + "customsRole": "EXPORTER" + } + }, + "insuranceCharge": { + "amount": 12.45, + "currency": "USD" + } + }, + "smartPostInfoDetail": { + "ancillaryEndorsement": "RETURN_SERVICE", + "hubId": "5015", + "indicia": "PRESORTED_STANDARD", + "specialServices": "USPS_DELIVERY_CONFIRMATION" + }, + "blockInsightVisibility": true, + "labelSpecification": { + "labelFormatType": "COMMON2D", + "labelOrder": "SHIPPING_LABEL_FIRST", + "customerSpecifiedDetail": { + "maskedData": [ + "CUSTOMS_VALUE", + "TOTAL_WEIGHT" + ], + "regulatoryLabels": [ + { + "generationOptions": "CONTENT_ON_SHIPPING_LABEL_ONLY", + "type": "ALCOHOL_SHIPMENT_LABEL" + } + ], + "additionalLabels": [ + { + "type": "CONSIGNEE", + "count": 1 + } + ], + "docTabContent": { + "docTabContentType": "BARCODED", + "zone001": { + "docTabZoneSpecifications": [ + { + "zoneNumber": 0, + "header": "string", + "dataField": "string", + "literalValue": "string", + "justification": "RIGHT" + } + ] + }, + "barcoded": { + "symbology": "UCC128", + "specification": { + "zoneNumber": 0, + "header": "string", + "dataField": "string", + "literalValue": "string", + "justification": "RIGHT" + } + } + } + }, + "printedLabelOrigin": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "38127", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "person name", + "emailAddress": "email address", + "phoneNumber": "phone number", + "phoneExtension": "phone extension", + "companyName": "company name", + "faxNumber": "fax number" + } + }, + "labelStockType": "PAPER_85X11_TOP_HALF_LABEL", + "labelRotation": "UPSIDE_DOWN", + "imageType": "PDF", + "labelPrintingOrientation": "TOP_EDGE_OF_TEXT_FIRST", + "returnedDispositionDetail": true + }, + "shippingDocumentSpecification": { + "generalAgencyAgreementDetail": { + "documentFormat": { + "provideInstructions": true, + "optionsRequested": { + "options": [ + "SUPPRESS_ADDITIONAL_LANGUAGES", + "SHIPPING_LABEL_LAST" + ] + }, + "stockType": "PAPER_LETTER", + "dispositions": [ + { + "eMailDetail": { + "eMailRecipients": [ + { + "emailAddress": "email@fedex.com", + "recipientType": "THIRD_PARTY" + } + ], + "locale": "en_US", + "grouping": "NONE" + }, + "dispositionType": "CONFIRMED" + } + ], + "locale": "en_US", + "docType": "PDF" + } + }, + "returnInstructionsDetail": { + "customText": "This is additional text printed on Return instr", + "documentFormat": { + "provideInstructions": true, + "optionsRequested": { + "options": [ + "SUPPRESS_ADDITIONAL_LANGUAGES", + "SHIPPING_LABEL_LAST" + ] + }, + "stockType": "PAPER_LETTER", + "dispositions": [ + { + "eMailDetail": { + "eMailRecipients": [ + { + "emailAddress": "email@fedex.com", + "recipientType": "THIRD_PARTY" + } + ], + "locale": "en_US", + "grouping": "NONE" + }, + "dispositionType": "CONFIRMED" + } + ], + "locale": "en_US\"", + "docType": "PNG" + } + }, + "op900Detail": { + "customerImageUsages": [ + { + "id": "IMAGE_5", + "type": "SIGNATURE", + "providedImageType": "SIGNATURE" + } + ], + "signatureName": "Signature Name", + "documentFormat": { + "provideInstructions": true, + "optionsRequested": { + "options": [ + "SUPPRESS_ADDITIONAL_LANGUAGES", + "SHIPPING_LABEL_LAST" + ] + }, + "stockType": "PAPER_LETTER", + "dispositions": [ + { + "eMailDetail": { + "eMailRecipients": [ + { + "emailAddress": "email@fedex.com", + "recipientType": "THIRD_PARTY" + } + ], + "locale": "en_US", + "grouping": "NONE" + }, + "dispositionType": "CONFIRMED" + } + ], + "locale": "en_US", + "docType": "PDF" + } + }, + "usmcaCertificationOfOriginDetail": { + "customerImageUsages": [ + { + "id": "IMAGE_5", + "type": "SIGNATURE", + "providedImageType": "SIGNATURE" + } + ], + "documentFormat": { + "provideInstructions": true, + "optionsRequested": { + "options": [ + "SUPPRESS_ADDITIONAL_LANGUAGES", + "SHIPPING_LABEL_LAST" + ] + }, + "stockType": "PAPER_LETTER", + "dispositions": [ + { + "eMailDetail": { + "eMailRecipients": [ + { + "emailAddress": "email@fedex.com", + "recipientType": "THIRD_PARTY" + } + ], + "locale": "en_US", + "grouping": "NONE" + }, + "dispositionType": "CONFIRMED" + } + ], + "locale": "en_US", + "docType": "PDF" + }, + "certifierSpecification": "EXPORTER", + "importerSpecification": "UNKNOWN", + "producerSpecification": "SAME_AS_EXPORTER", + "producer": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneExtension": "000", + "phoneNumber": "XXXX345671", + "companyName": "Fedex" + }, + "accountNumber": { + "value": "Your account number" + }, + "tins": [ + { + "number": "123567", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + ] + }, + "blanketPeriod": { + "begins": "22-01-2020", + "ends": "2-01-2020" + }, + "certifierJobTitle": "Manager" + }, + "usmcaCommercialInvoiceCertificationOfOriginDetail": { + "customerImageUsages": [ + { + "id": "IMAGE_5", + "type": "SIGNATURE", + "providedImageType": "SIGNATURE" + } + ], + "documentFormat": { + "provideInstructions": true, + "optionsRequested": { + "options": [ + "SUPPRESS_ADDITIONAL_LANGUAGES", + "SHIPPING_LABEL_LAST" + ] + }, + "stockType": "PAPER_LETTER", + "dispositions": [ + { + "eMailDetail": { + "eMailRecipients": [ + { + "emailAddress": "email@fedex.com", + "recipientType": "THIRD_PARTY" + } + ], + "locale": "en_US", + "grouping": "NONE" + }, + "dispositionType": "CONFIRMED" + } + ], + "locale": "en_US", + "docType": "PDF" + }, + "certifierSpecification": "EXPORTER", + "importerSpecification": "UNKNOWN", + "producerSpecification": "SAME_AS_EXPORTER", + "producer": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneExtension": "000", + "phoneNumber": "XXXX345671", + "companyName": "Fedex" + }, + "accountNumber": { + "value": "Your account number" + }, + "tins": [ + { + "number": "123567", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + ] + }, + "certifierJobTitle": "Manager" + }, + "shippingDocumentTypes": [ + "RETURN_INSTRUCTIONS" + ], + "certificateOfOrigin": { + "customerImageUsages": [ + { + "id": "IMAGE_5", + "type": "SIGNATURE", + "providedImageType": "SIGNATURE" + } + ], + "documentFormat": { + "provideInstructions": true, + "optionsRequested": { + "options": [ + "SUPPRESS_ADDITIONAL_LANGUAGES", + "SHIPPING_LABEL_LAST" + ] + }, + "stockType": "PAPER_LETTER", + "dispositions": [ + { + "eMailDetail": { + "eMailRecipients": [ + { + "emailAddress": "email@fedex.com", + "recipientType": "THIRD_PARTY" + } + ], + "locale": "en_US", + "grouping": "NONE" + }, + "dispositionType": "CONFIRMED" + } + ], + "locale": "en_US", + "docType": "PDF" + } + }, + "commercialInvoiceDetail": { + "customerImageUsages": [ + { + "id": "IMAGE_5", + "type": "SIGNATURE", + "providedImageType": "SIGNATURE" + } + ], + "documentFormat": { + "provideInstructions": true, + "optionsRequested": { + "options": [ + "SUPPRESS_ADDITIONAL_LANGUAGES", + "SHIPPING_LABEL_LAST" + ] + }, + "stockType": "PAPER_LETTER", + "dispositions": [ + { + "eMailDetail": { + "eMailRecipients": [ + { + "emailAddress": "email@fedex.com", + "recipientType": "THIRD_PARTY" + } + ], + "locale": "en_US", + "grouping": "NONE" + }, + "dispositionType": "CONFIRMED" + } + ], + "locale": "en_US", + "docType": "PDF" + } + } + }, + "rateRequestType": [ + "LIST", + "PREFERRED" + ], + "preferredCurrency": "USD", + "totalPackageCount": 25, + "masterTrackingId": { + "formId": "0201", + "trackingIdType": "EXPRESS", + "uspsApplicationId": "92", + "trackingNumber": "49092000070120032835" + }, + "requestedPackageLineItems": [ + { + "sequenceNumber": "1", + "subPackagingType": "BUCKET", + "customerReferences": [ + { + "customerReferenceType": "INVOICE_NUMBER", + "value": "3686" + } + ], + "declaredValue": { + "amount": 12.45, + "currency": "USD" + }, + "weight": { + "units": "KG", + "value": 68 + }, + "dimensions": { + "length": 100, + "width": 50, + "height": 30, + "units": "CM" + }, + "groupPackageCount": 2, + "itemDescriptionForClearance": "description", + "contentRecord": [ + { + "itemNumber": "2876", + "receivedQuantity": 256, + "description": "Description", + "partNumber": "456" + } + ], + "itemDescription": "item description for the package", + "variableHandlingChargeDetail": { + "rateType": "PREFERRED_CURRENCY", + "percentValue": 12.45, + "rateLevelType": "INDIVIDUAL_PACKAGE_RATE", + "fixedValue": { + "amount": 24.45, + "currency": "USD" + }, + "rateElementBasis": "NET_CHARGE_EXCLUDING_TAXES" + }, + "packageSpecialServices": { + "specialServiceTypes": [ + "ALCOHOL", + "NON_STANDARD_CONTAINER" + ], + "signatureOptionType": "ADULT", + "priorityAlertDetail": { + "enhancementTypes": [ + "PRIORITY_ALERT_PLUS" + ], + "content": [ + "string" + ] + }, + "signatureOptionDetail": { + "signatureReleaseNumber": "23456" + }, + "alcoholDetail": { + "alcoholRecipientType": "LICENSEE", + "shipperAgreementType": "Retailer" + }, + "dangerousGoodsDetail": { + "cargoAircraftOnly": false, + "accessibility": "INACCESSIBLE", + "options": [ + "LIMITED_QUANTITIES_COMMODITIES", + "ORM_D" + ] + }, + "packageCODDetail": { + "codCollectionAmount": { + "amount": 12.45, + "currency": "USD" + } + }, + "pieceCountVerificationBoxCount": 0, + "batteryDetails": [ + { + "batteryPackingType": "CONTAINED_IN_EQUIPMENT", + "batteryRegulatoryType": "IATA_SECTION_II", + "batteryMaterialType": "LITHIUM_METAL" + } + ], + "dryIceWeight": { + "units": "KG", + "value": 68.0 + } + }, + "trackingNumber": "756477399" + } + ] + }, + "labelResponseOptions": "LABEL", + "accountNumber": { + "value": "Your account number" + }, + "shipAction": "CONFIRM", + "processingOptionType": "ALLOW_ASYNCHRONOUS", + "oneLabelAtATime": true +} \ No newline at end of file diff --git a/modules/connectors/fedex/schemas/shipping_response.json b/modules/connectors/fedex/schemas/shipping_response.json new file mode 100644 index 0000000000..5190119241 --- /dev/null +++ b/modules/connectors/fedex/schemas/shipping_response.json @@ -0,0 +1,521 @@ +{ + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "output": { + "transactionShipments": [ + { + "serviceType": "STANDARD_OVERNIGHT", + "shipDatestamp": "2010-03-04", + "serviceCategory": "EXPRESS", + "shipmentDocuments": [ + { + "contentKey": "content key", + "copiesToPrint": 10, + "contentType": "COMMERCIAL_INVOICE", + "trackingNumber": "794953535000", + "docType": "PDF", + "alerts": [ + { + "code": "SHIP.RECIPIENT.POSTALCITY.MISMATCH", + "alertType": "NOTE", + "message": "Recipient Postal-City Mismatch." + } + ], + "encodedLabel": "JVBERi0xLjQKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwovUGFnZXMgMyAwIFIKPj4KZW5kb2JqCjIgMCBvYmoKPDwKL1R5cGUgL091dGxpbmVzCi9Db3VudCAwCj4+CmVuZG9iagozIDAgb2JqCjw8Ci9UeXBlIC9QYWdlcwovQ291bnQgMwovS2lkcyBbMTggMCBSIDE5IDAgUiAyMCAwIFJdCj4+CmVuZG9iago0IDAgb2JqClsvUERGIC9UZXh0IC9JbWFnZUIgL0ltYWdlQyAvSW1hZ2VJXQplbmRvYmoKNSAwIG9iago8PAovVHlwZSAvRm9udAovU3VidHlwZSAvVHlwZTEKL0Jhc2VGb250IC9IZWx2ZXRpY2EKL0VuY29kaW5nIC9NYWNSb21hbkVuY29kaW5nCj4+CmVuZG9iago2IDAgb2JqCjw8Ci9UeXBlIC9Gb250Ci9TdWJ0eXBlIC9UeXBlMQovQmFzZUZvbnQgL0hlbHZldGljYS1Cb2xkCi9FbmNvZGluZyAvTWFjUm9tYW5FbmNvZGluZwo+PgplbmRvYmoKNyAwIG9iago8PAovVHlwZSAvRm9udAovU3VidHlwZSAvVHlwZTEKL0Jhc2VGb250IC9IZWx2ZXRpY2EtT2JsaXF1ZQovRW5jb2RpbmcgL01hY1JvbWFuRW5jb2RpbmcKPj4KZW5kb2JqCjggMCBvYmoKPDwKL1R5cGUgL0ZvbnQKL1N1YnR5cGUgL1R5cGUxCi9CYXNlRm9udCAvSGVsdmV0aWNhLUJvbGRPYmxpcXVlCi9FbmNvZGluZyAvTWFjUm9tYW5FbmNvZGluZwo+PgplbmRvYmoKOSAwIG9iago8PAovVHlwZSAvRm9udAovU3VidHlwZSAvVHlwZTEKL0Jhc2VGb250IC9Db3VyaWVyCi9FbmNvZGluZyAvTWFjUm9tYW5FbmNvZGluZwo+PgplbmRvYmoKMTAgMCBvYmoKPDwKL1R5cGUgL0ZvbnQKL1N1YnR5cGUgL1R5cGUxCi9CYXNlRm9udCAvQ291cmllci1Cb2xkCi9FbmNvZGluZyAvTWFjUm9tYW5FbmNvZGluZwo+PgplbmRvYmoKMTEgMCBvYmoKPDwKL1R5cGUgL0ZvbnQKL1N1YnR5cGUgL1R5cGUxCi9CYXNlRm9udCAvQ291cmllci1PYmxpcXVlCi9FbmNvZGluZyAvTWFjUm9tYW5FbmNvZGluZwo+PgplbmRvYmoKMTIgMCBvYmoKPDwKL1R5cGUgL0ZvbnQKL1N1YnR5cGUgL1R5cGUxCi9CYXNlRm9udCAvQ291cmllci1Cb2xkT2JsaXF1ZQovRW5jb2RpbmcgL01hY1JvbWFuRW5jb2RpbmcKPj4KZW5kb2JqCjEzIDAgb2JqCjw8Ci9UeXBlIC9Gb250Ci9TdWJ0eXBlIC9UeXBlMQovQmFzZUZvbnQgL1RpbWVzLVJvbWFuCi9FbmNvZGluZyAvTWFjUm9tYW5FbmNvZGluZwo+PgplbmRvYmoKMTQgMCBvYmoKPDwKL1R5cGUgL0ZvbnQKL1N1YnR5cGUgL1R5cGUxCi9CYXNlRm9udCAvVGltZXMtQm9sZAovRW5jb2RpbmcgL01hY1JvbWFuRW5jb2RpbmcKPj4KZW5kb2JqCjE1IDAgb2JqCjw8Ci9UeXBlIC9Gb250Ci9TdWJ0eXBlIC9UeXBlMQovQmFzZUZvbnQgL1RpbWVzLUl0YWxpYwovRW5jb2RpbmcgL01hY1JvbWFuRW5jb2RpbmcKPj4KZW5kb2JqCjE2IDAgb2JqCjw8Ci9UeXBlIC9Gb250Ci9TdWJ0eXBlIC9UeXBlMQovQmFzZUZvbnQgL1RpbWVzLUJvbGRJdGFsaWMKL0VuY29kaW5nIC9NYWNSb21hbkVuY29kaW5nCj4+CmVuZG9iagoxNyAwIG9iaiAKPDwKL0NyZWF0aW9uRGF0ZSAoRDoyMDAzKQovUHJvZHVjZXIgKEZlZEV4IFNlcnZpY2VzKQovVGl0bGUgKEZlZEV4IFNoaXBwaW5nIExhYmVsKQ0vQ3JlYXRvciAoRmVkRXggQ3VzdG9tZXIgQXV0b21hdGlvbikNL0F1dGhvciAoQ0xTIFZlcnNpb24gNTEyMDEzNSkKPj4KZW5kb2JqCjE4IDAgb2JqCjw8Ci9UeXBlIC9QYWdlDS9QYXJlbnQgMyAwIFIKL1Jlc291cmNlcyA8PCAvUHJvY1NldCA0IDAgUiAKIC9Gb250IDw8IC9GMSA1IDAgUiAKL0YyIDYgMCBSIAovRjMgNyAwIFIgCi9GNCA4IDAgUiAKL0Y1IDkgMCBSIAovRjYgMTAgMCBSIAovRjcgMTEgMCBSIAovRjggMTIgMCBSIAovRjkgMTMgMCBSIAovRjEwIDE0IDAgUiAKL0YxMSAxNSAwIFIgCi9GMTIgMTYgMCBSIAogPj4KL1hPYmplY3QgPDwgL0ZlZEV4RXhwcmVzcyAyMyAwIFIKL0V4cHJlc3NFIDI0IDAgUgovYmFyY29kZTAgMjUgMCBSCi9GZWRFeEV4cHJlc3MgMjYgMCBSCi9FeHByZXNzRSAyNyAwIFIKPj4KPj4KL01lZGlhQm94IFswIDAgMjg4IDQzMl0KL1RyaW1Cb3hbMCAwIDI4OCA0MzJdCi9Db250ZW50cyAyMSAwIFIKL1JvdGF0ZSAwPj4KZW5kb2JqCjE5IDAgb2JqCjw8Ci9UeXBlIC9QYWdlDS9QYXJlbnQgMyAwIFIKL1Jlc291cmNlcyA8PCAvUHJvY1NldCA0IDAgUiAKIC9Gb250IDw8IC9GMSA1IDAgUiAKL0YyIDYgMCBSIAovRjMgNyAwIFIgCi9GNCA4IDAgUiAKL0Y1IDkgMCBSIAovRjYgMTAgMCBSIAovRjcgMTEgMCBSIAovRjggMTIgMCBSIAovRjkgMTMgMCBSIAovRjEwIDE0IDAgUiAKL0YxMSAxNSAwIFIgCi9GMTIgMTYgMCBSIAogPj4KL1hPYmplY3QgPDwgL0ZlZEV4RXhwcmVzcyAyMyAwIFIKL0V4cHJlc3NFIDI0IDAgUgovYmFyY29kZTAgMjUgMCBSCi9GZWRFeEV4cHJlc3MgMjYgMCBSCi9FeHByZXNzRSAyNyAwIFIKPj4KPj4KL01lZGlhQm94IFswIDAgMjg4IDQzMl0KL1RyaW1Cb3hbMCAwIDI4OCA0MzJdCi9Db250ZW50cyAyMiAwIFIKL1JvdGF0ZSAwPj4KZW5kb2JqCjIwIDAgb2JqCjw8Ci9UeXBlIC9QYWdlDS9QYXJlbnQgMyAwIFIKL1Jlc291cmNlcyA8PCAvUHJvY1NldCA0IDAgUiAKIC9Gb250IDw8IC9GMSA1IDAgUiAKL0YyIDYgMCBSIAovRjMgNyAwIFIgCi9GNCA4IDAgUiAKL0Y1IDkgMCBSIAovRjYgMTAgMCBSIAovRjcgMTEgMCBSIAovRjggMTIgMCBSIAovRjkgMTMgMCBSIAovRjEwIDE0IDAgUiAKL0YxMSAxNSAwIFIgCi9GMTIgMTYgMCBSIAogPj4KL1hPYmplY3QgPDwgL0ZlZEV4RXhwcmVzcyAyMyAwIFIKL0V4cHJlc3NFIDI0IDAgUgovYmFyY29kZTAgMjUgMCBSCi9GZWRFeEV4cHJlc3MgMjYgMCBSCi9FeHByZXNzRSAyNyAwIFIKPj4KPj4KL01lZGlhQm94IFswIDAgMjg4IDQzMl0KL1RyaW1Cb3hbMCAwIDI4OCA0MzJdCi9Db250ZW50cyAyMiAwIFIKL1JvdGF0ZSAwPj4KZW5kb2JqCjIxIDAgb2JqCjw8IC9MZW5ndGggMjYwNwovRmlsdGVyIFsvQVNDSUk4NURlY29kZSAvRmxhdGVEZWNvZGVdIAo+PgpzdHJlYW0KR2F0PS45bGpPSigjPHJOcnJGcTMsYiJRSVxAQjxYWyVnJUNWQl86XjhCWFJQUmw1NyZTVS9eRlBMZTJpaFpMTV1STl9gZSs7XjQnbCtEKGYKTWk3SDVjalozczUiOk0qYGVsL3BFUjlUXSRwKj1XKCw9ZVcudWdJbGR0Y1ckYlM5TUJpOz89aSJUTDRPMyVcdEU9J21eS3M1P1RsXVNzPjQKXClQPT0uaVUxSCR0NFkkaDxcYCw/NWFSLm1kRHJPQ0E1SzIxKCNILTFkOiZZQkhPO1lrMjZxUClYWnRROVJYNnFddC46J3EvMUo7Slw3RFMKTTglZ0VBJSgxYzEpZGk9XVVeXllQcWFGWUFGRWo7aHU5amM/TCdoUUlCRWZiLCFJLzBrRnJIXi9KZEEzXVw9RUlPTVswRixpbS9cbyEwLD8KUlM1SyhwM1ZbaF4zUjNkbC5gKm1bQHRaJF5MVlcxUUFlaGAqREVuZ3EhTHAqLExQW289TSpgVWoqYyk8b1o6R2E0LSVVJSNLKTw4Nix0SXMKcnIpWlttZXMzQltESyNQcVgybUZGU1tcYGBUbGphPiQ6XkdyaiooIXA/YmRGVz1eJS0nIWRSTzokLFNVTi1pRXNqaV9GXiMpT0NLW1BDUEMKLCRQUWZnMmpASE51KWc+XCooOVlTNDJEXEEvbXR0NjhaXnNNcmpwKlBiX3BNMyJUX1gkLyJRJUM9KU8mNydrXWYrYUEpLT09OVtjcF4kW1AKQkA+SykyKVw1JWQ8ayY6IV9NSyJbU24wJiM4SHVyIW8jWlEpTWQtSUs9L2U3M2VGUVo0OkVpdDdXcl9RbFwxP0RlRTEzNEM6LipDYFYjO0wKXlJfISo4ITFWODZSKDxrIm0lSFYoNWcvO1QrUi83X3RwWmloSj9OJWVSR2t0TjkxXSRrM0AtXUUnSVVHbm4lXDlFcEVBa104LC5tQzpoKjIKYj02dTFBPyEzXyVORzAwQXBxO0dYVCxCUTJlbSZFcShMXF42TWNqQGYoMCdoMXF0Ry5mbC40YjJsalBQWzldcE9iRC5rZCQnbzhLZismQj0KNnQzPlJaR1c9bmxjOCs1XChbcTYvVWgnTmtaU2tfPlFQazU2Vy9oODduJjIxPyFaaWBnUllwRmhebjZHRjgzQE5EZyFURiU5SFVJUDNbYDQKbilkaklcOXMiJmxVUVolV1QtISlkY11IUFlmTUQ1bCZWI3RAcz5oXUM0aVE0a1YjIzRxZC10S3FyKTghXydIIz1GZSE2U2k1Zmtycmc5WFQKNEVBXTE4LWZzJHBfN2tRRUBHQTU5Jy1dXFNSOSQ8TGtrY2JqY1xkUyIqMFktPVdZVW4zL0NaTTBtY2xjSFRqX3VWRExxRmc9WkFkVXFyIjUKJTUrO1s2M1g3Y3FlU2AjTDUoWzlWUDE3LWNFWjhBTFNAbFAlLl5aXFVEJyJucypRYFo1K0BzPSxcOCw6LFg5Oi47PXQ2MVNbcVhTQ0MvWkMKUyJePCpwLixDTktJZUgyVkNqWD80ISFUSS0qL0NrMms5UE5tMDVQal5pNkVlOUVGSDgpc11mXCxgdWkoWWxkVWJXX05gTC4+LmxNIjMlPGwKLEZPOV0hVUROXExFWV91YFpSOVAxaDZxcWhlWitAcSVUKnVoaDdObyVASWpbLj4tMHFnWCdbPFt0XmZPSyktYFQ+LEdRLlluYD1vVnI7ODcKWERfQ1dTUVpVMWtPQmFVME1vVklCLVgxQClSMlNkQmduTChlcm8hZGpiQVpGWi5xOE1dc2JwO2xSRjNeRF9lN1gzPmonTFRONFM3UXFSaFAKUF9sMCEmdSI+czlzKihfWVdlSV83bE1fNWkoOWRYQipxVjFTIldnKWRjOlBJNmkwPWMtdC5OYSEiR1lxIkdDJ09YUFQ9PCQxIiZpLlZiR1MKMk1lW1JGQSZLXW9yU1luZTwkXlAkXExFU2k4ZG4vJEVkSU8lUTZJP0Q4SVJII1xZTmNjWVEoK0VSaC4lRk1Yb1Q9dWxoaTtvaz5XbzA/SGsKQDEnK0NRKzEtRDJgZSY1TjlaK3JpPF42KGs2ZFY6XHVfMFE/UDZTRzp1WE5LNnJTZVJAbC9wLjJzUHIkWSZkJ2M3OEBpXCVCOllbJVpPRm4KXzAram1IbnEmN1U+U2JpWis1XWA+YzZbN2lkSURxZGxzRSFbWSt1bVZcIVVXSGpbYUlVKDxQanJEQ0UoJEpGc3JMSyFOISh1KkohS2xxXEMKYk1cUkg3cyQ/OltxYGVmWSM+VXM7RzlrLFNpXW88WFZFPSpTVkQyPEdDP0R0WG4sOTU1IjUuJWA6OXFTK2ZJKVhFaGJnc2kmWlFncjhpb2wKZ3U4b0QpV2FeI2xdbWtKcFJHbjJSKEFdPjhtSjlVOVA5YzxrVy9GYj4rWkdaLyopRilPUlUjOE5rTUU1JEw8dDZpdXNtTi5IajpSTUpzbEUKO15nI1ZZVD1nRUYwOmVwJDxYTFVGRjQxY1VObEw7alRtMDg7XmUqblMwIzpvbFA4RixBTmMza1ZjTk9qX0tvZTFmVlNFLUxfMClcTl9uYTMKS0YhOFMtLU0yaSldPVc9aiVRQWhvYTpOQkFQb0NpTzEoPj0uXyY0c1VXN3VsQElzWV4/MGRgVGA6WEpKbltVVjEhRmcqcEMwLEFmNj1GdD4KJlBDU2pDY0hWQmYtcytQMD1fW05VTHVwZGUuPSpMXWc9SlxRdCgxPypPcUE5LyVBPXRYJTBXLllRZ1tsYjhFb1dZN000PyViNGIuOnVYTUgKQDtRaUNbdCJJNT8vSVtcV1NmZ01gKUMuZWAwY2U1PXJYb2dGajtEa1RrPUVEKyxxX1ddV1QxcWMzVkJzZXJTUCNLajFILy0qNlJySnQqcEQKXio5NlA1V1JKWzNKRFVFJUUyXmklIT1zYlBSXXJeMThoP09VTm1jPWZIUSpIaGU0Myw9QSghdU0+NjxeYiVVYkdRQTU+LGpLKExNZ2AxM0cKZTw6RE0+Q0QhS2RGKEQpblgrRitoVkcwMy5uLEJsTzZZdSM9ZChbaktkRGstciswP09eOUxxVDpCSDBQMTUrblw5WUBdYlxobmdXa0stXF0KZ0dWOlBEOlBTai8jJGtnYUktL2xHU2w/QjU8YVMrNGVbdVYlSWw5US1tXCYhX2w9UTZtSyJccUonWEBjX3RYaiI2K1luckhiKmNyU2VRVz0KUkFwRiFwJShbJUosIVVOSDI3OENUMEUySFJwLF9OcWBdIiYyZltxRCVLUz5aX29eZjU7SWgxV24mUF5TMkVFLzI2b09RZCVuJWFSJ18xQiMKMTlEaSVpUEc/OystQj9QVHAnQmdvKU1YLiwrcUtocjdiUkNyVll0Nys4IVc3Py9OM1hGZUhmMElMM25PZURSPTIxXkI1WjhMTSM5ZzdbbzEKaHU+TGNtSmxTS1M4QX4+CmVuZHN0cmVhbQplbmRvYmoKMjIgMCBvYmoKPDwgL0xlbmd0aCAzMDY0Ci9GaWx0ZXIgWy9BU0NJSTg1RGVjb2RlIC9GbGF0ZURlY29kZV0gCj4+CnN0cmVhbQpHYXQ9Lj1gWUxsKDROLzJzNT9yNVFeTGguZEQjKykhSU1vP2ZPTldURWJmIS1FJG82KUJGZzNEcFhlO3QoPDAhPzI2QTMqTD5eREBlKEtmMwozb1YiWFh1NjJoYGFmM1pQUjhSaVYkNzNTJF8rR0dnY09MUTVkWipxPGwtXWwoWSFIXUhbZUF1NWxSVVgtMDUqbCE8bilULitoNSheRVNnUApWKEpBSiJFUjVaPSQ/Pz9pYkVLcFJETkxhczg5cTUhLltaa0xrI0FsczRuWFdNMz1pZVBsLjVkPkptQmhdODdcbEBLbk5pMllVPyUuPjBvWApUaE4+bW1iOz8mI0lAXFA9a3AjST1lNVFJXF4oNk5IKnM3NFdxQUhAKmxGP1RgSUNUQEpiMmd0RSVpO2sjNEdxWnBpZiMnbztxWWgtSCZOTgooazNTOFplbSpyMEgwJDQ0dHVxRDBQLj5UNnQyYj0yWDFDQGBcOHAtSSIqc0wxdVtfMkJKSC9nXFtpOG9VOF9bJEM5RSs6SFddTUFTPUchRwpeZTZzRmY+a2c8SUAlXkBwLTJuaD9OR1c+aVdkQzVEVEsjMXMlYSNEMSQrKnNTbG05ZFZwQXFFPDFERGdnUTVKJVRfO2NeYVlaNTdbcjZoVwojK3RHIVA7cjkjSiJrOTJBW2FAZExRaVlibzorNEElaUIhYGcvcEJZTm5acGtOW0VxcTUmZzNvVzFWa1xuQFk1VUYmNm0+UkQvXFxeXWhIWAooKDVGQic/M1VBPT1fZWU+aTgzYTxVWyRBX1QyNF9aLFFZPyNmXWJPPkJpQz9tZko0aWhHRCtcI0FqOWBfX1YyVWNgJyhrRnU7SS9XRTRcJgolVmQiW2NIXWZVU3JVZmwwQGQ8LjsuTGJFPCxgN2UuZSklcCpFIk4pQk9SIWFPZTUjTVg3YzQtXWoiSE9SLGBQKEJkJlU5ajdQNF5DKmcqWQo0STZuIUhPNmE6M29tSUkhQCI+cllaOzkoRCk7WS1qYkc3MXFfZlBCRV0+IVhPM2NfaTdNZGJsYU1DbVM8XSknSFMvcj02SDkwMGcsRklURgo0KGRzPkhNMENeNnFGLD1xWy44KzJRZFpWYkcuOk9cWHJjcUNDO1NNI1ZYLk4tSl9kN0pEITpVKlNfV1k4ZnIsQSooSnVBT1M1bSM+PCItawpoJlNPZD07PERXTGsmO1JUKm82LzotdE9dZWQ6OlVMIV0hTDcpKXFGUSYjNThrXGNQdDxdYnBPNz9QcWhxIWs1WjFdRiprOD1WO1tGKklaNwomdEtRNitBQy5LMEYjXVpeIkprXCVsUSI/WUU6VDhLZColQk0qZV4/LUQmV11DRjIidWIhbjJwXmddRFdVTCYzaiU0Qjo4Y1FiNUhCOlUzbwo4OmQkVjY1NzNdQzg8WiVYYT1KXFVtL2xUUl1uVWk3UGFER1ZRUSg5LSY7Zz9LbENiN0EsRC1QVjhBQks9TiFdMT1KQTo7XTNmMj9PPTVXUAplND0vakxUVFFuKUEyTDohMSdSR2FfWFx0WGpnT0FSI0BFOzFgaTA2Tk11R1NFRltCTS5TTFBuLHIwSjQrNSIqTWEnLi4lOyVvODosUEdJcApMPipgRjlTQjtNOThgcTUvaUdSLFtvSm1HUixPTDw3IickJVcrMixsTWNqTSpOJHMzTEBtW1EpbyxXVF1CYmNVUTsjbHAnX3FSJkQmMicpOgpxKD4kUzEoZks3KGY6czRhSjFRSFtHYWFsOTo6YnNdYDlUOGsoTkQxYUpjT0g4PGIlVEJ1ODxqT2opLW0qJSxuVWQ0L1JyISVhNjsjRmFCOQo3UyMuSyxaVT40NmwrYFtPOWtjZGxTJnA+LTdtRCdkXjg6XyFFYmRTTVlKZ0QnVW1mXC02a28lPmFlLT5bSF9vOT1KQTolW2tXVGNOKyMrRQpcbTU8JWFKNC9tRTM6WS1uZUs5PSElYThRcUJncnJMTkFaOFEwXEslTkNXSG5MKXM6R2FEQFs/IkNQcWBUUzkhQFY4UnRFMGNRZyNURyJZMAo0dSFvQlBtZ2haW1JZJksnIidHWDAtbkg0OVhvc19YVS5ZTGB0NGpZYmFpaVBhczBhcEowamRVPG8jLCc5Qjs0YS8mZUc0PUdVT2E+UitZbgo0PVpRP0QqaERHQVQ1KnVpRyQuQUgkISkqVVRBRnAxUVJnSyElYThRW2NxZyw8KkU3Km1jUWcyVjhETEcsPz4yZmReNjloY2BRMFc6aF9XbAosPFNcJiwqMjxaVlpfSFlRJk5wMCFFYylQOVdLM05KPkppcjBSbkM5L0AxKWtYczgqRmRfbUgnPTpqRklLNihnZjBYNXBFX1BRTy49dURyYQovc1UvTktMQUghcW9WJ0hOQSo1ME0rajAxJSlFRi5tNnVvIjonIlRMJzVRLmY2RmFzaUUwI1I/IktmJnNBZ1YtJyElcTghajdjRmc6PiFkdApNTXRYXD5VZ0Q1XG0/b00jKCpfNmpcbC9HYU1fYm1gWVpMZzE5amxeMDgpdTBnKW8hYGJeVCEqJFh1ZSg+W20lU201JVhaLl8vUzJiMStBKwpsPUJpSl07PFhvNFAla0hcM3VtdDU2SmBMXzMpTionKF0kJVFbNmUrSHEqKmI3KE5VU1ohJjNhVikjI05TJDNHVmVVI2cwJCVBb2FmLj5BKAo2YiNPVCJEYCxzKHJFKylNMD5GREo0akk6bTVlWVVRY2MsWUZpIiwyUS0jWVQ6YEw7QTJgMHMjLTgoUypxTVxzPjtnODNSZVoiQnVJO1p0Wgo9YSdzViJEPiIyaTtiRSssOlZDP18jUSpROGMqbkIpWV1ANlgnMUldTStiNEhfQTFGRGNjKTtPPmZZaElKNG5CYG0xMWRmaSVcM08qWlA+awowcVM+Qmk4RDlgQ145Vk8uJHFwbEJuPFAsVUxbJT4iW20jM21VWCNjL0xER0ZwPHAxJ1teXEdVNCM+ZE1RL0VRJFYkKjBgcWQjRTdCY2wmOQorYCdAJklaY1MkXD1WaGFUQWZfL1prKCVUNWA9QU4hST0lcjo+PT1MQThqU2FPK1hlKUVQSiFRVm4yckhsV0pbVjUnck1gY21XaXIpZypzcApAP0xCX0AzOSkoV09xWU9VIlcpblpPNzAwbzAtRW1kVCFYJjw7QSpsRmx1QzliRGIuLm4/MVE0MFgiTlhsPzlGOlBoVURkLypELUJDMD50NQpHUiliJ1thZ2AjTygpJilOdFFyLDVPWVl0WS5USEFScWdKYipSXmkkUSw2dWNDL2lOS15LOztdIllBNSRiaWRPPVtUTGs8RU8hLS5oOyc7KwonWHQtXkhFbDpDTVleQiFWWXA6LT1iIzQ9U1gpVi5tJUtSW2dzUC5nSFoudWFwTiFVQkRgKE8xak91YDNZKEN0Tk1kZC49aVduN1dXazY1VwokYWA4KkJMMC1XMlZbNF1RU2w7OTpBI08wbi5AKk9qNkckbEdfImZRSVlnO0BbcUxvYycjJURWXmlmVSpbK0Q+M21VMEA7YjpQN11YMldAJQpYT0JmPiknbm9XYWI+KSdtJEciRzRkVilfIiZyWGNVcUE5PGA9ZzBUbWwwP08kWFlTTVE1K2thcFkwXmtlMCtMcj07PjE5WnMmZj1FMStDYwpiJDsuMVUmJ01LR2RrMWlUal1eRElKYEAhRWtaVWRFPDFaX0VvRHE9aTBMVkkjKDhHZl1vJWQ8VjZwMjgkY0BQO0QwbGw3XWVRYV4mOEFdJgpIY01ZODgpbUIhXDJmPCZgVDpfbEskMUxqP29IJDZfL0tnSC45cDFhJXRFPjRybUx1OW0lMi5cQV9eY0wwOixlMi5lKEUuaiFfI01bP2E4cApBZWlOa1xCc2VpcjpBPVlVVDQnRFBEK2JdWktfdG5GaydaWzU5YiwwOWwnJCVATEJHNztKXVE0ZW0/U1FiQWU+Ymw2YEc8bUxtJVtcLTIxOwpPTHFHbj9fMlVhT287aTZTPkQ4JCRDRSIwKGRXL1ZgaiFTQ29gJyJicVpDPzJbR2xSZyxMKl5kSFcwaGFxVlxOKX4+CmVuZHN0cmVhbQplbmRvYmoKMjMgMCBvYmoKPDwgL1R5cGUgL1hPYmplY3QKL1N1YnR5cGUgL0ltYWdlCi9XaWR0aCAxMTgKL0hlaWdodCA0OQovQ29sb3JTcGFjZSAvRGV2aWNlR3JheQovQml0c1BlckNvbXBvbmVudCA4Ci9MZW5ndGggNDYxCi9GaWx0ZXIgWy9BU0NJSTg1RGVjb2RlIC9GbGF0ZURlY29kZV0KPj5zdHJlYW0KR2IiL2VKSV1SPyNYblhrVDZBPlhLbkRiV0IiTVpFYWpQcGQ0XScoXkBSbHQia0IiUzAkZiU/PW09NEM7Oy4kTihqUmNZUiVzZCZsOSRPdF4KKSY3PUwoNy1lcXFlQC4oL1NDOTg0LWZMWGVMWjVxY1o1bEFFQjU1PjNAMD1rIjtSaDJoQmNRTDMmSj81b1tjSDBiU0ZOXjw7O0A0MVNZOW0KYyJaST1ZbCNjNClgXyJZbG1OMyUuQS5sTlNgVmUvWTwlPy43KCgpLy5kQls7ayFKWyUnJURKXEk/K2E3OjVvTmtZXHFFUz4zPEk1YlptKEkKJWQ8QEIpOERidDNwS0djbGJRazEnaVpWczdOTTBcbyZSKnFVPmdIdS1GckNraDxrSEZHKlwkTT1fc1YvLSRcSkY6ZS8/PmZYQStDQ21wRGUKZFNQNkdjdSxcWCdBTD1hNUpDWzQ2Ry5ocDI9VTRlXiRlb1xRI2IqbTdDOCQtSkEoY1o/WWAnQzs2SnBIZVBsXCRIRUMhdV4qUWErNmdFTWsKW2ZFVipiLiM+cHI+LVdTZiM+aCZXP3Vra1RzaFlgPS9YLjY2QSo7YmlzL2RnQFFYWHNyOG07fj4KZW5kc3RyZWFtCmVuZG9iagoyNCAwIG9iago8PCAvVHlwZSAvWE9iamVjdAovU3VidHlwZSAvSW1hZ2UKL1dpZHRoIDU0Ci9IZWlnaHQgNTQKL0NvbG9yU3BhY2UgL0RldmljZUdyYXkKL0JpdHNQZXJDb21wb25lbnQgOAovTGVuZ3RoIDc3Ci9GaWx0ZXIgWy9BU0NJSTg1RGVjb2RlIC9GbGF0ZURlY29kZV0KPj5zdHJlYW0KR2IiMEpkMFRkcSRqNG9GXlUsIkhUczlFSUU7MEFULF9FKkxaJW9AN0psNVY7SCdDcz1UcnFEYUguNEJmI2M0T1ZUOyhkI2Y8R0U5fj4KZW5kc3RyZWFtCmVuZG9iagoyNSAwIG9iago8PCAvVHlwZSAvWE9iamVjdAovU3VidHlwZSAvSW1hZ2UKL1dpZHRoIDI3NwovSGVpZ2h0IDczCi9Db2xvclNwYWNlIC9EZXZpY2VHcmF5Ci9CaXRzUGVyQ29tcG9uZW50IDgKL0xlbmd0aCAxMzk0Ci9GaWx0ZXIgWy9BU0NJSTg1RGVjb2RlIC9GbGF0ZURlY29kZV0KPj5zdHJlYW0KR2IiL2NnUSE0LSRxJ2pqNUwjcFpHdTY9I0g/JWghJFonRWs9WCZuTU9vK0xPY1gvbXImKVZsP0ttSitFbkU5ISNrSSNwOTYyYy02LE11dUEKb0ZaSG08JnBIZ1NgJEAobS03LVVRKDckSV1fSl5ZU0E3bScpQiY5LVo7Oz1aNT03Xj5KZEhedFRxcWYqXz1JLWQqb0BVWjpjT1soIWFJTGEKYjByalFXUDslUFhjP3M8cFRbTzFiI0trUEVgdUVCV1xKUl47dVxrPjRSVjlmNGdoIjYzSnU2ZUgtQit1QzE8IjdpVVdbU1cqOllYalpjIygKQjdfQFpCWmM1T1w8cEQ8Q0RrTmVMYTE3O0o+TV5qMmovMWUrJV9sLTctSStaV1U0NCkvWDFzMCZXMEsiUElwOWZWPyYpSUMqWkNiNWtrZ1MKL1JgMGlGNkNibS4/RyZQJiZMRnNVKkZsWlVgbSpBKDxaWi9pb1lEWmFdL2phJ1I5Jjk5SUhLVF8uVTA4LzZlZ1NBZkI8NF9dQT8jO1wsJi0KIkQiZkBrJTVDTzZGZDhyXW8ldU1hOCdFcXEmTS5hOFxgJFRpciMvdCwvO1NWMFAiOjkkX2VuNFBpaVhFUW4hY1BeLyxUZjlkaEJkJ0kuZUEKUW9QISkmMj42IUUqKlgrVTtcbWBKYWVhRyUiY3BdMidaNV9dTUtEVUc2WVpVKDxUbzJCbXMjdDlZbG5uWG83IzMkJDAhbSluLFJQYGApcm8KN09gNT5LYjcrdCYyJFRST0M0YjVQXFgpYCs/PStmLXJtc10yQj0/bzJXWnVgVmBHbjdrYG4sdFVJYjtzckJxRUw3NjJdIyFTYGMoRGtTX0gKWCYrc1lyVFw7PU1MRD1cZCp1S2ZWWXRmKkUjS0A8bFRbO24vbjNNLyw+LSFZQmpoKm41Vjg0U0VaJ2FlUC1Hb14pSCdwI1cvNHJuRTQraTEKK0lCRlA1Uys0PThGOSU3Tyo6ZipuM0otYTc2MmIzYiFOV0hWKWhGK21iLC1VLUU5U05oST4sVSo8LkdtcC0pMiQvLztJOm4+W2I3cUljKDYKcElAI05UZSlHY0s3YFliUFRmZERhbiNLbVBdV145KDZqbGNMQlFlVzdxTCMjPDNlNW8rPC0pNGNsNFR1XFwoYFNiJm8qRUAnYytqam1aUCoKNE5nRkdFXiQmOi4mXyVQRkBONWQ1dSFgR1Y2bylVS0c3OCsmW1A6TGIlMnRRNC9DbF9OTltXI3A/XkxqNCRtVlZTZCZOMCwzPUA4J0xRKHQKTGBuZWAvWXM4aiwlbSVQOl9xMnItbWRjPVhYNSY+OiNZO24+LipHcGZtVyc8OE9fRWtsPSkkTi9HRCtRSFhyWD5HLCVpYUtzRlBDNjVfLE0KQD8yXic5Mk1JVz8kZ2s1aEQ+YGtuOzFPLSViazVuXVteOj5QX0YsaWIzM3ErW249OCFibkBBbGViMltVU2NoT0VrXVdpV189KCQxOjM4KTsKIklWbHFLNDFOK1BsNjxBOmk4Uyg0PSc1cChjV2RCQmQtZSNgMVdoOzs6QXQzQ3Q+YURLQklQaWNdKzMyXTtnXTRXWEVDM2drPFBMMnFnLHMKJG5FSDJqP14haFMrUztVTGR0U2pAYV9fYjtsQGprRlxvPUs1PCgxUSRzP3BjJGZzLi5abUE9dD47X0UpRzVjNzkocyokJFZCITA2WyEoLGUKLVUzTFJKbCQwWFxKT1loQjYtdSsoV28oVCMsVD0qLVVkPiU8V3FTXmVqKyUrZWRqXksiVnNIMi5wSCZXYT5sdUxOMDRPWUo0TkJoZz9DcSwKLi9zS19UPElEX1AkQCc0fj4KZW5kc3RyZWFtCmVuZG9iagoyNiAwIG9iago8PCAvVHlwZSAvWE9iamVjdAovU3VidHlwZSAvSW1hZ2UKL1dpZHRoIDExOAovSGVpZ2h0IDQ5Ci9Db2xvclNwYWNlIC9EZXZpY2VHcmF5Ci9CaXRzUGVyQ29tcG9uZW50IDgKL0xlbmd0aCA0NjEKL0ZpbHRlciBbL0FTQ0lJODVEZWNvZGUgL0ZsYXRlRGVjb2RlXQo+PnN0cmVhbQpHYiIvZUpJXVI/I1huWGtUNkE+WEtuRGJXQiJNWkVhalBwZDRdJyheQFJsdCJrQiJTMCRmJT89bT00Qzs7LiROKGpSY1lSJXNkJmw5JE90XgopJjc9TCg3LWVxcWVALigvU0M5ODQtZkxYZUxaNXFjWjVsQUVCNTU+M0AwPWsiO1JoMmhCY1FMMyZKPzVvW2NIMGJTRk5ePDs7QDQxU1k5bQpjIlpJPVlsI2M0KWBfIllsbU4zJS5BLmxOU2BWZS9ZPCU/LjcoKCkvLmRCWztrIUpbJSclREpcST8rYTc6NW9Oa1lccUVTPjM8STViWm0oSQolZDxAQik4RGJ0M3BLR2NsYlFrMSdpWlZzN05NMFxvJlIqcVU+Z0h1LUZyQ2toPGtIRkcqXCRNPV9zVi8tJFxKRjplLz8+ZlhBK0NDbXBEZQpkU1A2R2N1LFxYJ0FMPWE1SkNbNDZHLmhwMj1VNGVeJGVvXFEjYiptN0M4JC1KQShjWj9ZYCdDOzZKcEhlUGxcJEhFQyF1XipRYSs2Z0VNawpbZkVWKmIuIz5wcj4tV1NmIz5oJlc/dWtrVHNoWWA9L1guNjZBKjtiaXMvZGdAUVhYc3I4bTt+PgplbmRzdHJlYW0KZW5kb2JqCjI3IDAgb2JqCjw8IC9UeXBlIC9YT2JqZWN0Ci9TdWJ0eXBlIC9JbWFnZQovV2lkdGggNTQKL0hlaWdodCA1NAovQ29sb3JTcGFjZSAvRGV2aWNlR3JheQovQml0c1BlckNvbXBvbmVudCA4Ci9MZW5ndGggNzcKL0ZpbHRlciBbL0FTQ0lJODVEZWNvZGUgL0ZsYXRlRGVjb2RlXQo+PnN0cmVhbQpHYiIwSmQwVGRxJGo0b0ZeVSwiSFRzOUVJRTswQVQsX0UqTFolb0A3Smw1VjtIJ0NzPVRycURhSC40QmYjYzRPVlQ7KGQjZjxHRTl+PgplbmRzdHJlYW0KZW5kb2JqCnhyZWYKMCAyOAowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwMDAwMDkgMDAwMDAgbiAKMDAwMDAwMDA1OCAwMDAwMCBuIAowMDAwMDAwMTA0IDAwMDAwIG4gCjAwMDAwMDAxNzYgMDAwMDAgbiAKMDAwMDAwMDIyOCAwMDAwMCBuIAowMDAwMDAwMzI2IDAwMDAwIG4gCjAwMDAwMDA0MjkgMDAwMDAgbiAKMDAwMDAwMDUzNSAwMDAwMCBuIAowMDAwMDAwNjQ1IDAwMDAwIG4gCjAwMDAwMDA3NDEgMDAwMDAgbiAKMDAwMDAwMDg0MyAwMDAwMCBuIAowMDAwMDAwOTQ4IDAwMDAwIG4gCjAwMDAwMDEwNTcgMDAwMDAgbiAKMDAwMDAwMTE1OCAwMDAwMCBuIAowMDAwMDAxMjU4IDAwMDAwIG4gCjAwMDAwMDEzNjAgMDAwMDAgbiAKMDAwMDAwMTQ2NiAwMDAwMCBuIAowMDAwMDAxNjM2IDAwMDAwIG4gCjAwMDAwMDIwNTMgMDAwMDAgbiAKMDAwMDAwMjQ3MCAwMDAwMCBuIAowMDAwMDAyODg3IDAwMDAwIG4gCjAwMDAwMDU1ODYgMDAwMDAgbiAKMDAwMDAwODc0MiAwMDAwMCBuIAowMDAwMDA5Mzg5IDAwMDAwIG4gCjAwMDAwMDk2NTAgMDAwMDAgbiAKMDAwMDAxMTIzMSAwMDAwMCBuIAowMDAwMDExODc4IDAwMDAwIG4gCnRyYWlsZXIKPDwKL0luZm8gMTcgMCBSCi9TaXplIDI4Ci9Sb290IDEgMCBSCj4+CnN0YXJ0eHJlZgoxMjEzOQolJUVPRgo", + "url": "https://wwwdev.idev.fedex.com/document/v2/document/retrieve/SH,794810209259_SHIPPING_P/isLabel=true&autoPrint=false" + } + ], + "pieceResponses": [ + { + "netChargeAmount": 21.45, + "transactionDetails": [ + { + "transactionDetails": "transactionDetails", + "transactionId": "12345" + } + ], + "packageDocuments": [ + { + "contentKey": "content key", + "copiesToPrint": 10, + "contentType": "COMMERCIAL_INVOICE", + "trackingNumber": "794953535000", + "docType": "PDF", + "alerts": [ + { + "code": "SHIP.RECIPIENT.POSTALCITY.MISMATCH", + "alertType": "NOTE", + "message": "Recipient Postal-City Mismatch." + } + ], + "encodedLabel": "encoded label", + "url": "https://wwwdev.idev.fedex.com/document/v2/document/retrieve/SH,794810209259_SHIPPING_P/isLabel=true&autoPrint=false" + } + ], + "acceptanceTrackingNumber": "794953535000", + "serviceCategory": "EXPRESS", + "listCustomerTotalCharge": "listCustomerTotalCharge", + "deliveryTimestamp": "2012-09-23", + "trackingIdType": "FEDEX", + "additionalChargesDiscount": 621.45, + "netListRateAmount": 1.45, + "baseRateAmount": 321.45, + "packageSequenceNumber": 215, + "netDiscountAmount": 121.45, + "codcollectionAmount": 231.45, + "masterTrackingNumber": "794953535000", + "acceptanceType": "acceptanceType", + "trackingNumber": "794953535000", + "successful": true, + "customerReferences": [ + { + "customerReferenceType": "INVOICE_NUMBER", + "value": "3686" + } + ] + } + ], + "serviceName": "FedEx 2 Day Freight", + "alerts": [ + { + "code": "SHIP.RECIPIENT.POSTALCITY.MISMATCH", + "alertType": "NOTE", + "message": "Recipient Postal-City Mismatch." + } + ], + "completedShipmentDetail": { + "completedPackageDetails": [ + { + "sequenceNumber": 256, + "operationalDetail": { + "astraHandlingText": "astraHandlingText", + "barcodes": { + "binaryBarcodes": [ + { + "type": "COMMON-2D", + "value": "string" + } + ], + "stringBarcodes": [ + { + "type": "ADDRESS", + "value": "1010062512241535917900794953544894" + } + ] + }, + "operationalInstructions": [ + { + "number": 17, + "content": "content" + } + ] + }, + "signatureOption": "DIRECT", + "trackingIds": [ + { + "formId": "0201", + "trackingIdType": "EXPRESS", + "uspsApplicationId": "92", + "trackingNumber": "49092000070120032835" + } + ], + "groupNumber": 567, + "oversizeClass": "OVERSIZE_1, OVERSIZE_2, OVERSIZE_3", + "packageRating": { + "effectiveNetDiscount": 0, + "actualRateType": "PAYOR_ACCOUNT_PACKAGE", + "packageRateDetails": [ + { + "ratedWeightMethod": "DIM", + "totalFreightDiscounts": 44.55, + "totalTaxes": 3.45, + "minimumChargeType": "CUSTOMER", + "baseCharge": 45.67, + "totalRebates": 4.56, + "rateType": "PAYOR_RETAIL_PACKAGE", + "billingWeight": { + "units": "KG", + "value": 68 + }, + "netFreight": 4.89, + "surcharges": [ + { + "amount": "string", + "surchargeType": "APPOINTMENT_DELIVERY", + "level": "PACKAGE, or SHIPMENT", + "description": "description" + } + ], + "totalSurcharges": 22.56, + "netFedExCharge": 12.56, + "netCharge": 121.56, + "currency": "USD" + } + ] + }, + "dryIceWeight": { + "units": "KG", + "value": 68 + }, + "hazardousPackageDetail": { + "regulation": "IATA", + "accessibility": "ACCESSIBLE", + "labelType": "II_YELLOW", + "containers": [ + { + "qvalue": 2, + "hazardousCommodities": [ + { + "quantity": { + "quantityType": "GROSS", + "amount": 24.56, + "units": "Kg" + }, + "options": { + "quantity": { + "quantityType": "GROSS", + "amount": 24.56, + "units": "Kg" + }, + "innerReceptacles": [ + { + "quantity": { + "quantityType": "NET", + "amount": 34.56, + "units": "Kg" + } + } + ], + "options": { + "labelTextOption": "APPEND", + "customerSuppliedLabelText": "Customer Supplied Label Text." + }, + "description": { + "sequenceNumber": 9812, + "processingOptions": [ + "INCLUDE_SPECIAL_PROVISIONS" + ], + "subsidiaryClasses": [ + "Subsidiary Classes" + ], + "labelText": "labelText", + "technicalName": "technicalName", + "packingDetails": { + "packingInstructions": "packing Instructions", + "cargoAircraftOnly": true + }, + "authorization": "authorization", + "reportableQuantity": true, + "percentage": 12.45, + "id": "123", + "packingGroup": "I", + "properShippingName": "properShippingName", + "hazardClass": "hazard Class" + } + }, + "description": { + "sequenceNumber": 876, + "packingInstructions": "packingInstructions", + "subsidiaryClasses": [ + "Subsidiary Classes" + ], + "labelText": "labelText", + "tunnelRestrictionCode": "UN2919", + "specialProvisions": "specialProvisions", + "properShippingNameAndDescription": "properShippingNameAndDescription", + "technicalName": "technicalName", + "symbols": "symbols", + "authorization": "authorization", + "attributes": [ + "attributes" + ], + "id": "1234", + "packingGroup": "packingGroup", + "properShippingName": "properShippingName", + "hazardClass": "hazardClass" + }, + "netExplosiveDetail": { + "amount": 10, + "units": "units", + "type": "NET_EXPLOSIVE_WEIGHT" + }, + "massPoints": 2 + } + ] + } + ], + "cargoAircraftOnly": true, + "referenceId": "123456", + "radioactiveTransportIndex": 2.45 + } + } + ], + "operationalDetail": { + "originServiceArea": "A1", + "serviceCode": "010", + "airportId": "DFW", + "postalCode": "38010", + "scac": "scac", + "deliveryDay": "TUE", + "originLocationId": "678", + "countryCode": "US", + "astraDescription": "SMART POST", + "originLocationNumber": 243, + "deliveryDate": "2001-04-05", + "deliveryEligibilities": [ + "deliveryEligibilities" + ], + "ineligibleForMoneyBackGuarantee": true, + "maximumTransitTime": "SEVEN_DAYS", + "destinationLocationStateOrProvinceCode": "GA", + "astraPlannedServiceLevel": "TUE - 15 OCT 10:30A", + "destinationLocationId": "DALA", + "transitTime": "TWO_DAYS", + "stateOrProvinceCode": "GA", + "destinationLocationNumber": 876, + "packagingCode": "03", + "commitDate": "2019-10-15", + "publishedDeliveryTime": "10:30A", + "ursaSuffixCode": "Ga", + "ursaPrefixCode": "XH", + "destinationServiceArea": "A1", + "commitDay": "TUE", + "customTransitTime": "ONE_DAY" + }, + "carrierCode": "FDXE", + "completedHoldAtLocationDetail": { + "holdingLocationType": "FEDEX_STAFFED", + "holdingLocation": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "38127", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "tollFreePhoneNumber": "6127812", + "emailAddress": "sample@company.com", + "phoneNumber": "1234567890", + "phoneExtension": "91", + "faxNumber": "1234567890", + "pagerNumber": "6127812", + "companyName": "Fedex", + "title": "title" + } + } + }, + "completedEtdDetail": { + "folderId": "0b0493e580dc1a1b", + "type": "COMMERCIAL_INVOICE", + "uploadDocumentReferenceDetails": [ + { + "documentType": "PRO_FORMA_INVOICE", + "documentReference": "DocumentReference", + "description": "PRO FORMA INVOICE", + "documentId": "090927d680038c61" + } + ] + }, + "packagingDescription": "description", + "masterTrackingId": { + "formId": "0201", + "trackingIdType": "EXPRESS", + "uspsApplicationId": "92", + "trackingNumber": "49092000070120032835" + }, + "serviceDescription": { + "serviceType": "FEDEX_1_DAY_FREIGHT", + "code": "80", + "names": [ + { + "type": "long", + "encoding": "UTF-8", + "value": "F-2" + } + ], + "operatingOrgCodes": [ + "FXE" + ], + "astraDescription": "2 DAY FRT", + "description": "description", + "serviceId": "EP1000000027", + "serviceCategory": "freight" + }, + "usDomestic": true, + "hazardousShipmentDetail": { + "hazardousSummaryDetail": { + "smallQuantityExceptionPackageCount": 10 + }, + "adrLicense": { + "licenseOrPermitDetail": { + "number": "12345", + "effectiveDate": "2019-08-09", + "expirationDate": "2019-04-09" + } + }, + "dryIceDetail": { + "totalWeight": { + "units": "KG", + "value": 68 + }, + "packageCount": 10, + "processingOptions": { + "options": [ + "options" + ] + } + } + }, + "shipmentRating": { + "actualRateType": "PAYOR_LIST_SHIPMENT", + "shipmentRateDetails": [ + { + "rateZone": "US001O", + "ratedWeightMethod": "ACTUAL", + "totalDutiesTaxesAndFees": 24.56, + "pricingCode": "LTL_FREIGHT", + "totalFreightDiscounts": 1.56, + "totalTaxes": 3.45, + "totalDutiesAndTaxes": 6.78, + "totalAncillaryFeesAndTaxes": 5.67, + "taxes": [ + { + "amount": 10, + "level": "level", + "description": "description", + "type": "type" + } + ], + "totalRebates": 1.98, + "fuelSurchargePercent": 4.56, + "currencyExchangeRate": { + "rate": 25.6, + "fromCurrency": "Rupee", + "intoCurrency": "USD" + }, + "totalNetFreight": 9.56, + "totalNetFedExCharge": 88.56, + "shipmentLegRateDetails": [], + "dimDivisor": 0, + "rateType": "RATED_ACCOUNT_SHIPMENT", + "surcharges": [ + { + "amount": "string", + "surchargeType": "APPOINTMENT_DELIVERY", + "level": "PACKAGE, or SHIPMENT", + "description": "description" + } + ], + "totalSurcharges": 9.88, + "totalBillingWeight": { + "units": "KG", + "value": 68 + }, + "freightDiscounts": [ + { + "amount": 8.9, + "rateDiscountType": "COUPON", + "percent": 28.9, + "description": "description" + } + ], + "rateScale": "00000", + "totalNetCharge": 3.78, + "totalBaseCharge": 234.56, + "totalNetChargeWithDutiesAndTaxes": 222.56, + "currency": "USD" + } + ] + }, + "documentRequirements": { + "requiredDocuments": [ + "COMMERCIAL_OR_PRO_FORMA_INVOICE", + "AIR_WAYBILL" + ], + "prohibitedDocuments": [ + "CERTIFICATE_OF_ORIGIN" + ], + "generationDetails": [ + { + "type": "COMMERCIAL_INVOICE", + "minimumCopiesRequired": 3, + "letterhead": "OPTIONAL", + "electronicSignature": "OPTIONAL" + } + ] + }, + "exportComplianceStatement": "12345678901234567", + "accessDetail": { + "accessorDetails": [ + { + "password": "password", + "role": "role", + "emailLabelUrl": "emailLabelUrl", + "userId": "userId" + } + ] + } + }, + "shipmentAdvisoryDetails": { + "regulatoryAdvisory": { + "prohibitions": [ + { + "derivedHarmonizedCode": "01", + "advisory": { + "code": "code", + "text": "Text", + "parameters": [ + { + "id": "message ID", + "value": "Message value" + } + ], + "localizedText": "localizedText" + }, + "commodityIndex": 12, + "source": "source", + "categories": [ + "categories" + ], + "type": "type", + "waiver": { + "advisories": [ + { + "code": "code", + "text": "Text", + "parameters": [ + { + "id": "message ID", + "value": "Message value" + } + ], + "localizedText": "localizedText" + } + ], + "description": "description", + "id": "id" + }, + "status": "status" + } + ] + } + }, + "masterTrackingNumber": "794953535000" + } + ], + "alerts": [ + { + "code": "SHIP.RECIPIENT.POSTALCITY.MISMATCH", + "alertType": "NOTE", + "message": "Recipient Postal-City Mismatch." + } + ], + "jobId": "abc123456" + } +} \ No newline at end of file diff --git a/modules/connectors/fedex/schemas/tracking_request.json b/modules/connectors/fedex/schemas/tracking_request.json new file mode 100644 index 0000000000..e0f90a4558 --- /dev/null +++ b/modules/connectors/fedex/schemas/tracking_request.json @@ -0,0 +1,14 @@ +{ + "includeDetailedScans": true, + "trackingInfo": [ + { + "shipDateBegin": "2020-03-29", + "shipDateEnd": "2020-04-01", + "trackingNumberInfo": { + "trackingNumber": "128667043726", + "carrierCode": "FDXE", + "trackingNumberUniqueId": "245822~123456789012~FDEG" + } + } + ] +} diff --git a/modules/connectors/fedex/schemas/tracking_response.json b/modules/connectors/fedex/schemas/tracking_response.json new file mode 100644 index 0000000000..a6b54b319a --- /dev/null +++ b/modules/connectors/fedex/schemas/tracking_response.json @@ -0,0 +1,459 @@ +{ + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "output": { + "completeTrackResults": [ + { + "trackingNumber": "123456789012", + "trackResults": [ + { + "trackingNumberInfo": { + "trackingNumber": "128667043726", + "carrierCode": "FDXE", + "trackingNumberUniqueId": "245822~123456789012~FDEG" + }, + "additionalTrackingInfo": { + "hasAssociatedShipments": false, + "nickname": "shipment nickname", + "packageIdentifiers": [ + { + "type": "SHIPPER_REFERENCE", + "value": "ASJFGVAS", + "trackingNumberUniqueId": "245822~123456789012~FDEG" + } + ], + "shipmentNotes": "shipment notes" + }, + "distanceToDestination": { + "units": "KM", + "value": 685.7 + }, + "consolidationDetail": [ + { + "timeStamp": "2020-10-13T03:54:44-06:00", + "consolidationID": "47936927", + "reasonDetail": { + "description": "Wrong color", + "type": "REJECTED" + }, + "packageCount": 25, + "eventType": "PACKAGE_ADDED_TO_CONSOLIDATION" + } + ], + "meterNumber": "8468376", + "returnDetail": { + "authorizationName": "Sammy Smith", + "reasonDetail": [ + { + "description": "Wrong color", + "type": "REJECTED" + } + ] + }, + "serviceDetail": { + "description": "FedEx Freight Economy.", + "shortDescription": "FL", + "type": "FEDEX_FREIGHT_ECONOMY" + }, + "destinationLocation": { + "locationId": "SEA", + "locationContactAndAddress": { + "contact": { + "personName": "John Taylor", + "phoneNumber": "1234567890", + "companyName": "Fedex" + }, + "address": { + "addressClassification": "BUSINESS", + "residential": false, + "streetLines": [ + "1043 North Easy Street", + "Suite 999" + ], + "city": "SEATTLE", + "urbanizationCode": "RAFAEL", + "stateOrProvinceCode": "WA", + "postalCode": "98101", + "countryCode": "US", + "countryName": "United States" + } + }, + "locationType": "PICKUP_LOCATION" + }, + "latestStatusDetail": { + "scanLocation": { + "addressClassification": "BUSINESS", + "residential": false, + "streetLines": [ + "1043 North Easy Street", + "Suite 999" + ], + "city": "SEATTLE", + "urbanizationCode": "RAFAEL", + "stateOrProvinceCode": "WA", + "postalCode": "98101", + "countryCode": "US", + "countryName": "United States" + }, + "code": "PU", + "derivedCode": "PU", + "ancillaryDetails": [ + { + "reason": "15", + "reasonDescription": "Customer not available or business closed", + "action": "Contact us at to discuss possible delivery or pickup alternatives.", + "actionDescription": "Customer not Available or Business Closed" + } + ], + "statusByLocale": "Picked up", + "description": "Picked up", + "delayDetail": { + "type": "WEATHER", + "subType": "SNOW", + "status": "DELAYED" + } + }, + "serviceCommitMessage": { + "message": "No scheduled delivery date available at this time.", + "type": "ESTIMATED_DELIVERY_DATE_UNAVAILABLE" + }, + "informationNotes": [ + { + "code": "CLEARANCE_ENTRY_FEE_APPLIES", + "description": "this is an informational message" + } + ], + "error": { + "code": "TRACKING.TRACKINGNUMBER.EMPTY", + "parameterList": [ + { + "value": "value", + "key": "key" + } + ], + "message": "Please provide tracking number." + }, + "specialHandlings": [ + { + "description": "Deliver Weekday", + "type": "DELIVER_WEEKDAY", + "paymentType": "OTHER" + } + ], + "availableImages": [ + { + "size": "LARGE", + "type": "BILL_OF_LADING" + } + ], + "deliveryDetails": { + "receivedByName": "Reciever", + "destinationServiceArea": "EDDUNAVAILABLE", + "destinationServiceAreaDescription": "Appointment required", + "locationDescription": "Receptionist/Front Desk", + "actualDeliveryAddress": { + "addressClassification": "BUSINESS", + "residential": false, + "streetLines": [ + "1043 North Easy Street", + "Suite 999" + ], + "city": "SEATTLE", + "urbanizationCode": "RAFAEL", + "stateOrProvinceCode": "WA", + "postalCode": "98101", + "countryCode": "US", + "countryName": "United States" + }, + "deliveryToday": false, + "locationType": "FEDEX_EXPRESS_STATION", + "signedByName": "Reciever", + "officeOrderDeliveryMethod": "Courier", + "deliveryAttempts": "0", + "deliveryOptionEligibilityDetails": [ + { + "option": "INDIRECT_SIGNATURE_RELEASE", + "eligibility": "INELIGIBLE" + } + ] + }, + "scanEvents": [ + { + "date": "2018-02-02T12:01:00-07:00", + "derivedStatus": "Picked Up", + "scanLocation": { + "addressClassification": "BUSINESS", + "residential": false, + "streetLines": [ + "1043 North Easy Street", + "Suite 999" + ], + "city": "SEATTLE", + "urbanizationCode": "RAFAEL", + "stateOrProvinceCode": "WA", + "postalCode": "98101", + "countryCode": "US", + "countryName": "United States" + }, + "locationId": "SEA", + "locationType": "PICKUP_LOCATION", + "exceptionDescription": "Package available for clearance", + "eventDescription": "Picked Up", + "eventType": "PU", + "derivedStatusCode": "PU", + "exceptionCode": "A25", + "delayDetail": { + "type": "WEATHER", + "subType": "SNOW", + "status": "DELAYED" + } + } + ], + "dateAndTimes": [ + { + "dateTime": "2007-09-27T00:00:00", + "type": "ACTUAL_DELIVERY" + } + ], + "packageDetails": { + "physicalPackagingType": "BARREL", + "sequenceNumber": "45", + "undeliveredCount": "7", + "packagingDescription": { + "description": "FedEx Pak", + "type": "FEDEX_PAK" + }, + "count": "1", + "weightAndDimensions": { + "weight": [ + { + "unit": "LB", + "value": "22222.0" + } + ], + "dimensions": [ + { + "length": 100, + "width": 50, + "height": 30, + "units": "CM" + } + ] + }, + "packageContent": [ + "wire hangers", + "buttons" + ], + "contentPieceCount": "100", + "declaredValue": { + "currency": "USD", + "value": 56.8 + } + }, + "goodsClassificationCode": "goodsClassificationCode", + "holdAtLocation": { + "locationId": "SEA", + "locationContactAndAddress": { + "contact": { + "personName": "John Taylor", + "phoneNumber": "1234567890", + "companyName": "Fedex" + }, + "address": { + "addressClassification": "BUSINESS", + "residential": false, + "streetLines": [ + "1043 North Easy Street", + "Suite 999" + ], + "city": "SEATTLE", + "urbanizationCode": "RAFAEL", + "stateOrProvinceCode": "WA", + "postalCode": "98101", + "countryCode": "US", + "countryName": "United States" + } + }, + "locationType": "PICKUP_LOCATION" + }, + "customDeliveryOptions": [ + { + "requestedAppointmentDetail": { + "date": "2019-05-07", + "window": [ + { + "description": "Description field", + "window": { + "begins": "2021-10-01T08:00:00", + "ends": "2021-10-15T00:00:00-06:00" + }, + "type": "ESTIMATED_DELIVERY" + } + ] + }, + "description": "Redirect the package to the hold location.", + "type": "REDIRECT_TO_HOLD_AT_LOCATION", + "status": "HELD" + } + ], + "estimatedDeliveryTimeWindow": { + "description": "Description field", + "window": { + "begins": "2021-10-01T08:00:00", + "ends": "2021-10-15T00:00:00-06:00" + }, + "type": "ESTIMATED_DELIVERY" + }, + "pieceCounts": [ + { + "count": "35", + "description": "picec count description", + "type": "ORIGIN" + } + ], + "originLocation": { + "locationId": "SEA", + "locationContactAndAddress": { + "contact": { + "personName": "John Taylor", + "phoneNumber": "1234567890", + "companyName": "Fedex" + }, + "address": { + "addressClassification": "BUSINESS", + "residential": false, + "streetLines": [ + "1043 North Easy Street", + "Suite 999" + ], + "city": "SEATTLE", + "urbanizationCode": "RAFAEL", + "stateOrProvinceCode": "WA", + "postalCode": "98101", + "countryCode": "US", + "countryName": "United States" + } + }, + "locationType": "PICKUP_LOCATION" + }, + "recipientInformation": { + "contact": { + "personName": "John Taylor", + "phoneNumber": "1234567890", + "companyName": "Fedex" + }, + "address": { + "addressClassification": "BUSINESS", + "residential": false, + "streetLines": [ + "1043 North Easy Street", + "Suite 999" + ], + "city": "SEATTLE", + "urbanizationCode": "RAFAEL", + "stateOrProvinceCode": "WA", + "postalCode": "98101", + "countryCode": "US", + "countryName": "United States" + } + }, + "standardTransitTimeWindow": { + "description": "Description field", + "window": { + "begins": "2021-10-01T08:00:00", + "ends": "2021-10-15T00:00:00-06:00" + }, + "type": "ESTIMATED_DELIVERY" + }, + "shipmentDetails": { + "contents": [ + { + "itemNumber": "RZ5678", + "receivedQuantity": "13", + "description": "pulyurethane rope", + "partNumber": "RK1345" + } + ], + "beforePossessionStatus": false, + "weight": [ + { + "unit": "LB", + "value": "22222.0" + } + ], + "contentPieceCount": "3333", + "splitShipments": [ + { + "pieceCount": "10", + "statusDescription": "status", + "timestamp": "2019-05-07T08:00:07", + "statusCode": "statuscode" + } + ] + }, + "reasonDetail": { + "description": "Wrong color", + "type": "REJECTED" + }, + "availableNotifications": [ + "ON_DELIVERY", + "ON_EXCEPTION" + ], + "shipperInformation": { + "contact": { + "personName": "John Taylor", + "phoneNumber": "1234567890", + "companyName": "Fedex" + }, + "address": { + "addressClassification": "BUSINESS", + "residential": false, + "streetLines": [ + "1043 North Easy Street", + "Suite 999" + ], + "city": "SEATTLE", + "urbanizationCode": "RAFAEL", + "stateOrProvinceCode": "WA", + "postalCode": "98101", + "countryCode": "US", + "countryName": "United States" + } + }, + "lastUpdatedDestinationAddress": { + "addressClassification": "BUSINESS", + "residential": false, + "streetLines": [ + "1043 North Easy Street", + "Suite 999" + ], + "city": "SEATTLE", + "urbanizationCode": "RAFAEL", + "stateOrProvinceCode": "WA", + "postalCode": "98101", + "countryCode": "US", + "countryName": "United States" + } + } + ] + }, + { + "trackingNumber": "39936862321", + "trackResults": [ + { + "trackingNumberInfo": { + "trackingNumber": "39936862321", + "trackingNumberUniqueId": "", + "carrierCode": "" + }, + "error": { + "code": "TRACKING.TRACKINGNUMBER.NOTFOUND", + "message": "Tracking number cannot be found. Please correct the tracking number and try again." + } + } + ] + } + ], + "alerts": "TRACKING.DATA.NOTFOUND - Tracking data unavailable" + } +} diff --git a/modules/connectors/fedex/setup.py b/modules/connectors/fedex/setup.py new file mode 100644 index 0000000000..e079bed3ae --- /dev/null +++ b/modules/connectors/fedex/setup.py @@ -0,0 +1,26 @@ +"""Warning: This setup.py is only there for git install until poetry support git subdirectory""" +from setuptools import setup, find_namespace_packages + +with open("README.md", "r") as fh: + long_description = fh.read() + +setup( + name="karrio.fedex", + version="2024.2", + description="Karrio - FedEx Shipping Extension", + long_description=long_description, + long_description_content_type="text/markdown", + url="https://github.com/karrioapi/karrio", + author="karrio", + author_email="hello@karrio.io", + license="Apache-2.0", + packages=find_namespace_packages(exclude=["tests.*", "tests"]), + install_requires=["karrio"], + classifiers=[ + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + ], + zip_safe=False, + include_package_data=True, +) diff --git a/modules/connectors/fedex/tests/__init__.py b/modules/connectors/fedex/tests/__init__.py new file mode 100644 index 0000000000..6844a939cd --- /dev/null +++ b/modules/connectors/fedex/tests/__init__.py @@ -0,0 +1,4 @@ + +from tests.fedex.test_rate import * +from tests.fedex.test_tracking import * +from tests.fedex.test_shipment import * \ No newline at end of file diff --git a/modules/connectors/fedex/tests/fedex/__init__.py b/modules/connectors/fedex/tests/fedex/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/modules/connectors/fedex/tests/fedex/fixture.py b/modules/connectors/fedex/tests/fedex/fixture.py new file mode 100644 index 0000000000..4613a0db1a --- /dev/null +++ b/modules/connectors/fedex/tests/fedex/fixture.py @@ -0,0 +1,25 @@ +import karrio +import datetime +import karrio.lib as lib + +expiry = datetime.datetime.now() + datetime.timedelta(days=1) +api_key = "api_key" +secret_key = "secret_key" +cached_auth = { + f"fedex|{api_key}|{secret_key}": dict( + access_token="access_token", + token_type="bearer", + expires_in=3599, + scope="CXS-TP", + expiry=expiry.strftime("%Y-%m-%d %H:%M:%S"), + ) +} + +gateway = karrio.gateway["fedex"].create( + dict( + api_key=api_key, + secret_key=secret_key, + account_number="2349857", + cache=lib.Cache(**cached_auth), + ) +) diff --git a/modules/connectors/fedex/tests/fedex/test_document.py b/modules/connectors/fedex/tests/fedex/test_document.py new file mode 100644 index 0000000000..b9790d7bb8 --- /dev/null +++ b/modules/connectors/fedex/tests/fedex/test_document.py @@ -0,0 +1,103 @@ +import unittest +from unittest.mock import patch, ANY +from .fixture import gateway + +import karrio +import karrio.lib as lib +import karrio.core.models as models + + +class TestFedExTracking(unittest.TestCase): + def setUp(self): + self.maxDiff = None + self.DocumentUploadRequest = models.DocumentUploadRequest( + **DocumentUploadPayload + ) + + def test_create_tracking_request(self): + request = gateway.mapper.create_document_upload_request( + self.DocumentUploadRequest + ) + + self.assertEqual(request.serialize(), DocumentUploadRequest) + + def test_get_tracking(self): + with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + mock.return_value = "{}" + karrio.Document.upload(self.DocumentUploadRequest).from_(gateway) + + self.assertEqual( + mock.call_args[1]["url"], + f"https://documentapi.prod.fedex.com/documents/v1/etds/upload", + ) + + def test_parse_document_upload_response(self): + with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + mock.return_value = DocumentUploadResponse + parsed_response = ( + karrio.Document.upload(self.DocumentUploadRequest) + .from_(gateway) + .parse() + ) + + self.assertListEqual( + lib.to_dict(parsed_response), ParsedDocumentUploadResponse + ) + + +if __name__ == "__main__": + unittest.main() + + +DocumentUploadPayload = { + "document_files": [ + { + "doc_format": "txt", + "doc_name": "file.txt", + "doc_type": "other", + "doc_file": "R0lGODdhIAOwBPAAAA==", + } + ], +} + +ParsedDocumentUploadResponse = [ + { + "carrier_id": "fedex", + "carrier_name": "fedex", + "documents": [ + { + "doc_id": "090493e181586308", + "file_name": "090493e181586308", + } + ], + "meta": {}, + }, + [], +] + + +DocumentUploadRequest = [ + { + "attachment": "R0lGODdhIAOwBPAAAA==", + "document": { + "contentType": "txt", + "meta": {"shipDocumentType": "OTHER", "shipmentDate": ANY}, + "name": "file.txt", + "workflowName": "ETDPostshipment", + }, + } +] + +DocumentUploadResponse = """{ + "output": { + "meta": { + "documentType": "CO", + "docId": "090493e181586308", + "folderId": [ + "0b0493e1812f8921" + ] + } + }, + "customerTransactionId": "XXXX_XXX123XXXXX" +} +""" diff --git a/modules/connectors/fedex/tests/fedex/test_rate.py b/modules/connectors/fedex/tests/fedex/test_rate.py new file mode 100644 index 0000000000..a73c2565d7 --- /dev/null +++ b/modules/connectors/fedex/tests/fedex/test_rate.py @@ -0,0 +1,1340 @@ +import unittest +from unittest.mock import patch, ANY +from .fixture import gateway + +import karrio +import karrio.lib as lib +import karrio.core.models as models + + +class TestFedExRating(unittest.TestCase): + def setUp(self): + self.maxDiff = None + self.RateRequest = models.RateRequest(**RatePayload) + + def test_create_rate_request(self): + request = gateway.mapper.create_rate_request(self.RateRequest) + + self.assertEqual(request.serialize(), RateRequest) + + def test_get_rate(self): + with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + mock.return_value = "{}" + karrio.Rating.fetch(self.RateRequest).from_(gateway) + + self.assertEqual( + mock.call_args[1]["url"], + f"{gateway.settings.server_url}/rate", + ) + + def test_parse_rate_response(self): + with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + mock.return_value = RateResponse + parsed_response = ( + karrio.Rating.fetch(self.RateRequest).from_(gateway).parse() + ) + + self.assertListEqual(lib.to_dict(parsed_response), ParsedRateResponse) + + +if __name__ == "__main__": + unittest.main() + + +RatePayload = { + "shipper": {"postal_code": "H3N1S4", "country_code": "CA"}, + "recipient": {"city": "Lome", "country_code": "TG"}, + "parcels": [{"id": "1", "height": 3, "length": 10, "width": 3, "weight": 4.0}], + "options": { + "currency": "USD", + "fedex_one_rate": True, + "shipment_date": "2024-02-15", + }, +} + +ParsedRateResponse = [ + [ + { + "carrier_id": "fedex", + "carrier_name": "fedex", + "currency": "USD", + "estimated_delivery": "2019-07-22", + "extra_charges": [ + {"amount": 308.71, "currency": "USD", "name": "Base Charge"}, + {"amount": 0.0, "currency": "USD", "name": "Discounts"}, + {"amount": 0.0, "currency": "USD", "name": "VAT Charge"}, + {"amount": 0.0, "currency": "USD", "name": "Duties and Taxes"}, + {"amount": 32.42, "currency": "USD", "name": "Fuel Surcharge"}, + ], + "meta": { + "service_name": "fedex_international_first", + "transit_time": "THREE_DAYS", + }, + "service": "fedex_international_first", + "total_charge": 341.13, + "transit_days": 0, + }, + { + "carrier_id": "fedex", + "carrier_name": "fedex", + "currency": "USD", + "estimated_delivery": "2019-07-22", + "extra_charges": [ + {"amount": 239.15, "currency": "USD", "name": "Base Charge"}, + {"amount": 0.0, "currency": "USD", "name": "Discounts"}, + {"amount": 0.0, "currency": "USD", "name": "VAT Charge"}, + {"amount": 0.0, "currency": "USD", "name": "Duties and Taxes"}, + {"amount": 25.11, "currency": "USD", "name": "Fuel Surcharge"}, + ], + "meta": { + "service_name": "FedEx International Priority", + "transit_time": "THREE_DAYS", + }, + "service": "INTERNATIONAL_PRIORITY", + "total_charge": 264.26, + "transit_days": 0, + }, + { + "carrier_id": "fedex", + "carrier_name": "fedex", + "currency": "USD", + "extra_charges": [ + {"amount": 145.21, "currency": "USD", "name": "Base Charge"}, + {"amount": 0.0, "currency": "USD", "name": "Discounts"}, + {"amount": 0.0, "currency": "USD", "name": "VAT Charge"}, + {"amount": 0.0, "currency": "USD", "name": "Duties and Taxes"}, + {"amount": 15.24, "currency": "USD", "name": "Fuel Surcharge"}, + ], + "meta": { + "service_name": "fedex_international_economy", + "transit_time": "THREE_DAYS", + }, + "service": "fedex_international_economy", + "total_charge": 160.45, + }, + { + "carrier_id": "fedex", + "carrier_name": "fedex", + "currency": "USD", + "extra_charges": [ + {"amount": 38.17, "currency": "USD", "name": "Base Charge"}, + {"amount": 0.0, "currency": "USD", "name": "Discounts"}, + {"amount": 0.0, "currency": "USD", "name": "VAT Charge"}, + {"amount": 0.0, "currency": "USD", "name": "Duties and Taxes"}, + {"amount": 2.86, "currency": "USD", "name": "Fuel Surcharge"}, + ], + "meta": {"service_name": "fedex_ground"}, + "service": "fedex_ground", + "total_charge": 41.03, + }, + ], + [ + { + "carrier_id": "fedex", + "carrier_name": "fedex", + "code": "MONEYBACKGUARANTEE.NOT.ELIGIBLE", + "details": {}, + "message": "We are unable to process this request. Please try again later " + "or contact FedEx Customer Service.", + } + ], +] + + +RateRequest = { + "accountNumber": {"value": "2349857"}, + "rateRequestControlParameters": { + "rateSortOrder": "COMMITASCENDING", + "returnTransitTimes": True, + "servicesNeededOnRateFailure": True, + "variableOptions": ["FEDEX_ONE_RATE", "SIGNATURE_OPTION"], + }, + "requestedShipment": { + "documentShipment": False, + "packagingType": "YOUR_PACKAGING", + "pickupType": "DROPOFF_AT_FEDEX_LOCATION", + "preferredCurrency": { + "code": "currency", + "state": "USD", + "type": "", + }, + "rateRequestType": ["LIST", "PREFERRED"], + "recipient": { + "address": {"city": "Lome", "countryCode": "TG", "residential": False} + }, + "requestedPackageLineItems": [ + { + "declaredValue": {"type": ""}, + "dimensions": { + "height": 3.0, + "length": 10.0, + "units": "IN", + "width": 3.0, + }, + "groupPackageCount": 1, + "weight": {"units": "LB", "value": 4.0}, + } + ], + "shipDateStamp": "2024-02-15", + "shipmentSpecialServices": {}, + "shipper": { + "address": { + "countryCode": "CA", + "postalCode": "H3N1S4", + "residential": False, + } + }, + "totalWeight": 4.0, + }, +} + +RateResponse = """{ + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "output": { + "rateReplyDetails": [ + { + "serviceType": "INTERNATIONAL_FIRST", + "serviceName": "FedEx International First", + "packagingType": "YOUR_PACKAGING", + "customerMessages": [ + { + "code": "SERVICE.TYPE.INTERNATIONAL.MESSAGE", + "message": "Rate does not include duties & taxes, clearance entry fees or other import fees. The payor of duties/taxes/fees will be responsible for any applicable Clearance Entry Fees." + }, + { + "code": "EDT.DETAILS.MISSING", + "message": "The harmonized code for the commodity at array index 1 is missing or invalid; estimated duties and taxes were not returned." + } + ], + "ratedShipmentDetails": [ + { + "rateType": "ACCOUNT", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 403.2, + "totalNetCharge": 445.54, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 445.54, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 445.54, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA003O", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 42.34, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 42.34 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "CAD", + "rate": 1.0 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22.0 + }, + "currency": "CAD" + }, + "currency": "CAD" + }, + { + "rateType": "LIST", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 403.2, + "totalNetCharge": 445.54, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 445.54, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 445.54, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA003O", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 42.34, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 42.34 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "CAD", + "rate": 1.0 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22.0 + }, + "currency": "CAD" + }, + "currency": "CAD" + }, + { + "rateType": "PREFERRED_INCENTIVE", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 308.71, + "totalNetCharge": 341.13, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 341.13, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 341.13, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA003O", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 32.42, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 32.42 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "USD", + "rate": 0.77 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22.0 + }, + "currency": "USD" + }, + "currency": "USD" + }, + { + "rateType": "PREFERRED_CURRENCY", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 308.71, + "totalNetCharge": 341.13, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 341.13, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 341.13, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA003O", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 32.42, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 32.42 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "USD", + "rate": 0.77 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "USD" + }, + "currency": "USD" + } + ], + "anonymouslyAllowable": true, + "operationalDetail": { + "originLocationIds": "COSA", + "commitDays": "", + "serviceCode": "92", + "airportId": "MEM", + "scac": "", + "originServiceAreas": "AM", + "deliveryDay": "TUE", + "originLocationNumbers": 1162, + "destinationPostalCode": "38125", + "commitDate": "2019-07-22T08:30:00", + "astraDescription": "INTL1ST", + "deliveryDate": "", + "deliveryEligibilities": "", + "ineligibleForMoneyBackGuarantee": false, + "maximumTransitTime": "", + "astraPlannedServiceLevel": "", + "destinationLocationIds": "EHTA", + "destinationLocationStateOrProvinceCodes": "CT", + "transitTime": "THREE_DAYS", + "packagingCode": "02", + "destinationLocationNumbers": 892, + "publishedDeliveryTime": "06:30:00", + "countryCodes": "US", + "stateOrProvinceCodes": "TX", + "ursaPrefixCode": "82", + "ursaSuffixCode": "EHTA", + "destinationServiceAreas": "AA", + "originPostalCodes": "75063", + "customTransitTime": "" + }, + "signatureOptionType": "SERVICE_DEFAULT", + "serviceDescription": { + "serviceId": "EP1000000007", + "serviceType": "INTERNATIONAL_FIRST", + "code": "06", + "names": [ + { + "type": "long", + "encoding": "utf-8", + "value": "FedEx International First®" + }, + { + "type": "long", + "encoding": "ascii", + "value": "FedEx International First" + }, + { + "type": "medium", + "encoding": "utf-8", + "value": "FedEx International First®" + }, + { + "type": "medium", + "encoding": "ascii", + "value": "FedEx International First" + }, + { + "type": "short", + "encoding": "utf-8", + "value": "FO" + }, + { + "type": "short", + "encoding": "ascii", + "value": "FO" + }, + { + "type": "abbrv", + "encoding": "ascii", + "value": "FO" + } + ], + "operatingOrgCodes": [ + "FXE" + ], + "serviceCategory": "parcel", + "description": "International First", + "astraDescription": "INTL1ST" + }, + "commit": { + "dateDetail": { + "dayOfWeek": "THU", + "dayCxsFormat": "2020-07-16T10:30:00" + } + } + }, + { + "serviceType": "INTERNATIONAL_PRIORITY", + "serviceName": "FedEx International Priority", + "packagingType": "YOUR_PACKAGING", + "customerMessages": [ + { + "code": "SERVICE.TYPE.INTERNATIONAL.MESSAGE", + "message": "Rate does not include duties & taxes, clearance entry fees or other import fees. The payor of duties/taxes/fees will be responsible for any applicable Clearance Entry Fees." + }, + { + "code": "EDT.DETAILS.MISSING", + "message": "The harmonized code for the commodity at array index 1 is missing or invalid; estimated duties and taxes were not returned." + } + ], + "ratedShipmentDetails": [ + { + "rateType": "ACCOUNT", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 312.35, + "totalNetCharge": 345.15, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 345.15, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 345.15, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA003O", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 32.8, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 32.8 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "CAD", + "rate": 1 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "CAD" + }, + "currency": "CAD" + }, + { + "rateType": "LIST", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 78.99, + "totalNetCharge": 87.28, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 87.28, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 87.28, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA1520", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 8.29, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 8.29 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "CAD", + "rate": 1 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "CAD" + }, + "currency": "CAD" + }, + { + "rateType": "PREFERRED_INCENTIVE", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 60.48, + "totalNetCharge": 66.83, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 66.83, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 66.83, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA1520", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 6.3, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 6.35 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "USD", + "rate": 0.77 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "USD" + }, + "currency": "USD" + }, + { + "rateType": "PREFERRED_CURRENCY", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 239.15, + "totalNetCharge": 264.26, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 264.26, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 264.26, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA003O", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 25.11, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 25.11 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "USD", + "rate": 0.77 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "USD" + }, + "currency": "USD" + } + ], + "anonymouslyAllowable": true, + "operationalDetail": { + "ineligibleForMoneyBackGuarantee": false, + "astraDescription": "IP", + "airportId": "MEM", + "serviceCode": "01", + "originLocationIds": "COSA", + "commitDays": "", + "scac": "", + "originServiceAreas": "AM", + "deliveryDay": "TUE", + "originLocationNumbers": 1162, + "destinationPostalCode": "38125", + "commitDate": "2019-07-22T08:30:00", + "deliveryDate": "", + "deliveryEligibilities": "", + "maximumTransitTime": "", + "astraPlannedServiceLevel": "", + "destinationLocationIds": "EHTA", + "destinationLocationStateOrProvinceCodes": "CT", + "transitTime": "THREE_DAYS", + "packagingCode": "02", + "destinationLocationNumbers": 892, + "publishedDeliveryTime": "06:30:00", + "countryCodes": "US", + "stateOrProvinceCodes": "TX", + "ursaPrefixCode": "82", + "ursaSuffixCode": "EHTA", + "destinationServiceAreas": "AA", + "originPostalCodes": "75063", + "customTransitTime": "" + }, + "signatureOptionType": "SERVICE_DEFAULT", + "serviceDescription": { + "serviceId": "EP1000000001", + "serviceType": "INTERNATIONAL_PRIORITY", + "code": "01", + "names": [ + { + "type": "long", + "encoding": "utf-8", + "value": "FedEx International Priority®" + }, + { + "type": "long", + "encoding": "ascii", + "value": "FedEx International Priority" + }, + { + "type": "medium", + "encoding": "utf-8", + "value": "FedEx International Priority®" + }, + { + "type": "medium", + "encoding": "ascii", + "value": "FedEx International Priority" + }, + { + "type": "short", + "encoding": "utf-8", + "value": "IP" + }, + { + "type": "short", + "encoding": "ascii", + "value": "IP" + }, + { + "type": "abbrv", + "encoding": "ascii", + "value": "IP" + } + ], + "operatingOrgCodes": [ + "FXE" + ], + "serviceCategory": "parcel", + "description": "International Priority", + "astraDescription": "IP" + }, + "commit": { + "dateDetail": { + "dayOfWeek": "FRI", + "dayCxsFormat": "2020-07-16T10:30:00" + } + } + }, + { + "serviceType": "INTERNATIONAL_ECONOMY", + "serviceName": "FedEx International Economy", + "packagingType": "YOUR_PACKAGING", + "customerMessages": [ + { + "code": "SERVICE.TYPE.INTERNATIONAL.MESSAGE", + "message": "Rate does not include duties & taxes, clearance entry fees or other import fees. The payor of duties/taxes/fees will be responsible for any applicable Clearance Entry Fees." + }, + { + "code": "EDT.DETAILS.MISSING", + "message": "The harmonized code for the commodity at array index 1 is missing or invalid; estimated duties and taxes were not returned." + } + ], + "ratedShipmentDetails": [ + { + "rateType": "ACCOUNT", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 189.65, + "totalNetCharge": 209.56, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 209.56, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 209.56, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA003O", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 19.91, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 19.91 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "CAD", + "rate": 1 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "CAD" + }, + "currency": "CAD" + }, + { + "rateType": "LIST", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 48.56, + "totalNetCharge": 53.66, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 53.66, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 53.66, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA1520", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 5.1, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 5.1 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "CAD", + "rate": 1 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "CAD" + }, + "currency": "CAD" + }, + { + "rateType": "PREFERRED_INCENTIVE", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 37.18, + "totalNetCharge": 41.08, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 41.08, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 41.08, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA1520", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 3.9, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 3.9 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "USD", + "rate": 0.77 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "USD" + }, + "currency": "USD" + }, + { + "rateType": "PREFERRED_CURRENCY", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 145.21, + "totalNetCharge": 160.45, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 160.45, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 160.45, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "CA003O", + "dimDivisor": 0.0, + "fuelSurchargePercent": 10.5, + "totalSurcharges": 15.24, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "amount": 15.24 + } + ], + "pricingCode": "ACTUAL", + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "USD", + "rate": 0.77 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "USD" + }, + "currency": "USD" + } + ], + "anonymouslyAllowable": true, + "operationalDetail": { + "ineligibleForMoneyBackGuarantee": false, + "astraDescription": "IE", + "airportId": "MEM", + "serviceCode": "03", + "originLocationIds": "COSA", + "originServiceAreas": "AM", + "deliveryDay": "TUE", + "originLocationNumbers": 1162, + "destinationPostalCode": "38125", + "destinationLocationIds": "EHTA", + "destinationLocationStateOrProvinceCodes": "CT", + "transitTime": "THREE_DAYS", + "packagingCode": "02", + "destinationLocationNumbers": 892, + "publishedDeliveryTime": "06:30:00", + "countryCodes": "US", + "stateOrProvinceCodes": "TX", + "ursaPrefixCode": "82", + "ursaSuffixCode": "EHTA", + "destinationServiceAreas": "AA", + "originPostalCodes": "75063" + }, + "signatureOptionType": "SERVICE_DEFAULT", + "serviceDescription": { + "serviceId": "EP1000000004", + "serviceType": "INTERNATIONAL_ECONOMY", + "code": "03", + "names": [ + { + "type": "long", + "encoding": "utf-8", + "value": "FedEx International Economy®" + }, + { + "type": "long", + "encoding": "ascii", + "value": "FedEx International Economy" + }, + { + "type": "medium", + "encoding": "utf-8", + "value": "FedEx International Economy®" + }, + { + "type": "medium", + "encoding": "ascii", + "value": "FedEx International Economy" + }, + { + "type": "short", + "encoding": "utf-8", + "value": "IE" + }, + { + "type": "short", + "encoding": "ascii", + "value": "IE" + }, + { + "type": "abbrv", + "encoding": "ascii", + "value": "IE" + } + ], + "operatingOrgCodes": [ + "FXE" + ], + "serviceCategory": "parcel", + "description": "International Two Day", + "astraDescription": "IE" + } + }, + { + "serviceType": "FEDEX_GROUND", + "serviceName": "FedEx International Ground�", + "packagingType": "YOUR_PACKAGING", + "customerMessages": [ + { + "code": "SERVICE.TYPE.INTERNATIONAL.MESSAGE", + "message": "Rate does not include duties & taxes, clearance entry fees or other import fees. The payor of duties/taxes/fees will be responsible for any applicable Clearance Entry Fees." + }, + { + "code": "EDT.DETAILS.MISSING", + "message": "The harmonized code for the commodity at array index 1 is missing or invalid; estimated duties and taxes were not returned." + } + ], + "ratedShipmentDetails": [ + { + "rateType": "ACCOUNT", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 2.79, + "totalBaseCharge": 49.85, + "totalNetCharge": 53.59, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 53.59, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 53.59, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "52", + "dimDivisor": 0.0, + "fuelSurchargePercent": 7.5, + "totalSurcharges": 3.74, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "level": "PACKAGE", + "amount": 3.74 + } + ], + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "CAD" + }, + "ratedPackages": [ + { + "groupNumber": 0.0, + "effectiveNetDiscount": 2.79, + "packageRateDetail": { + "rateType": "PAYOR_ACCOUNT_PACKAGE", + "ratedWeightMethod": "ACTUAL", + "baseCharge": 49.85, + "netFreight": 49.85, + "totalSurcharges": 3.74, + "netFedExCharge": 53.59, + "totalTaxes": 0.0, + "netCharge": 53.59, + "totalRebates": 0.0, + "billingWeight": { + "units": "LB", + "value": 22 + }, + "totalFreightDiscounts": 0.0, + "surcharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "level": "PACKAGE", + "amount": 3.74 + } + ], + "currency": "CAD" + } + } + ], + "currency": "CAD" + }, + { + "rateType": "PREFERRED_INCENTIVE", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 40.16, + "totalNetCharge": 43.17, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 43.17, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 43.17, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "52", + "dimDivisor": 0.0, + "fuelSurchargePercent": 7.5, + "totalSurcharges": 3.01, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "level": "PACKAGE", + "amount": 3.01 + } + ], + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "USD", + "rate": 0.77 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "USD" + }, + "ratedPackages": [ + { + "groupNumber": 0.0, + "effectiveNetDiscount": 0.0, + "packageRateDetail": { + "rateType": "PREFERRED_LIST_PACKAGE", + "ratedWeightMethod": "ACTUAL", + "baseCharge": 40.16, + "netFreight": 40.16, + "totalSurcharges": 3.01, + "netFedExCharge": 43.17, + "totalTaxes": 0.0, + "netCharge": 43.17, + "totalRebates": 0.0, + "billingWeight": { + "units": "LB", + "value": 22 + }, + "totalFreightDiscounts": 0.0, + "surcharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "level": "PACKAGE", + "amount": 3.01 + } + ], + "currency": "USD" + } + } + ] + }, + { + "rateType": "PREFERRED_CURRENCY", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 38.17, + "totalNetCharge": 41.03, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 41.03, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 41.03, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "52", + "dimDivisor": 0.0, + "fuelSurchargePercent": 7.5, + "totalSurcharges": 2.86, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "level": "PACKAGE", + "amount": 2.86 + } + ], + "currencyExchangeRate": { + "fromCurrency": "CAD", + "intoCurrency": "USD", + "rate": 0.77 + }, + "totalBillingWeight": { + "units": "LB", + "value": 22 + }, + "currency": "USD" + }, + "ratedPackages": [ + { + "groupNumber": 0.0, + "effectiveNetDiscount": 0.0, + "packageRateDetail": { + "rateType": "PREFERRED_ACCOUNT_PACKAGE", + "ratedWeightMethod": "ACTUAL", + "baseCharge": 38.17, + "netFreight": 38.17, + "totalSurcharges": 2.86, + "netFedExCharge": 41.03, + "totalTaxes": 0.0, + "netCharge": 41.03, + "totalRebates": 0.0, + "billingWeight": { + "units": "LB", + "value": 22 + }, + "totalFreightDiscounts": 0.0, + "surcharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "level": "PACKAGE", + "amount": 2.86 + } + ], + "currency": "USD" + } + } + ], + "currency": "USD" + }, + { + "rateType": "LIST", + "ratedWeightMethod": "ACTUAL", + "totalDiscounts": 0.0, + "totalBaseCharge": 52.45, + "totalNetCharge": 56.38, + "totalVatCharge": 0.0, + "totalNetFedExCharge": 56.38, + "totalDutiesAndTaxes": 0.0, + "totalNetChargeWithDutiesAndTaxes": 56.38, + "totalDutiesTaxesAndFees": 0.0, + "totalAncillaryFeesAndTaxes": 0.0, + "shipmentRateDetail": { + "rateZone": "52", + "dimDivisor": 0.0, + "fuelSurchargePercent": 7.5, + "totalSurcharges": 3.93, + "totalFreightDiscount": 0.0, + "surCharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "level": "PACKAGE", + "amount": 3.93 + } + ], + "totalBillingWeight": { + "units": "LB", + "value": 2 + }, + "currency": "CAD" + }, + "ratedPackages": [ + { + "groupNumber": 0.0, + "effectiveNetDiscount": 0.0, + "packageRateDetail": { + "rateType": "PAYOR_LIST_PACKAGE", + "ratedWeightMethod": "ACTUAL", + "baseCharge": 52.45, + "netFreight": 52.45, + "totalSurcharges": 3.93, + "netFedExCharge": 56.38, + "totalTaxes": 0.0, + "netCharge": 56.38, + "totalRebates": 0.0, + "billingWeight": { + "units": "LB", + "value": 22 + }, + "totalFreightDiscounts": 0.0, + "surcharges": [ + { + "type": "FUEL", + "description": "Fuel Surcharge", + "level": "PACKAGE", + "amount": 3.93 + } + ], + "currency": "CAD" + } + } + ], + "currency": "CAD", + "anonymouslyAllowable": true, + "operationalDetail": { + "ineligibleForMoneyBackGuarantee": false, + "astraDescription": "FXG", + "airportId": "MEM", + "serviceCode": "92", + "originLocationIds": "COSA", + "commitDays": "", + "scac": "", + "originServiceAreas": "AM", + "deliveryDay": "TUE", + "originLocationNumbers": 1162, + "destinationPostalCode": "38125", + "commitDate": "2019-07-22T08:30:00", + "deliveryDate": "", + "deliveryEligibilities": "", + "maximumTransitTime": "", + "astraPlannedServiceLevel": "", + "destinationLocationIds": "EHTA", + "destinationLocationStateOrProvinceCodes": "CT", + "transitTime": "THREE_DAYS", + "packagingCode": "02", + "destinationLocationNumbers": 892, + "publishedDeliveryTime": "06:30:00", + "countryCodes": "US", + "stateOrProvinceCodes": "TX", + "ursaPrefixCode": "82", + "ursaSuffixCode": "EHTA", + "destinationServiceAreas": "AA", + "originPostalCodes": "75063", + "customTransitTime": "" + }, + "signatureOptionType": "SERVICE_DEFAULT", + "serviceDescription": { + "serviceId": "EP1000000135", + "serviceType": "FEDEX_GROUND", + "code": "92", + "names": [ + { + "type": "long", + "encoding": "utf-8", + "value": "FedEx International Ground®" + }, + { + "type": "long", + "encoding": "ascii", + "value": "FedEx International Ground" + }, + { + "type": "medium", + "encoding": "utf-8", + "value": "International Ground®" + }, + { + "type": "medium", + "encoding": "ascii", + "value": "International Ground" + }, + { + "type": "short", + "encoding": "utf-8", + "value": "IG" + }, + { + "type": "short", + "encoding": "ascii", + "value": "IG" + }, + { + "type": "abbrv", + "encoding": "ascii", + "value": "SG" + } + ], + "operatingOrgCodes": [ + "FXG" + ], + "description": "FedEx Ground", + "astraDescription": "FXG" + } + } + ] + } + ], + "quoteDate": "2019-09-06", + "encoded": false, + "alerts": [ + { + "code": "MONEYBACKGUARANTEE.NOT.ELIGIBLE", + "message": "We are unable to process this request. Please try again later or contact FedEx Customer Service.", + "alertType": "NOTE" + } + ] + } +} +""" diff --git a/modules/connectors/fedex/tests/fedex/test_shipment.py b/modules/connectors/fedex/tests/fedex/test_shipment.py new file mode 100644 index 0000000000..a4148ac05a --- /dev/null +++ b/modules/connectors/fedex/tests/fedex/test_shipment.py @@ -0,0 +1,1285 @@ +import unittest +from unittest.mock import patch, ANY +from .fixture import gateway + +import karrio +import karrio.lib as lib +import karrio.core.models as models + + +class TestFedExShipping(unittest.TestCase): + def setUp(self): + self.maxDiff = None + self.ShipmentRequest = models.ShipmentRequest(**ShipmentPayload) + self.ShipmentCancelRequest = models.ShipmentCancelRequest( + **ShipmentCancelPayload + ) + self.MultiPieceShipmentRequest = models.ShipmentRequest( + **MultiPieceShipmentPayload + ) + + def test_create_shipment_request(self): + request = gateway.mapper.create_shipment_request(self.ShipmentRequest) + + self.assertEqual(request.serialize(), ShipmentRequest) + + def test_create_multi_piece_shipment_request(self): + request = gateway.mapper.create_shipment_request(self.MultiPieceShipmentRequest) + + self.assertEqual(request.serialize(), MultiPieceShipmentRequest) + + def test_create_cancel_shipment_request(self): + request = gateway.mapper.create_cancel_shipment_request( + self.ShipmentCancelRequest + ) + + self.assertEqual(request.serialize(), ShipmentCancelRequest) + + def test_create_shipment(self): + with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + mock.return_value = "{}" + karrio.Shipment.create(self.ShipmentRequest).from_(gateway) + + self.assertEqual( + mock.call_args[1]["url"], + f"{gateway.settings.server_url}/ship", + ) + + def test_cancel_shipment(self): + with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + mock.return_value = "{}" + karrio.Shipment.cancel(self.ShipmentCancelRequest).from_(gateway) + + self.assertEqual( + mock.call_args[1]["url"], + f"{gateway.settings.server_url}/ship", + ) + + def test_parse_shipment_response(self): + with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + mock.return_value = ShipmentResponse + parsed_response = ( + karrio.Shipment.create(self.ShipmentRequest).from_(gateway).parse() + ) + + self.assertListEqual(lib.to_dict(parsed_response), ParsedShipmentResponse) + + def test_parse_cancel_shipment_response(self): + with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + mock.return_value = ShipmentCancelResponse + parsed_response = ( + karrio.Shipment.cancel(self.ShipmentCancelRequest) + .from_(gateway) + .parse() + ) + + self.assertListEqual( + lib.to_dict(parsed_response), ParsedCancelShipmentResponse + ) + + +if __name__ == "__main__": + unittest.main() + + +ShipmentPayload = { + "shipper": { + "person_name": "Input Your Information", + "company_name": "Input Your Information", + "phone_number": "Input Your Information", + "email": "Input Your Information", + "address_line1": "Input Your Information", + "address_line2": "Input Your Information", + "city": "MEMPHIS", + "state_code": "TN", + "postal_code": "38117", + "country_code": "US", + }, + "recipient": { + "person_name": "Input Your Information", + "company_name": "Input Your Information", + "phone_number": "Input Your Information", + "email": "Input Your Information", + "address_line1": "Input Your Information", + "address_line2": "Input Your Information", + "city": "RICHMOND", + "state_code": "BC", + "postal_code": "V7C4v7", + "country_code": "CA", + }, + "parcels": [ + { + "packaging_type": "your_packaging", + "weight_unit": "LB", + "dimension_unit": "IN", + "weight": 20.0, + "length": 12, + "width": 12, + "height": 12, + } + ], + "service": "fedex_international_priority", + "options": { + "currency": "USD", + "shipment_date": "2024-02-15", + }, + "payment": {"paid_by": "third_party", "account_number": "2349857"}, + "customs": { + "invoice": "123456789", + "duty": {"paid_by": "sender", "declared_value": 100.0}, + "commodities": [{"weight": "10", "title": "test", "hs_code": "00339BB"}], + "commercial_invoice": True, + }, + "reference": "#Order 11111", +} + +MultiPieceShipmentPayload = { + **ShipmentPayload, + "parcels": [ + { + "packaging_type": "your_packaging", + "weight_unit": "LB", + "dimension_unit": "IN", + "weight": 1.0, + "length": 12, + "width": 12, + "height": 12, + }, + { + "packaging_type": "your_packaging", + "weight_unit": "LB", + "dimension_unit": "IN", + "weight": 2.0, + "length": 11, + "width": 11, + "height": 11, + }, + ], + "options": { + "currency": "USD", + "paperless_trade": True, + "shipment_date": "2024-02-17", + }, +} + +ShipmentCancelPayload = {"shipment_identifier": "794953555571"} + +ParsedShipmentResponse = [ + { + "carrier_id": "fedex", + "carrier_name": "fedex", + "docs": {"label": ANY}, + "label_type": "PDF", + "meta": { + "carrier_tracking_link": "https://www.fedex.com/fedextrack/?trknbr=794953535000", + "serviceCategory": "EXPRESS", + "service_name": "fedex_standard_overnight", + "trackingIdType": "FEDEX", + }, + "shipment_identifier": "794953535000", + "tracking_number": "794953535000", + }, + [ + { + "carrier_id": "fedex", + "carrier_name": "fedex", + "code": "SHIP.RECIPIENT.POSTALCITY.MISMATCH", + "details": {}, + "message": "Recipient Postal-City Mismatch.", + } + ], +] + +ParsedCancelShipmentResponse = [ + { + "carrier_id": "fedex", + "carrier_name": "fedex", + "operation": "Cancel Shipment", + "success": True, + }, + [ + { + "carrier_id": "fedex", + "carrier_name": "fedex", + "code": "SHIP.RECIPIENT.POSTALCITY.MISMATCH", + "details": {}, + "message": "Recipient Postal-City Mismatch.", + } + ], +] + + +ShipmentRequest = [ + { + "accountNumber": {"value": "2349857"}, + "labelResponseOptions": "LABEL", + "requestedShipment": { + "customsClearanceDetail": { + "commercialInvoice": { + "customerReferences": [ + { + "customerReferenceType": "INVOICE_NUMBER", + "value": "123456789", + } + ], + "originatorName": "Input Your Information", + "termsOfSale": "DDU", + }, + "commodities": [ + { + "countryOfManufacture": "US", + "description": "test", + "harmonizedCode": "00339BB", + "numberOfPieces": 1, + "quantity": 1, + "quantityUnits": "EA", + "weight": {"units": "LB", "value": 10.0}, + } + ], + "dutiesPayment": { + "paymentType": "SENDER", + "payor": { + "responsibleParty": { + "address": { + "city": "MEMPHIS", + "countryCode": "US", + "postalCode": "38117", + "residential": False, + "stateOrProvinceCode": "TN", + "streetLines": [ + "Input Your Information", + "Input Your Information", + ], + }, + "contact": { + "companyName": "Input Your Information", + "emailAddress": "Input Your Information", + "personName": "Input Your Information", + "phoneNumber": "Input Your Information", + }, + } + }, + }, + "isDocumentOnly": False, + }, + "labelSpecification": { + "imageType": "PDF", + "labelFormatType": "COMMON2D", + "labelOrder": "SHIPPING_LABEL_FIRST", + "labelStockType": "STOCK_4X6", + }, + "packagingType": "YOUR_PACKAGING", + "pickupType": "DROPOFF_AT_FEDEX_LOCATION", + "preferredCurrency": "USD", + "recipients": [ + { + "address": { + "city": "RICHMOND", + "countryCode": "CA", + "postalCode": "V7C4v7", + "residential": False, + "stateOrProvinceCode": "BC", + "streetLines": [ + "Input Your Information", + "Input Your Information", + ], + }, + "contact": { + "companyName": "Input Your Information", + "emailAddress": "Input Your Information", + "personName": "Input Your Information", + "phoneNumber": "Input Your Information", + }, + } + ], + "requestedPackageLineItems": [ + { + "dimensions": { + "height": 12.0, + "length": 12.0, + "units": "IN", + "width": 12.0, + }, + "packageSpecialServices": { + "signatureOptionType": True, + "specialServiceTypes": ["SIGNATURE_OPTION"], + }, + "sequenceNumber": 1, + "weight": {"units": "LB", "value": 20.0}, + } + ], + "serviceType": "FEDEX_INTERNATIONAL_PRIORITY", + "shipDatestamp": "2024-02-15", + "shipmentSpecialServices": {"specialServiceTypes": ["SIGNATURE_OPTION"]}, + "shipper": { + "accountNumber": "2349857", + "address": { + "city": "MEMPHIS", + "countryCode": "US", + "postalCode": "38117", + "residential": False, + "stateOrProvinceCode": "TN", + "streetLines": ["Input Your Information", "Input Your Information"], + }, + "contact": { + "companyName": "Input Your Information", + "emailAddress": "Input Your Information", + "personName": "Input Your Information", + "phoneNumber": "Input Your Information", + }, + }, + "shippingChargesPayment": { + "paymentType": "THIRD_PARTY", + "payor": {"responsibleParty": {"accountNumber": "2349857"}}, + }, + "shippingDocumentSpecification": { + "shippingDocumentTypes": ["COMMERCIAL_INVOICE"] + }, + "soldTo": { + "address": { + "city": "RICHMOND", + "countryCode": "CA", + "postalCode": "V7C4v7", + "residential": False, + "stateOrProvinceCode": "BC", + "streetLines": ["Input Your Information", "Input Your Information"], + }, + "contact": { + "companyName": "Input Your Information", + "emailAddress": "Input Your Information", + "personName": "Input Your Information", + "phoneNumber": "Input Your Information", + }, + }, + "totalPackageCount": 1, + "totalWeight": 20.0, + }, + "shipAction": "CONFIRM", + } +] + +MultiPieceShipmentRequest = [ + { + "accountNumber": {"value": "2349857"}, + "labelResponseOptions": "LABEL", + "requestedShipment": { + "customsClearanceDetail": { + "commercialInvoice": { + "customerReferences": [ + { + "customerReferenceType": "INVOICE_NUMBER", + "value": "123456789", + } + ], + "originatorName": "Input " "Your " "Information", + "termsOfSale": "DDU", + }, + "commodities": [ + { + "countryOfManufacture": "US", + "description": "test", + "harmonizedCode": "00339BB", + "numberOfPieces": 1, + "quantity": 1, + "quantityUnits": "EA", + "weight": {"units": "LB", "value": 10.0}, + } + ], + "dutiesPayment": { + "paymentType": "SENDER", + "payor": { + "responsibleParty": { + "address": { + "city": "MEMPHIS", + "countryCode": "US", + "postalCode": "38117", + "residential": False, + "stateOrProvinceCode": "TN", + "streetLines": [ + "Input " "Your " "Information", + "Input " "Your " "Information", + ], + }, + "contact": { + "companyName": "Input " "Your " "Information", + "emailAddress": "Input " "Your " "Information", + "personName": "Input " "Your " "Information", + "phoneNumber": "Input " "Your " "Information", + }, + } + }, + }, + "isDocumentOnly": False, + }, + "labelSpecification": { + "imageType": "PDF", + "labelFormatType": "COMMON2D", + "labelOrder": "SHIPPING_LABEL_FIRST", + "labelStockType": "STOCK_4X6", + }, + "packagingType": "YOUR_PACKAGING", + "pickupType": "DROPOFF_AT_FEDEX_LOCATION", + "preferredCurrency": "USD", + "recipients": [ + { + "address": { + "city": "RICHMOND", + "countryCode": "CA", + "postalCode": "V7C4v7", + "residential": False, + "stateOrProvinceCode": "BC", + "streetLines": [ + "Input " "Your " "Information", + "Input " "Your " "Information", + ], + }, + "contact": { + "companyName": "Input Your " "Information", + "emailAddress": "Input " "Your " "Information", + "personName": "Input Your " "Information", + "phoneNumber": "Input Your " "Information", + }, + } + ], + "requestedPackageLineItems": [ + { + "dimensions": { + "height": 12.0, + "length": 12.0, + "units": "IN", + "width": 12.0, + }, + "packageSpecialServices": { + "signatureOptionType": True, + "specialServiceTypes": ["SIGNATURE_OPTION"], + }, + "sequenceNumber": 1, + "weight": {"units": "LB", "value": 1.0}, + } + ], + "serviceType": "FEDEX_INTERNATIONAL_PRIORITY", + "shipDatestamp": "2024-02-17", + "shipmentSpecialServices": { + "etdDetail": { + "attachedDocuments": [None], + "attributes": ["POST_SHIPMENT_UPLOAD_REQUESTED"], + "requestedDocumentTypes": ["COMMERCIAL_INVOICE"], + }, + "specialServiceTypes": [ + "ELECTRONIC_TRADE_DOCUMENTS", + "SIGNATURE_OPTION", + ], + }, + "shipper": { + "accountNumber": "2349857", + "address": { + "city": "MEMPHIS", + "countryCode": "US", + "postalCode": "38117", + "residential": False, + "stateOrProvinceCode": "TN", + "streetLines": [ + "Input Your " "Information", + "Input Your " "Information", + ], + }, + "contact": { + "companyName": "Input Your " "Information", + "emailAddress": "Input Your " "Information", + "personName": "Input Your " "Information", + "phoneNumber": "Input Your " "Information", + }, + }, + "shippingChargesPayment": { + "paymentType": "THIRD_PARTY", + "payor": {"responsibleParty": {"accountNumber": "2349857"}}, + }, + "soldTo": { + "address": { + "city": "RICHMOND", + "countryCode": "CA", + "postalCode": "V7C4v7", + "residential": False, + "stateOrProvinceCode": "BC", + "streetLines": [ + "Input Your " "Information", + "Input Your " "Information", + ], + }, + "contact": { + "companyName": "Input Your " "Information", + "emailAddress": "Input Your " "Information", + "personName": "Input Your " "Information", + "phoneNumber": "Input Your " "Information", + }, + }, + "totalPackageCount": 2, + "totalWeight": 1.0, + }, + "shipAction": "CONFIRM", + }, + { + "accountNumber": {"value": "2349857"}, + "labelResponseOptions": "LABEL", + "requestedShipment": { + "customsClearanceDetail": { + "commercialInvoice": { + "customerReferences": [ + { + "customerReferenceType": "INVOICE_NUMBER", + "value": "123456789", + } + ], + "originatorName": "Input " "Your " "Information", + "termsOfSale": "DDU", + }, + "commodities": [ + { + "countryOfManufacture": "US", + "description": "test", + "harmonizedCode": "00339BB", + "numberOfPieces": 1, + "quantity": 1, + "quantityUnits": "EA", + "weight": {"units": "LB", "value": 10.0}, + } + ], + "dutiesPayment": { + "paymentType": "SENDER", + "payor": { + "responsibleParty": { + "address": { + "city": "MEMPHIS", + "countryCode": "US", + "postalCode": "38117", + "residential": False, + "stateOrProvinceCode": "TN", + "streetLines": [ + "Input " "Your " "Information", + "Input " "Your " "Information", + ], + }, + "contact": { + "companyName": "Input " "Your " "Information", + "emailAddress": "Input " "Your " "Information", + "personName": "Input " "Your " "Information", + "phoneNumber": "Input " "Your " "Information", + }, + } + }, + }, + "isDocumentOnly": False, + }, + "labelSpecification": { + "imageType": "PDF", + "labelFormatType": "COMMON2D", + "labelOrder": "SHIPPING_LABEL_FIRST", + "labelStockType": "STOCK_4X6", + }, + "masterTrackingId": { + "trackingIdType": "[MASTER_ID_TYPE]", + "trackingNumber": "[MASTER_TRACKING_ID]", + }, + "packagingType": "YOUR_PACKAGING", + "pickupType": "DROPOFF_AT_FEDEX_LOCATION", + "preferredCurrency": "USD", + "recipients": [ + { + "address": { + "city": "RICHMOND", + "countryCode": "CA", + "postalCode": "V7C4v7", + "residential": False, + "stateOrProvinceCode": "BC", + "streetLines": [ + "Input " "Your " "Information", + "Input " "Your " "Information", + ], + }, + "contact": { + "companyName": "Input Your " "Information", + "emailAddress": "Input " "Your " "Information", + "personName": "Input Your " "Information", + "phoneNumber": "Input Your " "Information", + }, + } + ], + "requestedPackageLineItems": [ + { + "dimensions": { + "height": 11.0, + "length": 11.0, + "units": "IN", + "width": 11.0, + }, + "packageSpecialServices": { + "signatureOptionType": True, + "specialServiceTypes": ["SIGNATURE_OPTION"], + }, + "sequenceNumber": 2, + "weight": {"units": "LB", "value": 2.0}, + } + ], + "serviceType": "FEDEX_INTERNATIONAL_PRIORITY", + "shipDatestamp": "2024-02-17", + "shipmentSpecialServices": { + "etdDetail": { + "attachedDocuments": [None], + "attributes": ["POST_SHIPMENT_UPLOAD_REQUESTED"], + "requestedDocumentTypes": ["COMMERCIAL_INVOICE"], + }, + "specialServiceTypes": [ + "ELECTRONIC_TRADE_DOCUMENTS", + "SIGNATURE_OPTION", + ], + }, + "shipper": { + "accountNumber": "2349857", + "address": { + "city": "MEMPHIS", + "countryCode": "US", + "postalCode": "38117", + "residential": False, + "stateOrProvinceCode": "TN", + "streetLines": [ + "Input Your " "Information", + "Input Your " "Information", + ], + }, + "contact": { + "companyName": "Input Your " "Information", + "emailAddress": "Input Your " "Information", + "personName": "Input Your " "Information", + "phoneNumber": "Input Your " "Information", + }, + }, + "shippingChargesPayment": { + "paymentType": "THIRD_PARTY", + "payor": {"responsibleParty": {"accountNumber": "2349857"}}, + }, + "soldTo": { + "address": { + "city": "RICHMOND", + "countryCode": "CA", + "postalCode": "V7C4v7", + "residential": False, + "stateOrProvinceCode": "BC", + "streetLines": [ + "Input Your " "Information", + "Input Your " "Information", + ], + }, + "contact": { + "companyName": "Input Your " "Information", + "emailAddress": "Input Your " "Information", + "personName": "Input Your " "Information", + "phoneNumber": "Input Your " "Information", + }, + }, + "totalPackageCount": 2, + "totalWeight": 2.0, + }, + "shipAction": "CONFIRM", + }, +] + +ShipmentCancelRequest = { + "accountNumber": {"value": "2349857"}, + "deletionControl": "DELETE_ALL_PACKAGES", + "trackingNumber": "794953555571", +} + +ShipmentResponse = """{ + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "output": { + "transactionShipments": [ + { + "serviceType": "STANDARD_OVERNIGHT", + "shipDatestamp": "2010-03-04", + "serviceCategory": "EXPRESS", + "shipmentDocuments": [ + { + "contentKey": "content key", + "copiesToPrint": 10, + "contentType": "LABEL", + "trackingNumber": "794953535000", + "docType": "PDF", + "encodedLabel": "JVBERi0xLjQKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwovUGFnZXMgMyAwIFIKPj4KZW5kb2JqCjIgMCBvYmoKPDwKL1R5cGUgL091dGxpbmVzCi9Db3VudCAwCj4+CmVuZG9iagozIDAgb2JqCjw8Ci9UeXBlIC9QYWdlcwovQ291bnQgMwovS2lkcyBbMTggMCBSIDE5IDAgUiAyMCAwIFJdCj4+CmVuZG9iago0IDAgb2JqClsvUERGIC9UZXh0IC9JbWFnZUIgL0ltYWdlQyAvSW1hZ2VJXQplbmRvYmoKNSAwIG9iago8PAovVHlwZSAvRm9udAovU3VidHlwZSAvVHlwZTEKL0Jhc2VGb250IC9IZWx2ZXRpY2EKL0VuY29kaW5nIC9NYWNSb21hbkVuY29kaW5nCj4+CmVuZG9iago2IDAgb2JqCjw8Ci9UeXBlIC9Gb250Ci9TdWJ0eXBlIC9UeXBlMQovQmFzZUZvbnQgL0hlbHZldGljYS1Cb2xkCi9FbmNvZGluZyAvTWFjUm9tYW5FbmNvZGluZwo+PgplbmRvYmoKNyAwIG9iago8PAovVHlwZSAvRm9udAovU3VidHlwZSAvVHlwZTEKL0Jhc2VGb250IC9IZWx2ZXRpY2EtT2JsaXF1ZQovRW5jb2RpbmcgL01hY1JvbWFuRW5jb2RpbmcKPj4KZW5kb2JqCjggMCBvYmoKPDwKL1R5cGUgL0ZvbnQKL1N1YnR5cGUgL1R5cGUxCi9CYXNlRm9udCAvSGVsdmV0aWNhLUJvbGRPYmxpcXVlCi9FbmNvZGluZyAvTWFjUm9tYW5FbmNvZGluZwo+PgplbmRvYmoKOSAwIG9iago8PAovVHlwZSAvRm9udAovU3VidHlwZSAvVHlwZTEKL0Jhc2VGb250IC9Db3VyaWVyCi9FbmNvZGluZyAvTWFjUm9tYW5FbmNvZGluZwo+PgplbmRvYmoKMTAgMCBvYmoKPDwKL1R5cGUgL0ZvbnQKL1N1YnR5cGUgL1R5cGUxCi9CYXNlRm9udCAvQ291cmllci1Cb2xkCi9FbmNvZGluZyAvTWFjUm9tYW5FbmNvZGluZwo+PgplbmRvYmoKMTEgMCBvYmoKPDwKL1R5cGUgL0ZvbnQKL1N1YnR5cGUgL1R5cGUxCi9CYXNlRm9udCAvQ291cmllci1PYmxpcXVlCi9FbmNvZGluZyAvTWFjUm9tYW5FbmNvZGluZwo+PgplbmRvYmoKMTIgMCBvYmoKPDwKL1R5cGUgL0ZvbnQKL1N1YnR5cGUgL1R5cGUxCi9CYXNlRm9udCAvQ291cmllci1Cb2xkT2JsaXF1ZQovRW5jb2RpbmcgL01hY1JvbWFuRW5jb2RpbmcKPj4KZW5kb2JqCjEzIDAgb2JqCjw8Ci9UeXBlIC9Gb250Ci9TdWJ0eXBlIC9UeXBlMQovQmFzZUZvbnQgL1RpbWVzLVJvbWFuCi9FbmNvZGluZyAvTWFjUm9tYW5FbmNvZGluZwo+PgplbmRvYmoKMTQgMCBvYmoKPDwKL1R5cGUgL0ZvbnQKL1N1YnR5cGUgL1R5cGUxCi9CYXNlRm9udCAvVGltZXMtQm9sZAovRW5jb2RpbmcgL01hY1JvbWFuRW5jb2RpbmcKPj4KZW5kb2JqCjE1IDAgb2JqCjw8Ci9UeXBlIC9Gb250Ci9TdWJ0eXBlIC9UeXBlMQovQmFzZUZvbnQgL1RpbWVzLUl0YWxpYwovRW5jb2RpbmcgL01hY1JvbWFuRW5jb2RpbmcKPj4KZW5kb2JqCjE2IDAgb2JqCjw8Ci9UeXBlIC9Gb250Ci9TdWJ0eXBlIC9UeXBlMQovQmFzZUZvbnQgL1RpbWVzLUJvbGRJdGFsaWMKL0VuY29kaW5nIC9NYWNSb21hbkVuY29kaW5nCj4+CmVuZG9iagoxNyAwIG9iaiAKPDwKL0NyZWF0aW9uRGF0ZSAoRDoyMDAzKQovUHJvZHVjZXIgKEZlZEV4IFNlcnZpY2VzKQovVGl0bGUgKEZlZEV4IFNoaXBwaW5nIExhYmVsKQ0vQ3JlYXRvciAoRmVkRXggQ3VzdG9tZXIgQXV0b21hdGlvbikNL0F1dGhvciAoQ0xTIFZlcnNpb24gNTEyMDEzNSkKPj4KZW5kb2JqCjE4IDAgb2JqCjw8Ci9UeXBlIC9QYWdlDS9QYXJlbnQgMyAwIFIKL1Jlc291cmNlcyA8PCAvUHJvY1NldCA0IDAgUiAKIC9Gb250IDw8IC9GMSA1IDAgUiAKL0YyIDYgMCBSIAovRjMgNyAwIFIgCi9GNCA4IDAgUiAKL0Y1IDkgMCBSIAovRjYgMTAgMCBSIAovRjcgMTEgMCBSIAovRjggMTIgMCBSIAovRjkgMTMgMCBSIAovRjEwIDE0IDAgUiAKL0YxMSAxNSAwIFIgCi9GMTIgMTYgMCBSIAogPj4KL1hPYmplY3QgPDwgL0ZlZEV4RXhwcmVzcyAyMyAwIFIKL0V4cHJlc3NFIDI0IDAgUgovYmFyY29kZTAgMjUgMCBSCi9GZWRFeEV4cHJlc3MgMjYgMCBSCi9FeHByZXNzRSAyNyAwIFIKPj4KPj4KL01lZGlhQm94IFswIDAgMjg4IDQzMl0KL1RyaW1Cb3hbMCAwIDI4OCA0MzJdCi9Db250ZW50cyAyMSAwIFIKL1JvdGF0ZSAwPj4KZW5kb2JqCjE5IDAgb2JqCjw8Ci9UeXBlIC9QYWdlDS9QYXJlbnQgMyAwIFIKL1Jlc291cmNlcyA8PCAvUHJvY1NldCA0IDAgUiAKIC9Gb250IDw8IC9GMSA1IDAgUiAKL0YyIDYgMCBSIAovRjMgNyAwIFIgCi9GNCA4IDAgUiAKL0Y1IDkgMCBSIAovRjYgMTAgMCBSIAovRjcgMTEgMCBSIAovRjggMTIgMCBSIAovRjkgMTMgMCBSIAovRjEwIDE0IDAgUiAKL0YxMSAxNSAwIFIgCi9GMTIgMTYgMCBSIAogPj4KL1hPYmplY3QgPDwgL0ZlZEV4RXhwcmVzcyAyMyAwIFIKL0V4cHJlc3NFIDI0IDAgUgovYmFyY29kZTAgMjUgMCBSCi9GZWRFeEV4cHJlc3MgMjYgMCBSCi9FeHByZXNzRSAyNyAwIFIKPj4KPj4KL01lZGlhQm94IFswIDAgMjg4IDQzMl0KL1RyaW1Cb3hbMCAwIDI4OCA0MzJdCi9Db250ZW50cyAyMiAwIFIKL1JvdGF0ZSAwPj4KZW5kb2JqCjIwIDAgb2JqCjw8Ci9UeXBlIC9QYWdlDS9QYXJlbnQgMyAwIFIKL1Jlc291cmNlcyA8PCAvUHJvY1NldCA0IDAgUiAKIC9Gb250IDw8IC9GMSA1IDAgUiAKL0YyIDYgMCBSIAovRjMgNyAwIFIgCi9GNCA4IDAgUiAKL0Y1IDkgMCBSIAovRjYgMTAgMCBSIAovRjcgMTEgMCBSIAovRjggMTIgMCBSIAovRjkgMTMgMCBSIAovRjEwIDE0IDAgUiAKL0YxMSAxNSAwIFIgCi9GMTIgMTYgMCBSIAogPj4KL1hPYmplY3QgPDwgL0ZlZEV4RXhwcmVzcyAyMyAwIFIKL0V4cHJlc3NFIDI0IDAgUgovYmFyY29kZTAgMjUgMCBSCi9GZWRFeEV4cHJlc3MgMjYgMCBSCi9FeHByZXNzRSAyNyAwIFIKPj4KPj4KL01lZGlhQm94IFswIDAgMjg4IDQzMl0KL1RyaW1Cb3hbMCAwIDI4OCA0MzJdCi9Db250ZW50cyAyMiAwIFIKL1JvdGF0ZSAwPj4KZW5kb2JqCjIxIDAgb2JqCjw8IC9MZW5ndGggMjYwNwovRmlsdGVyIFsvQVNDSUk4NURlY29kZSAvRmxhdGVEZWNvZGVdIAo+PgpzdHJlYW0KR2F0PS45bGpPSigjPHJOcnJGcTMsYiJRSVxAQjxYWyVnJUNWQl86XjhCWFJQUmw1NyZTVS9eRlBMZTJpaFpMTV1STl9gZSs7XjQnbCtEKGYKTWk3SDVjalozczUiOk0qYGVsL3BFUjlUXSRwKj1XKCw9ZVcudWdJbGR0Y1ckYlM5TUJpOz89aSJUTDRPMyVcdEU9J21eS3M1P1RsXVNzPjQKXClQPT0uaVUxSCR0NFkkaDxcYCw/NWFSLm1kRHJPQ0E1SzIxKCNILTFkOiZZQkhPO1lrMjZxUClYWnRROVJYNnFddC46J3EvMUo7Slw3RFMKTTglZ0VBJSgxYzEpZGk9XVVeXllQcWFGWUFGRWo7aHU5amM/TCdoUUlCRWZiLCFJLzBrRnJIXi9KZEEzXVw9RUlPTVswRixpbS9cbyEwLD8KUlM1SyhwM1ZbaF4zUjNkbC5gKm1bQHRaJF5MVlcxUUFlaGAqREVuZ3EhTHAqLExQW289TSpgVWoqYyk8b1o6R2E0LSVVJSNLKTw4Nix0SXMKcnIpWlttZXMzQltESyNQcVgybUZGU1tcYGBUbGphPiQ6XkdyaiooIXA/YmRGVz1eJS0nIWRSTzokLFNVTi1pRXNqaV9GXiMpT0NLW1BDUEMKLCRQUWZnMmpASE51KWc+XCooOVlTNDJEXEEvbXR0NjhaXnNNcmpwKlBiX3BNMyJUX1gkLyJRJUM9KU8mNydrXWYrYUEpLT09OVtjcF4kW1AKQkA+SykyKVw1JWQ8ayY6IV9NSyJbU24wJiM4SHVyIW8jWlEpTWQtSUs9L2U3M2VGUVo0OkVpdDdXcl9RbFwxP0RlRTEzNEM6LipDYFYjO0wKXlJfISo4ITFWODZSKDxrIm0lSFYoNWcvO1QrUi83X3RwWmloSj9OJWVSR2t0TjkxXSRrM0AtXUUnSVVHbm4lXDlFcEVBa104LC5tQzpoKjIKYj02dTFBPyEzXyVORzAwQXBxO0dYVCxCUTJlbSZFcShMXF42TWNqQGYoMCdoMXF0Ry5mbC40YjJsalBQWzldcE9iRC5rZCQnbzhLZismQj0KNnQzPlJaR1c9bmxjOCs1XChbcTYvVWgnTmtaU2tfPlFQazU2Vy9oODduJjIxPyFaaWBnUllwRmhebjZHRjgzQE5EZyFURiU5SFVJUDNbYDQKbilkaklcOXMiJmxVUVolV1QtISlkY11IUFlmTUQ1bCZWI3RAcz5oXUM0aVE0a1YjIzRxZC10S3FyKTghXydIIz1GZSE2U2k1Zmtycmc5WFQKNEVBXTE4LWZzJHBfN2tRRUBHQTU5Jy1dXFNSOSQ8TGtrY2JqY1xkUyIqMFktPVdZVW4zL0NaTTBtY2xjSFRqX3VWRExxRmc9WkFkVXFyIjUKJTUrO1s2M1g3Y3FlU2AjTDUoWzlWUDE3LWNFWjhBTFNAbFAlLl5aXFVEJyJucypRYFo1K0BzPSxcOCw6LFg5Oi47PXQ2MVNbcVhTQ0MvWkMKUyJePCpwLixDTktJZUgyVkNqWD80ISFUSS0qL0NrMms5UE5tMDVQal5pNkVlOUVGSDgpc11mXCxgdWkoWWxkVWJXX05gTC4+LmxNIjMlPGwKLEZPOV0hVUROXExFWV91YFpSOVAxaDZxcWhlWitAcSVUKnVoaDdObyVASWpbLj4tMHFnWCdbPFt0XmZPSyktYFQ+LEdRLlluYD1vVnI7ODcKWERfQ1dTUVpVMWtPQmFVME1vVklCLVgxQClSMlNkQmduTChlcm8hZGpiQVpGWi5xOE1dc2JwO2xSRjNeRF9lN1gzPmonTFRONFM3UXFSaFAKUF9sMCEmdSI+czlzKihfWVdlSV83bE1fNWkoOWRYQipxVjFTIldnKWRjOlBJNmkwPWMtdC5OYSEiR1lxIkdDJ09YUFQ9PCQxIiZpLlZiR1MKMk1lW1JGQSZLXW9yU1luZTwkXlAkXExFU2k4ZG4vJEVkSU8lUTZJP0Q4SVJII1xZTmNjWVEoK0VSaC4lRk1Yb1Q9dWxoaTtvaz5XbzA/SGsKQDEnK0NRKzEtRDJgZSY1TjlaK3JpPF42KGs2ZFY6XHVfMFE/UDZTRzp1WE5LNnJTZVJAbC9wLjJzUHIkWSZkJ2M3OEBpXCVCOllbJVpPRm4KXzAram1IbnEmN1U+U2JpWis1XWA+YzZbN2lkSURxZGxzRSFbWSt1bVZcIVVXSGpbYUlVKDxQanJEQ0UoJEpGc3JMSyFOISh1KkohS2xxXEMKYk1cUkg3cyQ/OltxYGVmWSM+VXM7RzlrLFNpXW88WFZFPSpTVkQyPEdDP0R0WG4sOTU1IjUuJWA6OXFTK2ZJKVhFaGJnc2kmWlFncjhpb2wKZ3U4b0QpV2FeI2xdbWtKcFJHbjJSKEFdPjhtSjlVOVA5YzxrVy9GYj4rWkdaLyopRilPUlUjOE5rTUU1JEw8dDZpdXNtTi5IajpSTUpzbEUKO15nI1ZZVD1nRUYwOmVwJDxYTFVGRjQxY1VObEw7alRtMDg7XmUqblMwIzpvbFA4RixBTmMza1ZjTk9qX0tvZTFmVlNFLUxfMClcTl9uYTMKS0YhOFMtLU0yaSldPVc9aiVRQWhvYTpOQkFQb0NpTzEoPj0uXyY0c1VXN3VsQElzWV4/MGRgVGA6WEpKbltVVjEhRmcqcEMwLEFmNj1GdD4KJlBDU2pDY0hWQmYtcytQMD1fW05VTHVwZGUuPSpMXWc9SlxRdCgxPypPcUE5LyVBPXRYJTBXLllRZ1tsYjhFb1dZN000PyViNGIuOnVYTUgKQDtRaUNbdCJJNT8vSVtcV1NmZ01gKUMuZWAwY2U1PXJYb2dGajtEa1RrPUVEKyxxX1ddV1QxcWMzVkJzZXJTUCNLajFILy0qNlJySnQqcEQKXio5NlA1V1JKWzNKRFVFJUUyXmklIT1zYlBSXXJeMThoP09VTm1jPWZIUSpIaGU0Myw9QSghdU0+NjxeYiVVYkdRQTU+LGpLKExNZ2AxM0cKZTw6RE0+Q0QhS2RGKEQpblgrRitoVkcwMy5uLEJsTzZZdSM9ZChbaktkRGstciswP09eOUxxVDpCSDBQMTUrblw5WUBdYlxobmdXa0stXF0KZ0dWOlBEOlBTai8jJGtnYUktL2xHU2w/QjU8YVMrNGVbdVYlSWw5US1tXCYhX2w9UTZtSyJccUonWEBjX3RYaiI2K1luckhiKmNyU2VRVz0KUkFwRiFwJShbJUosIVVOSDI3OENUMEUySFJwLF9OcWBdIiYyZltxRCVLUz5aX29eZjU7SWgxV24mUF5TMkVFLzI2b09RZCVuJWFSJ18xQiMKMTlEaSVpUEc/OystQj9QVHAnQmdvKU1YLiwrcUtocjdiUkNyVll0Nys4IVc3Py9OM1hGZUhmMElMM25PZURSPTIxXkI1WjhMTSM5ZzdbbzEKaHU+TGNtSmxTS1M4QX4+CmVuZHN0cmVhbQplbmRvYmoKMjIgMCBvYmoKPDwgL0xlbmd0aCAzMDY0Ci9GaWx0ZXIgWy9BU0NJSTg1RGVjb2RlIC9GbGF0ZURlY29kZV0gCj4+CnN0cmVhbQpHYXQ9Lj1gWUxsKDROLzJzNT9yNVFeTGguZEQjKykhSU1vP2ZPTldURWJmIS1FJG82KUJGZzNEcFhlO3QoPDAhPzI2QTMqTD5eREBlKEtmMwozb1YiWFh1NjJoYGFmM1pQUjhSaVYkNzNTJF8rR0dnY09MUTVkWipxPGwtXWwoWSFIXUhbZUF1NWxSVVgtMDUqbCE8bilULitoNSheRVNnUApWKEpBSiJFUjVaPSQ/Pz9pYkVLcFJETkxhczg5cTUhLltaa0xrI0FsczRuWFdNMz1pZVBsLjVkPkptQmhdODdcbEBLbk5pMllVPyUuPjBvWApUaE4+bW1iOz8mI0lAXFA9a3AjST1lNVFJXF4oNk5IKnM3NFdxQUhAKmxGP1RgSUNUQEpiMmd0RSVpO2sjNEdxWnBpZiMnbztxWWgtSCZOTgooazNTOFplbSpyMEgwJDQ0dHVxRDBQLj5UNnQyYj0yWDFDQGBcOHAtSSIqc0wxdVtfMkJKSC9nXFtpOG9VOF9bJEM5RSs6SFddTUFTPUchRwpeZTZzRmY+a2c8SUAlXkBwLTJuaD9OR1c+aVdkQzVEVEsjMXMlYSNEMSQrKnNTbG05ZFZwQXFFPDFERGdnUTVKJVRfO2NeYVlaNTdbcjZoVwojK3RHIVA7cjkjSiJrOTJBW2FAZExRaVlibzorNEElaUIhYGcvcEJZTm5acGtOW0VxcTUmZzNvVzFWa1xuQFk1VUYmNm0+UkQvXFxeXWhIWAooKDVGQic/M1VBPT1fZWU+aTgzYTxVWyRBX1QyNF9aLFFZPyNmXWJPPkJpQz9tZko0aWhHRCtcI0FqOWBfX1YyVWNgJyhrRnU7SS9XRTRcJgolVmQiW2NIXWZVU3JVZmwwQGQ8LjsuTGJFPCxgN2UuZSklcCpFIk4pQk9SIWFPZTUjTVg3YzQtXWoiSE9SLGBQKEJkJlU5ajdQNF5DKmcqWQo0STZuIUhPNmE6M29tSUkhQCI+cllaOzkoRCk7WS1qYkc3MXFfZlBCRV0+IVhPM2NfaTdNZGJsYU1DbVM8XSknSFMvcj02SDkwMGcsRklURgo0KGRzPkhNMENeNnFGLD1xWy44KzJRZFpWYkcuOk9cWHJjcUNDO1NNI1ZYLk4tSl9kN0pEITpVKlNfV1k4ZnIsQSooSnVBT1M1bSM+PCItawpoJlNPZD07PERXTGsmO1JUKm82LzotdE9dZWQ6OlVMIV0hTDcpKXFGUSYjNThrXGNQdDxdYnBPNz9QcWhxIWs1WjFdRiprOD1WO1tGKklaNwomdEtRNitBQy5LMEYjXVpeIkprXCVsUSI/WUU6VDhLZColQk0qZV4/LUQmV11DRjIidWIhbjJwXmddRFdVTCYzaiU0Qjo4Y1FiNUhCOlUzbwo4OmQkVjY1NzNdQzg8WiVYYT1KXFVtL2xUUl1uVWk3UGFER1ZRUSg5LSY7Zz9LbENiN0EsRC1QVjhBQks9TiFdMT1KQTo7XTNmMj9PPTVXUAplND0vakxUVFFuKUEyTDohMSdSR2FfWFx0WGpnT0FSI0BFOzFgaTA2Tk11R1NFRltCTS5TTFBuLHIwSjQrNSIqTWEnLi4lOyVvODosUEdJcApMPipgRjlTQjtNOThgcTUvaUdSLFtvSm1HUixPTDw3IickJVcrMixsTWNqTSpOJHMzTEBtW1EpbyxXVF1CYmNVUTsjbHAnX3FSJkQmMicpOgpxKD4kUzEoZks3KGY6czRhSjFRSFtHYWFsOTo6YnNdYDlUOGsoTkQxYUpjT0g4PGIlVEJ1ODxqT2opLW0qJSxuVWQ0L1JyISVhNjsjRmFCOQo3UyMuSyxaVT40NmwrYFtPOWtjZGxTJnA+LTdtRCdkXjg6XyFFYmRTTVlKZ0QnVW1mXC02a28lPmFlLT5bSF9vOT1KQTolW2tXVGNOKyMrRQpcbTU8JWFKNC9tRTM6WS1uZUs5PSElYThRcUJncnJMTkFaOFEwXEslTkNXSG5MKXM6R2FEQFs/IkNQcWBUUzkhQFY4UnRFMGNRZyNURyJZMAo0dSFvQlBtZ2haW1JZJksnIidHWDAtbkg0OVhvc19YVS5ZTGB0NGpZYmFpaVBhczBhcEowamRVPG8jLCc5Qjs0YS8mZUc0PUdVT2E+UitZbgo0PVpRP0QqaERHQVQ1KnVpRyQuQUgkISkqVVRBRnAxUVJnSyElYThRW2NxZyw8KkU3Km1jUWcyVjhETEcsPz4yZmReNjloY2BRMFc6aF9XbAosPFNcJiwqMjxaVlpfSFlRJk5wMCFFYylQOVdLM05KPkppcjBSbkM5L0AxKWtYczgqRmRfbUgnPTpqRklLNihnZjBYNXBFX1BRTy49dURyYQovc1UvTktMQUghcW9WJ0hOQSo1ME0rajAxJSlFRi5tNnVvIjonIlRMJzVRLmY2RmFzaUUwI1I/IktmJnNBZ1YtJyElcTghajdjRmc6PiFkdApNTXRYXD5VZ0Q1XG0/b00jKCpfNmpcbC9HYU1fYm1gWVpMZzE5amxeMDgpdTBnKW8hYGJeVCEqJFh1ZSg+W20lU201JVhaLl8vUzJiMStBKwpsPUJpSl07PFhvNFAla0hcM3VtdDU2SmBMXzMpTionKF0kJVFbNmUrSHEqKmI3KE5VU1ohJjNhVikjI05TJDNHVmVVI2cwJCVBb2FmLj5BKAo2YiNPVCJEYCxzKHJFKylNMD5GREo0akk6bTVlWVVRY2MsWUZpIiwyUS0jWVQ6YEw7QTJgMHMjLTgoUypxTVxzPjtnODNSZVoiQnVJO1p0Wgo9YSdzViJEPiIyaTtiRSssOlZDP18jUSpROGMqbkIpWV1ANlgnMUldTStiNEhfQTFGRGNjKTtPPmZZaElKNG5CYG0xMWRmaSVcM08qWlA+awowcVM+Qmk4RDlgQ145Vk8uJHFwbEJuPFAsVUxbJT4iW20jM21VWCNjL0xER0ZwPHAxJ1teXEdVNCM+ZE1RL0VRJFYkKjBgcWQjRTdCY2wmOQorYCdAJklaY1MkXD1WaGFUQWZfL1prKCVUNWA9QU4hST0lcjo+PT1MQThqU2FPK1hlKUVQSiFRVm4yckhsV0pbVjUnck1gY21XaXIpZypzcApAP0xCX0AzOSkoV09xWU9VIlcpblpPNzAwbzAtRW1kVCFYJjw7QSpsRmx1QzliRGIuLm4/MVE0MFgiTlhsPzlGOlBoVURkLypELUJDMD50NQpHUiliJ1thZ2AjTygpJilOdFFyLDVPWVl0WS5USEFScWdKYipSXmkkUSw2dWNDL2lOS15LOztdIllBNSRiaWRPPVtUTGs8RU8hLS5oOyc7KwonWHQtXkhFbDpDTVleQiFWWXA6LT1iIzQ9U1gpVi5tJUtSW2dzUC5nSFoudWFwTiFVQkRgKE8xak91YDNZKEN0Tk1kZC49aVduN1dXazY1VwokYWA4KkJMMC1XMlZbNF1RU2w7OTpBI08wbi5AKk9qNkckbEdfImZRSVlnO0BbcUxvYycjJURWXmlmVSpbK0Q+M21VMEA7YjpQN11YMldAJQpYT0JmPiknbm9XYWI+KSdtJEciRzRkVilfIiZyWGNVcUE5PGA9ZzBUbWwwP08kWFlTTVE1K2thcFkwXmtlMCtMcj07PjE5WnMmZj1FMStDYwpiJDsuMVUmJ01LR2RrMWlUal1eRElKYEAhRWtaVWRFPDFaX0VvRHE9aTBMVkkjKDhHZl1vJWQ8VjZwMjgkY0BQO0QwbGw3XWVRYV4mOEFdJgpIY01ZODgpbUIhXDJmPCZgVDpfbEskMUxqP29IJDZfL0tnSC45cDFhJXRFPjRybUx1OW0lMi5cQV9eY0wwOixlMi5lKEUuaiFfI01bP2E4cApBZWlOa1xCc2VpcjpBPVlVVDQnRFBEK2JdWktfdG5GaydaWzU5YiwwOWwnJCVATEJHNztKXVE0ZW0/U1FiQWU+Ymw2YEc8bUxtJVtcLTIxOwpPTHFHbj9fMlVhT287aTZTPkQ4JCRDRSIwKGRXL1ZgaiFTQ29gJyJicVpDPzJbR2xSZyxMKl5kSFcwaGFxVlxOKX4+CmVuZHN0cmVhbQplbmRvYmoKMjMgMCBvYmoKPDwgL1R5cGUgL1hPYmplY3QKL1N1YnR5cGUgL0ltYWdlCi9XaWR0aCAxMTgKL0hlaWdodCA0OQovQ29sb3JTcGFjZSAvRGV2aWNlR3JheQovQml0c1BlckNvbXBvbmVudCA4Ci9MZW5ndGggNDYxCi9GaWx0ZXIgWy9BU0NJSTg1RGVjb2RlIC9GbGF0ZURlY29kZV0KPj5zdHJlYW0KR2IiL2VKSV1SPyNYblhrVDZBPlhLbkRiV0IiTVpFYWpQcGQ0XScoXkBSbHQia0IiUzAkZiU/PW09NEM7Oy4kTihqUmNZUiVzZCZsOSRPdF4KKSY3PUwoNy1lcXFlQC4oL1NDOTg0LWZMWGVMWjVxY1o1bEFFQjU1PjNAMD1rIjtSaDJoQmNRTDMmSj81b1tjSDBiU0ZOXjw7O0A0MVNZOW0KYyJaST1ZbCNjNClgXyJZbG1OMyUuQS5sTlNgVmUvWTwlPy43KCgpLy5kQls7ayFKWyUnJURKXEk/K2E3OjVvTmtZXHFFUz4zPEk1YlptKEkKJWQ8QEIpOERidDNwS0djbGJRazEnaVpWczdOTTBcbyZSKnFVPmdIdS1GckNraDxrSEZHKlwkTT1fc1YvLSRcSkY6ZS8/PmZYQStDQ21wRGUKZFNQNkdjdSxcWCdBTD1hNUpDWzQ2Ry5ocDI9VTRlXiRlb1xRI2IqbTdDOCQtSkEoY1o/WWAnQzs2SnBIZVBsXCRIRUMhdV4qUWErNmdFTWsKW2ZFVipiLiM+cHI+LVdTZiM+aCZXP3Vra1RzaFlgPS9YLjY2QSo7YmlzL2RnQFFYWHNyOG07fj4KZW5kc3RyZWFtCmVuZG9iagoyNCAwIG9iago8PCAvVHlwZSAvWE9iamVjdAovU3VidHlwZSAvSW1hZ2UKL1dpZHRoIDU0Ci9IZWlnaHQgNTQKL0NvbG9yU3BhY2UgL0RldmljZUdyYXkKL0JpdHNQZXJDb21wb25lbnQgOAovTGVuZ3RoIDc3Ci9GaWx0ZXIgWy9BU0NJSTg1RGVjb2RlIC9GbGF0ZURlY29kZV0KPj5zdHJlYW0KR2IiMEpkMFRkcSRqNG9GXlUsIkhUczlFSUU7MEFULF9FKkxaJW9AN0psNVY7SCdDcz1UcnFEYUguNEJmI2M0T1ZUOyhkI2Y8R0U5fj4KZW5kc3RyZWFtCmVuZG9iagoyNSAwIG9iago8PCAvVHlwZSAvWE9iamVjdAovU3VidHlwZSAvSW1hZ2UKL1dpZHRoIDI3NwovSGVpZ2h0IDczCi9Db2xvclNwYWNlIC9EZXZpY2VHcmF5Ci9CaXRzUGVyQ29tcG9uZW50IDgKL0xlbmd0aCAxMzk0Ci9GaWx0ZXIgWy9BU0NJSTg1RGVjb2RlIC9GbGF0ZURlY29kZV0KPj5zdHJlYW0KR2IiL2NnUSE0LSRxJ2pqNUwjcFpHdTY9I0g/JWghJFonRWs9WCZuTU9vK0xPY1gvbXImKVZsP0ttSitFbkU5ISNrSSNwOTYyYy02LE11dUEKb0ZaSG08JnBIZ1NgJEAobS03LVVRKDckSV1fSl5ZU0E3bScpQiY5LVo7Oz1aNT03Xj5KZEhedFRxcWYqXz1JLWQqb0BVWjpjT1soIWFJTGEKYjByalFXUDslUFhjP3M8cFRbTzFiI0trUEVgdUVCV1xKUl47dVxrPjRSVjlmNGdoIjYzSnU2ZUgtQit1QzE8IjdpVVdbU1cqOllYalpjIygKQjdfQFpCWmM1T1w8cEQ8Q0RrTmVMYTE3O0o+TV5qMmovMWUrJV9sLTctSStaV1U0NCkvWDFzMCZXMEsiUElwOWZWPyYpSUMqWkNiNWtrZ1MKL1JgMGlGNkNibS4/RyZQJiZMRnNVKkZsWlVgbSpBKDxaWi9pb1lEWmFdL2phJ1I5Jjk5SUhLVF8uVTA4LzZlZ1NBZkI8NF9dQT8jO1wsJi0KIkQiZkBrJTVDTzZGZDhyXW8ldU1hOCdFcXEmTS5hOFxgJFRpciMvdCwvO1NWMFAiOjkkX2VuNFBpaVhFUW4hY1BeLyxUZjlkaEJkJ0kuZUEKUW9QISkmMj42IUUqKlgrVTtcbWBKYWVhRyUiY3BdMidaNV9dTUtEVUc2WVpVKDxUbzJCbXMjdDlZbG5uWG83IzMkJDAhbSluLFJQYGApcm8KN09gNT5LYjcrdCYyJFRST0M0YjVQXFgpYCs/PStmLXJtc10yQj0/bzJXWnVgVmBHbjdrYG4sdFVJYjtzckJxRUw3NjJdIyFTYGMoRGtTX0gKWCYrc1lyVFw7PU1MRD1cZCp1S2ZWWXRmKkUjS0A8bFRbO24vbjNNLyw+LSFZQmpoKm41Vjg0U0VaJ2FlUC1Hb14pSCdwI1cvNHJuRTQraTEKK0lCRlA1Uys0PThGOSU3Tyo6ZipuM0otYTc2MmIzYiFOV0hWKWhGK21iLC1VLUU5U05oST4sVSo8LkdtcC0pMiQvLztJOm4+W2I3cUljKDYKcElAI05UZSlHY0s3YFliUFRmZERhbiNLbVBdV145KDZqbGNMQlFlVzdxTCMjPDNlNW8rPC0pNGNsNFR1XFwoYFNiJm8qRUAnYytqam1aUCoKNE5nRkdFXiQmOi4mXyVQRkBONWQ1dSFgR1Y2bylVS0c3OCsmW1A6TGIlMnRRNC9DbF9OTltXI3A/XkxqNCRtVlZTZCZOMCwzPUA4J0xRKHQKTGBuZWAvWXM4aiwlbSVQOl9xMnItbWRjPVhYNSY+OiNZO24+LipHcGZtVyc8OE9fRWtsPSkkTi9HRCtRSFhyWD5HLCVpYUtzRlBDNjVfLE0KQD8yXic5Mk1JVz8kZ2s1aEQ+YGtuOzFPLSViazVuXVteOj5QX0YsaWIzM3ErW249OCFibkBBbGViMltVU2NoT0VrXVdpV189KCQxOjM4KTsKIklWbHFLNDFOK1BsNjxBOmk4Uyg0PSc1cChjV2RCQmQtZSNgMVdoOzs6QXQzQ3Q+YURLQklQaWNdKzMyXTtnXTRXWEVDM2drPFBMMnFnLHMKJG5FSDJqP14haFMrUztVTGR0U2pAYV9fYjtsQGprRlxvPUs1PCgxUSRzP3BjJGZzLi5abUE9dD47X0UpRzVjNzkocyokJFZCITA2WyEoLGUKLVUzTFJKbCQwWFxKT1loQjYtdSsoV28oVCMsVD0qLVVkPiU8V3FTXmVqKyUrZWRqXksiVnNIMi5wSCZXYT5sdUxOMDRPWUo0TkJoZz9DcSwKLi9zS19UPElEX1AkQCc0fj4KZW5kc3RyZWFtCmVuZG9iagoyNiAwIG9iago8PCAvVHlwZSAvWE9iamVjdAovU3VidHlwZSAvSW1hZ2UKL1dpZHRoIDExOAovSGVpZ2h0IDQ5Ci9Db2xvclNwYWNlIC9EZXZpY2VHcmF5Ci9CaXRzUGVyQ29tcG9uZW50IDgKL0xlbmd0aCA0NjEKL0ZpbHRlciBbL0FTQ0lJODVEZWNvZGUgL0ZsYXRlRGVjb2RlXQo+PnN0cmVhbQpHYiIvZUpJXVI/I1huWGtUNkE+WEtuRGJXQiJNWkVhalBwZDRdJyheQFJsdCJrQiJTMCRmJT89bT00Qzs7LiROKGpSY1lSJXNkJmw5JE90XgopJjc9TCg3LWVxcWVALigvU0M5ODQtZkxYZUxaNXFjWjVsQUVCNTU+M0AwPWsiO1JoMmhCY1FMMyZKPzVvW2NIMGJTRk5ePDs7QDQxU1k5bQpjIlpJPVlsI2M0KWBfIllsbU4zJS5BLmxOU2BWZS9ZPCU/LjcoKCkvLmRCWztrIUpbJSclREpcST8rYTc6NW9Oa1lccUVTPjM8STViWm0oSQolZDxAQik4RGJ0M3BLR2NsYlFrMSdpWlZzN05NMFxvJlIqcVU+Z0h1LUZyQ2toPGtIRkcqXCRNPV9zVi8tJFxKRjplLz8+ZlhBK0NDbXBEZQpkU1A2R2N1LFxYJ0FMPWE1SkNbNDZHLmhwMj1VNGVeJGVvXFEjYiptN0M4JC1KQShjWj9ZYCdDOzZKcEhlUGxcJEhFQyF1XipRYSs2Z0VNawpbZkVWKmIuIz5wcj4tV1NmIz5oJlc/dWtrVHNoWWA9L1guNjZBKjtiaXMvZGdAUVhYc3I4bTt+PgplbmRzdHJlYW0KZW5kb2JqCjI3IDAgb2JqCjw8IC9UeXBlIC9YT2JqZWN0Ci9TdWJ0eXBlIC9JbWFnZQovV2lkdGggNTQKL0hlaWdodCA1NAovQ29sb3JTcGFjZSAvRGV2aWNlR3JheQovQml0c1BlckNvbXBvbmVudCA4Ci9MZW5ndGggNzcKL0ZpbHRlciBbL0FTQ0lJODVEZWNvZGUgL0ZsYXRlRGVjb2RlXQo+PnN0cmVhbQpHYiIwSmQwVGRxJGo0b0ZeVSwiSFRzOUVJRTswQVQsX0UqTFolb0A3Smw1VjtIJ0NzPVRycURhSC40QmYjYzRPVlQ7KGQjZjxHRTl+PgplbmRzdHJlYW0KZW5kb2JqCnhyZWYKMCAyOAowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwMDAwMDkgMDAwMDAgbiAKMDAwMDAwMDA1OCAwMDAwMCBuIAowMDAwMDAwMTA0IDAwMDAwIG4gCjAwMDAwMDAxNzYgMDAwMDAgbiAKMDAwMDAwMDIyOCAwMDAwMCBuIAowMDAwMDAwMzI2IDAwMDAwIG4gCjAwMDAwMDA0MjkgMDAwMDAgbiAKMDAwMDAwMDUzNSAwMDAwMCBuIAowMDAwMDAwNjQ1IDAwMDAwIG4gCjAwMDAwMDA3NDEgMDAwMDAgbiAKMDAwMDAwMDg0MyAwMDAwMCBuIAowMDAwMDAwOTQ4IDAwMDAwIG4gCjAwMDAwMDEwNTcgMDAwMDAgbiAKMDAwMDAwMTE1OCAwMDAwMCBuIAowMDAwMDAxMjU4IDAwMDAwIG4gCjAwMDAwMDEzNjAgMDAwMDAgbiAKMDAwMDAwMTQ2NiAwMDAwMCBuIAowMDAwMDAxNjM2IDAwMDAwIG4gCjAwMDAwMDIwNTMgMDAwMDAgbiAKMDAwMDAwMjQ3MCAwMDAwMCBuIAowMDAwMDAyODg3IDAwMDAwIG4gCjAwMDAwMDU1ODYgMDAwMDAgbiAKMDAwMDAwODc0MiAwMDAwMCBuIAowMDAwMDA5Mzg5IDAwMDAwIG4gCjAwMDAwMDk2NTAgMDAwMDAgbiAKMDAwMDAxMTIzMSAwMDAwMCBuIAowMDAwMDExODc4IDAwMDAwIG4gCnRyYWlsZXIKPDwKL0luZm8gMTcgMCBSCi9TaXplIDI4Ci9Sb290IDEgMCBSCj4+CnN0YXJ0eHJlZgoxMjEzOQolJUVPRgo=", + "url": "https://wwwdev.idev.fedex.com/document/v2/document/retrieve/SH,794810209259_SHIPPING_P/isLabel=true&autoPrint=false" + } + ], + "pieceResponses": [ + { + "netChargeAmount": 21.45, + "transactionDetails": [ + { + "transactionDetails": "transactionDetails", + "transactionId": "12345" + } + ], + "packageDocuments": [ + { + "contentKey": "content key", + "copiesToPrint": 10, + "contentType": "COMMERCIAL_INVOICE", + "trackingNumber": "794953535000", + "docType": "PDF", + "alerts": [ + { + "code": "SHIP.RECIPIENT.POSTALCITY.MISMATCH", + "alertType": "NOTE", + "message": "Recipient Postal-City Mismatch." + } + ], + "encodedLabel": "encoded label", + "url": "https://wwwdev.idev.fedex.com/document/v2/document/retrieve/SH,794810209259_SHIPPING_P/isLabel=true&autoPrint=false" + } + ], + "acceptanceTrackingNumber": "794953535000", + "serviceCategory": "EXPRESS", + "listCustomerTotalCharge": "listCustomerTotalCharge", + "deliveryTimestamp": "2012-09-23", + "trackingIdType": "FEDEX", + "additionalChargesDiscount": 621.45, + "netListRateAmount": 1.45, + "baseRateAmount": 321.45, + "packageSequenceNumber": 215, + "netDiscountAmount": 121.45, + "codcollectionAmount": 231.45, + "masterTrackingNumber": "794953535000", + "acceptanceType": "acceptanceType", + "trackingNumber": "794953535000", + "successful": true, + "customerReferences": [ + { + "customerReferenceType": "INVOICE_NUMBER", + "value": "3686" + } + ] + } + ], + "serviceName": "FedEx 2 Day Freight", + "alerts": [ + { + "code": "SHIP.RECIPIENT.POSTALCITY.MISMATCH", + "alertType": "NOTE", + "message": "Recipient Postal-City Mismatch." + } + ], + "completedShipmentDetail": { + "completedPackageDetails": [ + { + "sequenceNumber": 256, + "operationalDetail": { + "astraHandlingText": "astraHandlingText", + "barcodes": { + "binaryBarcodes": [ + { + "type": "COMMON-2D", + "value": "string" + } + ], + "stringBarcodes": [ + { + "type": "ADDRESS", + "value": "1010062512241535917900794953544894" + } + ] + }, + "operationalInstructions": [ + { + "number": 17, + "content": "content" + } + ] + }, + "signatureOption": "DIRECT", + "trackingIds": [ + { + "formId": "0201", + "trackingIdType": "EXPRESS", + "uspsApplicationId": "92", + "trackingNumber": "49092000070120032835" + } + ], + "groupNumber": 567, + "oversizeClass": "OVERSIZE_1, OVERSIZE_2, OVERSIZE_3", + "packageRating": { + "effectiveNetDiscount": 0, + "actualRateType": "PAYOR_ACCOUNT_PACKAGE", + "packageRateDetails": [ + { + "ratedWeightMethod": "DIM", + "totalFreightDiscounts": 44.55, + "totalTaxes": 3.45, + "minimumChargeType": "CUSTOMER", + "baseCharge": 45.67, + "totalRebates": 4.56, + "rateType": "PAYOR_RETAIL_PACKAGE", + "billingWeight": { + "units": "KG", + "value": 68 + }, + "netFreight": 4.89, + "surcharges": [ + { + "amount": "string", + "surchargeType": "APPOINTMENT_DELIVERY", + "level": "PACKAGE, or SHIPMENT", + "description": "description" + } + ], + "totalSurcharges": 22.56, + "netFedExCharge": 12.56, + "netCharge": 121.56, + "currency": "USD" + } + ] + }, + "dryIceWeight": { + "units": "KG", + "value": 68 + }, + "hazardousPackageDetail": { + "regulation": "IATA", + "accessibility": "ACCESSIBLE", + "labelType": "II_YELLOW", + "containers": [ + { + "qvalue": 2, + "hazardousCommodities": [ + { + "quantity": { + "quantityType": "GROSS", + "amount": 24.56, + "units": "Kg" + }, + "options": { + "quantity": { + "quantityType": "GROSS", + "amount": 24.56, + "units": "Kg" + }, + "innerReceptacles": [ + { + "quantity": { + "quantityType": "NET", + "amount": 34.56, + "units": "Kg" + } + } + ], + "options": { + "labelTextOption": "APPEND", + "customerSuppliedLabelText": "Customer Supplied Label Text." + }, + "description": { + "sequenceNumber": 9812, + "processingOptions": [ + "INCLUDE_SPECIAL_PROVISIONS" + ], + "subsidiaryClasses": [ + "Subsidiary Classes" + ], + "labelText": "labelText", + "technicalName": "technicalName", + "packingDetails": { + "packingInstructions": "packing Instructions", + "cargoAircraftOnly": true + }, + "authorization": "authorization", + "reportableQuantity": true, + "percentage": 12.45, + "id": "123", + "packingGroup": "I", + "properShippingName": "properShippingName", + "hazardClass": "hazard Class" + } + }, + "description": { + "sequenceNumber": 876, + "packingInstructions": "packingInstructions", + "subsidiaryClasses": [ + "Subsidiary Classes" + ], + "labelText": "labelText", + "tunnelRestrictionCode": "UN2919", + "specialProvisions": "specialProvisions", + "properShippingNameAndDescription": "properShippingNameAndDescription", + "technicalName": "technicalName", + "symbols": "symbols", + "authorization": "authorization", + "attributes": [ + "attributes" + ], + "id": "1234", + "packingGroup": "packingGroup", + "properShippingName": "properShippingName", + "hazardClass": "hazardClass" + }, + "netExplosiveDetail": { + "amount": 10, + "units": "units", + "type": "NET_EXPLOSIVE_WEIGHT" + }, + "massPoints": 2 + } + ] + } + ], + "cargoAircraftOnly": true, + "referenceId": "123456", + "radioactiveTransportIndex": 2.45 + } + } + ], + "operationalDetail": { + "originServiceArea": "A1", + "serviceCode": "010", + "airportId": "DFW", + "postalCode": "38010", + "scac": "scac", + "deliveryDay": "TUE", + "originLocationId": "678", + "countryCode": "US", + "astraDescription": "SMART POST", + "originLocationNumber": 243, + "deliveryDate": "2001-04-05", + "deliveryEligibilities": [ + "deliveryEligibilities" + ], + "ineligibleForMoneyBackGuarantee": true, + "maximumTransitTime": "SEVEN_DAYS", + "destinationLocationStateOrProvinceCode": "GA", + "astraPlannedServiceLevel": "TUE - 15 OCT 10:30A", + "destinationLocationId": "DALA", + "transitTime": "TWO_DAYS", + "stateOrProvinceCode": "GA", + "destinationLocationNumber": 876, + "packagingCode": "03", + "commitDate": "2019-10-15", + "publishedDeliveryTime": "10:30A", + "ursaSuffixCode": "Ga", + "ursaPrefixCode": "XH", + "destinationServiceArea": "A1", + "commitDay": "TUE", + "customTransitTime": "ONE_DAY" + }, + "carrierCode": "FDXE", + "completedHoldAtLocationDetail": { + "holdingLocationType": "FEDEX_STAFFED", + "holdingLocation": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "38127", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "tollFreePhoneNumber": "6127812", + "emailAddress": "sample@company.com", + "phoneNumber": "1234567890", + "phoneExtension": "91", + "faxNumber": "1234567890", + "pagerNumber": "6127812", + "companyName": "Fedex", + "title": "title" + } + } + }, + "completedEtdDetail": { + "folderId": "0b0493e580dc1a1b", + "type": "COMMERCIAL_INVOICE", + "uploadDocumentReferenceDetails": [ + { + "documentType": "PRO_FORMA_INVOICE", + "documentReference": "DocumentReference", + "description": "PRO FORMA INVOICE", + "documentId": "090927d680038c61" + } + ] + }, + "packagingDescription": "description", + "masterTrackingId": { + "formId": "0201", + "trackingIdType": "EXPRESS", + "uspsApplicationId": "92", + "trackingNumber": "49092000070120032835" + }, + "serviceDescription": { + "serviceType": "FEDEX_1_DAY_FREIGHT", + "code": "80", + "names": [ + { + "type": "long", + "encoding": "UTF-8", + "value": "F-2" + } + ], + "operatingOrgCodes": [ + "FXE" + ], + "astraDescription": "2 DAY FRT", + "description": "description", + "serviceId": "EP1000000027", + "serviceCategory": "freight" + }, + "usDomestic": true, + "hazardousShipmentDetail": { + "hazardousSummaryDetail": { + "smallQuantityExceptionPackageCount": 10 + }, + "adrLicense": { + "licenseOrPermitDetail": { + "number": "12345", + "effectiveDate": "2019-08-09", + "expirationDate": "2019-04-09" + } + }, + "dryIceDetail": { + "totalWeight": { + "units": "KG", + "value": 68 + }, + "packageCount": 10, + "processingOptions": { + "options": [ + "options" + ] + } + } + }, + "shipmentRating": { + "actualRateType": "PAYOR_LIST_SHIPMENT", + "shipmentRateDetails": [ + { + "rateZone": "US001O", + "ratedWeightMethod": "ACTUAL", + "totalDutiesTaxesAndFees": 24.56, + "pricingCode": "LTL_FREIGHT", + "totalFreightDiscounts": 1.56, + "totalTaxes": 3.45, + "totalDutiesAndTaxes": 6.78, + "totalAncillaryFeesAndTaxes": 5.67, + "taxes": [ + { + "amount": 10, + "level": "level", + "description": "description", + "type": "type" + } + ], + "totalRebates": 1.98, + "fuelSurchargePercent": 4.56, + "currencyExchangeRate": { + "rate": 25.6, + "fromCurrency": "Rupee", + "intoCurrency": "USD" + }, + "totalNetFreight": 9.56, + "totalNetFedExCharge": 88.56, + "shipmentLegRateDetails": [ + { + "rateZone": "rateZone", + "pricingCode": "pricingCode", + "taxes": [ + { + "amount": 10, + "level": "level", + "description": "description", + "type": "type" + } + ], + "totalDimWeight": { + "units": "KG", + "value": 68 + }, + "totalRebates": 2, + "fuelSurchargePercent": 6, + "currencyExchangeRate": { + "rate": 25.6, + "fromCurrency": "Rupee", + "intoCurrency": "USD" + }, + "dimDivisor": 6, + "rateType": "PAYOR_RETAIL_PACKAGE", + "legDestinationLocationId": "legDestinationLocationId", + "dimDivisorType": "dimDivisorType", + "totalBaseCharge": 6, + "ratedWeightMethod": "ratedWeightMethod", + "totalFreightDiscounts": 9, + "totalTaxes": 12.6, + "minimumChargeType": "minimumChargeType", + "totalDutiesAndTaxes": 17.78, + "totalNetFreight": 6, + "totalNetFedExCharge": 3.2, + "surcharges": [ + { + "amount": "string", + "surchargeType": "APPOINTMENT_DELIVERY", + "level": "PACKAGE, or SHIPMENT", + "description": "description" + } + ], + "totalSurcharges": 5, + "totalBillingWeight": { + "units": "KG", + "value": 68 + }, + "freightDiscounts": [ + { + "amount": 8.9, + "rateDiscountType": "COUPON", + "percent": 28.9, + "description": "description" + } + ], + "rateScale": "6702", + "totalNetCharge": 253, + "totalNetChargeWithDutiesAndTaxes": 25.67, + "currency": "USD" + } + ], + "dimDivisor": 0, + "rateType": "RATED_ACCOUNT_SHIPMENT", + "surcharges": [ + { + "amount": "string", + "surchargeType": "APPOINTMENT_DELIVERY", + "level": "PACKAGE, or SHIPMENT", + "description": "description" + } + ], + "totalSurcharges": 9.88, + "totalBillingWeight": { + "units": "KG", + "value": 68 + }, + "freightDiscounts": [ + { + "amount": 8.9, + "rateDiscountType": "COUPON", + "percent": 28.9, + "description": "description" + } + ], + "rateScale": "00000", + "totalNetCharge": 3.78, + "totalBaseCharge": 234.56, + "totalNetChargeWithDutiesAndTaxes": 222.56, + "currency": "USD" + } + ] + }, + "documentRequirements": { + "requiredDocuments": [ + "COMMERCIAL_OR_PRO_FORMA_INVOICE", + "AIR_WAYBILL" + ], + "prohibitedDocuments": [ + "CERTIFICATE_OF_ORIGIN" + ], + "generationDetails": [ + { + "type": "COMMERCIAL_INVOICE", + "minimumCopiesRequired": 3, + "letterhead": "OPTIONAL", + "electronicSignature": "OPTIONAL" + } + ] + }, + "exportComplianceStatement": "12345678901234567", + "accessDetail": { + "accessorDetails": [ + { + "password": "password", + "role": "role", + "emailLabelUrl": "emailLabelUrl", + "userId": "userId" + } + ] + } + }, + "shipmentAdvisoryDetails": { + "regulatoryAdvisory": { + "prohibitions": [ + { + "derivedHarmonizedCode": "01", + "advisory": { + "code": "code", + "text": "Text", + "parameters": [ + { + "id": "message ID", + "value": "Message value" + } + ], + "localizedText": "localizedText" + }, + "commodityIndex": 12, + "source": "source", + "categories": [ + "categories" + ], + "type": "type", + "waiver": { + "advisories": [ + { + "code": "code", + "text": "Text", + "parameters": [ + { + "id": "message ID", + "value": "Message value" + } + ], + "localizedText": "localizedText" + } + ], + "description": "description", + "id": "id" + }, + "status": "status" + } + ] + } + }, + "masterTrackingNumber": "794953535000" + } + ], + "alerts": [ + { + "code": "SHIP.RECIPIENT.POSTALCITY.MISMATCH", + "alertType": "NOTE", + "message": "Recipient Postal-City Mismatch." + } + ], + "jobId": "abc123456" + } +} +""" + +ShipmentCancelResponse = """{ + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "output": { + "cancelledShipment": true, + "cancelledHistory": true, + "successMessage": "Success", + "alerts": [ + { + "code": "SHIP.RECIPIENT.POSTALCITY.MISMATCH", + "alertType": "NOTE", + "message": "Recipient Postal-City Mismatch." + } + ] + } +} +""" diff --git a/modules/connectors/fedex/tests/fedex/test_tracking.py b/modules/connectors/fedex/tests/fedex/test_tracking.py new file mode 100644 index 0000000000..385e7ffffd --- /dev/null +++ b/modules/connectors/fedex/tests/fedex/test_tracking.py @@ -0,0 +1,596 @@ +import unittest +from unittest.mock import patch, ANY +from .fixture import gateway + +import karrio +import karrio.lib as lib +import karrio.core.models as models + + +class TestFedExTracking(unittest.TestCase): + def setUp(self): + self.maxDiff = None + self.TrackingRequest = models.TrackingRequest(**TrackingPayload) + + def test_create_tracking_request(self): + request = gateway.mapper.create_tracking_request(self.TrackingRequest) + + self.assertEqual(request.serialize(), TrackingRequest) + + def test_get_tracking(self): + with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + mock.return_value = "{}" + karrio.Tracking.fetch(self.TrackingRequest).from_(gateway) + + self.assertEqual( + mock.call_args[1]["url"], + f"{gateway.settings.server_url}/track/v1/trackingnumbers", + ) + + def test_parse_tracking_response(self): + with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + mock.return_value = TrackingResponse + parsed_response = ( + karrio.Tracking.fetch(self.TrackingRequest).from_(gateway).parse() + ) + + self.assertListEqual(lib.to_dict(parsed_response), ParsedTrackingResponse) + + def test_parse_error_response(self): + with patch("karrio.mappers.fedex.proxy.lib.request") as mock: + mock.return_value = ErrorResponse + parsed_response = ( + karrio.Tracking.fetch(self.TrackingRequest).from_(gateway).parse() + ) + + self.assertListEqual(lib.to_dict(parsed_response), ParsedErrorResponse) + + +if __name__ == "__main__": + unittest.main() + + +TrackingPayload = {"tracking_numbers": ["399368623212", "39936862321"]} + +ParsedTrackingResponse = [ + [ + { + "carrier_id": "fedex", + "carrier_name": "fedex", + "delivered": False, + "estimated_delivery": "2021-10-01", + "events": [ + { + "code": "PU", + "date": "2018-02-02", + "description": "Package available for clearance", + "location": "SEATTLE, WA, 98101, US", + "time": "12:01", + } + ], + "info": { + "carrier_tracking_link": "https://www.fedex.com/fedextrack/?trknbr=123456789012", + "package_weight": 22222.0, + "package_weight_unit": "LB", + "shipment_destination_country": "US", + "shipment_origin_country": "US", + "shipment_service": "FedEx Freight Economy.", + }, + "status": "in_transit", + "tracking_number": "123456789012", + } + ], + [ + { + "carrier_id": "fedex", + "carrier_name": "fedex", + "code": "TRACKING.TRACKINGNUMBER.EMPTY", + "details": {"tracking_number": "128667043726"}, + "message": "Please provide tracking number.", + }, + { + "carrier_id": "fedex", + "carrier_name": "fedex", + "code": "TRACKING.TRACKINGNUMBER.NOTFOUND", + "details": {"tracking_number": "39936862321"}, + "message": "Tracking number cannot be found. Please correct the tracking " + "number and try again.", + }, + ], +] + +ParsedErrorResponse = [ + [], + [ + { + "carrier_id": "fedex", + "carrier_name": "fedex", + "code": "TRACKING.TRACKINGNUMBER.EMPTY", + "details": {}, + "message": "Please provide tracking number.", + } + ], +] + + +TrackingRequest = { + "trackingInfo": [ + {"trackingNumberInfo": {"trackingNumber": "399368623212"}}, + {"trackingNumberInfo": {"trackingNumber": "39936862321"}}, + ], + "includeDetailedScans": True, +} + + +TrackingResponse = """{ + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "output": { + "completeTrackResults": [ + { + "trackingNumber": "123456789012", + "trackResults": [ + { + "trackingNumberInfo": { + "trackingNumber": "128667043726", + "carrierCode": "FDXE", + "trackingNumberUniqueId": "245822~123456789012~FDEG" + }, + "additionalTrackingInfo": { + "hasAssociatedShipments": false, + "nickname": "shipment nickname", + "packageIdentifiers": [ + { + "type": "SHIPPER_REFERENCE", + "value": "ASJFGVAS", + "trackingNumberUniqueId": "245822~123456789012~FDEG" + } + ], + "shipmentNotes": "shipment notes" + }, + "distanceToDestination": { + "units": "KM", + "value": 685.7 + }, + "consolidationDetail": [ + { + "timeStamp": "2020-10-13T03:54:44-06:00", + "consolidationID": "47936927", + "reasonDetail": { + "description": "Wrong color", + "type": "REJECTED" + }, + "packageCount": 25, + "eventType": "PACKAGE_ADDED_TO_CONSOLIDATION" + } + ], + "meterNumber": "8468376", + "returnDetail": { + "authorizationName": "Sammy Smith", + "reasonDetail": [ + { + "description": "Wrong color", + "type": "REJECTED" + } + ] + }, + "serviceDetail": { + "description": "FedEx Freight Economy.", + "shortDescription": "FL", + "type": "FEDEX_FREIGHT_ECONOMY" + }, + "destinationLocation": { + "locationId": "SEA", + "locationContactAndAddress": { + "contact": { + "personName": "John Taylor", + "phoneNumber": "1234567890", + "companyName": "Fedex" + }, + "address": { + "addressClassification": "BUSINESS", + "residential": false, + "streetLines": [ + "1043 North Easy Street", + "Suite 999" + ], + "city": "SEATTLE", + "urbanizationCode": "RAFAEL", + "stateOrProvinceCode": "WA", + "postalCode": "98101", + "countryCode": "US", + "countryName": "United States" + } + }, + "locationType": "PICKUP_LOCATION" + }, + "latestStatusDetail": { + "scanLocation": { + "addressClassification": "BUSINESS", + "residential": false, + "streetLines": [ + "1043 North Easy Street", + "Suite 999" + ], + "city": "SEATTLE", + "urbanizationCode": "RAFAEL", + "stateOrProvinceCode": "WA", + "postalCode": "98101", + "countryCode": "US", + "countryName": "United States" + }, + "code": "PU", + "derivedCode": "PU", + "ancillaryDetails": [ + { + "reason": "15", + "reasonDescription": "Customer not available or business closed", + "action": "Contact us at to discuss possible delivery or pickup alternatives.", + "actionDescription": "Customer not Available or Business Closed" + } + ], + "statusByLocale": "Picked up", + "description": "Picked up", + "delayDetail": { + "type": "WEATHER", + "subType": "SNOW", + "status": "DELAYED" + } + }, + "serviceCommitMessage": { + "message": "No scheduled delivery date available at this time.", + "type": "ESTIMATED_DELIVERY_DATE_UNAVAILABLE" + }, + "informationNotes": [ + { + "code": "CLEARANCE_ENTRY_FEE_APPLIES", + "description": "this is an informational message" + } + ], + "error": { + "code": "TRACKING.TRACKINGNUMBER.EMPTY", + "parameterList": [ + { + "value": "value", + "key": "key" + } + ], + "message": "Please provide tracking number." + }, + "specialHandlings": [ + { + "description": "Deliver Weekday", + "type": "DELIVER_WEEKDAY", + "paymentType": "OTHER" + } + ], + "availableImages": [ + { + "size": "LARGE", + "type": "BILL_OF_LADING" + } + ], + "deliveryDetails": { + "receivedByName": "Reciever", + "destinationServiceArea": "EDDUNAVAILABLE", + "destinationServiceAreaDescription": "Appointment required", + "locationDescription": "Receptionist/Front Desk", + "actualDeliveryAddress": { + "addressClassification": "BUSINESS", + "residential": false, + "streetLines": [ + "1043 North Easy Street", + "Suite 999" + ], + "city": "SEATTLE", + "urbanizationCode": "RAFAEL", + "stateOrProvinceCode": "WA", + "postalCode": "98101", + "countryCode": "US", + "countryName": "United States" + }, + "deliveryToday": false, + "locationType": "FEDEX_EXPRESS_STATION", + "signedByName": "Reciever", + "officeOrderDeliveryMethod": "Courier", + "deliveryAttempts": "0", + "deliveryOptionEligibilityDetails": [ + { + "option": "INDIRECT_SIGNATURE_RELEASE", + "eligibility": "INELIGIBLE" + } + ] + }, + "scanEvents": [ + { + "date": "2018-02-02T12:01:00-07:00", + "derivedStatus": "Picked Up", + "scanLocation": { + "addressClassification": "BUSINESS", + "residential": false, + "streetLines": [ + "1043 North Easy Street", + "Suite 999" + ], + "city": "SEATTLE", + "urbanizationCode": "RAFAEL", + "stateOrProvinceCode": "WA", + "postalCode": "98101", + "countryCode": "US", + "countryName": "United States" + }, + "locationId": "SEA", + "locationType": "PICKUP_LOCATION", + "exceptionDescription": "Package available for clearance", + "eventDescription": "Picked Up", + "eventType": "PU", + "derivedStatusCode": "PU", + "exceptionCode": "A25", + "delayDetail": { + "type": "WEATHER", + "subType": "SNOW", + "status": "DELAYED" + } + } + ], + "dateAndTimes": [ + { + "dateTime": "2007-09-27T00:00:00", + "type": "ACTUAL_DELIVERY" + } + ], + "packageDetails": { + "physicalPackagingType": "BARREL", + "sequenceNumber": "45", + "undeliveredCount": "7", + "packagingDescription": { + "description": "FedEx Pak", + "type": "FEDEX_PAK" + }, + "count": "1", + "weightAndDimensions": { + "weight": [ + { + "unit": "LB", + "value": "22222.0" + } + ], + "dimensions": [ + { + "length": 100, + "width": 50, + "height": 30, + "units": "CM" + } + ] + }, + "packageContent": [ + "wire hangers", + "buttons" + ], + "contentPieceCount": "100", + "declaredValue": { + "currency": "USD", + "value": 56.8 + } + }, + "goodsClassificationCode": "goodsClassificationCode", + "holdAtLocation": { + "locationId": "SEA", + "locationContactAndAddress": { + "contact": { + "personName": "John Taylor", + "phoneNumber": "1234567890", + "companyName": "Fedex" + }, + "address": { + "addressClassification": "BUSINESS", + "residential": false, + "streetLines": [ + "1043 North Easy Street", + "Suite 999" + ], + "city": "SEATTLE", + "urbanizationCode": "RAFAEL", + "stateOrProvinceCode": "WA", + "postalCode": "98101", + "countryCode": "US", + "countryName": "United States" + } + }, + "locationType": "PICKUP_LOCATION" + }, + "customDeliveryOptions": [ + { + "requestedAppointmentDetail": { + "date": "2019-05-07", + "window": [ + { + "description": "Description field", + "window": { + "begins": "2021-10-01T08:00:00", + "ends": "2021-10-15T00:00:00-06:00" + }, + "type": "ESTIMATED_DELIVERY" + } + ] + }, + "description": "Redirect the package to the hold location.", + "type": "REDIRECT_TO_HOLD_AT_LOCATION", + "status": "HELD" + } + ], + "estimatedDeliveryTimeWindow": { + "description": "Description field", + "window": { + "begins": "2021-10-01T08:00:00", + "ends": "2021-10-15T00:00:00-06:00" + }, + "type": "ESTIMATED_DELIVERY" + }, + "pieceCounts": [ + { + "count": "35", + "description": "picec count description", + "type": "ORIGIN" + } + ], + "originLocation": { + "locationId": "SEA", + "locationContactAndAddress": { + "contact": { + "personName": "John Taylor", + "phoneNumber": "1234567890", + "companyName": "Fedex" + }, + "address": { + "addressClassification": "BUSINESS", + "residential": false, + "streetLines": [ + "1043 North Easy Street", + "Suite 999" + ], + "city": "SEATTLE", + "urbanizationCode": "RAFAEL", + "stateOrProvinceCode": "WA", + "postalCode": "98101", + "countryCode": "US", + "countryName": "United States" + } + }, + "locationType": "PICKUP_LOCATION" + }, + "recipientInformation": { + "contact": { + "personName": "John Taylor", + "phoneNumber": "1234567890", + "companyName": "Fedex" + }, + "address": { + "addressClassification": "BUSINESS", + "residential": false, + "streetLines": [ + "1043 North Easy Street", + "Suite 999" + ], + "city": "SEATTLE", + "urbanizationCode": "RAFAEL", + "stateOrProvinceCode": "WA", + "postalCode": "98101", + "countryCode": "US", + "countryName": "United States" + } + }, + "standardTransitTimeWindow": { + "description": "Description field", + "window": { + "begins": "2021-10-01T08:00:00", + "ends": "2021-10-15T00:00:00-06:00" + }, + "type": "ESTIMATED_DELIVERY" + }, + "shipmentDetails": { + "contents": [ + { + "itemNumber": "RZ5678", + "receivedQuantity": "13", + "description": "pulyurethane rope", + "partNumber": "RK1345" + } + ], + "beforePossessionStatus": false, + "weight": [ + { + "unit": "LB", + "value": "22222.0" + } + ], + "contentPieceCount": "3333", + "splitShipments": [ + { + "pieceCount": "10", + "statusDescription": "status", + "timestamp": "2019-05-07T08:00:07", + "statusCode": "statuscode" + } + ] + }, + "reasonDetail": { + "description": "Wrong color", + "type": "REJECTED" + }, + "availableNotifications": [ + "ON_DELIVERY", + "ON_EXCEPTION" + ], + "shipperInformation": { + "contact": { + "personName": "John Taylor", + "phoneNumber": "1234567890", + "companyName": "Fedex" + }, + "address": { + "addressClassification": "BUSINESS", + "residential": false, + "streetLines": [ + "1043 North Easy Street", + "Suite 999" + ], + "city": "SEATTLE", + "urbanizationCode": "RAFAEL", + "stateOrProvinceCode": "WA", + "postalCode": "98101", + "countryCode": "US", + "countryName": "United States" + } + }, + "lastUpdatedDestinationAddress": { + "addressClassification": "BUSINESS", + "residential": false, + "streetLines": [ + "1043 North Easy Street", + "Suite 999" + ], + "city": "SEATTLE", + "urbanizationCode": "RAFAEL", + "stateOrProvinceCode": "WA", + "postalCode": "98101", + "countryCode": "US", + "countryName": "United States" + } + } + ] + }, + { + "trackingNumber": "39936862321", + "trackResults": [ + { + "trackingNumberInfo": { + "trackingNumber": "39936862321", + "trackingNumberUniqueId": "", + "carrierCode": "" + }, + "error": { + "code": "TRACKING.TRACKINGNUMBER.NOTFOUND", + "message": "Tracking number cannot be found. Please correct the tracking number and try again." + } + } + ] + } + ], + "alerts": "TRACKING.DATA.NOTFOUND - Tracking data unavailable" + } +} +""" + +ErrorResponse = """{ + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "TRACKING.TRACKINGNUMBER.EMPTY", + "message": "Please provide tracking number." + } + ] +} +""" From 092c0a29ab88c7b21dbff1c9c57a1eb33efc9629 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Wed, 21 Feb 2024 16:50:43 -0800 Subject: [PATCH 05/20] feat: Add daatabase model for new FedEx extension --- modules/connectors/fedex_ws/setup.py | 2 +- .../providers/extension/models/fedex.py | 24 ++ .../server/providers/extension/models/ups.py | 10 +- .../migrations/0067_fedexsettings.py | 283 ++++++++++++++++++ .../0045_alter_surcharge_carriers.py | 63 ++++ requirements.sdk.dev.txt | 1 + requirements.server.dev.txt | 1 + 7 files changed, 375 insertions(+), 9 deletions(-) create mode 100644 modules/core/karrio/server/providers/extension/models/fedex.py create mode 100644 modules/core/karrio/server/providers/migrations/0067_fedexsettings.py create mode 100644 modules/pricing/karrio/server/pricing/migrations/0045_alter_surcharge_carriers.py diff --git a/modules/connectors/fedex_ws/setup.py b/modules/connectors/fedex_ws/setup.py index 27c695aad7..e740b90ef1 100644 --- a/modules/connectors/fedex_ws/setup.py +++ b/modules/connectors/fedex_ws/setup.py @@ -5,7 +5,7 @@ setup( name="karrio.fedex_ws", - version="2023.9.3", + version="2024.2", description="Karrio - Fedex Web Service Shipping extension", long_description=long_description, long_description_content_type="text/markdown", diff --git a/modules/core/karrio/server/providers/extension/models/fedex.py b/modules/core/karrio/server/providers/extension/models/fedex.py new file mode 100644 index 0000000000..64523373b5 --- /dev/null +++ b/modules/core/karrio/server/providers/extension/models/fedex.py @@ -0,0 +1,24 @@ +import django.db.models as models +import karrio.server.providers.models as providers + + +@providers.has_auth_cache +class FedexSettings(providers.Carrier): + class Meta: + db_table = "fedex-settings" + verbose_name = "FedEx Settings" + verbose_name_plural = "FedEx Settings" + + api_key = models.CharField(max_length=200) + secret_key = models.CharField(max_length=200) + account_number = models.CharField(max_length=200) + account_country_code = models.CharField( + max_length=3, blank=True, null=True, choices=providers.COUNTRIES + ) + + @property + def carrier_name(self) -> str: + return "fedex" + + +SETTINGS = FedexSettings diff --git a/modules/core/karrio/server/providers/extension/models/ups.py b/modules/core/karrio/server/providers/extension/models/ups.py index 983c5a72a7..87eeed3ee6 100644 --- a/modules/core/karrio/server/providers/extension/models/ups.py +++ b/modules/core/karrio/server/providers/extension/models/ups.py @@ -1,10 +1,8 @@ import django.db.models as models -import django.core.cache as caching - -import karrio.lib as lib -import karrio.server.providers.models.carrier as providers +import karrio.server.providers.models as providers +@providers.has_auth_cache class UPSSettings(providers.Carrier): class Meta: db_table = "ups-settings" @@ -22,9 +20,5 @@ class Meta: def carrier_name(self) -> str: return "ups" - @property - def cache(self): - return lib.Cache(cache=caching.cache) - SETTINGS = UPSSettings diff --git a/modules/core/karrio/server/providers/migrations/0067_fedexsettings.py b/modules/core/karrio/server/providers/migrations/0067_fedexsettings.py new file mode 100644 index 0000000000..20bd74020f --- /dev/null +++ b/modules/core/karrio/server/providers/migrations/0067_fedexsettings.py @@ -0,0 +1,283 @@ +# Generated by Django 4.2.10 on 2024-02-22 00:47 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ("providers", "0066_rename_fedexsettings_fedexwssettings_and_more"), + ] + + operations = [ + migrations.CreateModel( + name="FedexSettings", + fields=[ + ( + "carrier_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="providers.carrier", + ), + ), + ("api_key", models.CharField(max_length=200)), + ("secret_key", models.CharField(max_length=200)), + ("account_number", models.CharField(max_length=200)), + ( + "account_country_code", + models.CharField( + blank=True, + choices=[ + ("AD", "AD"), + ("AE", "AE"), + ("AF", "AF"), + ("AG", "AG"), + ("AI", "AI"), + ("AL", "AL"), + ("AM", "AM"), + ("AN", "AN"), + ("AO", "AO"), + ("AR", "AR"), + ("AS", "AS"), + ("AT", "AT"), + ("AU", "AU"), + ("AW", "AW"), + ("AZ", "AZ"), + ("BA", "BA"), + ("BB", "BB"), + ("BD", "BD"), + ("BE", "BE"), + ("BF", "BF"), + ("BG", "BG"), + ("BH", "BH"), + ("BI", "BI"), + ("BJ", "BJ"), + ("BM", "BM"), + ("BN", "BN"), + ("BO", "BO"), + ("BR", "BR"), + ("BS", "BS"), + ("BT", "BT"), + ("BW", "BW"), + ("BY", "BY"), + ("BZ", "BZ"), + ("CA", "CA"), + ("CD", "CD"), + ("CF", "CF"), + ("CG", "CG"), + ("CH", "CH"), + ("CI", "CI"), + ("CK", "CK"), + ("CL", "CL"), + ("CM", "CM"), + ("CN", "CN"), + ("CO", "CO"), + ("CR", "CR"), + ("CU", "CU"), + ("CV", "CV"), + ("CY", "CY"), + ("CZ", "CZ"), + ("DE", "DE"), + ("DJ", "DJ"), + ("DK", "DK"), + ("DM", "DM"), + ("DO", "DO"), + ("DZ", "DZ"), + ("EC", "EC"), + ("EE", "EE"), + ("EG", "EG"), + ("ER", "ER"), + ("ES", "ES"), + ("ET", "ET"), + ("FI", "FI"), + ("FJ", "FJ"), + ("FK", "FK"), + ("FM", "FM"), + ("FO", "FO"), + ("FR", "FR"), + ("GA", "GA"), + ("GB", "GB"), + ("GD", "GD"), + ("GE", "GE"), + ("GF", "GF"), + ("GG", "GG"), + ("GH", "GH"), + ("GI", "GI"), + ("GL", "GL"), + ("GM", "GM"), + ("GN", "GN"), + ("GP", "GP"), + ("GQ", "GQ"), + ("GR", "GR"), + ("GT", "GT"), + ("GU", "GU"), + ("GW", "GW"), + ("GY", "GY"), + ("HK", "HK"), + ("HN", "HN"), + ("HR", "HR"), + ("HT", "HT"), + ("HU", "HU"), + ("IC", "IC"), + ("ID", "ID"), + ("IE", "IE"), + ("IL", "IL"), + ("IN", "IN"), + ("IQ", "IQ"), + ("IR", "IR"), + ("IS", "IS"), + ("IT", "IT"), + ("JE", "JE"), + ("JM", "JM"), + ("JO", "JO"), + ("JP", "JP"), + ("KE", "KE"), + ("KG", "KG"), + ("KH", "KH"), + ("KI", "KI"), + ("KM", "KM"), + ("KN", "KN"), + ("KP", "KP"), + ("KR", "KR"), + ("KV", "KV"), + ("KW", "KW"), + ("KY", "KY"), + ("KZ", "KZ"), + ("LA", "LA"), + ("LB", "LB"), + ("LC", "LC"), + ("LI", "LI"), + ("LK", "LK"), + ("LR", "LR"), + ("LS", "LS"), + ("LT", "LT"), + ("LU", "LU"), + ("LV", "LV"), + ("LY", "LY"), + ("MA", "MA"), + ("MC", "MC"), + ("MD", "MD"), + ("ME", "ME"), + ("MG", "MG"), + ("MH", "MH"), + ("MK", "MK"), + ("ML", "ML"), + ("MM", "MM"), + ("MN", "MN"), + ("MO", "MO"), + ("MP", "MP"), + ("MQ", "MQ"), + ("MR", "MR"), + ("MS", "MS"), + ("MT", "MT"), + ("MU", "MU"), + ("MV", "MV"), + ("MW", "MW"), + ("MX", "MX"), + ("MY", "MY"), + ("MZ", "MZ"), + ("NA", "NA"), + ("NC", "NC"), + ("NE", "NE"), + ("NG", "NG"), + ("NI", "NI"), + ("NL", "NL"), + ("NO", "NO"), + ("NP", "NP"), + ("NR", "NR"), + ("NU", "NU"), + ("NZ", "NZ"), + ("OM", "OM"), + ("PA", "PA"), + ("PE", "PE"), + ("PF", "PF"), + ("PG", "PG"), + ("PH", "PH"), + ("PK", "PK"), + ("PL", "PL"), + ("PR", "PR"), + ("PT", "PT"), + ("PW", "PW"), + ("PY", "PY"), + ("QA", "QA"), + ("RE", "RE"), + ("RO", "RO"), + ("RS", "RS"), + ("RU", "RU"), + ("RW", "RW"), + ("SA", "SA"), + ("SB", "SB"), + ("SC", "SC"), + ("SD", "SD"), + ("SE", "SE"), + ("SG", "SG"), + ("SH", "SH"), + ("SI", "SI"), + ("SK", "SK"), + ("SL", "SL"), + ("SM", "SM"), + ("SN", "SN"), + ("SO", "SO"), + ("SR", "SR"), + ("SS", "SS"), + ("ST", "ST"), + ("SV", "SV"), + ("SY", "SY"), + ("SZ", "SZ"), + ("TC", "TC"), + ("TD", "TD"), + ("TG", "TG"), + ("TH", "TH"), + ("TJ", "TJ"), + ("TL", "TL"), + ("TN", "TN"), + ("TO", "TO"), + ("TR", "TR"), + ("TT", "TT"), + ("TV", "TV"), + ("TW", "TW"), + ("TZ", "TZ"), + ("UA", "UA"), + ("UG", "UG"), + ("US", "US"), + ("UY", "UY"), + ("UZ", "UZ"), + ("VA", "VA"), + ("VC", "VC"), + ("VE", "VE"), + ("VG", "VG"), + ("VI", "VI"), + ("VN", "VN"), + ("VU", "VU"), + ("WS", "WS"), + ("XB", "XB"), + ("XC", "XC"), + ("XE", "XE"), + ("XM", "XM"), + ("XN", "XN"), + ("XS", "XS"), + ("XY", "XY"), + ("YE", "YE"), + ("YT", "YT"), + ("ZA", "ZA"), + ("ZM", "ZM"), + ("ZW", "ZW"), + ], + max_length=3, + null=True, + ), + ), + ], + options={ + "verbose_name": "FedEx Settings", + "verbose_name_plural": "FedEx Settings", + "db_table": "fedex-settings", + }, + bases=("providers.carrier",), + ), + ] diff --git a/modules/pricing/karrio/server/pricing/migrations/0045_alter_surcharge_carriers.py b/modules/pricing/karrio/server/pricing/migrations/0045_alter_surcharge_carriers.py new file mode 100644 index 0000000000..67487f3627 --- /dev/null +++ b/modules/pricing/karrio/server/pricing/migrations/0045_alter_surcharge_carriers.py @@ -0,0 +1,63 @@ +# Generated by Django 4.2.10 on 2024-02-22 00:47 + +from django.db import migrations +import karrio.server.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ("pricing", "0044_alter_surcharge_carriers"), + ] + + operations = [ + migrations.AlterField( + model_name="surcharge", + name="carriers", + field=karrio.server.core.fields.MultiChoiceField( + blank=True, + choices=[ + ("allied_express", "allied_express"), + ("allied_express_local", "allied_express_local"), + ("amazon_shipping", "amazon_shipping"), + ("aramex", "aramex"), + ("asendia_us", "asendia_us"), + ("australiapost", "australiapost"), + ("boxknight", "boxknight"), + ("bpost", "bpost"), + ("canadapost", "canadapost"), + ("canpar", "canpar"), + ("chronopost", "chronopost"), + ("colissimo", "colissimo"), + ("dhl_express", "dhl_express"), + ("dhl_parcel_de", "dhl_parcel_de"), + ("dhl_poland", "dhl_poland"), + ("dhl_universal", "dhl_universal"), + ("dicom", "dicom"), + ("dpd", "dpd"), + ("dpdhl", "dpdhl"), + ("easypost", "easypost"), + ("eshipper", "eshipper"), + ("fedex", "fedex"), + ("fedex_ws", "fedex_ws"), + ("freightcom", "freightcom"), + ("generic", "generic"), + ("geodis", "geodis"), + ("laposte", "laposte"), + ("locate2u", "locate2u"), + ("nationex", "nationex"), + ("purolator", "purolator"), + ("roadie", "roadie"), + ("royalmail", "royalmail"), + ("sendle", "sendle"), + ("tnt", "tnt"), + ("ups", "ups"), + ("usps", "usps"), + ("usps_international", "usps_international"), + ("zoom2u", "zoom2u"), + ], + help_text="\n The list of carriers you want to apply the surcharge to.\n
\n Note that by default, the surcharge is applied to all carriers\n ", + null=True, + ), + ), + ] diff --git a/requirements.sdk.dev.txt b/requirements.sdk.dev.txt index 7eca631bd9..39a7af0f9a 100644 --- a/requirements.sdk.dev.txt +++ b/requirements.sdk.dev.txt @@ -19,6 +19,7 @@ -e ./modules/connectors/dicom -e ./modules/connectors/dpd -e ./modules/connectors/dpdhl +-e ./modules/connectors/fedex -e ./modules/connectors/fedex_ws -e ./modules/connectors/generic -e ./modules/connectors/geodis diff --git a/requirements.server.dev.txt b/requirements.server.dev.txt index e47cbe4051..b3f3046503 100644 --- a/requirements.server.dev.txt +++ b/requirements.server.dev.txt @@ -22,6 +22,7 @@ Django==4.2.10 -e ./modules/connectors/dicom -e ./modules/connectors/dpd -e ./modules/connectors/dpdhl +-e ./modules/connectors/fedex -e ./modules/connectors/fedex_ws -e ./modules/connectors/generic -e ./modules/connectors/geodis From 1e18099ca720ee1bcc3797da4c49da08de654e7d Mon Sep 17 00:00:00 2001 From: Daniel K Date: Wed, 21 Feb 2024 17:14:10 -0800 Subject: [PATCH 06/20] chore: Update API schemas, GraphQL queries and generated types --- apps/api/karrio/server/VERSION | 2 +- packages/types/graphql/admin/queries.ts | 30 ++ packages/types/graphql/admin/types.ts | 66 ++- packages/types/graphql/queries.ts | 15 + packages/types/graphql/types.ts | 47 +- packages/types/rest/api.ts | 52 +- packages/types/rest/base.ts | 4 +- packages/types/rest/common.ts | 4 +- packages/types/rest/configuration.ts | 4 +- packages/types/rest/index.ts | 4 +- packages/ui/modals/connect-provider-modal.tsx | 3 +- schemas/graphql-admin.json | 487 ++++++++++++++++++ schemas/graphql.json | 465 +++++++++++++++++ schemas/openapi.yml | 213 ++++---- 14 files changed, 1260 insertions(+), 136 deletions(-) diff --git a/apps/api/karrio/server/VERSION b/apps/api/karrio/server/VERSION index 6fe904a8fa..500e109833 100644 --- a/apps/api/karrio/server/VERSION +++ b/apps/api/karrio/server/VERSION @@ -1 +1 @@ -2024.2.rc5 +2024.2.rc6 diff --git a/packages/types/graphql/admin/queries.ts b/packages/types/graphql/admin/queries.ts index fccd122330..c1cafaeaf8 100644 --- a/packages/types/graphql/admin/queries.ts +++ b/packages/types/graphql/admin/queries.ts @@ -721,6 +721,21 @@ export const GET_SYSTEM_CONNECTIONS = gql`query GetSystemConnections { config } ... on FedexSettingsType { + id + carrier_id + carrier_name + display_name + test_mode + active + metadata + capabilities + account_number + api_key + secret_key + account_country_code + config + } + ... on FedexWSSettingsType { id carrier_id carrier_name @@ -1414,6 +1429,21 @@ export const GET_SYSTEM_CONNECTION = gql`query GetSystemConnection($id: String!) config } ... on FedexSettingsType { + id + carrier_id + carrier_name + display_name + test_mode + active + metadata + capabilities + account_number + api_key + secret_key + account_country_code + config + } + ... on FedexWSSettingsType { id carrier_id carrier_name diff --git a/packages/types/graphql/admin/types.ts b/packages/types/graphql/admin/types.ts index ef7f7c40e8..1956b65627 100644 --- a/packages/types/graphql/admin/types.ts +++ b/packages/types/graphql/admin/types.ts @@ -914,6 +914,23 @@ export interface GetSystemConnections_system_connections_FedexSettingsType { metadata: any | null; capabilities: string[]; account_number: string | null; + api_key: string; + secret_key: string; + account_country_code: string | null; + config: any | null; +} + +export interface GetSystemConnections_system_connections_FedexWSSettingsType { + __typename: "FedexWSSettingsType"; + id: string; + carrier_id: string; + carrier_name: string; + display_name: string; + test_mode: boolean; + active: boolean; + metadata: any | null; + capabilities: string[]; + account_number: string | null; password: string; meter_number: string; user_key: string; @@ -1218,7 +1235,7 @@ export interface GetSystemConnections_system_connections_Zoom2uSettingsType { api_key: string; } -export type GetSystemConnections_system_connections = GetSystemConnections_system_connections_AlliedExpressSettingsType | GetSystemConnections_system_connections_AlliedExpressLocalSettingsType | GetSystemConnections_system_connections_AmazonShippingSettingsType | GetSystemConnections_system_connections_AramexSettingsType | GetSystemConnections_system_connections_AsendiaUSSettingsType | GetSystemConnections_system_connections_AustraliaPostSettingsType | GetSystemConnections_system_connections_BoxKnightSettingsType | GetSystemConnections_system_connections_BelgianPostSettingsType | GetSystemConnections_system_connections_CanadaPostSettingsType | GetSystemConnections_system_connections_CanparSettingsType | GetSystemConnections_system_connections_ChronopostSettingsType | GetSystemConnections_system_connections_ColissimoSettingsType | GetSystemConnections_system_connections_DHLParcelDESettingsType | GetSystemConnections_system_connections_DHLExpressSettingsType | GetSystemConnections_system_connections_DHLPolandSettingsType | GetSystemConnections_system_connections_DHLUniversalSettingsType | GetSystemConnections_system_connections_DicomSettingsType | GetSystemConnections_system_connections_DPDSettingsType | GetSystemConnections_system_connections_DPDHLSettingsType | GetSystemConnections_system_connections_EShipperSettingsType | GetSystemConnections_system_connections_EasyPostSettingsType | GetSystemConnections_system_connections_FedexSettingsType | GetSystemConnections_system_connections_FreightcomSettingsType | GetSystemConnections_system_connections_GenericSettingsType | GetSystemConnections_system_connections_GEODISSettingsType | GetSystemConnections_system_connections_LaPosteSettingsType | GetSystemConnections_system_connections_Locate2uSettingsType | GetSystemConnections_system_connections_NationexSettingsType | GetSystemConnections_system_connections_PurolatorSettingsType | GetSystemConnections_system_connections_RoadieSettingsType | GetSystemConnections_system_connections_RoyalMailSettingsType | GetSystemConnections_system_connections_SendleSettingsType | GetSystemConnections_system_connections_TNTSettingsType | GetSystemConnections_system_connections_UPSSettingsType | GetSystemConnections_system_connections_USPSSettingsType | GetSystemConnections_system_connections_USPSInternationalSettingsType | GetSystemConnections_system_connections_Zoom2uSettingsType; +export type GetSystemConnections_system_connections = GetSystemConnections_system_connections_AlliedExpressSettingsType | GetSystemConnections_system_connections_AlliedExpressLocalSettingsType | GetSystemConnections_system_connections_AmazonShippingSettingsType | GetSystemConnections_system_connections_AramexSettingsType | GetSystemConnections_system_connections_AsendiaUSSettingsType | GetSystemConnections_system_connections_AustraliaPostSettingsType | GetSystemConnections_system_connections_BoxKnightSettingsType | GetSystemConnections_system_connections_BelgianPostSettingsType | GetSystemConnections_system_connections_CanadaPostSettingsType | GetSystemConnections_system_connections_CanparSettingsType | GetSystemConnections_system_connections_ChronopostSettingsType | GetSystemConnections_system_connections_ColissimoSettingsType | GetSystemConnections_system_connections_DHLParcelDESettingsType | GetSystemConnections_system_connections_DHLExpressSettingsType | GetSystemConnections_system_connections_DHLPolandSettingsType | GetSystemConnections_system_connections_DHLUniversalSettingsType | GetSystemConnections_system_connections_DicomSettingsType | GetSystemConnections_system_connections_DPDSettingsType | GetSystemConnections_system_connections_DPDHLSettingsType | GetSystemConnections_system_connections_EShipperSettingsType | GetSystemConnections_system_connections_EasyPostSettingsType | GetSystemConnections_system_connections_FedexSettingsType | GetSystemConnections_system_connections_FedexWSSettingsType | GetSystemConnections_system_connections_FreightcomSettingsType | GetSystemConnections_system_connections_GenericSettingsType | GetSystemConnections_system_connections_GEODISSettingsType | GetSystemConnections_system_connections_LaPosteSettingsType | GetSystemConnections_system_connections_Locate2uSettingsType | GetSystemConnections_system_connections_NationexSettingsType | GetSystemConnections_system_connections_PurolatorSettingsType | GetSystemConnections_system_connections_RoadieSettingsType | GetSystemConnections_system_connections_RoyalMailSettingsType | GetSystemConnections_system_connections_SendleSettingsType | GetSystemConnections_system_connections_TNTSettingsType | GetSystemConnections_system_connections_UPSSettingsType | GetSystemConnections_system_connections_USPSSettingsType | GetSystemConnections_system_connections_USPSInternationalSettingsType | GetSystemConnections_system_connections_Zoom2uSettingsType; export interface GetSystemConnections { system_connections: GetSystemConnections_system_connections[]; @@ -1715,6 +1732,23 @@ export interface GetSystemConnection_system_connection_FedexSettingsType { metadata: any | null; capabilities: string[]; account_number: string | null; + api_key: string; + secret_key: string; + account_country_code: string | null; + config: any | null; +} + +export interface GetSystemConnection_system_connection_FedexWSSettingsType { + __typename: "FedexWSSettingsType"; + id: string; + carrier_id: string; + carrier_name: string; + display_name: string; + test_mode: boolean; + active: boolean; + metadata: any | null; + capabilities: string[]; + account_number: string | null; password: string; meter_number: string; user_key: string; @@ -2010,7 +2044,7 @@ export interface GetSystemConnection_system_connection_Zoom2uSettingsType { api_key: string; } -export type GetSystemConnection_system_connection = GetSystemConnection_system_connection_AlliedExpressSettingsType | GetSystemConnection_system_connection_AmazonShippingSettingsType | GetSystemConnection_system_connection_AramexSettingsType | GetSystemConnection_system_connection_AsendiaUSSettingsType | GetSystemConnection_system_connection_AustraliaPostSettingsType | GetSystemConnection_system_connection_BoxKnightSettingsType | GetSystemConnection_system_connection_BelgianPostSettingsType | GetSystemConnection_system_connection_CanadaPostSettingsType | GetSystemConnection_system_connection_CanparSettingsType | GetSystemConnection_system_connection_ChronopostSettingsType | GetSystemConnection_system_connection_ColissimoSettingsType | GetSystemConnection_system_connection_DHLExpressSettingsType | GetSystemConnection_system_connection_DHLPolandSettingsType | GetSystemConnection_system_connection_DHLUniversalSettingsType | GetSystemConnection_system_connection_DicomSettingsType | GetSystemConnection_system_connection_DPDSettingsType | GetSystemConnection_system_connection_DPDHLSettingsType | GetSystemConnection_system_connection_EShipperSettingsType | GetSystemConnection_system_connection_EasyPostSettingsType | GetSystemConnection_system_connection_FedexSettingsType | GetSystemConnection_system_connection_FreightcomSettingsType | GetSystemConnection_system_connection_GenericSettingsType | GetSystemConnection_system_connection_GEODISSettingsType | GetSystemConnection_system_connection_LaPosteSettingsType | GetSystemConnection_system_connection_Locate2uSettingsType | GetSystemConnection_system_connection_NationexSettingsType | GetSystemConnection_system_connection_PurolatorSettingsType | GetSystemConnection_system_connection_RoadieSettingsType | GetSystemConnection_system_connection_RoyalMailSettingsType | GetSystemConnection_system_connection_SendleSettingsType | GetSystemConnection_system_connection_TNTSettingsType | GetSystemConnection_system_connection_UPSSettingsType | GetSystemConnection_system_connection_USPSSettingsType | GetSystemConnection_system_connection_USPSInternationalSettingsType | GetSystemConnection_system_connection_Zoom2uSettingsType; +export type GetSystemConnection_system_connection = GetSystemConnection_system_connection_AlliedExpressSettingsType | GetSystemConnection_system_connection_AmazonShippingSettingsType | GetSystemConnection_system_connection_AramexSettingsType | GetSystemConnection_system_connection_AsendiaUSSettingsType | GetSystemConnection_system_connection_AustraliaPostSettingsType | GetSystemConnection_system_connection_BoxKnightSettingsType | GetSystemConnection_system_connection_BelgianPostSettingsType | GetSystemConnection_system_connection_CanadaPostSettingsType | GetSystemConnection_system_connection_CanparSettingsType | GetSystemConnection_system_connection_ChronopostSettingsType | GetSystemConnection_system_connection_ColissimoSettingsType | GetSystemConnection_system_connection_DHLExpressSettingsType | GetSystemConnection_system_connection_DHLPolandSettingsType | GetSystemConnection_system_connection_DHLUniversalSettingsType | GetSystemConnection_system_connection_DicomSettingsType | GetSystemConnection_system_connection_DPDSettingsType | GetSystemConnection_system_connection_DPDHLSettingsType | GetSystemConnection_system_connection_EShipperSettingsType | GetSystemConnection_system_connection_EasyPostSettingsType | GetSystemConnection_system_connection_FedexSettingsType | GetSystemConnection_system_connection_FedexWSSettingsType | GetSystemConnection_system_connection_FreightcomSettingsType | GetSystemConnection_system_connection_GenericSettingsType | GetSystemConnection_system_connection_GEODISSettingsType | GetSystemConnection_system_connection_LaPosteSettingsType | GetSystemConnection_system_connection_Locate2uSettingsType | GetSystemConnection_system_connection_NationexSettingsType | GetSystemConnection_system_connection_PurolatorSettingsType | GetSystemConnection_system_connection_RoadieSettingsType | GetSystemConnection_system_connection_RoyalMailSettingsType | GetSystemConnection_system_connection_SendleSettingsType | GetSystemConnection_system_connection_TNTSettingsType | GetSystemConnection_system_connection_UPSSettingsType | GetSystemConnection_system_connection_USPSSettingsType | GetSystemConnection_system_connection_USPSInternationalSettingsType | GetSystemConnection_system_connection_Zoom2uSettingsType; export interface GetSystemConnection { system_connection: GetSystemConnection_system_connection | null; @@ -2976,6 +3010,7 @@ export enum CarrierNameEnum { easypost = "easypost", eshipper = "eshipper", fedex = "fedex", + fedex_ws = "fedex_ws", freightcom = "freightcom", generic = "generic", geodis = "geodis", @@ -3133,6 +3168,7 @@ export interface CreateConnectionMutationInput { easypost?: EasyPostSettingsInput | null; eshipper?: EShipperSettingsInput | null; fedex?: FedexSettingsInput | null; + fedex_ws?: FedexWSSettingsInput | null; freightcom?: FreightcomSettingsInput | null; generic?: GenericSettingsInput | null; geodis?: GEODISSettingsInput | null; @@ -3438,6 +3474,18 @@ export interface EShipperSettingsInput { // null export interface FedexSettingsInput { + account_country_code?: string | null; + active?: boolean | null; + config?: any | null; + metadata?: any | null; + api_key: string; + secret_key: string; + account_number: string; + carrier_id: string; +} + +// null +export interface FedexWSSettingsInput { account_country_code?: string | null; active?: boolean | null; config?: any | null; @@ -3655,6 +3703,7 @@ export interface UpdateConnectionMutationInput { easypost?: UpdateEasyPostSettingsInput | null; eshipper?: UpdateEShipperSettingsInput | null; fedex?: UpdateFedexSettingsInput | null; + fedex_ws?: UpdateFedexWSSettingsInput | null; freightcom?: UpdateFreightcomSettingsInput | null; generic?: UpdateGenericSettingsInput | null; geodis?: UpdateGEODISSettingsInput | null; @@ -3982,6 +4031,19 @@ export interface UpdateEShipperSettingsInput { // null export interface UpdateFedexSettingsInput { + id: string; + account_country_code?: string | null; + active?: boolean | null; + config?: any | null; + metadata?: any | null; + api_key?: string | null; + secret_key?: string | null; + account_number?: string | null; + carrier_id?: string | null; +} + +// null +export interface UpdateFedexWSSettingsInput { id: string; account_country_code?: string | null; active?: boolean | null; diff --git a/packages/types/graphql/queries.ts b/packages/types/graphql/queries.ts index b617c22630..a44b65a987 100644 --- a/packages/types/graphql/queries.ts +++ b/packages/types/graphql/queries.ts @@ -2048,6 +2048,21 @@ export const GET_USER_CONNECTIONS = gql`query get_user_connections { config } ... on FedexSettingsType { + id + carrier_id + carrier_name + display_name + test_mode + active + metadata + capabilities + account_number + api_key + secret_key + account_country_code + config + } + ... on FedexWSSettingsType { id carrier_id carrier_name diff --git a/packages/types/graphql/types.ts b/packages/types/graphql/types.ts index da244e0dd9..654a18254c 100644 --- a/packages/types/graphql/types.ts +++ b/packages/types/graphql/types.ts @@ -2820,6 +2820,23 @@ export interface get_user_connections_user_connections_FedexSettingsType { metadata: any | null; capabilities: string[]; account_number: string | null; + api_key: string; + secret_key: string; + account_country_code: string | null; + config: any | null; +} + +export interface get_user_connections_user_connections_FedexWSSettingsType { + __typename: "FedexWSSettingsType"; + id: string; + carrier_id: string; + carrier_name: string; + display_name: string; + test_mode: boolean; + active: boolean; + metadata: any | null; + capabilities: string[]; + account_number: string | null; password: string; meter_number: string; user_key: string; @@ -3126,7 +3143,7 @@ export interface get_user_connections_user_connections_Zoom2uSettingsType { api_key: string; } -export type get_user_connections_user_connections = get_user_connections_user_connections_AlliedExpressSettingsType | get_user_connections_user_connections_AlliedExpressLocalSettingsType | get_user_connections_user_connections_AmazonShippingSettingsType | get_user_connections_user_connections_AramexSettingsType | get_user_connections_user_connections_AsendiaUSSettingsType | get_user_connections_user_connections_AustraliaPostSettingsType | get_user_connections_user_connections_BoxKnightSettingsType | get_user_connections_user_connections_BelgianPostSettingsType | get_user_connections_user_connections_CanadaPostSettingsType | get_user_connections_user_connections_CanparSettingsType | get_user_connections_user_connections_ChronopostSettingsType | get_user_connections_user_connections_ColissimoSettingsType | get_user_connections_user_connections_DHLParcelDESettingsType | get_user_connections_user_connections_DHLExpressSettingsType | get_user_connections_user_connections_DHLPolandSettingsType | get_user_connections_user_connections_DHLUniversalSettingsType | get_user_connections_user_connections_DicomSettingsType | get_user_connections_user_connections_DPDSettingsType | get_user_connections_user_connections_DPDHLSettingsType | get_user_connections_user_connections_EShipperSettingsType | get_user_connections_user_connections_EasyPostSettingsType | get_user_connections_user_connections_FedexSettingsType | get_user_connections_user_connections_FreightcomSettingsType | get_user_connections_user_connections_GenericSettingsType | get_user_connections_user_connections_GEODISSettingsType | get_user_connections_user_connections_LaPosteSettingsType | get_user_connections_user_connections_Locate2uSettingsType | get_user_connections_user_connections_NationexSettingsType | get_user_connections_user_connections_PurolatorSettingsType | get_user_connections_user_connections_RoadieSettingsType | get_user_connections_user_connections_RoyalMailSettingsType | get_user_connections_user_connections_SendleSettingsType | get_user_connections_user_connections_TNTSettingsType | get_user_connections_user_connections_UPSSettingsType | get_user_connections_user_connections_USPSSettingsType | get_user_connections_user_connections_USPSInternationalSettingsType | get_user_connections_user_connections_Zoom2uSettingsType; +export type get_user_connections_user_connections = get_user_connections_user_connections_AlliedExpressSettingsType | get_user_connections_user_connections_AlliedExpressLocalSettingsType | get_user_connections_user_connections_AmazonShippingSettingsType | get_user_connections_user_connections_AramexSettingsType | get_user_connections_user_connections_AsendiaUSSettingsType | get_user_connections_user_connections_AustraliaPostSettingsType | get_user_connections_user_connections_BoxKnightSettingsType | get_user_connections_user_connections_BelgianPostSettingsType | get_user_connections_user_connections_CanadaPostSettingsType | get_user_connections_user_connections_CanparSettingsType | get_user_connections_user_connections_ChronopostSettingsType | get_user_connections_user_connections_ColissimoSettingsType | get_user_connections_user_connections_DHLParcelDESettingsType | get_user_connections_user_connections_DHLExpressSettingsType | get_user_connections_user_connections_DHLPolandSettingsType | get_user_connections_user_connections_DHLUniversalSettingsType | get_user_connections_user_connections_DicomSettingsType | get_user_connections_user_connections_DPDSettingsType | get_user_connections_user_connections_DPDHLSettingsType | get_user_connections_user_connections_EShipperSettingsType | get_user_connections_user_connections_EasyPostSettingsType | get_user_connections_user_connections_FedexSettingsType | get_user_connections_user_connections_FedexWSSettingsType | get_user_connections_user_connections_FreightcomSettingsType | get_user_connections_user_connections_GenericSettingsType | get_user_connections_user_connections_GEODISSettingsType | get_user_connections_user_connections_LaPosteSettingsType | get_user_connections_user_connections_Locate2uSettingsType | get_user_connections_user_connections_NationexSettingsType | get_user_connections_user_connections_PurolatorSettingsType | get_user_connections_user_connections_RoadieSettingsType | get_user_connections_user_connections_RoyalMailSettingsType | get_user_connections_user_connections_SendleSettingsType | get_user_connections_user_connections_TNTSettingsType | get_user_connections_user_connections_UPSSettingsType | get_user_connections_user_connections_USPSSettingsType | get_user_connections_user_connections_USPSInternationalSettingsType | get_user_connections_user_connections_Zoom2uSettingsType; export interface get_user_connections { user_connections: get_user_connections_user_connections[]; @@ -5494,6 +5511,7 @@ export enum CarrierNameEnum { easypost = "easypost", eshipper = "eshipper", fedex = "fedex", + fedex_ws = "fedex_ws", freightcom = "freightcom", generic = "generic", geodis = "geodis", @@ -5590,6 +5608,7 @@ export interface CreateCarrierConnectionMutationInput { easypost?: EasyPostSettingsInput | null; eshipper?: EShipperSettingsInput | null; fedex?: FedexSettingsInput | null; + fedex_ws?: FedexWSSettingsInput | null; freightcom?: FreightcomSettingsInput | null; generic?: GenericSettingsInput | null; geodis?: GEODISSettingsInput | null; @@ -5895,6 +5914,18 @@ export interface EShipperSettingsInput { // null export interface FedexSettingsInput { + account_country_code?: string | null; + active?: boolean | null; + config?: any | null; + metadata?: any | null; + api_key: string; + secret_key: string; + account_number: string; + carrier_id: string; +} + +// null +export interface FedexWSSettingsInput { account_country_code?: string | null; active?: boolean | null; config?: any | null; @@ -6112,6 +6143,7 @@ export interface UpdateCarrierConnectionMutationInput { easypost?: UpdateEasyPostSettingsInput | null; eshipper?: UpdateEShipperSettingsInput | null; fedex?: UpdateFedexSettingsInput | null; + fedex_ws?: UpdateFedexWSSettingsInput | null; freightcom?: UpdateFreightcomSettingsInput | null; generic?: UpdateGenericSettingsInput | null; geodis?: UpdateGEODISSettingsInput | null; @@ -6439,6 +6471,19 @@ export interface UpdateEShipperSettingsInput { // null export interface UpdateFedexSettingsInput { + id: string; + account_country_code?: string | null; + active?: boolean | null; + config?: any | null; + metadata?: any | null; + api_key?: string | null; + secret_key?: string | null; + account_number?: string | null; + carrier_id?: string | null; +} + +// null +export interface UpdateFedexWSSettingsInput { id: string; account_country_code?: string | null; active?: boolean | null; diff --git a/packages/types/rest/api.ts b/packages/types/rest/api.ts index d7b0b2b9f5..7f13b4768c 100644 --- a/packages/types/rest/api.ts +++ b/packages/types/rest/api.ts @@ -2,9 +2,9 @@ /* eslint-disable */ /** * Karrio API - * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistics carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2024.2`. Read our API changelog to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. + * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistics carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2024.2.rc6`. Read our API changelog to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. * - * The version of the OpenAPI document: 2024.2 + * The version of the OpenAPI document: 2024.2.rc6 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -1032,7 +1032,7 @@ export interface CarrierSettings { */ 'carrier_id': string; /** - * Indicates a carrier (type) * `allied_express` - allied_express * `allied_express_local` - allied_express_local * `amazon_shipping` - amazon_shipping * `aramex` - aramex * `asendia_us` - asendia_us * `australiapost` - australiapost * `boxknight` - boxknight * `bpost` - bpost * `canadapost` - canadapost * `canpar` - canpar * `chronopost` - chronopost * `colissimo` - colissimo * `dhl_express` - dhl_express * `dhl_parcel_de` - dhl_parcel_de * `dhl_poland` - dhl_poland * `dhl_universal` - dhl_universal * `dicom` - dicom * `dpd` - dpd * `dpdhl` - dpdhl * `easypost` - easypost * `eshipper` - eshipper * `fedex` - fedex * `freightcom` - freightcom * `generic` - generic * `geodis` - geodis * `laposte` - laposte * `locate2u` - locate2u * `nationex` - nationex * `purolator` - purolator * `roadie` - roadie * `royalmail` - royalmail * `sendle` - sendle * `tnt` - tnt * `ups` - ups * `usps` - usps * `usps_international` - usps_international * `zoom2u` - zoom2u + * Indicates a carrier (type) * `allied_express` - allied_express * `allied_express_local` - allied_express_local * `amazon_shipping` - amazon_shipping * `aramex` - aramex * `asendia_us` - asendia_us * `australiapost` - australiapost * `boxknight` - boxknight * `bpost` - bpost * `canadapost` - canadapost * `canpar` - canpar * `chronopost` - chronopost * `colissimo` - colissimo * `dhl_express` - dhl_express * `dhl_parcel_de` - dhl_parcel_de * `dhl_poland` - dhl_poland * `dhl_universal` - dhl_universal * `dicom` - dicom * `dpd` - dpd * `dpdhl` - dpdhl * `easypost` - easypost * `eshipper` - eshipper * `fedex` - fedex * `fedex_ws` - fedex_ws * `freightcom` - freightcom * `generic` - generic * `geodis` - geodis * `laposte` - laposte * `locate2u` - locate2u * `nationex` - nationex * `purolator` - purolator * `roadie` - roadie * `royalmail` - royalmail * `sendle` - sendle * `tnt` - tnt * `ups` - ups * `usps` - usps * `usps_international` - usps_international * `zoom2u` - zoom2u * @type {string} * @memberof CarrierSettings */ @@ -1098,6 +1098,7 @@ export const CarrierSettingsCarrierNameEnum = { Easypost: 'easypost', Eshipper: 'eshipper', Fedex: 'fedex', + FedexWs: 'fedex_ws', Freightcom: 'freightcom', Generic: 'generic', Geodis: 'geodis', @@ -9663,7 +9664,7 @@ export interface TrackingData { */ 'tracking_number': string; /** - * The tracking carrier * `allied_express` - allied_express * `allied_express_local` - allied_express_local * `amazon_shipping` - amazon_shipping * `aramex` - aramex * `asendia_us` - asendia_us * `australiapost` - australiapost * `boxknight` - boxknight * `bpost` - bpost * `canadapost` - canadapost * `canpar` - canpar * `chronopost` - chronopost * `colissimo` - colissimo * `dhl_express` - dhl_express * `dhl_parcel_de` - dhl_parcel_de * `dhl_poland` - dhl_poland * `dhl_universal` - dhl_universal * `dicom` - dicom * `dpd` - dpd * `dpdhl` - dpdhl * `fedex` - fedex * `generic` - generic * `geodis` - geodis * `laposte` - laposte * `locate2u` - locate2u * `nationex` - nationex * `purolator` - purolator * `roadie` - roadie * `royalmail` - royalmail * `sendle` - sendle * `tnt` - tnt * `ups` - ups * `usps` - usps * `usps_international` - usps_international * `zoom2u` - zoom2u + * The tracking carrier * `allied_express` - allied_express * `allied_express_local` - allied_express_local * `amazon_shipping` - amazon_shipping * `aramex` - aramex * `asendia_us` - asendia_us * `australiapost` - australiapost * `boxknight` - boxknight * `bpost` - bpost * `canadapost` - canadapost * `canpar` - canpar * `chronopost` - chronopost * `colissimo` - colissimo * `dhl_express` - dhl_express * `dhl_parcel_de` - dhl_parcel_de * `dhl_poland` - dhl_poland * `dhl_universal` - dhl_universal * `dicom` - dicom * `dpd` - dpd * `dpdhl` - dpdhl * `fedex` - fedex * `fedex_ws` - fedex_ws * `generic` - generic * `geodis` - geodis * `laposte` - laposte * `locate2u` - locate2u * `nationex` - nationex * `purolator` - purolator * `roadie` - roadie * `royalmail` - royalmail * `sendle` - sendle * `tnt` - tnt * `ups` - ups * `usps` - usps * `usps_international` - usps_international * `zoom2u` - zoom2u * @type {string} * @memberof TrackingData */ @@ -9715,6 +9716,7 @@ export const TrackingDataCarrierNameEnum = { Dpd: 'dpd', Dpdhl: 'dpdhl', Fedex: 'fedex', + FedexWs: 'fedex_ws', Generic: 'generic', Geodis: 'geodis', Laposte: 'laposte', @@ -11965,7 +11967,7 @@ export const CarriersApiAxiosParamCreator = function (configuration?: Configurat /** * Retrieve a carrier\'s services * @summary Get carrier services - * @param {string} carrierName The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` + * @param {string} carrierName The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `fedex_ws`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -12014,7 +12016,7 @@ export const CarriersApiAxiosParamCreator = function (configuration?: Configurat * Returns the list of configured carriers * @summary List all carriers * @param {boolean} [active] - * @param {string} [carrierName] The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` + * @param {string} [carrierName] The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `fedex_ws`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` * @param {string} [metadataKey] * @param {string} [metadataValue] * @param {boolean} [systemOnly] @@ -12140,7 +12142,7 @@ export const CarriersApiFp = function (configuration?: Configuration) { /** * Retrieve a carrier\'s services * @summary Get carrier services - * @param {string} carrierName The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` + * @param {string} carrierName The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `fedex_ws`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -12154,7 +12156,7 @@ export const CarriersApiFp = function (configuration?: Configuration) { * Returns the list of configured carriers * @summary List all carriers * @param {boolean} [active] - * @param {string} [carrierName] The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` + * @param {string} [carrierName] The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `fedex_ws`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` * @param {string} [metadataKey] * @param {string} [metadataValue] * @param {boolean} [systemOnly] @@ -12230,7 +12232,7 @@ export const CarriersApiFactory = function (configuration?: Configuration, baseP */ export interface CarriersApiGetServicesRequest { /** - * The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` + * The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `fedex_ws`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` * @type {string} * @memberof CarriersApiGetServices */ @@ -12251,7 +12253,7 @@ export interface CarriersApiListRequest { readonly active?: boolean /** - * The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` + * The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `fedex_ws`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` * @type {string} * @memberof CarriersApiList */ @@ -15570,7 +15572,7 @@ export interface ProxyApiBuyLabelRequest { export interface ProxyApiCancelPickupRequest { /** * - * @type {'allied_express' | 'allied_express_local' | 'amazon_shipping' | 'aramex' | 'asendia_us' | 'australiapost' | 'boxknight' | 'bpost' | 'canadapost' | 'canpar' | 'chronopost' | 'colissimo' | 'dhl_express' | 'dhl_parcel_de' | 'dhl_poland' | 'dhl_universal' | 'dicom' | 'dpd' | 'dpdhl' | 'easypost' | 'eshipper' | 'fedex' | 'freightcom' | 'generic' | 'geodis' | 'laposte' | 'locate2u' | 'nationex' | 'purolator' | 'roadie' | 'royalmail' | 'sendle' | 'tnt' | 'ups' | 'usps' | 'usps_international' | 'zoom2u'} + * @type {'allied_express' | 'allied_express_local' | 'amazon_shipping' | 'aramex' | 'asendia_us' | 'australiapost' | 'boxknight' | 'bpost' | 'canadapost' | 'canpar' | 'chronopost' | 'colissimo' | 'dhl_express' | 'dhl_parcel_de' | 'dhl_poland' | 'dhl_universal' | 'dicom' | 'dpd' | 'dpdhl' | 'easypost' | 'eshipper' | 'fedex' | 'fedex_ws' | 'freightcom' | 'generic' | 'geodis' | 'laposte' | 'locate2u' | 'nationex' | 'purolator' | 'roadie' | 'royalmail' | 'sendle' | 'tnt' | 'ups' | 'usps' | 'usps_international' | 'zoom2u'} * @memberof ProxyApiCancelPickup */ readonly carrierName: CancelPickupCarrierNameEnum @@ -15626,7 +15628,7 @@ export interface ProxyApiGetTrackingRequest { export interface ProxyApiSchedulePickupRequest { /** * - * @type {'allied_express' | 'allied_express_local' | 'amazon_shipping' | 'aramex' | 'asendia_us' | 'australiapost' | 'boxknight' | 'bpost' | 'canadapost' | 'canpar' | 'chronopost' | 'colissimo' | 'dhl_express' | 'dhl_parcel_de' | 'dhl_poland' | 'dhl_universal' | 'dicom' | 'dpd' | 'dpdhl' | 'easypost' | 'eshipper' | 'fedex' | 'freightcom' | 'generic' | 'geodis' | 'laposte' | 'locate2u' | 'nationex' | 'purolator' | 'roadie' | 'royalmail' | 'sendle' | 'tnt' | 'ups' | 'usps' | 'usps_international' | 'zoom2u'} + * @type {'allied_express' | 'allied_express_local' | 'amazon_shipping' | 'aramex' | 'asendia_us' | 'australiapost' | 'boxknight' | 'bpost' | 'canadapost' | 'canpar' | 'chronopost' | 'colissimo' | 'dhl_express' | 'dhl_parcel_de' | 'dhl_poland' | 'dhl_universal' | 'dicom' | 'dpd' | 'dpdhl' | 'easypost' | 'eshipper' | 'fedex' | 'fedex_ws' | 'freightcom' | 'generic' | 'geodis' | 'laposte' | 'locate2u' | 'nationex' | 'purolator' | 'roadie' | 'royalmail' | 'sendle' | 'tnt' | 'ups' | 'usps' | 'usps_international' | 'zoom2u'} * @memberof ProxyApiSchedulePickup */ readonly carrierName: SchedulePickupCarrierNameEnum @@ -15647,7 +15649,7 @@ export interface ProxyApiSchedulePickupRequest { export interface ProxyApiTrackShipmentRequest { /** * - * @type {'allied_express' | 'allied_express_local' | 'amazon_shipping' | 'aramex' | 'asendia_us' | 'australiapost' | 'boxknight' | 'bpost' | 'canadapost' | 'canpar' | 'chronopost' | 'colissimo' | 'dhl_express' | 'dhl_parcel_de' | 'dhl_poland' | 'dhl_universal' | 'dicom' | 'dpd' | 'dpdhl' | 'fedex' | 'generic' | 'geodis' | 'laposte' | 'locate2u' | 'nationex' | 'purolator' | 'roadie' | 'royalmail' | 'sendle' | 'tnt' | 'ups' | 'usps' | 'usps_international' | 'zoom2u'} + * @type {'allied_express' | 'allied_express_local' | 'amazon_shipping' | 'aramex' | 'asendia_us' | 'australiapost' | 'boxknight' | 'bpost' | 'canadapost' | 'canpar' | 'chronopost' | 'colissimo' | 'dhl_express' | 'dhl_parcel_de' | 'dhl_poland' | 'dhl_universal' | 'dicom' | 'dpd' | 'dpdhl' | 'fedex' | 'fedex_ws' | 'generic' | 'geodis' | 'laposte' | 'locate2u' | 'nationex' | 'purolator' | 'roadie' | 'royalmail' | 'sendle' | 'tnt' | 'ups' | 'usps' | 'usps_international' | 'zoom2u'} * @memberof ProxyApiTrackShipment */ readonly carrierName: TrackShipmentCarrierNameEnum @@ -15675,7 +15677,7 @@ export interface ProxyApiTrackShipmentRequest { export interface ProxyApiUpdatePickupRequest { /** * - * @type {'allied_express' | 'allied_express_local' | 'amazon_shipping' | 'aramex' | 'asendia_us' | 'australiapost' | 'boxknight' | 'bpost' | 'canadapost' | 'canpar' | 'chronopost' | 'colissimo' | 'dhl_express' | 'dhl_parcel_de' | 'dhl_poland' | 'dhl_universal' | 'dicom' | 'dpd' | 'dpdhl' | 'easypost' | 'eshipper' | 'fedex' | 'freightcom' | 'generic' | 'geodis' | 'laposte' | 'locate2u' | 'nationex' | 'purolator' | 'roadie' | 'royalmail' | 'sendle' | 'tnt' | 'ups' | 'usps' | 'usps_international' | 'zoom2u'} + * @type {'allied_express' | 'allied_express_local' | 'amazon_shipping' | 'aramex' | 'asendia_us' | 'australiapost' | 'boxknight' | 'bpost' | 'canadapost' | 'canpar' | 'chronopost' | 'colissimo' | 'dhl_express' | 'dhl_parcel_de' | 'dhl_poland' | 'dhl_universal' | 'dicom' | 'dpd' | 'dpdhl' | 'easypost' | 'eshipper' | 'fedex' | 'fedex_ws' | 'freightcom' | 'generic' | 'geodis' | 'laposte' | 'locate2u' | 'nationex' | 'purolator' | 'roadie' | 'royalmail' | 'sendle' | 'tnt' | 'ups' | 'usps' | 'usps_international' | 'zoom2u'} * @memberof ProxyApiUpdatePickup */ readonly carrierName: UpdatePickupCarrierNameEnum @@ -15696,7 +15698,7 @@ export interface ProxyApiUpdatePickupRequest { export interface ProxyApiVoidLabelRequest { /** * - * @type {'allied_express' | 'allied_express_local' | 'amazon_shipping' | 'aramex' | 'asendia_us' | 'australiapost' | 'boxknight' | 'bpost' | 'canadapost' | 'canpar' | 'chronopost' | 'colissimo' | 'dhl_express' | 'dhl_parcel_de' | 'dhl_poland' | 'dhl_universal' | 'dicom' | 'dpd' | 'dpdhl' | 'easypost' | 'eshipper' | 'fedex' | 'freightcom' | 'generic' | 'geodis' | 'laposte' | 'locate2u' | 'nationex' | 'purolator' | 'roadie' | 'royalmail' | 'sendle' | 'tnt' | 'ups' | 'usps' | 'usps_international' | 'zoom2u'} + * @type {'allied_express' | 'allied_express_local' | 'amazon_shipping' | 'aramex' | 'asendia_us' | 'australiapost' | 'boxknight' | 'bpost' | 'canadapost' | 'canpar' | 'chronopost' | 'colissimo' | 'dhl_express' | 'dhl_parcel_de' | 'dhl_poland' | 'dhl_universal' | 'dicom' | 'dpd' | 'dpdhl' | 'easypost' | 'eshipper' | 'fedex' | 'fedex_ws' | 'freightcom' | 'generic' | 'geodis' | 'laposte' | 'locate2u' | 'nationex' | 'purolator' | 'roadie' | 'royalmail' | 'sendle' | 'tnt' | 'ups' | 'usps' | 'usps_international' | 'zoom2u'} * @memberof ProxyApiVoidLabel */ readonly carrierName: VoidLabelCarrierNameEnum @@ -15840,6 +15842,7 @@ export const CancelPickupCarrierNameEnum = { Easypost: 'easypost', Eshipper: 'eshipper', Fedex: 'fedex', + FedexWs: 'fedex_ws', Freightcom: 'freightcom', Generic: 'generic', Geodis: 'geodis', @@ -15883,6 +15886,7 @@ export const SchedulePickupCarrierNameEnum = { Easypost: 'easypost', Eshipper: 'eshipper', Fedex: 'fedex', + FedexWs: 'fedex_ws', Freightcom: 'freightcom', Generic: 'generic', Geodis: 'geodis', @@ -15924,6 +15928,7 @@ export const TrackShipmentCarrierNameEnum = { Dpd: 'dpd', Dpdhl: 'dpdhl', Fedex: 'fedex', + FedexWs: 'fedex_ws', Generic: 'generic', Geodis: 'geodis', Laposte: 'laposte', @@ -15966,6 +15971,7 @@ export const UpdatePickupCarrierNameEnum = { Easypost: 'easypost', Eshipper: 'eshipper', Fedex: 'fedex', + FedexWs: 'fedex_ws', Freightcom: 'freightcom', Generic: 'generic', Geodis: 'geodis', @@ -16009,6 +16015,7 @@ export const VoidLabelCarrierNameEnum = { Easypost: 'easypost', Eshipper: 'eshipper', Fedex: 'fedex', + FedexWs: 'fedex_ws', Freightcom: 'freightcom', Generic: 'generic', Geodis: 'geodis', @@ -16136,7 +16143,7 @@ export const ShipmentsApiAxiosParamCreator = function (configuration?: Configura * Retrieve all shipments. * @summary List all shipments * @param {string} [address] - * @param {string} [carrierName] The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` + * @param {string} [carrierName] The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `fedex_ws`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` * @param {string} [createdAfter] * @param {string} [createdBefore] * @param {string} [keyword] @@ -16491,7 +16498,7 @@ export const ShipmentsApiFp = function (configuration?: Configuration) { * Retrieve all shipments. * @summary List all shipments * @param {string} [address] - * @param {string} [carrierName] The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` + * @param {string} [carrierName] The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `fedex_ws`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` * @param {string} [createdAfter] * @param {string} [createdBefore] * @param {string} [keyword] @@ -16692,7 +16699,7 @@ export interface ShipmentsApiListRequest { readonly address?: string /** - * The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` + * The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `fedex_ws`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` * @type {string} * @memberof ShipmentsApiList */ @@ -17081,7 +17088,7 @@ export const TrackersApiAxiosParamCreator = function (configuration?: Configurat /** * Retrieve all shipment trackers. * @summary List all package trackers - * @param {string} [carrierName] The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` + * @param {string} [carrierName] The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `fedex_ws`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` * @param {string} [createdAfter] * @param {string} [createdBefore] * @param {string} [status] Valid tracker status. <br/>Values: `pending`, `unknown`, `on_hold`, `delivered`, `in_transit`, `delivery_delayed`, `out_for_delivery`, `ready_for_pickup`, `delivery_failed` @@ -17344,7 +17351,7 @@ export const TrackersApiFp = function (configuration?: Configuration) { /** * Retrieve all shipment trackers. * @summary List all package trackers - * @param {string} [carrierName] The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` + * @param {string} [carrierName] The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `fedex_ws`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` * @param {string} [createdAfter] * @param {string} [createdBefore] * @param {string} [status] Valid tracker status. <br/>Values: `pending`, `unknown`, `on_hold`, `delivered`, `in_transit`, `delivery_delayed`, `out_for_delivery`, `ready_for_pickup`, `delivery_failed` @@ -17515,7 +17522,7 @@ export interface TrackersApiCreateRequest { /** * - * @type {'allied_express' | 'allied_express_local' | 'amazon_shipping' | 'aramex' | 'asendia_us' | 'australiapost' | 'boxknight' | 'bpost' | 'canadapost' | 'canpar' | 'chronopost' | 'colissimo' | 'dhl_express' | 'dhl_parcel_de' | 'dhl_poland' | 'dhl_universal' | 'dicom' | 'dpd' | 'dpdhl' | 'fedex' | 'generic' | 'geodis' | 'laposte' | 'locate2u' | 'nationex' | 'purolator' | 'roadie' | 'royalmail' | 'sendle' | 'tnt' | 'ups' | 'usps' | 'usps_international' | 'zoom2u'} + * @type {'allied_express' | 'allied_express_local' | 'amazon_shipping' | 'aramex' | 'asendia_us' | 'australiapost' | 'boxknight' | 'bpost' | 'canadapost' | 'canpar' | 'chronopost' | 'colissimo' | 'dhl_express' | 'dhl_parcel_de' | 'dhl_poland' | 'dhl_universal' | 'dicom' | 'dpd' | 'dpdhl' | 'fedex' | 'fedex_ws' | 'generic' | 'geodis' | 'laposte' | 'locate2u' | 'nationex' | 'purolator' | 'roadie' | 'royalmail' | 'sendle' | 'tnt' | 'ups' | 'usps' | 'usps_international' | 'zoom2u'} * @memberof TrackersApiCreate */ readonly carrierName2: CreateCarrierNameEnum @@ -17542,7 +17549,7 @@ export interface TrackersApiCreateRequest { */ export interface TrackersApiListRequest { /** - * The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` + * The unique carrier slug. <br/>Values: `allied_express`, `allied_express_local`, `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, `easypost`, `eshipper`, `fedex`, `fedex_ws`, `freightcom`, `generic`, `geodis`, `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, `ups`, `usps`, `usps_international`, `zoom2u` * @type {string} * @memberof TrackersApiList */ @@ -17731,6 +17738,7 @@ export const CreateCarrierNameEnum = { Dpd: 'dpd', Dpdhl: 'dpdhl', Fedex: 'fedex', + FedexWs: 'fedex_ws', Generic: 'generic', Geodis: 'geodis', Laposte: 'laposte', diff --git a/packages/types/rest/base.ts b/packages/types/rest/base.ts index 7dba23a116..613ac8e74e 100644 --- a/packages/types/rest/base.ts +++ b/packages/types/rest/base.ts @@ -2,9 +2,9 @@ /* eslint-disable */ /** * Karrio API - * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistics carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2024.2`. Read our API changelog to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. + * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistics carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2024.2.rc6`. Read our API changelog to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. * - * The version of the OpenAPI document: 2024.2 + * The version of the OpenAPI document: 2024.2.rc6 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/types/rest/common.ts b/packages/types/rest/common.ts index 6ba9db1677..a915e033e2 100644 --- a/packages/types/rest/common.ts +++ b/packages/types/rest/common.ts @@ -2,9 +2,9 @@ /* eslint-disable */ /** * Karrio API - * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistics carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2024.2`. Read our API changelog to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. + * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistics carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2024.2.rc6`. Read our API changelog to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. * - * The version of the OpenAPI document: 2024.2 + * The version of the OpenAPI document: 2024.2.rc6 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/types/rest/configuration.ts b/packages/types/rest/configuration.ts index 54d683c9e0..0d7082c66d 100644 --- a/packages/types/rest/configuration.ts +++ b/packages/types/rest/configuration.ts @@ -2,9 +2,9 @@ /* eslint-disable */ /** * Karrio API - * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistics carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2024.2`. Read our API changelog to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. + * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistics carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2024.2.rc6`. Read our API changelog to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. * - * The version of the OpenAPI document: 2024.2 + * The version of the OpenAPI document: 2024.2.rc6 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/types/rest/index.ts b/packages/types/rest/index.ts index 7d01eae3d0..0e05fa541c 100644 --- a/packages/types/rest/index.ts +++ b/packages/types/rest/index.ts @@ -2,9 +2,9 @@ /* eslint-disable */ /** * Karrio API - * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistics carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2024.2`. Read our API changelog to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. + * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistics carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2024.2.rc6`. Read our API changelog to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. * - * The version of the OpenAPI document: 2024.2 + * The version of the OpenAPI document: 2024.2.rc6 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/ui/modals/connect-provider-modal.tsx b/packages/ui/modals/connect-provider-modal.tsx index 784fd76c7c..64cc6f747d 100644 --- a/packages/ui/modals/connect-provider-modal.tsx +++ b/packages/ui/modals/connect-provider-modal.tsx @@ -804,7 +804,8 @@ function fieldState(carrier_name: CarrierNameType, property: string) { [CarrierSettingsCarrierNameEnum.Locate2u]: [["carrier_id", true], ["client_id", true], ["client_secret", true], ["account_country_code"]], [CarrierSettingsCarrierNameEnum.Nationex]: [["carrier_id", true], ["api_key", true], ["customer_id", true], ["billing_account"], ["language", false, "en"]], [CarrierSettingsCarrierNameEnum.Roadie]: [["carrier_id", true], ["api_key", true]], - [CarrierSettingsCarrierNameEnum.Fedex]: [["carrier_id", true], ["user_key"], ["password", true], ["meter_number", true], ["account_number", true], ["account_country_code"]], + [CarrierSettingsCarrierNameEnum.Fedex]: [["carrier_id", true], ["api_key", true], ["secret_key", true], ["account_number", true], ["account_country_code"]], + [CarrierSettingsCarrierNameEnum.FedexWs]: [["carrier_id", true], ["user_key"], ["password", true], ["meter_number", true], ["account_number", true], ["account_country_code"]], [CarrierSettingsCarrierNameEnum.Purolator]: [["carrier_id", true], ["username", true], ["password", true], ["account_number", true], ["user_token"]], [CarrierSettingsCarrierNameEnum.Royalmail]: [["carrier_id", true], ["client_id", true], ["client_secret", true]], [CarrierSettingsCarrierNameEnum.Sendle]: [["carrier_id", true], ["sendle_id", true], ["api_key", true], ["account_country_code"]], diff --git a/schemas/graphql-admin.json b/schemas/graphql-admin.json index 2d9bf142ae..c8fa273d9a 100644 --- a/schemas/graphql-admin.json +++ b/schemas/graphql-admin.json @@ -1919,6 +1919,11 @@ "name": "FedexSettingsType", "ofType": null }, + { + "kind": "OBJECT", + "name": "FedexWSSettingsType", + "ofType": null + }, { "kind": "OBJECT", "name": "FreightcomSettingsType", @@ -2494,6 +2499,11 @@ "name": "FedexSettingsType", "ofType": null }, + { + "kind": "OBJECT", + "name": "FedexWSSettingsType", + "ofType": null + }, { "kind": "OBJECT", "name": "FreightcomSettingsType", @@ -2703,6 +2713,11 @@ "name": "FedexSettingsType", "ofType": null }, + { + "kind": "OBJECT", + "name": "FedexWSSettingsType", + "ofType": null + }, { "kind": "OBJECT", "name": "FreightcomSettingsType", @@ -4725,6 +4740,12 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "fedex_ws", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "freightcom", "description": null, @@ -10917,6 +10938,240 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "api_key", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "secret_key", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "object_type", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "ConnectionType", + "ofType": null + }, + { + "kind": "INTERFACE", + "name": "SystemConnectionType", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "FedexWSSettingsType", + "description": null, + "fields": [ + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "active", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "carrier_id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "carrier_name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "display_name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "capabilities", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "test_mode", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "metadata", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "JSON", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "config", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "JSON", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "account_number", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "account_country_code", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "password", "description": null, @@ -16822,6 +17077,16 @@ }, "defaultValue": null }, + { + "name": "fedex_ws", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "FedexWSSettingsInput", + "ofType": null + }, + "defaultValue": null + }, { "name": "freightcom", "description": null, @@ -19583,6 +19848,113 @@ "name": "FedexSettingsInput", "description": null, "fields": null, + "inputFields": [ + { + "name": "account_country_code", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "active", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "true" + }, + { + "name": "config", + "description": null, + "type": { + "kind": "SCALAR", + "name": "JSON", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "metadata", + "description": null, + "type": { + "kind": "SCALAR", + "name": "JSON", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "api_key", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "secret_key", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "account_number", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "carrier_id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "FedexWSSettingsInput", + "description": null, + "fields": null, "inputFields": [ { "name": "account_country_code", @@ -21524,6 +21896,16 @@ }, "defaultValue": null }, + { + "name": "fedex_ws", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "UpdateFedexWSSettingsInput", + "ofType": null + }, + "defaultValue": null + }, { "name": "freightcom", "description": null, @@ -24261,6 +24643,111 @@ "name": "UpdateFedexSettingsInput", "description": null, "fields": null, + "inputFields": [ + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "account_country_code", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "active", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "true" + }, + { + "name": "config", + "description": null, + "type": { + "kind": "SCALAR", + "name": "JSON", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "metadata", + "description": null, + "type": { + "kind": "SCALAR", + "name": "JSON", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "api_key", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "secret_key", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "account_number", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "carrier_id", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UpdateFedexWSSettingsInput", + "description": null, + "fields": null, "inputFields": [ { "name": "id", diff --git a/schemas/graphql.json b/schemas/graphql.json index 724c98d4eb..19e8b7ee13 100644 --- a/schemas/graphql.json +++ b/schemas/graphql.json @@ -2068,6 +2068,11 @@ "name": "FedexSettingsType", "ofType": null }, + { + "kind": "OBJECT", + "name": "FedexWSSettingsType", + "ofType": null + }, { "kind": "OBJECT", "name": "FreightcomSettingsType", @@ -2626,6 +2631,11 @@ "name": "FedexSettingsType", "ofType": null }, + { + "kind": "OBJECT", + "name": "FedexWSSettingsType", + "ofType": null + }, { "kind": "OBJECT", "name": "FreightcomSettingsType", @@ -4539,6 +4549,12 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "fedex_ws", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "freightcom", "description": null, @@ -10530,6 +10546,223 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "api_key", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "secret_key", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "ConnectionType", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "FedexWSSettingsType", + "description": null, + "fields": [ + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "active", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "carrier_id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "carrier_name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "display_name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "capabilities", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "test_mode", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "metadata", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "JSON", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "config", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "JSON", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "account_number", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "account_country_code", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "password", "description": null, @@ -33268,6 +33501,16 @@ }, "defaultValue": null }, + { + "name": "fedex_ws", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "FedexWSSettingsInput", + "ofType": null + }, + "defaultValue": null + }, { "name": "freightcom", "description": null, @@ -36029,6 +36272,113 @@ "name": "FedexSettingsInput", "description": null, "fields": null, + "inputFields": [ + { + "name": "account_country_code", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "active", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "true" + }, + { + "name": "config", + "description": null, + "type": { + "kind": "SCALAR", + "name": "JSON", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "metadata", + "description": null, + "type": { + "kind": "SCALAR", + "name": "JSON", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "api_key", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "secret_key", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "account_number", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "carrier_id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "FedexWSSettingsInput", + "description": null, + "fields": null, "inputFields": [ { "name": "account_country_code", @@ -37974,6 +38324,16 @@ }, "defaultValue": null }, + { + "name": "fedex_ws", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "UpdateFedexWSSettingsInput", + "ofType": null + }, + "defaultValue": null + }, { "name": "freightcom", "description": null, @@ -40711,6 +41071,111 @@ "name": "UpdateFedexSettingsInput", "description": null, "fields": null, + "inputFields": [ + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "account_country_code", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "active", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "true" + }, + { + "name": "config", + "description": null, + "type": { + "kind": "SCALAR", + "name": "JSON", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "metadata", + "description": null, + "type": { + "kind": "SCALAR", + "name": "JSON", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "api_key", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "secret_key", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "account_number", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "carrier_id", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UpdateFedexWSSettingsInput", + "description": null, + "fields": null, "inputFields": [ { "name": "id", diff --git a/schemas/openapi.yml b/schemas/openapi.yml index e852a4830b..4be4adc1d4 100644 --- a/schemas/openapi.yml +++ b/schemas/openapi.yml @@ -16,7 +16,7 @@ info: ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. - The current version is `2024.2.rc5`. + The current version is `2024.2.rc6`. Read our API changelog to learn more about backwards compatibility. @@ -86,7 +86,7 @@ info: All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. title: Karrio API - version: 2024.2.rc5 + version: 2024.2.rc6 paths: /: get: @@ -680,9 +680,9 @@ paths: `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, - `easypost`, `eshipper`, `fedex`, `freightcom`, `generic`, `geodis`, `laposte`, - `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, - `ups`, `usps`, `usps_international`, `zoom2u`' + `easypost`, `eshipper`, `fedex`, `fedex_ws`, `freightcom`, `generic`, `geodis`, + `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, + `tnt`, `ups`, `usps`, `usps_international`, `zoom2u`' - in: query name: metadata_key schema: @@ -729,9 +729,9 @@ paths: `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, - `easypost`, `eshipper`, `fedex`, `freightcom`, `generic`, `geodis`, `laposte`, - `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, - `ups`, `usps`, `usps_international`, `zoom2u`' + `easypost`, `eshipper`, `fedex`, `fedex_ws`, `freightcom`, `generic`, `geodis`, + `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, + `tnt`, `ups`, `usps`, `usps_international`, `zoom2u`' required: true tags: - Carriers @@ -1818,6 +1818,7 @@ paths: - easypost - eshipper - fedex + - fedex_ws - freightcom - generic - geodis @@ -1905,6 +1906,7 @@ paths: - easypost - eshipper - fedex + - fedex_ws - freightcom - generic - geodis @@ -1992,6 +1994,7 @@ paths: - easypost - eshipper - fedex + - fedex_ws - freightcom - generic - geodis @@ -2170,6 +2173,7 @@ paths: - easypost - eshipper - fedex + - fedex_ws - freightcom - generic - geodis @@ -2299,6 +2303,7 @@ paths: - dpd - dpdhl - fedex + - fedex_ws - generic - geodis - laposte @@ -2431,9 +2436,9 @@ paths: `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, - `easypost`, `eshipper`, `fedex`, `freightcom`, `generic`, `geodis`, `laposte`, - `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, - `ups`, `usps`, `usps_international`, `zoom2u`' + `easypost`, `eshipper`, `fedex`, `fedex_ws`, `freightcom`, `generic`, `geodis`, + `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, + `tnt`, `ups`, `usps`, `usps_international`, `zoom2u`' - in: query name: created_after schema: @@ -2839,9 +2844,9 @@ paths: `amazon_shipping`, `aramex`, `asendia_us`, `australiapost`, `boxknight`, `bpost`, `canadapost`, `canpar`, `chronopost`, `colissimo`, `dhl_express`, `dhl_parcel_de`, `dhl_poland`, `dhl_universal`, `dicom`, `dpd`, `dpdhl`, - `easypost`, `eshipper`, `fedex`, `freightcom`, `generic`, `geodis`, `laposte`, - `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, `tnt`, - `ups`, `usps`, `usps_international`, `zoom2u`' + `easypost`, `eshipper`, `fedex`, `fedex_ws`, `freightcom`, `generic`, `geodis`, + `laposte`, `locate2u`, `nationex`, `purolator`, `roadie`, `royalmail`, `sendle`, + `tnt`, `ups`, `usps`, `usps_international`, `zoom2u`' - in: query name: created_after schema: @@ -2983,6 +2988,7 @@ paths: - dpd - dpdhl - fedex + - fedex_ws - generic - geodis - laposte @@ -4763,6 +4769,7 @@ components: - easypost - eshipper - fedex + - fedex_ws - freightcom - generic - geodis @@ -4779,7 +4786,7 @@ components: - usps_international - zoom2u type: string - x-spec-enum-id: be48b0138e0e7bed + x-spec-enum-id: dc69b92121ccff3a description: |- Indicates a carrier (type) @@ -4805,6 +4812,7 @@ components: * `easypost` - easypost * `eshipper` - eshipper * `fedex` - fedex + * `fedex_ws` - fedex_ws * `freightcom` - freightcom * `generic` - generic * `geodis` - geodis @@ -11330,6 +11338,7 @@ components: - dpd - dpdhl - fedex + - fedex_ws - generic - geodis - laposte @@ -11345,7 +11354,7 @@ components: - usps_international - zoom2u type: string - x-spec-enum-id: 8da975469a034792 + x-spec-enum-id: f3a4cc88fccf77a5 description: |- The tracking carrier @@ -11369,6 +11378,7 @@ components: * `dpd` - dpd * `dpdhl` - dpdhl * `fedex` - fedex + * `fedex_ws` - fedex_ws * `generic` - generic * `geodis` - geodis * `laposte` - laposte @@ -11930,7 +11940,6 @@ tags: ## Carriers | Carrier Name | Display Name | | ------------ | ------------ | - | australiapost | Australia Post | | zoom2u | Zoom2u | | usps_international | USPS International | | usps | USPS | @@ -11945,7 +11954,6 @@ tags: | laposte | La Poste | | geodis | GEODIS | | freightcom | Freightcom | - | fedex | FedEx | | eshipper | eShipper | | easypost | EasyPost | | dpdhl | Deutsche Post DHL | @@ -11961,11 +11969,14 @@ tags: | canadapost | Canada Post | | bpost | Belgian Post | | boxknight | BoxKnight | + | australiapost | Australia Post | | asendia_us | Asendia US | | aramex | Aramex | | amazon_shipping | AmazonShipping | | allied_express_local | Allied Express Local | | allied_express | Allied Express | + | fedex | FedEx | + | fedex_ws | FedEx Web Service | --- ## Services @@ -11973,14 +11984,6 @@ tags: when purchasing shipping labels using single call label creation. You can also find all of the possible service levels for each of your carrier accounts by using [this endpoint](#operation/&&get_services). - ### Australia Post - | Code | Service Name | - | ------------ | ------------ | - | australiapost_parcel_post | T28 | - | australiapost_express_post | E34 | - | australiapost_parcel_post_signature | T28S | - | australiapost_express_post_signature | E34S | - ### Zoom2u | Code | Service Name | | ------------ | ------------ | @@ -12262,66 +12265,6 @@ tags: | freightcom_canadapost_xpresspost | 6303 | | freightcom_canadapost_priority | 6302 | - ### FedEx - | Code | Service Name | - | ------------ | ------------ | - | fedex_europe_first_international_priority | EUROPE_FIRST_INTERNATIONAL_PRIORITY | - | fedex_1_day_freight | FEDEX_1_DAY_FREIGHT | - | fedex_2_day | FEDEX_2_DAY | - | fedex_2_day_am | FEDEX_2_DAY_AM | - | fedex_2_day_freight | FEDEX_2_DAY_FREIGHT | - | fedex_3_day_freight | FEDEX_3_DAY_FREIGHT | - | fedex_cargo_airport_to_airport | FEDEX_CARGO_AIRPORT_TO_AIRPORT | - | fedex_cargo_freight_forwarding | FEDEX_CARGO_FREIGHT_FORWARDING | - | fedex_cargo_international_express_freight | FEDEX_CARGO_INTERNATIONAL_EXPRESS_FREIGHT | - | fedex_cargo_international_premium | FEDEX_CARGO_INTERNATIONAL_PREMIUM | - | fedex_cargo_mail | FEDEX_CARGO_MAIL | - | fedex_cargo_registered_mail | FEDEX_CARGO_REGISTERED_MAIL | - | fedex_cargo_surface_mail | FEDEX_CARGO_SURFACE_MAIL | - | fedex_custom_critical_air_expedite | FEDEX_CUSTOM_CRITICAL_AIR_EXPEDITE | - | fedex_custom_critical_air_expedite_exclusive_use | FEDEX_CUSTOM_CRITICAL_AIR_EXPEDITE_EXCLUSIVE_USE | - | fedex_custom_critical_air_expedite_network | FEDEX_CUSTOM_CRITICAL_AIR_EXPEDITE_NETWORK | - | fedex_custom_critical_charter_air | FEDEX_CUSTOM_CRITICAL_CHARTER_AIR | - | fedex_custom_critical_point_to_point | FEDEX_CUSTOM_CRITICAL_POINT_TO_POINT | - | fedex_custom_critical_surface_expedite | FEDEX_CUSTOM_CRITICAL_SURFACE_EXPEDITE | - | fedex_custom_critical_surface_expedite_exclusive_use | FEDEX_CUSTOM_CRITICAL_SURFACE_EXPEDITE_EXCLUSIVE_USE | - | fedex_custom_critical_temp_assure_air | FEDEX_CUSTOM_CRITICAL_TEMP_ASSURE_AIR | - | fedex_custom_critical_temp_assure_validated_air | FEDEX_CUSTOM_CRITICAL_TEMP_ASSURE_VALIDATED_AIR | - | fedex_custom_critical_white_glove_services | FEDEX_CUSTOM_CRITICAL_WHITE_GLOVE_SERVICES | - | fedex_distance_deferred | FEDEX_DISTANCE_DEFERRED | - | fedex_express_saver | FEDEX_EXPRESS_SAVER | - | fedex_first_freight | FEDEX_FIRST_FREIGHT | - | fedex_freight_economy | FEDEX_FREIGHT_ECONOMY | - | fedex_freight_priority | FEDEX_FREIGHT_PRIORITY | - | fedex_ground | FEDEX_GROUND | - | fedex_international_priority_plus | FEDEX_INTERNATIONAL_PRIORITY_PLUS | - | fedex_next_day_afternoon | FEDEX_NEXT_DAY_AFTERNOON | - | fedex_next_day_early_morning | FEDEX_NEXT_DAY_EARLY_MORNING | - | fedex_next_day_end_of_day | FEDEX_NEXT_DAY_END_OF_DAY | - | fedex_next_day_freight | FEDEX_NEXT_DAY_FREIGHT | - | fedex_next_day_mid_morning | FEDEX_NEXT_DAY_MID_MORNING | - | fedex_first_overnight | FIRST_OVERNIGHT | - | fedex_ground_home_delivery | GROUND_HOME_DELIVERY | - | fedex_international_distribution_freight | INTERNATIONAL_DISTRIBUTION_FREIGHT | - | fedex_international_economy | INTERNATIONAL_ECONOMY | - | fedex_international_economy_distribution | INTERNATIONAL_ECONOMY_DISTRIBUTION | - | fedex_international_economy_freight | INTERNATIONAL_ECONOMY_FREIGHT | - | fedex_international_first | INTERNATIONAL_FIRST | - | fedex_international_ground | INTERNATIONAL_GROUND | - | fedex_international_priority | INTERNATIONAL_PRIORITY | - | fedex_international_priority_distribution | INTERNATIONAL_PRIORITY_DISTRIBUTION | - | fedex_international_priority_express | INTERNATIONAL_PRIORITY_EXPRESS | - | fedex_international_priority_freight | INTERNATIONAL_PRIORITY_FREIGHT | - | fedex_priority_overnight | PRIORITY_OVERNIGHT | - | fedex_same_day | SAME_DAY | - | fedex_same_day_city | SAME_DAY_CITY | - | fedex_same_day_metro_afternoon | SAME_DAY_METRO_AFTERNOON | - | fedex_same_day_metro_morning | SAME_DAY_METRO_MORNING | - | fedex_same_day_metro_rush | SAME_DAY_METRO_RUSH | - | fedex_smart_post | SMART_POST | - | fedex_standard_overnight | STANDARD_OVERNIGHT | - | fedex_transborder_distribution_consolidation | TRANSBORDER_DISTRIBUTION_CONSOLIDATION | - ### eShipper | Code | Service Name | | ------------ | ------------ | @@ -13200,6 +13143,14 @@ tags: | boxknight_nextday | NEXTDAY | | boxknight_scheduled | SCHEDULED | + ### Australia Post + | Code | Service Name | + | ------------ | ------------ | + | australiapost_parcel_post | T28 | + | australiapost_express_post | E34 | + | australiapost_parcel_post_signature | T28S | + | australiapost_express_post_signature | E34S | + ### Asendia US | Code | Service Name | | ------------ | ------------ | @@ -13230,6 +13181,66 @@ tags: | allied_standard_pallet_service | PT | | allied_oversized_pallet_service | PT2 | + ### FedEx Web Service + | Code | Service Name | + | ------------ | ------------ | + | fedex_europe_first_international_priority | EUROPE_FIRST_INTERNATIONAL_PRIORITY | + | fedex_1_day_freight | FEDEX_1_DAY_FREIGHT | + | fedex_2_day | FEDEX_2_DAY | + | fedex_2_day_am | FEDEX_2_DAY_AM | + | fedex_2_day_freight | FEDEX_2_DAY_FREIGHT | + | fedex_3_day_freight | FEDEX_3_DAY_FREIGHT | + | fedex_cargo_airport_to_airport | FEDEX_CARGO_AIRPORT_TO_AIRPORT | + | fedex_cargo_freight_forwarding | FEDEX_CARGO_FREIGHT_FORWARDING | + | fedex_cargo_international_express_freight | FEDEX_CARGO_INTERNATIONAL_EXPRESS_FREIGHT | + | fedex_cargo_international_premium | FEDEX_CARGO_INTERNATIONAL_PREMIUM | + | fedex_cargo_mail | FEDEX_CARGO_MAIL | + | fedex_cargo_registered_mail | FEDEX_CARGO_REGISTERED_MAIL | + | fedex_cargo_surface_mail | FEDEX_CARGO_SURFACE_MAIL | + | fedex_custom_critical_air_expedite | FEDEX_CUSTOM_CRITICAL_AIR_EXPEDITE | + | fedex_custom_critical_air_expedite_exclusive_use | FEDEX_CUSTOM_CRITICAL_AIR_EXPEDITE_EXCLUSIVE_USE | + | fedex_custom_critical_air_expedite_network | FEDEX_CUSTOM_CRITICAL_AIR_EXPEDITE_NETWORK | + | fedex_custom_critical_charter_air | FEDEX_CUSTOM_CRITICAL_CHARTER_AIR | + | fedex_custom_critical_point_to_point | FEDEX_CUSTOM_CRITICAL_POINT_TO_POINT | + | fedex_custom_critical_surface_expedite | FEDEX_CUSTOM_CRITICAL_SURFACE_EXPEDITE | + | fedex_custom_critical_surface_expedite_exclusive_use | FEDEX_CUSTOM_CRITICAL_SURFACE_EXPEDITE_EXCLUSIVE_USE | + | fedex_custom_critical_temp_assure_air | FEDEX_CUSTOM_CRITICAL_TEMP_ASSURE_AIR | + | fedex_custom_critical_temp_assure_validated_air | FEDEX_CUSTOM_CRITICAL_TEMP_ASSURE_VALIDATED_AIR | + | fedex_custom_critical_white_glove_services | FEDEX_CUSTOM_CRITICAL_WHITE_GLOVE_SERVICES | + | fedex_distance_deferred | FEDEX_DISTANCE_DEFERRED | + | fedex_express_saver | FEDEX_EXPRESS_SAVER | + | fedex_first_freight | FEDEX_FIRST_FREIGHT | + | fedex_freight_economy | FEDEX_FREIGHT_ECONOMY | + | fedex_freight_priority | FEDEX_FREIGHT_PRIORITY | + | fedex_ground | FEDEX_GROUND | + | fedex_international_priority_plus | FEDEX_INTERNATIONAL_PRIORITY_PLUS | + | fedex_next_day_afternoon | FEDEX_NEXT_DAY_AFTERNOON | + | fedex_next_day_early_morning | FEDEX_NEXT_DAY_EARLY_MORNING | + | fedex_next_day_end_of_day | FEDEX_NEXT_DAY_END_OF_DAY | + | fedex_next_day_freight | FEDEX_NEXT_DAY_FREIGHT | + | fedex_next_day_mid_morning | FEDEX_NEXT_DAY_MID_MORNING | + | fedex_first_overnight | FIRST_OVERNIGHT | + | fedex_ground_home_delivery | GROUND_HOME_DELIVERY | + | fedex_international_distribution_freight | INTERNATIONAL_DISTRIBUTION_FREIGHT | + | fedex_international_economy | INTERNATIONAL_ECONOMY | + | fedex_international_economy_distribution | INTERNATIONAL_ECONOMY_DISTRIBUTION | + | fedex_international_economy_freight | INTERNATIONAL_ECONOMY_FREIGHT | + | fedex_international_first | INTERNATIONAL_FIRST | + | fedex_international_ground | INTERNATIONAL_GROUND | + | fedex_international_priority | INTERNATIONAL_PRIORITY | + | fedex_international_priority_distribution | INTERNATIONAL_PRIORITY_DISTRIBUTION | + | fedex_international_priority_express | INTERNATIONAL_PRIORITY_EXPRESS | + | fedex_international_priority_freight | INTERNATIONAL_PRIORITY_FREIGHT | + | fedex_priority_overnight | PRIORITY_OVERNIGHT | + | fedex_same_day | SAME_DAY | + | fedex_same_day_city | SAME_DAY_CITY | + | fedex_same_day_metro_afternoon | SAME_DAY_METRO_AFTERNOON | + | fedex_same_day_metro_morning | SAME_DAY_METRO_MORNING | + | fedex_same_day_metro_rush | SAME_DAY_METRO_RUSH | + | fedex_smart_post | SMART_POST | + | fedex_standard_overnight | STANDARD_OVERNIGHT | + | fedex_transborder_distribution_consolidation | TRANSBORDER_DISTRIBUTION_CONSOLIDATION | + --- ## Parcel Templates @@ -13264,21 +13275,6 @@ tags: | purolator_express_pack | 12.5 x 16 x 1.0 in | | purolator_express_box | 18 x 12 x 3.5 in | - ### FedEx - | Code | Dimensions | - | ------------ | ------------ | - | fedex_envelope_legal_size | 9.5 x 15.5 x 1 in | - | fedex_padded_pak | 11.75 x 14.75 x 1 in | - | fedex_polyethylene_pak | 12.0 x 15.5 x 1 in | - | fedex_clinical_pak | 13.5 x 18.0 x 1 in | - | fedex_small_box | 12.25 x 10.9 x 1.5 in | - | fedex_medium_box | 13.25 x 11.5 x 2.38 in | - | fedex_large_box | 17.88 x 12.38 x 3.0 in | - | fedex_extra_large_box | 11.88 x 11.0 x 10.75 in | - | fedex_10_kg_box | 15.81 x 12.94 x 10.19 in | - | fedex_25_kg_box | 21.56 x 16.56 x 13.19 in | - | fedex_tube | 38.0 x 6.0 x 6.0 in | - ### DHL Express | Code | Dimensions | | ------------ | ------------ | @@ -13312,4 +13308,19 @@ tags: | canadapost_xexpresspost_certified_envelope | 26.0 x 15.9 x 1.5 cm | | canadapost_xexpresspost_national_large_envelope | 40.0 x 29.2 x 1.5 cm | + ### FedEx Web Service + | Code | Dimensions | + | ------------ | ------------ | + | fedex_envelope_legal_size | 9.5 x 15.5 x 1 in | + | fedex_padded_pak | 11.75 x 14.75 x 1 in | + | fedex_polyethylene_pak | 12.0 x 15.5 x 1 in | + | fedex_clinical_pak | 13.5 x 18.0 x 1 in | + | fedex_small_box | 12.25 x 10.9 x 1.5 in | + | fedex_medium_box | 13.25 x 11.5 x 2.38 in | + | fedex_large_box | 17.88 x 12.38 x 3.0 in | + | fedex_extra_large_box | 11.88 x 11.0 x 10.75 in | + | fedex_10_kg_box | 15.81 x 12.94 x 10.19 in | + | fedex_25_kg_box | 21.56 x 16.56 x 13.19 in | + | fedex_tube | 38.0 x 6.0 x 6.0 in | + ... From 08065cc5318659d3362a7641364e3f0d3096a243 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Wed, 21 Feb 2024 17:15:02 -0800 Subject: [PATCH 07/20] chore(deps): Update turbo --- package-lock.json | 56 +++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/package-lock.json b/package-lock.json index d2cbbe0def..dba78eb869 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "eslint": "^8.48.0", "prettier": "^3.0.3", "tsconfig": "*", - "turbo": "^1.12.3" + "turbo": "^1.12.4" } }, "apps/api": { @@ -29755,26 +29755,26 @@ "dev": true }, "node_modules/turbo": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/turbo/-/turbo-1.12.3.tgz", - "integrity": "sha512-a6q8I0TK9ohACYbkmxzG/JYPuDC4VCvfmXLTlf321qQ4BIAhoyaOj/O2g+zJ6L1vNYnZ82G4LrbMfgLLngbLsg==", + "version": "1.12.4", + "resolved": "https://registry.npmjs.org/turbo/-/turbo-1.12.4.tgz", + "integrity": "sha512-yUJ7elEUSToiGwFZogXpYKJpQ0BvaMbkEuQECIWtkBLcmWzlMOt6bActsIm29oN83mRU0WbzGt4e8H1KHWedhg==", "dev": true, "bin": { "turbo": "bin/turbo" }, "optionalDependencies": { - "turbo-darwin-64": "1.12.3", - "turbo-darwin-arm64": "1.12.3", - "turbo-linux-64": "1.12.3", - "turbo-linux-arm64": "1.12.3", - "turbo-windows-64": "1.12.3", - "turbo-windows-arm64": "1.12.3" + "turbo-darwin-64": "1.12.4", + "turbo-darwin-arm64": "1.12.4", + "turbo-linux-64": "1.12.4", + "turbo-linux-arm64": "1.12.4", + "turbo-windows-64": "1.12.4", + "turbo-windows-arm64": "1.12.4" } }, "node_modules/turbo-darwin-64": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/turbo-darwin-64/-/turbo-darwin-64-1.12.3.tgz", - "integrity": "sha512-dDglIaux+A4jOnB9CDH69sujmrnuLJLrKw1t3J+if6ySlFuxSwC++gDq9TVuOZo2+S7lFkGh+x5ytn3wp+jE8Q==", + "version": "1.12.4", + "resolved": "https://registry.npmjs.org/turbo-darwin-64/-/turbo-darwin-64-1.12.4.tgz", + "integrity": "sha512-dBwFxhp9isTa9RS/fz2gDVk5wWhKQsPQMozYhjM7TT4jTrnYn0ZJMzr7V3B/M/T8QF65TbniW7w1gtgxQgX5Zg==", "cpu": [ "x64" ], @@ -29785,9 +29785,9 @@ ] }, "node_modules/turbo-darwin-arm64": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/turbo-darwin-arm64/-/turbo-darwin-arm64-1.12.3.tgz", - "integrity": "sha512-5TqqeujEyHMoVUWGzSzUl5ERSg7HDCdbU3gBs5ziWTpFRpeJ/+Y15kYyZJcMQcubRIH3Y1hL/yA5IhlGdgXOMA==", + "version": "1.12.4", + "resolved": "https://registry.npmjs.org/turbo-darwin-arm64/-/turbo-darwin-arm64-1.12.4.tgz", + "integrity": "sha512-1Uo5iI6xsJ1j9ObsqxYRsa3W26mEbUe6fnj4rQYV6kDaqYD54oAMJ6hM53q9rB8JvFxwdrUXGp3PwTw9A0qqkA==", "cpu": [ "arm64" ], @@ -29798,9 +29798,9 @@ ] }, "node_modules/turbo-linux-64": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/turbo-linux-64/-/turbo-linux-64-1.12.3.tgz", - "integrity": "sha512-yUreU+/gq4vlBtcdyfjz7slwz4zM1RG8sSXvyHmAS+QXqSrGkegg4qLl2fRbv/c3EyA/XbfcZuD6tcrXkejr6g==", + "version": "1.12.4", + "resolved": "https://registry.npmjs.org/turbo-linux-64/-/turbo-linux-64-1.12.4.tgz", + "integrity": "sha512-ONg2aSqKP7LAQOg7ysmU5WpEQp4DGNxSlAiR7um+LKtbmC/UxogbR5+T+Uuq6zGuQ5kJyKjWJ4NhtvUswOqBsA==", "cpu": [ "x64" ], @@ -29811,9 +29811,9 @@ ] }, "node_modules/turbo-linux-arm64": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/turbo-linux-arm64/-/turbo-linux-arm64-1.12.3.tgz", - "integrity": "sha512-XRwAsp2eRSqZmaMVNrmHoKqofeJMuD87zmefZLTRAObh38hIwKgyl2QRsJIbteob5RN77yFbv3lAJ36UIY5h7w==", + "version": "1.12.4", + "resolved": "https://registry.npmjs.org/turbo-linux-arm64/-/turbo-linux-arm64-1.12.4.tgz", + "integrity": "sha512-9FPufkwdgfIKg/9jj87Cdtftw8o36y27/S2vLN7FTR2pp9c0MQiTBOLVYadUr1FlShupddmaMbTkXEhyt9SdrA==", "cpu": [ "arm64" ], @@ -29824,9 +29824,9 @@ ] }, "node_modules/turbo-windows-64": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/turbo-windows-64/-/turbo-windows-64-1.12.3.tgz", - "integrity": "sha512-CPnRfnUCtmFeShOtUdMCthySjmyHaoTyh9JueiYFvtCNeO3WfDMj63dpOQstQWHdJFYmIrIGfhAclcds9ePQYA==", + "version": "1.12.4", + "resolved": "https://registry.npmjs.org/turbo-windows-64/-/turbo-windows-64-1.12.4.tgz", + "integrity": "sha512-2mOtxHW5Vjh/5rDVu/aFwsMzI+chs8XcEuJHlY1sYOpEymYTz+u6AXbnzRvwZFMrLKr7J7fQOGl+v96sLKbNdA==", "cpu": [ "x64" ], @@ -29837,9 +29837,9 @@ ] }, "node_modules/turbo-windows-arm64": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/turbo-windows-arm64/-/turbo-windows-arm64-1.12.3.tgz", - "integrity": "sha512-cYA/wlzvp4vlCNHYJ2AjNS3FLXWwUC/5CJompBkTeKFFB6AviE/iLkbIhFikCVSNXZk/3AGanpMUXIkt3bdlwg==", + "version": "1.12.4", + "resolved": "https://registry.npmjs.org/turbo-windows-arm64/-/turbo-windows-arm64-1.12.4.tgz", + "integrity": "sha512-nOY5wae9qnxPOpT1fRuYO0ks6dTwpKMPV6++VkDkamFDLFHUDVM/9kmD2UTeh1yyrKnrZksbb9zmShhmfj1wog==", "cpu": [ "arm64" ], diff --git a/package.json b/package.json index 196f95f27f..00f469b339 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "eslint": "^8.48.0", "prettier": "^3.0.3", "tsconfig": "*", - "turbo": "^1.12.3" + "turbo": "^1.12.4" }, "name": "karrio", "packageManager": "npm@9.8.0", From 963fb685302c5a3159746d349c79726ba57bf7dc Mon Sep 17 00:00:00 2001 From: Daniel K Date: Wed, 21 Feb 2024 17:59:40 -0800 Subject: [PATCH 08/20] feat: Make all carrier settings field optional on types --- .../karrio/server/graph/schemas/base/types.py | 5 +- packages/types/base.ts | 2 + packages/types/graphql/admin/types.ts | 308 +++---- packages/types/graphql/types.ts | 162 ++-- packages/ui/modals/connect-provider-modal.tsx | 8 + schemas/graphql-admin.json | 826 ++++++------------ schemas/graphql.json | 826 ++++++------------ 7 files changed, 747 insertions(+), 1390 deletions(-) diff --git a/modules/graph/karrio/server/graph/schemas/base/types.py b/modules/graph/karrio/server/graph/schemas/base/types.py index 1e79c2aa55..0756e7d574 100644 --- a/modules/graph/karrio/server/graph/schemas/base/types.py +++ b/modules/graph/karrio/server/graph/schemas/base/types.py @@ -1081,7 +1081,10 @@ def services( "__annotations__": { k: ( typing.Optional[v] - if serializers.is_field_optional(model, k) + if ( + k not in ConnectionType.__annotations__ + or serializers.is_field_optional(model, k) + ) else v ) for k, v in annotations.items() diff --git a/packages/types/base.ts b/packages/types/base.ts index 928f6bdb89..29716ff649 100644 --- a/packages/types/base.ts +++ b/packages/types/base.ts @@ -358,6 +358,7 @@ export const CARRIER_THEMES: Collection = { 'laposte': 'is-laposte', 'nationex': 'is-nationex', 'fedex': 'is-fedex', + 'fedex_ws': 'is-fedex', 'freightcom': 'is-freightcom', 'generic': 'is-generic', 'purolator': 'is-purolator', @@ -406,6 +407,7 @@ export const CARRIER_IMAGES: Collection = { 'estafeta': 'generic', 'fastway': 'generic', 'fedex': 'fedex', + 'fedex_ws': 'fedex', 'fedex_mail': 'fedex', 'fedex_sameday_city': 'fedex', 'fedex_smartpost': 'fedex', diff --git a/packages/types/graphql/admin/types.ts b/packages/types/graphql/admin/types.ts index 1956b65627..4fb10be580 100644 --- a/packages/types/graphql/admin/types.ts +++ b/packages/types/graphql/admin/types.ts @@ -302,8 +302,8 @@ export interface GetSystemConnections_system_connections_AlliedExpressSettingsTy capabilities: string[]; metadata: any | null; config: any | null; - username: string; - password: string; + username: string | null; + password: string | null; account: string | null; service_type: string | null; } @@ -319,8 +319,8 @@ export interface GetSystemConnections_system_connections_AlliedExpressLocalSetti capabilities: string[]; metadata: any | null; config: any | null; - username: string; - password: string; + username: string | null; + password: string | null; account: string | null; service_type: string | null; } @@ -335,10 +335,10 @@ export interface GetSystemConnections_system_connections_AmazonShippingSettingsT active: boolean; capabilities: string[]; metadata: any | null; - seller_id: string; - developer_id: string; - mws_auth_token: string; - aws_region: string; + seller_id: string | null; + developer_id: string | null; + mws_auth_token: string | null; + aws_region: string | null; config: any | null; } @@ -352,10 +352,10 @@ export interface GetSystemConnections_system_connections_AramexSettingsType { active: boolean; capabilities: string[]; metadata: any | null; - username: string; - password: string; - account_pin: string; - account_entity: string; + username: string | null; + password: string | null; + account_pin: string | null; + account_entity: string | null; account_number: string | null; account_country_code: string | null; config: any | null; @@ -371,10 +371,10 @@ export interface GetSystemConnections_system_connections_AsendiaUSSettingsType { active: boolean; capabilities: string[]; metadata: any | null; - username: string; - password: string; + username: string | null; + password: string | null; account_number: string | null; - api_key: string; + api_key: string | null; config: any | null; } @@ -388,8 +388,8 @@ export interface GetSystemConnections_system_connections_AustraliaPostSettingsTy active: boolean; capabilities: string[]; metadata: any | null; - api_key: string; - password: string; + api_key: string | null; + password: string | null; account_number: string | null; config: any | null; } @@ -403,8 +403,8 @@ export interface GetSystemConnections_system_connections_BoxKnightSettingsType { test_mode: boolean; active: boolean; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; config: any | null; metadata: any | null; } @@ -462,8 +462,8 @@ export interface GetSystemConnections_system_connections_BelgianPostSettingsType capabilities: string[]; metadata: any | null; config: any | null; - account_id: string; - passphrase: string; + account_id: string | null; + passphrase: string | null; services: GetSystemConnections_system_connections_BelgianPostSettingsType_services[] | null; rate_sheet: GetSystemConnections_system_connections_BelgianPostSettingsType_rate_sheet | null; } @@ -478,10 +478,10 @@ export interface GetSystemConnections_system_connections_CanadaPostSettingsType active: boolean; capabilities: string[]; metadata: any | null; - username: string; - password: string; - customer_number: string; - contract_id: string; + username: string | null; + password: string | null; + customer_number: string | null; + contract_id: string | null; config: any | null; } @@ -495,8 +495,8 @@ export interface GetSystemConnections_system_connections_CanparSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; config: any | null; } @@ -510,7 +510,7 @@ export interface GetSystemConnections_system_connections_ChronopostSettingsType active: boolean; metadata: any | null; capabilities: string[]; - password: string; + password: string | null; account_number: string | null; account_country_code: string | null; config: any | null; @@ -569,9 +569,9 @@ export interface GetSystemConnections_system_connections_ColissimoSettingsType { capabilities: string[]; metadata: any | null; config: any | null; - password: string; - contract_number: string; - laposte_api_key: string; + password: string | null; + contract_number: string | null; + laposte_api_key: string | null; services: GetSystemConnections_system_connections_ColissimoSettingsType_services[] | null; rate_sheet: GetSystemConnections_system_connections_ColissimoSettingsType_rate_sheet | null; } @@ -630,10 +630,10 @@ export interface GetSystemConnections_system_connections_DHLParcelDESettingsType active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; - customer_number: string; - dhl_api_key: string; + username: string | null; + password: string | null; + customer_number: string | null; + dhl_api_key: string | null; tracking_consumer_key: string | null; tracking_consumer_secret: string | null; config: any | null; @@ -651,8 +651,8 @@ export interface GetSystemConnections_system_connections_DHLExpressSettingsType active: boolean; metadata: any | null; capabilities: string[]; - site_id: string; - password: string; + site_id: string | null; + password: string | null; account_number: string | null; account_country_code: string | null; config: any | null; @@ -711,8 +711,8 @@ export interface GetSystemConnections_system_connections_DHLPolandSettingsType { capabilities: string[]; metadata: any | null; config: any | null; - username: string; - password: string; + username: string | null; + password: string | null; account_number: string | null; services: GetSystemConnections_system_connections_DHLPolandSettingsType_services[] | null; rate_sheet: GetSystemConnections_system_connections_DHLPolandSettingsType_rate_sheet | null; @@ -728,8 +728,8 @@ export interface GetSystemConnections_system_connections_DHLUniversalSettingsTyp active: boolean; metadata: any | null; capabilities: string[]; - consumer_key: string; - consumer_secret: string; + consumer_key: string | null; + consumer_secret: string | null; config: any | null; } @@ -743,8 +743,8 @@ export interface GetSystemConnections_system_connections_DicomSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; billing_account: string | null; config: any | null; } @@ -802,8 +802,8 @@ export interface GetSystemConnections_system_connections_DPDSettingsType { metadata: any | null; config: any | null; capabilities: string[]; - delis_id: string; - password: string; + delis_id: string | null; + password: string | null; depot: string | null; account_country_code: string | null; services: GetSystemConnections_system_connections_DPDSettingsType_services[] | null; @@ -862,8 +862,8 @@ export interface GetSystemConnections_system_connections_DPDHLSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; app_id: string | null; app_token: string | null; zt_id: string | null; @@ -884,8 +884,8 @@ export interface GetSystemConnections_system_connections_EShipperSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; config: any | null; } @@ -899,7 +899,7 @@ export interface GetSystemConnections_system_connections_EasyPostSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - api_key: string; + api_key: string | null; config: any | null; } @@ -914,8 +914,8 @@ export interface GetSystemConnections_system_connections_FedexSettingsType { metadata: any | null; capabilities: string[]; account_number: string | null; - api_key: string; - secret_key: string; + api_key: string | null; + secret_key: string | null; account_country_code: string | null; config: any | null; } @@ -931,9 +931,9 @@ export interface GetSystemConnections_system_connections_FedexWSSettingsType { metadata: any | null; capabilities: string[]; account_number: string | null; - password: string; - meter_number: string; - user_key: string; + password: string | null; + meter_number: string | null; + user_key: string | null; account_country_code: string | null; config: any | null; } @@ -948,8 +948,8 @@ export interface GetSystemConnections_system_connections_FreightcomSettingsType active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; config: any | null; } @@ -1011,7 +1011,7 @@ export interface GetSystemConnections_system_connections_GenericSettingsType { carrier_id: string; carrier_name: string; display_name: string; - custom_carrier_name: string; + custom_carrier_name: string | null; account_number: string | null; test_mode: boolean; active: boolean; @@ -1034,8 +1034,8 @@ export interface GetSystemConnections_system_connections_GEODISSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - api_key: string; - identifier: string; + api_key: string | null; + identifier: string | null; language: string | null; config: any | null; } @@ -1050,7 +1050,7 @@ export interface GetSystemConnections_system_connections_LaPosteSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - api_key: string; + api_key: string | null; lang: string | null; config: any | null; } @@ -1067,8 +1067,8 @@ export interface GetSystemConnections_system_connections_Locate2uSettingsType { metadata: any | null; config: any | null; account_country_code: string | null; - client_id: string; - client_secret: string; + client_id: string | null; + client_secret: string | null; } export interface GetSystemConnections_system_connections_NationexSettingsType { @@ -1081,8 +1081,8 @@ export interface GetSystemConnections_system_connections_NationexSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - api_key: string; - customer_id: string; + api_key: string | null; + customer_id: string | null; billing_account: string | null; language: string | null; config: any | null; @@ -1098,8 +1098,8 @@ export interface GetSystemConnections_system_connections_PurolatorSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; account_number: string | null; user_token: string | null; config: any | null; @@ -1115,7 +1115,7 @@ export interface GetSystemConnections_system_connections_RoadieSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - api_key: string; + api_key: string | null; config: any | null; } @@ -1129,8 +1129,8 @@ export interface GetSystemConnections_system_connections_RoyalMailSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - client_id: string; - client_secret: string; + client_id: string | null; + client_secret: string | null; config: any | null; } @@ -1144,8 +1144,8 @@ export interface GetSystemConnections_system_connections_SendleSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - sendle_id: string; - api_key: string; + sendle_id: string | null; + api_key: string | null; account_country_code: string | null; config: any | null; } @@ -1160,8 +1160,8 @@ export interface GetSystemConnections_system_connections_TNTSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; account_number: string | null; account_country_code: string | null; config: any | null; @@ -1177,8 +1177,8 @@ export interface GetSystemConnections_system_connections_UPSSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - client_id: string; - client_secret: string; + client_id: string | null; + client_secret: string | null; account_number: string | null; account_country_code: string | null; config: any | null; @@ -1194,8 +1194,8 @@ export interface GetSystemConnections_system_connections_USPSSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; mailer_id: string | null; customer_registration_id: string | null; logistics_manager_mailer_id: string | null; @@ -1212,8 +1212,8 @@ export interface GetSystemConnections_system_connections_USPSInternationalSettin active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; mailer_id: string | null; customer_registration_id: string | null; logistics_manager_mailer_id: string | null; @@ -1232,7 +1232,7 @@ export interface GetSystemConnections_system_connections_Zoom2uSettingsType { metadata: any | null; config: any | null; account_country_code: string | null; - api_key: string; + api_key: string | null; } export type GetSystemConnections_system_connections = GetSystemConnections_system_connections_AlliedExpressSettingsType | GetSystemConnections_system_connections_AlliedExpressLocalSettingsType | GetSystemConnections_system_connections_AmazonShippingSettingsType | GetSystemConnections_system_connections_AramexSettingsType | GetSystemConnections_system_connections_AsendiaUSSettingsType | GetSystemConnections_system_connections_AustraliaPostSettingsType | GetSystemConnections_system_connections_BoxKnightSettingsType | GetSystemConnections_system_connections_BelgianPostSettingsType | GetSystemConnections_system_connections_CanadaPostSettingsType | GetSystemConnections_system_connections_CanparSettingsType | GetSystemConnections_system_connections_ChronopostSettingsType | GetSystemConnections_system_connections_ColissimoSettingsType | GetSystemConnections_system_connections_DHLParcelDESettingsType | GetSystemConnections_system_connections_DHLExpressSettingsType | GetSystemConnections_system_connections_DHLPolandSettingsType | GetSystemConnections_system_connections_DHLUniversalSettingsType | GetSystemConnections_system_connections_DicomSettingsType | GetSystemConnections_system_connections_DPDSettingsType | GetSystemConnections_system_connections_DPDHLSettingsType | GetSystemConnections_system_connections_EShipperSettingsType | GetSystemConnections_system_connections_EasyPostSettingsType | GetSystemConnections_system_connections_FedexSettingsType | GetSystemConnections_system_connections_FedexWSSettingsType | GetSystemConnections_system_connections_FreightcomSettingsType | GetSystemConnections_system_connections_GenericSettingsType | GetSystemConnections_system_connections_GEODISSettingsType | GetSystemConnections_system_connections_LaPosteSettingsType | GetSystemConnections_system_connections_Locate2uSettingsType | GetSystemConnections_system_connections_NationexSettingsType | GetSystemConnections_system_connections_PurolatorSettingsType | GetSystemConnections_system_connections_RoadieSettingsType | GetSystemConnections_system_connections_RoyalMailSettingsType | GetSystemConnections_system_connections_SendleSettingsType | GetSystemConnections_system_connections_TNTSettingsType | GetSystemConnections_system_connections_UPSSettingsType | GetSystemConnections_system_connections_USPSSettingsType | GetSystemConnections_system_connections_USPSInternationalSettingsType | GetSystemConnections_system_connections_Zoom2uSettingsType; @@ -1263,10 +1263,10 @@ export interface GetSystemConnection_system_connection_AmazonShippingSettingsTyp active: boolean; capabilities: string[]; metadata: any | null; - seller_id: string; - developer_id: string; - mws_auth_token: string; - aws_region: string; + seller_id: string | null; + developer_id: string | null; + mws_auth_token: string | null; + aws_region: string | null; config: any | null; } @@ -1280,10 +1280,10 @@ export interface GetSystemConnection_system_connection_AramexSettingsType { active: boolean; capabilities: string[]; metadata: any | null; - username: string; - password: string; - account_pin: string; - account_entity: string; + username: string | null; + password: string | null; + account_pin: string | null; + account_entity: string | null; account_number: string | null; account_country_code: string | null; config: any | null; @@ -1299,10 +1299,10 @@ export interface GetSystemConnection_system_connection_AsendiaUSSettingsType { active: boolean; capabilities: string[]; metadata: any | null; - username: string; - password: string; + username: string | null; + password: string | null; account_number: string | null; - api_key: string; + api_key: string | null; config: any | null; } @@ -1316,8 +1316,8 @@ export interface GetSystemConnection_system_connection_AustraliaPostSettingsType active: boolean; capabilities: string[]; metadata: any | null; - api_key: string; - password: string; + api_key: string | null; + password: string | null; account_number: string | null; config: any | null; } @@ -1331,8 +1331,8 @@ export interface GetSystemConnection_system_connection_BoxKnightSettingsType { test_mode: boolean; active: boolean; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; config: any | null; metadata: any | null; } @@ -1382,8 +1382,8 @@ export interface GetSystemConnection_system_connection_BelgianPostSettingsType { capabilities: string[]; metadata: any | null; config: any | null; - account_id: string; - passphrase: string; + account_id: string | null; + passphrase: string | null; services: GetSystemConnection_system_connection_BelgianPostSettingsType_services[] | null; } @@ -1397,10 +1397,10 @@ export interface GetSystemConnection_system_connection_CanadaPostSettingsType { active: boolean; capabilities: string[]; metadata: any | null; - username: string; - password: string; - customer_number: string; - contract_id: string; + username: string | null; + password: string | null; + customer_number: string | null; + contract_id: string | null; config: any | null; } @@ -1414,8 +1414,8 @@ export interface GetSystemConnection_system_connection_CanparSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; config: any | null; } @@ -1429,7 +1429,7 @@ export interface GetSystemConnection_system_connection_ChronopostSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - password: string; + password: string | null; account_number: string | null; account_country_code: string | null; config: any | null; @@ -1480,9 +1480,9 @@ export interface GetSystemConnection_system_connection_ColissimoSettingsType { capabilities: string[]; metadata: any | null; config: any | null; - password: string; - contract_number: string; - laposte_api_key: string; + password: string | null; + contract_number: string | null; + laposte_api_key: string | null; services: GetSystemConnection_system_connection_ColissimoSettingsType_services[] | null; } @@ -1496,8 +1496,8 @@ export interface GetSystemConnection_system_connection_DHLExpressSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - site_id: string; - password: string; + site_id: string | null; + password: string | null; account_number: string | null; account_country_code: string | null; config: any | null; @@ -1547,8 +1547,8 @@ export interface GetSystemConnection_system_connection_DHLPolandSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; account_number: string | null; services: GetSystemConnection_system_connection_DHLPolandSettingsType_services[] | null; config: any | null; @@ -1564,8 +1564,8 @@ export interface GetSystemConnection_system_connection_DHLUniversalSettingsType active: boolean; metadata: any | null; capabilities: string[]; - consumer_key: string; - consumer_secret: string; + consumer_key: string | null; + consumer_secret: string | null; config: any | null; } @@ -1579,8 +1579,8 @@ export interface GetSystemConnection_system_connection_DicomSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; billing_account: string | null; config: any | null; } @@ -1629,8 +1629,8 @@ export interface GetSystemConnection_system_connection_DPDSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - delis_id: string; - password: string; + delis_id: string | null; + password: string | null; depot: string | null; account_country_code: string | null; config: any | null; @@ -1681,8 +1681,8 @@ export interface GetSystemConnection_system_connection_DPDHLSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; app_id: string | null; app_token: string | null; zt_id: string | null; @@ -1702,8 +1702,8 @@ export interface GetSystemConnection_system_connection_EShipperSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; config: any | null; } @@ -1717,7 +1717,7 @@ export interface GetSystemConnection_system_connection_EasyPostSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - api_key: string; + api_key: string | null; config: any | null; } @@ -1732,8 +1732,8 @@ export interface GetSystemConnection_system_connection_FedexSettingsType { metadata: any | null; capabilities: string[]; account_number: string | null; - api_key: string; - secret_key: string; + api_key: string | null; + secret_key: string | null; account_country_code: string | null; config: any | null; } @@ -1749,9 +1749,9 @@ export interface GetSystemConnection_system_connection_FedexWSSettingsType { metadata: any | null; capabilities: string[]; account_number: string | null; - password: string; - meter_number: string; - user_key: string; + password: string | null; + meter_number: string | null; + user_key: string | null; account_country_code: string | null; config: any | null; } @@ -1766,8 +1766,8 @@ export interface GetSystemConnection_system_connection_FreightcomSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; config: any | null; } @@ -1821,7 +1821,7 @@ export interface GetSystemConnection_system_connection_GenericSettingsType { carrier_id: string; carrier_name: string; display_name: string; - custom_carrier_name: string; + custom_carrier_name: string | null; account_number: string | null; test_mode: boolean; active: boolean; @@ -1843,8 +1843,8 @@ export interface GetSystemConnection_system_connection_GEODISSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - api_key: string; - identifier: string; + api_key: string | null; + identifier: string | null; language: string | null; config: any | null; } @@ -1859,7 +1859,7 @@ export interface GetSystemConnection_system_connection_LaPosteSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - api_key: string; + api_key: string | null; lang: string | null; config: any | null; } @@ -1876,8 +1876,8 @@ export interface GetSystemConnection_system_connection_Locate2uSettingsType { metadata: any | null; config: any | null; account_country_code: string | null; - client_id: string; - client_secret: string; + client_id: string | null; + client_secret: string | null; } export interface GetSystemConnection_system_connection_NationexSettingsType { @@ -1890,8 +1890,8 @@ export interface GetSystemConnection_system_connection_NationexSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - api_key: string; - customer_id: string; + api_key: string | null; + customer_id: string | null; billing_account: string | null; language: string | null; config: any | null; @@ -1907,8 +1907,8 @@ export interface GetSystemConnection_system_connection_PurolatorSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; account_number: string | null; user_token: string | null; config: any | null; @@ -1924,7 +1924,7 @@ export interface GetSystemConnection_system_connection_RoadieSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - api_key: string; + api_key: string | null; config: any | null; } @@ -1938,8 +1938,8 @@ export interface GetSystemConnection_system_connection_RoyalMailSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - client_id: string; - client_secret: string; + client_id: string | null; + client_secret: string | null; config: any | null; } @@ -1953,8 +1953,8 @@ export interface GetSystemConnection_system_connection_SendleSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - sendle_id: string; - api_key: string; + sendle_id: string | null; + api_key: string | null; account_country_code: string | null; config: any | null; } @@ -1969,8 +1969,8 @@ export interface GetSystemConnection_system_connection_TNTSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; account_number: string | null; account_country_code: string | null; config: any | null; @@ -1986,8 +1986,8 @@ export interface GetSystemConnection_system_connection_UPSSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - client_id: string; - client_secret: string; + client_id: string | null; + client_secret: string | null; account_number: string | null; account_country_code: string | null; config: any | null; @@ -2003,8 +2003,8 @@ export interface GetSystemConnection_system_connection_USPSSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; mailer_id: string | null; customer_registration_id: string | null; logistics_manager_mailer_id: string | null; @@ -2021,8 +2021,8 @@ export interface GetSystemConnection_system_connection_USPSInternationalSettings active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; mailer_id: string | null; customer_registration_id: string | null; logistics_manager_mailer_id: string | null; @@ -2041,7 +2041,7 @@ export interface GetSystemConnection_system_connection_Zoom2uSettingsType { metadata: any | null; config: any | null; account_country_code: string | null; - api_key: string; + api_key: string | null; } export type GetSystemConnection_system_connection = GetSystemConnection_system_connection_AlliedExpressSettingsType | GetSystemConnection_system_connection_AmazonShippingSettingsType | GetSystemConnection_system_connection_AramexSettingsType | GetSystemConnection_system_connection_AsendiaUSSettingsType | GetSystemConnection_system_connection_AustraliaPostSettingsType | GetSystemConnection_system_connection_BoxKnightSettingsType | GetSystemConnection_system_connection_BelgianPostSettingsType | GetSystemConnection_system_connection_CanadaPostSettingsType | GetSystemConnection_system_connection_CanparSettingsType | GetSystemConnection_system_connection_ChronopostSettingsType | GetSystemConnection_system_connection_ColissimoSettingsType | GetSystemConnection_system_connection_DHLExpressSettingsType | GetSystemConnection_system_connection_DHLPolandSettingsType | GetSystemConnection_system_connection_DHLUniversalSettingsType | GetSystemConnection_system_connection_DicomSettingsType | GetSystemConnection_system_connection_DPDSettingsType | GetSystemConnection_system_connection_DPDHLSettingsType | GetSystemConnection_system_connection_EShipperSettingsType | GetSystemConnection_system_connection_EasyPostSettingsType | GetSystemConnection_system_connection_FedexSettingsType | GetSystemConnection_system_connection_FedexWSSettingsType | GetSystemConnection_system_connection_FreightcomSettingsType | GetSystemConnection_system_connection_GenericSettingsType | GetSystemConnection_system_connection_GEODISSettingsType | GetSystemConnection_system_connection_LaPosteSettingsType | GetSystemConnection_system_connection_Locate2uSettingsType | GetSystemConnection_system_connection_NationexSettingsType | GetSystemConnection_system_connection_PurolatorSettingsType | GetSystemConnection_system_connection_RoadieSettingsType | GetSystemConnection_system_connection_RoyalMailSettingsType | GetSystemConnection_system_connection_SendleSettingsType | GetSystemConnection_system_connection_TNTSettingsType | GetSystemConnection_system_connection_UPSSettingsType | GetSystemConnection_system_connection_USPSSettingsType | GetSystemConnection_system_connection_USPSInternationalSettingsType | GetSystemConnection_system_connection_Zoom2uSettingsType; diff --git a/packages/types/graphql/types.ts b/packages/types/graphql/types.ts index 654a18254c..da309e720b 100644 --- a/packages/types/graphql/types.ts +++ b/packages/types/graphql/types.ts @@ -2198,8 +2198,8 @@ export interface get_user_connections_user_connections_AlliedExpressSettingsType capabilities: string[]; metadata: any | null; config: any | null; - username: string; - password: string; + username: string | null; + password: string | null; account: string | null; service_type: string | null; } @@ -2215,8 +2215,8 @@ export interface get_user_connections_user_connections_AlliedExpressLocalSetting capabilities: string[]; metadata: any | null; config: any | null; - username: string; - password: string; + username: string | null; + password: string | null; account: string | null; service_type: string | null; } @@ -2231,10 +2231,10 @@ export interface get_user_connections_user_connections_AmazonShippingSettingsTyp active: boolean; capabilities: string[]; metadata: any | null; - seller_id: string; - developer_id: string; - mws_auth_token: string; - aws_region: string; + seller_id: string | null; + developer_id: string | null; + mws_auth_token: string | null; + aws_region: string | null; config: any | null; } @@ -2248,10 +2248,10 @@ export interface get_user_connections_user_connections_AramexSettingsType { active: boolean; capabilities: string[]; metadata: any | null; - username: string; - password: string; - account_pin: string; - account_entity: string; + username: string | null; + password: string | null; + account_pin: string | null; + account_entity: string | null; account_number: string | null; account_country_code: string | null; config: any | null; @@ -2267,10 +2267,10 @@ export interface get_user_connections_user_connections_AsendiaUSSettingsType { active: boolean; capabilities: string[]; metadata: any | null; - username: string; - password: string; + username: string | null; + password: string | null; account_number: string | null; - api_key: string; + api_key: string | null; config: any | null; } @@ -2284,8 +2284,8 @@ export interface get_user_connections_user_connections_AustraliaPostSettingsType active: boolean; capabilities: string[]; metadata: any | null; - api_key: string; - password: string; + api_key: string | null; + password: string | null; account_number: string | null; config: any | null; } @@ -2299,8 +2299,8 @@ export interface get_user_connections_user_connections_BoxKnightSettingsType { test_mode: boolean; active: boolean; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; config: any | null; metadata: any | null; } @@ -2360,8 +2360,8 @@ export interface get_user_connections_user_connections_BelgianPostSettingsType { capabilities: string[]; metadata: any | null; config: any | null; - account_id: string; - passphrase: string; + account_id: string | null; + passphrase: string | null; services: get_user_connections_user_connections_BelgianPostSettingsType_services[] | null; rate_sheet: get_user_connections_user_connections_BelgianPostSettingsType_rate_sheet | null; } @@ -2376,10 +2376,10 @@ export interface get_user_connections_user_connections_CanadaPostSettingsType { active: boolean; capabilities: string[]; metadata: any | null; - username: string; - password: string; - customer_number: string; - contract_id: string; + username: string | null; + password: string | null; + customer_number: string | null; + contract_id: string | null; config: any | null; } @@ -2393,8 +2393,8 @@ export interface get_user_connections_user_connections_CanparSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; config: any | null; } @@ -2408,7 +2408,7 @@ export interface get_user_connections_user_connections_ChronopostSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - password: string; + password: string | null; account_number: string | null; account_country_code: string | null; config: any | null; @@ -2469,9 +2469,9 @@ export interface get_user_connections_user_connections_ColissimoSettingsType { capabilities: string[]; metadata: any | null; config: any | null; - password: string; - contract_number: string; - laposte_api_key: string; + password: string | null; + contract_number: string | null; + laposte_api_key: string | null; services: get_user_connections_user_connections_ColissimoSettingsType_services[] | null; rate_sheet: get_user_connections_user_connections_ColissimoSettingsType_rate_sheet | null; } @@ -2530,10 +2530,10 @@ export interface get_user_connections_user_connections_DHLParcelDESettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; - customer_number: string; - dhl_api_key: string; + username: string | null; + password: string | null; + customer_number: string | null; + dhl_api_key: string | null; tracking_consumer_key: string | null; tracking_consumer_secret: string | null; config: any | null; @@ -2551,8 +2551,8 @@ export interface get_user_connections_user_connections_DHLExpressSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - site_id: string; - password: string; + site_id: string | null; + password: string | null; account_number: string | null; account_country_code: string | null; config: any | null; @@ -2613,8 +2613,8 @@ export interface get_user_connections_user_connections_DHLPolandSettingsType { capabilities: string[]; metadata: any | null; config: any | null; - username: string; - password: string; + username: string | null; + password: string | null; account_number: string | null; services: get_user_connections_user_connections_DHLPolandSettingsType_services[] | null; rate_sheet: get_user_connections_user_connections_DHLPolandSettingsType_rate_sheet | null; @@ -2630,8 +2630,8 @@ export interface get_user_connections_user_connections_DHLUniversalSettingsType active: boolean; metadata: any | null; capabilities: string[]; - consumer_key: string; - consumer_secret: string; + consumer_key: string | null; + consumer_secret: string | null; config: any | null; } @@ -2645,8 +2645,8 @@ export interface get_user_connections_user_connections_DicomSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; billing_account: string | null; config: any | null; } @@ -2706,8 +2706,8 @@ export interface get_user_connections_user_connections_DPDSettingsType { metadata: any | null; config: any | null; capabilities: string[]; - delis_id: string; - password: string; + delis_id: string | null; + password: string | null; depot: string | null; account_country_code: string | null; services: get_user_connections_user_connections_DPDSettingsType_services[] | null; @@ -2768,8 +2768,8 @@ export interface get_user_connections_user_connections_DPDHLSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; app_id: string | null; app_token: string | null; zt_id: string | null; @@ -2790,8 +2790,8 @@ export interface get_user_connections_user_connections_EShipperSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; config: any | null; } @@ -2805,7 +2805,7 @@ export interface get_user_connections_user_connections_EasyPostSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - api_key: string; + api_key: string | null; config: any | null; } @@ -2820,8 +2820,8 @@ export interface get_user_connections_user_connections_FedexSettingsType { metadata: any | null; capabilities: string[]; account_number: string | null; - api_key: string; - secret_key: string; + api_key: string | null; + secret_key: string | null; account_country_code: string | null; config: any | null; } @@ -2837,9 +2837,9 @@ export interface get_user_connections_user_connections_FedexWSSettingsType { metadata: any | null; capabilities: string[]; account_number: string | null; - password: string; - meter_number: string; - user_key: string; + password: string | null; + meter_number: string | null; + user_key: string | null; account_country_code: string | null; config: any | null; } @@ -2854,8 +2854,8 @@ export interface get_user_connections_user_connections_FreightcomSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; config: any | null; } @@ -2919,7 +2919,7 @@ export interface get_user_connections_user_connections_GenericSettingsType { carrier_id: string; carrier_name: string; display_name: string; - custom_carrier_name: string; + custom_carrier_name: string | null; account_number: string | null; test_mode: boolean; active: boolean; @@ -2942,8 +2942,8 @@ export interface get_user_connections_user_connections_GEODISSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - api_key: string; - identifier: string; + api_key: string | null; + identifier: string | null; language: string | null; config: any | null; } @@ -2958,7 +2958,7 @@ export interface get_user_connections_user_connections_LaPosteSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - api_key: string; + api_key: string | null; lang: string | null; config: any | null; } @@ -2975,8 +2975,8 @@ export interface get_user_connections_user_connections_Locate2uSettingsType { metadata: any | null; config: any | null; account_country_code: string | null; - client_id: string; - client_secret: string; + client_id: string | null; + client_secret: string | null; } export interface get_user_connections_user_connections_NationexSettingsType { @@ -2989,8 +2989,8 @@ export interface get_user_connections_user_connections_NationexSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - api_key: string; - customer_id: string; + api_key: string | null; + customer_id: string | null; billing_account: string | null; language: string | null; config: any | null; @@ -3006,8 +3006,8 @@ export interface get_user_connections_user_connections_PurolatorSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; account_number: string | null; user_token: string | null; config: any | null; @@ -3023,7 +3023,7 @@ export interface get_user_connections_user_connections_RoadieSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - api_key: string; + api_key: string | null; config: any | null; } @@ -3037,8 +3037,8 @@ export interface get_user_connections_user_connections_RoyalMailSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - client_id: string; - client_secret: string; + client_id: string | null; + client_secret: string | null; config: any | null; } @@ -3052,8 +3052,8 @@ export interface get_user_connections_user_connections_SendleSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - sendle_id: string; - api_key: string; + sendle_id: string | null; + api_key: string | null; account_country_code: string | null; config: any | null; } @@ -3068,8 +3068,8 @@ export interface get_user_connections_user_connections_TNTSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; account_number: string | null; account_country_code: string | null; config: any | null; @@ -3085,8 +3085,8 @@ export interface get_user_connections_user_connections_UPSSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - client_id: string; - client_secret: string; + client_id: string | null; + client_secret: string | null; account_number: string | null; account_country_code: string | null; config: any | null; @@ -3102,8 +3102,8 @@ export interface get_user_connections_user_connections_USPSSettingsType { active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; mailer_id: string | null; customer_registration_id: string | null; logistics_manager_mailer_id: string | null; @@ -3120,8 +3120,8 @@ export interface get_user_connections_user_connections_USPSInternationalSettings active: boolean; metadata: any | null; capabilities: string[]; - username: string; - password: string; + username: string | null; + password: string | null; mailer_id: string | null; customer_registration_id: string | null; logistics_manager_mailer_id: string | null; @@ -3140,7 +3140,7 @@ export interface get_user_connections_user_connections_Zoom2uSettingsType { metadata: any | null; config: any | null; account_country_code: string | null; - api_key: string; + api_key: string | null; } export type get_user_connections_user_connections = get_user_connections_user_connections_AlliedExpressSettingsType | get_user_connections_user_connections_AlliedExpressLocalSettingsType | get_user_connections_user_connections_AmazonShippingSettingsType | get_user_connections_user_connections_AramexSettingsType | get_user_connections_user_connections_AsendiaUSSettingsType | get_user_connections_user_connections_AustraliaPostSettingsType | get_user_connections_user_connections_BoxKnightSettingsType | get_user_connections_user_connections_BelgianPostSettingsType | get_user_connections_user_connections_CanadaPostSettingsType | get_user_connections_user_connections_CanparSettingsType | get_user_connections_user_connections_ChronopostSettingsType | get_user_connections_user_connections_ColissimoSettingsType | get_user_connections_user_connections_DHLParcelDESettingsType | get_user_connections_user_connections_DHLExpressSettingsType | get_user_connections_user_connections_DHLPolandSettingsType | get_user_connections_user_connections_DHLUniversalSettingsType | get_user_connections_user_connections_DicomSettingsType | get_user_connections_user_connections_DPDSettingsType | get_user_connections_user_connections_DPDHLSettingsType | get_user_connections_user_connections_EShipperSettingsType | get_user_connections_user_connections_EasyPostSettingsType | get_user_connections_user_connections_FedexSettingsType | get_user_connections_user_connections_FedexWSSettingsType | get_user_connections_user_connections_FreightcomSettingsType | get_user_connections_user_connections_GenericSettingsType | get_user_connections_user_connections_GEODISSettingsType | get_user_connections_user_connections_LaPosteSettingsType | get_user_connections_user_connections_Locate2uSettingsType | get_user_connections_user_connections_NationexSettingsType | get_user_connections_user_connections_PurolatorSettingsType | get_user_connections_user_connections_RoadieSettingsType | get_user_connections_user_connections_RoyalMailSettingsType | get_user_connections_user_connections_SendleSettingsType | get_user_connections_user_connections_TNTSettingsType | get_user_connections_user_connections_UPSSettingsType | get_user_connections_user_connections_USPSSettingsType | get_user_connections_user_connections_USPSInternationalSettingsType | get_user_connections_user_connections_Zoom2uSettingsType; diff --git a/packages/ui/modals/connect-provider-modal.tsx b/packages/ui/modals/connect-provider-modal.tsx index 64cc6f747d..0f50c3f36c 100644 --- a/packages/ui/modals/connect-provider-modal.tsx +++ b/packages/ui/modals/connect-provider-modal.tsx @@ -350,6 +350,14 @@ export const ConnectProviderModal: React.FC = ({ required={field("client_secret").required} />} + {field("secret_key").exists && } + {field("customer_number").exists && Date: Thu, 22 Feb 2024 23:33:15 -0800 Subject: [PATCH 09/20] fix: allied express local with proper schema sample --- .../allied_express_local/shipment/create.py | 4 ++-- .../allied_express_local/label_response.py | 7 ++++--- .../schemas/label_response.json | 11 ++++++----- .../tests/allied_express_local/test_shipment.py | 15 ++++++++------- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/modules/connectors/allied_express_local/karrio/providers/allied_express_local/shipment/create.py b/modules/connectors/allied_express_local/karrio/providers/allied_express_local/shipment/create.py index 0a77cf8b28..ea78dae58f 100644 --- a/modules/connectors/allied_express_local/karrio/providers/allied_express_local/shipment/create.py +++ b/modules/connectors/allied_express_local/karrio/providers/allied_express_local/shipment/create.py @@ -19,7 +19,7 @@ def parse_shipment_response( messages = error.parse_error_response(response, settings) shipment = ( _extract_details(response, settings, ctx=_response.ctx) - if not response.is_error and "result" in (response.data or {}) + if not response.is_error and "result" in (response.response or {}) else None ) @@ -34,7 +34,7 @@ def _extract_details( shipment: shipping.LabelResponseType = lib.to_object( shipping.LabelResponseType, data.response ) - label = shipment.soapenvBody.ns1getLabelResponse.result + label = shipment.result or shipment.soapenvBody.ns1getLabelResponse.result return models.ShipmentDetails( carrier_id=settings.carrier_id, diff --git a/modules/connectors/allied_express_local/karrio/schemas/allied_express_local/label_response.py b/modules/connectors/allied_express_local/karrio/schemas/allied_express_local/label_response.py index af12cb4adc..45e9c8a328 100644 --- a/modules/connectors/allied_express_local/karrio/schemas/allied_express_local/label_response.py +++ b/modules/connectors/allied_express_local/karrio/schemas/allied_express_local/label_response.py @@ -1,5 +1,5 @@ from attr import s -from typing import Optional +from typing import Optional, Any from jstruct import JStruct @@ -18,7 +18,7 @@ class PriceType: jobCode: Optional[DiscountClassType] = JStruct[DiscountClassType] netPrice: Optional[str] = None rateCode: Optional[DiscountClassType] = JStruct[DiscountClassType] - reason: Optional[str] = None + reason: Any = None @s(auto_attribs=True) @@ -29,7 +29,7 @@ class PriceDetailType: @s(auto_attribs=True) class Ns1GetLabelResponseType: xmlnsns1: Optional[str] = None - result: Optional[str] = None + result: Any = None @s(auto_attribs=True) @@ -41,4 +41,5 @@ class SoapenvBodyType: class LabelResponseType: Tracking: Optional[str] = None pricedetail: Optional[PriceDetailType] = JStruct[PriceDetailType] + result: Optional[str] = None soapenvBody: Optional[SoapenvBodyType] = JStruct[SoapenvBodyType] diff --git a/modules/connectors/allied_express_local/schemas/label_response.json b/modules/connectors/allied_express_local/schemas/label_response.json index 5be6f60856..27bbd90a23 100644 --- a/modules/connectors/allied_express_local/schemas/label_response.json +++ b/modules/connectors/allied_express_local/schemas/label_response.json @@ -1,5 +1,5 @@ { - "Tracking": "AET1021116", + "Tracking": "AET1520983", "price_detail": { "price": { "chargeQuantity": "0", @@ -8,21 +8,22 @@ "@xsi:nil": "1" }, "discountRate": "0.0", - "grossPrice": "0.0", + "grossPrice": "14.21", "jobCode": { "@xsi:nil": "1" }, - "netPrice": "0.0", + "netPrice": "14.21", "rateCode": { "@xsi:nil": "1" }, - "reason": "No Hire time found" + "reason": null } }, + "result": "CnN0YXJ0eHJlZgoxNDUwMQolJUVPRgo=", "soapenv:Body": { "ns1:getLabelResponse": { "@xmlns:ns1": "http://neptune.alliedexpress.com.au/ttws-ejb", - "result": "CnN0YXJ0eHJlZgoxNDUwMQolJUVPRgo=" + "result": null } } } \ No newline at end of file diff --git a/modules/connectors/allied_express_local/tests/allied_express_local/test_shipment.py b/modules/connectors/allied_express_local/tests/allied_express_local/test_shipment.py index 19fcbb9049..30e52a771f 100644 --- a/modules/connectors/allied_express_local/tests/allied_express_local/test_shipment.py +++ b/modules/connectors/allied_express_local/tests/allied_express_local/test_shipment.py @@ -147,8 +147,8 @@ def test_parse_error_response(self): "docs": {"label": ANY}, "label_type": "PDF", "meta": {"postal_code": "6155"}, - "shipment_identifier": "AET1021116", - "tracking_number": "AET1021116", + "shipment_identifier": "AET1520983", + "tracking_number": "AET1520983", }, [], ] @@ -241,7 +241,7 @@ def test_parse_error_response(self): ShipmentCancelRequest = {"shipmentno": "123456789", "postalcode": "12345"} ShipmentResponse = """{ - "Tracking": "AET1021116", + "Tracking": "AET1520983", "price_detail": { "price": { "chargeQuantity": "0", @@ -250,21 +250,22 @@ def test_parse_error_response(self): "@xsi:nil": "1" }, "discountRate": "0.0", - "grossPrice": "0.0", + "grossPrice": "14.21", "jobCode": { "@xsi:nil": "1" }, - "netPrice": "0.0", + "netPrice": "14.21", "rateCode": { "@xsi:nil": "1" }, - "reason": "No Hire time found" + "reason": null } }, + "result": "JVBERi0xLjMKJeLjz9MKMSAwIG9iago8PAovVHlwZSAvUGFnZXMKL0NvdW50IDIKL0tpZHMgWyA0IDAgUiA5IDAgUiBdCj4+CmVuZG9iagoyIDAgb2JqCjw8Ci9Qcm9kdWNlciAocHlwZGYpCj4+CmVuZG9iagozIDAgb2JqCjw8Ci9UeXBlIC9DYXRhbG9nCi9QYWdlcyAxIDAgUgo+PgplbmRvYmoKNCAwIG9iago8PAovQ29udGVudHMgNSAwIFIKL01lZGlhQm94IFsgMCAwIDQxOS41Mjc2IDI5Ny42Mzc4IF0KL1Jlc291cmNlcyA8PAovRm9udCA2IDAgUgovUHJvY1NldCBbIC9QREYgL1RleHQgL0ltYWdlQiAvSW1hZ2VDIC9JbWFnZUkgXQo+PgovUm90YXRlIDAKL1RyYW5zIDw8Cj4+Ci9UeXBlIC9QYWdlCi9QYXJlbnQgMSAwIFIKPj4KZW5kb2JqCjUgMCBvYmoKPDwKL0ZpbHRlciBbIC9BU0NJSTg1RGVjb2RlIC9GbGF0ZURlY29kZSBdCi9MZW5ndGggODM5Cj4+CnN0cmVhbQpHYXRVMWI+LWVnJkRjTSJBbFNrYGlRZzUmRzoiL184PF9PWFYkZjF1RUM7OV8yK0Q/XF49Uj8rSCFLQCcuVDBkdGNUMVM8JzhaLlFnJkkqcEo+NChvOkMpYiJUKV48Pk9TOXBDNCM8RENjWDs9bCdySk1DWXNrY1ghPzcqZDhPQGsyNCVbM0U5OTE3cDNtLG5AKSNELWZkWURoMklIYm4nPy0lTF5eOjE4P09LO3QhWDk8akdyKFE5ISloLlhuOHVVZSooPS5tSylta29JJ0A2KDVbKChrX3BMQD5nNGdkXkRON3BBZElPOT5xTURbPzptbVZNLzwmXTpMXSpAR3NOVSU5Mlc2Zi1sIlVhUmFnZUpwNSY2XnJaKDpWb21RY1pyUmc5cElZN1BELGRpay9BSG5DRT44aSJBJVIvYiZQOjJoTCc4SiJzV1pVdWc8OlZTMUhiXVMzVWdkbF46N2tJbl1HKWIxTGMnITQwaCxqVj8rbkc2UHByMnMxYzctSjs5O1xsR0UiPFQ+PEs2U09rQj9EWDI+SF5kc1JaaEBCU19XUipZY1pyTmFLYUVqVmJRLWBGUDhUMCliKWFMVDRFPyVCT1w9I0s/Ki9lYSFeV15RZiJnO0tXQ1sjLipWbSNtQ2tHb0V0dFRNODInQFtiKFBuJGBfXVVbTXUuMmxxRzpvZElCSUoxQmBbN28vO2dHcjZRN2pHKjMmPHUyRStbMUopaj1GTGthcmJpQyxYcStcXkAxWlhtWk8iUEJESTdbWjNFQ2pRZzJdPU42Yzw8ZTYjUDBDLFRiTigwTissK1tXNDg3XXNlLy9ObzVFdUNHcDFoc0xpSUlcKGI6alU4TVNNIiZpITo8KykmJzdsb3VTOEdnR0c3KiljWGFcOGkubChZMGg3NWduSk9vNj1OVDRwalNUZGY9RUlFRl1FP1A5Wj5OTDJTQ1N1MlBUM1hgYDA8WWxHdU0uIlY3VFA4ZTtJTFMhXTQnXiQvT0RlP0tpYjgyXGdZJzJqZmheaEQ1W1ZPRl8+T2lZRkFoRjRlJ1RvKk1mWSg9aCdYZFc3MDRcWmwhKVI0R2UuOlZcUy5Gc3FgKFhoKTxxOnBQSD9mIktGQGZ+PgplbmRzdHJlYW0KZW5kb2JqCjYgMCBvYmoKPDwKL0YxIDcgMCBSCi9GMiA4IDAgUgo+PgplbmRvYmoKNyAwIG9iago8PAovQmFzZUZvbnQgL0hlbHZldGljYQovRW5jb2RpbmcgL1dpbkFuc2lFbmNvZGluZwovTmFtZSAvRjEKL1N1YnR5cGUgL1R5cGUxCi9UeXBlIC9Gb250Cj4+CmVuZG9iago4IDAgb2JqCjw8Ci9CYXNlRm9udCAvSGVsdmV0aWNhLUJvbGQKL0VuY29kaW5nIC9XaW5BbnNpRW5jb2RpbmcKL05hbWUgL0YyCi9TdWJ0eXBlIC9UeXBlMQovVHlwZSAvRm9udAo+PgplbmRvYmoKOSAwIG9iago8PAovQ29udGVudHMgMTAgMCBSCi9NZWRpYUJveCBbIDAgMCA0MTkuNTI3NiAyOTcuNjM3OCBdCi9SZXNvdXJjZXMgPDwKL0ZvbnQgMTEgMCBSCi9Qcm9jU2V0IFsgL1BERiAvVGV4dCAvSW1hZ2VCIC9JbWFnZUMgL0ltYWdlSSBdCj4+Ci9Sb3RhdGUgMAovVHJhbnMgPDwKPj4KL1R5cGUgL1BhZ2UKL1BhcmVudCAxIDAgUgo+PgplbmRvYmoKMTAgMCBvYmoKPDwKL0ZpbHRlciBbIC9BU0NJSTg1RGVjb2RlIC9GbGF0ZURlY29kZSBdCi9MZW5ndGggODM5Cj4+CnN0cmVhbQpHYXRVMWI+LWVnJkRjTSJBbFNrYGlRZzUmRzoiL184PF9PWFYkZjF1RUM7OV8yK0Q/XF49Uj8rSCFLQCcuVDBkdGNUMVM8JzhaLlFnJkkqcEo+NChvOkMpYiJUKV48Pk9TOXBDNCM8RENjWDs9bCdySk1DWXNrY1ghPzcqZDhPQGsyNCVbM0U5OTE3cDNtLG5AKSNELWZkWURoMklIYm4nPy0lTF5eOjE4P09LO3QhWDk8akdyKFE5ISloLlhuOHVVZSooPS5tSylta29JJ0A2KDVbKChrX3BMQD5nNGdkXkRON3BBZElPOT5xTURbPzptbVZNLzwmXTpMXSpAR3NOVSU5Mlc2Zi1sIlVhUmFnZUpwNSY2XnJaKDpWb21RY1pyUmc5cElZN1BELGRpay9BSG5DRT44aSJBJVIvYiZQOjJoTCc4SiJzV1pVdWc8OlZTMUhiXVMzVWdkbF46N2tJbl1HKWIxTGMnITQwaCxqVj1VQCFKJT1eTUIsXCZOWCs9UFFlKWlfJEEzUytDN1VeUjFiREVldVAhdWsrbC4pLVQ9KyNEIVE8bEVidEk0QmlCNzBTVFtgUEw2MnJBLVErIWFSYjAxYmk6NlgybkhoQ3BqZ1Y2PGlHLDhMOGkmYjddNUovNT5mQ0NrZFMnSjAxMUI3NzEiPV9FaWRQJ141KlFzXFQ8IkglPi83V3RNa1h0NmNqI0k/N3IlcGFjJkdgZSsqbDxUVT5ibFxHYGBHNSNoKm5QQ2AxbkEhSG9sVjs8SCtUZ1lSViZYdENjMVEsLW43LGtKKS4xQU9QbDdqNltZY0AqMkoyMjh1dTpMc1FqXWMtTlYzOGdhYzE8YkVRLC1WSjczIStrOWBeREBJSUJsQisyVSpQQzpfQGF0ZD9vYSM3YFI2KU1sTW1HTShSXUZxZENbVGxgTlkqPFA5aDknaVZhIW9Wc0lyTGwrUD07cGg+PSw5clRrNEpXbEc1cmA3Z0BRRyJsVkg8Ll5hJ3BrS2VPXUYuODJYOUdVSlhPTUM7UixBK3FKJSsoWF1bRS5cXmRqInVbXjVDMCY9SDFpNm8/YDdiTm5McGM5Pz1ETCorODk3X2tFc0ZhVSFUKHJlQGZ+PgplbmRzdHJlYW0KZW5kb2JqCjExIDAgb2JqCjw8Ci9GMSAxMiAwIFIKL0YyIDEzIDAgUgo+PgplbmRvYmoKMTIgMCBvYmoKPDwKL0Jhc2VGb250IC9IZWx2ZXRpY2EKL0VuY29kaW5nIC9XaW5BbnNpRW5jb2RpbmcKL05hbWUgL0YxCi9TdWJ0eXBlIC9UeXBlMQovVHlwZSAvRm9udAo+PgplbmRvYmoKMTMgMCBvYmoKPDwKL0Jhc2VGb250IC9IZWx2ZXRpY2EtQm9sZAovRW5jb2RpbmcgL1dpbkFuc2lFbmNvZGluZwovTmFtZSAvRjIKL1N1YnR5cGUgL1R5cGUxCi9UeXBlIC9Gb250Cj4+CmVuZG9iagp4cmVmCjAgMTQKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDE1IDAwMDAwIG4gCjAwMDAwMDAwODAgMDAwMDAgbiAKMDAwMDAwMDExOSAwMDAwMCBuIAowMDAwMDAwMTY4IDAwMDAwIG4gCjAwMDAwMDAzNjcgMDAwMDAgbiAKMDAwMDAwMTI5NyAwMDAwMCBuIAowMDAwMDAxMzM4IDAwMDAwIG4gCjAwMDAwMDE0NDUgMDAwMDAgbiAKMDAwMDAwMTU1NyAwMDAwMCBuIAowMDAwMDAxNzU4IDAwMDAwIG4gCjAwMDAwMDI2ODkgMDAwMDAgbiAKMDAwMDAwMjczMyAwMDAwMCBuIAowMDAwMDAyODQxIDAwMDAwIG4gCnRyYWlsZXIKPDwKL1NpemUgMTQKL1Jvb3QgMyAwIFIKL0luZm8gMiAwIFIKPj4Kc3RhcnR4cmVmCjI5NTQKJSVFT0YK", "soapenv:Body": { "ns1:getLabelResponse": { "@xmlns:ns1": "http://neptune.alliedexpress.com.au/ttws-ejb", - "result": "CnN0YXJ0eHJlZgoxNDUwMQolJUVPRgo=" + "result": null } } } From 59666805a66661f17754bb68303424fe45d1b99a Mon Sep 17 00:00:00 2001 From: Daniel K Date: Thu, 22 Feb 2024 23:45:24 -0800 Subject: [PATCH 10/20] fix(allied_express_local): shipment cancellation response parsing --- .../karrio/providers/allied_express_local/error.py | 10 ++++++++-- .../providers/allied_express_local/shipment/cancel.py | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/connectors/allied_express_local/karrio/providers/allied_express_local/error.py b/modules/connectors/allied_express_local/karrio/providers/allied_express_local/error.py index 62b4624bef..0916c75cea 100644 --- a/modules/connectors/allied_express_local/karrio/providers/allied_express_local/error.py +++ b/modules/connectors/allied_express_local/karrio/providers/allied_express_local/error.py @@ -17,8 +17,14 @@ def parse_error_response( errors.append( [ "400", - response.data["result"].get("statusError") - or response.data["result"].get("errors"), + ( + ( + response.data["result"].get("statusError") + or response.data["result"].get("errors") + ) + if isinstance(response.data["result"], dict) + else response.data["result"] + ), ] ) diff --git a/modules/connectors/allied_express_local/karrio/providers/allied_express_local/shipment/cancel.py b/modules/connectors/allied_express_local/karrio/providers/allied_express_local/shipment/cancel.py index db54d4766e..b9ca67ef97 100644 --- a/modules/connectors/allied_express_local/karrio/providers/allied_express_local/shipment/cancel.py +++ b/modules/connectors/allied_express_local/karrio/providers/allied_express_local/shipment/cancel.py @@ -14,7 +14,7 @@ def parse_shipment_cancel_response( ) -> typing.Tuple[models.ConfirmationDetails, typing.List[models.Message]]: response = _response.deserialize() messages = error.parse_error_response(response, settings) - success = not response.is_error and (response.data.get("result")) == "0" + success = not response.is_error # and (response.data.get("result")) == "0" confirmation = ( models.ConfirmationDetails( From e5ef353a6f1947cb4b252944b48fc69ebea7744f Mon Sep 17 00:00:00 2001 From: Daniel K Date: Fri, 23 Feb 2024 00:23:15 -0800 Subject: [PATCH 11/20] feat: Add allied services to allied local service list --- .../karrio/providers/allied_express_local/units.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/connectors/allied_express_local/karrio/providers/allied_express_local/units.py b/modules/connectors/allied_express_local/karrio/providers/allied_express_local/units.py index 9c4da42fc7..cd8f1355a2 100644 --- a/modules/connectors/allied_express_local/karrio/providers/allied_express_local/units.py +++ b/modules/connectors/allied_express_local/karrio/providers/allied_express_local/units.py @@ -27,6 +27,10 @@ class ConnectionConfig(lib.Enum): class ShippingService(lib.StrEnum): """Carrier specific services""" + allied_road_service = "R" + allied_parcel_service = "P" + allied_standard_pallet_service = "PT" + allied_oversized_pallet_service = "PT2" allied_local_normal_service = "N" allied_local_vip_service = "V" allied_local_executive_service = "E" From 7577ea1aee02e3b5305d41d591a04ad796d762c1 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Sat, 24 Feb 2024 15:54:45 -0800 Subject: [PATCH 12/20] feat: Consolidate FedEx smart post support with unit tests --- .../fedex/karrio/providers/fedex/rate.py | 57 ++++-- .../karrio/providers/fedex/shipment/create.py | 48 +++-- .../fedex/karrio/providers/fedex/units.py | 93 ++++++++-- .../connectors/fedex/tests/fedex/test_rate.py | 15 +- .../fedex/tests/fedex/test_shipment.py | 73 ++++---- .../karrio/providers/fedex_ws/rate.py | 165 +++++++++++------ .../providers/fedex_ws/shipment/create.py | 60 +++++-- .../karrio/providers/fedex_ws/units.py | 166 +++++++++++------- .../fedex_ws/tests/fedex_ws/test_rate.py | 9 + 9 files changed, 465 insertions(+), 221 deletions(-) diff --git a/modules/connectors/fedex/karrio/providers/fedex/rate.py b/modules/connectors/fedex/karrio/providers/fedex/rate.py index 4af4b0c979..18a844c41d 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/rate.py +++ b/modules/connectors/fedex/karrio/providers/fedex/rate.py @@ -30,8 +30,7 @@ def _extract_details( ctx: dict = {}, ) -> models.RateDetails: # fmt: off - # rate = lib.to_object(rating.RateReplyDetailType, data) - rate = rating.RateReplyDetailType(**data) + rate = lib.to_object(rating.RateReplyDetailType, data) service = provider_units.ShippingService.map(rate.serviceType) details: rating.RatedShipmentDetailType = ( next((_ for _ in rate.ratedShipmentDetails if _.rateType == "PREFERRED_CURRENCY"), None) or @@ -105,9 +104,26 @@ def rate_request( ) request_types = ["LIST"] + ([] if "currency" not in options else ["PREFERRED"]) shipment_date = lib.to_date(options.shipment_date.state or datetime.datetime.now()) - compute_options = lambda _options: [ - option for _, option in _options.items() if _options.state is not False + package_options = lambda _options: [ + option + for _, option in _options.items() + if _options.state is not False and option.code in provider_units.PACKAGE_OPTIONS ] + rate_options = lambda _options: [ + option + for _, option in _options.items() + if _options.state is not False and option.code in provider_units.RATING_OPTIONS + ] + shipment_options = lambda _options: [ + option + for _, option in _options.items() + if _options.state is not False + and option.code in provider_units.SHIPMENT_OPTIONS + ] + hub_id = ( + lib.text(settings.connection_config.smart_post_hub_id.state) + or options.fedex_smart_post_hub_id.state + ) request = fedex.RatingRequestType( accountNumber=fedex.RatingRequestAccountNumberType( @@ -117,9 +133,9 @@ def rate_request( returnTransitTimes=True, servicesNeededOnRateFailure=True, variableOptions=( - [option.code for option in compute_options(options)] - if any(compute_options(options)) - else None + [option.code for option in rate_options(options)] + if any(rate_options(options)) + else [] ), rateSortOrder="COMMITASCENDING", ), @@ -146,7 +162,7 @@ def rate_request( ), serviceType=getattr(service, "value", None), emailNotificationDetail=None, - preferredCurrency=options.currency, + preferredCurrency=options.currency.state, rateRequestType=request_types, shipDateStamp=lib.fdate(shipment_date, "%Y-%m-%d"), pickupType="DROPOFF_AT_FEDEX_LOCATION", @@ -155,7 +171,7 @@ def rate_request( subPackagingType=package.packaging_type, groupPackageCount=1, contentRecord=[], - declaredValue=package.options.declared_value, + declaredValue=package.options.declared_value.state, weight=fedex.WeightType( units=package.weight.unit, value=package.weight.value, @@ -188,7 +204,7 @@ def rate_request( fedex.PackageSpecialServicesType( specialServiceTypes=[ option.code - for option in compute_options(package.options) + for option in package_options(package.options) ], signatureOptionType=None, alcoholDetail=None, @@ -198,7 +214,7 @@ def rate_request( batteryDetails=None, dryIceWeight=None, ) - if any(compute_options(package.options)) + if any(package_options(package.options)) else None ), ) @@ -222,18 +238,27 @@ def rate_request( internationalControlledExportDetail=None, homeDeliveryPremiumDetail=None, specialServiceTypes=( - [option.code for option in compute_options(packages.options)] - if any(compute_options(packages.options)) - else None + [option.code for option in shipment_options(packages.options)] + if any(shipment_options(packages.options)) + else [] ), ) - if any(options.items()) + if any(shipment_options(packages.options)) else None ), customsClearanceDetail=None, groupShipment=None, serviceTypeDetail=None, - smartPostInfoDetail=None, + smartPostInfoDetail=( + fedex.SmartPostInfoDetailType( + ancillaryEndorsement=None, + hubId=hub_id, + indicia=options.fedex_smart_post_allowed_indicia.state, + specialServices=None, + ) + if hub_id is not None + else None + ), expressFreightDetail=None, groundShipment=None, ), diff --git a/modules/connectors/fedex/karrio/providers/fedex/shipment/create.py b/modules/connectors/fedex/karrio/providers/fedex/shipment/create.py index 501d56c9d6..80271b6c77 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/shipment/create.py +++ b/modules/connectors/fedex/karrio/providers/fedex/shipment/create.py @@ -118,7 +118,6 @@ def shipment_request( recipient=payload.recipient, weight_unit=weight_unit.value, ) - payment = payload.payment or models.Payment( paid_by="sender", account_number=settings.account_number ) @@ -126,9 +125,6 @@ def shipment_request( label_type, label_format = provider_units.LabelType.map( payload.label_type or "PDF_4x6" ).value - compute_options = lambda _options: [ - option for _, option in _options.items() if _options.state is not False - ] billing_address = lib.to_address( payload.billing_address or dict( @@ -145,6 +141,21 @@ def shipment_request( third_party=customs.duty_billing_address, ).get(customs.duty.paid_by) ) + package_options = lambda _options: [ + option + for _, option in _options.items() + if _options.state is not False and option.code in provider_units.PACKAGE_OPTIONS + ] + shipment_options = lambda _options: [ + option + for _, option in _options.items() + if _options.state is not False + and option.code in provider_units.SHIPMENT_OPTIONS + ] + hub_id = ( + lib.text(settings.connection_config.smart_post_hub_id.state) + or options.fedex_smart_post_hub_id.state + ) requests = [ fedex.ShippingRequestType( @@ -288,8 +299,11 @@ def shipment_request( shipmentSpecialServices=( fedex.ShipmentSpecialServicesType( specialServiceTypes=( - [option.code for option in compute_options(package.options)] - if compute_options(package.options) + [ + option.code + for option in shipment_options(package.options) + ] + if shipment_options(package.options) else None ), etdDetail=( @@ -319,7 +333,7 @@ def shipment_request( for doc in options.doc_files.state ] if (options.doc_files.state or []) - else None + else [] ), requestedDocumentTypes=["COMMERCIAL_INVOICE"], ) @@ -336,7 +350,7 @@ def shipment_request( internationalControlledExportDetail=None, homeDeliveryPremiumDetail=None, ) - if any(options.items()) + if any(shipment_options(packages.options)) else None ), emailNotificationDetail=None, @@ -462,7 +476,16 @@ def shipment_request( if payload.customs is not None else None ), - smartPostInfoDetail=None, + smartPostInfoDetail=( + fedex.SmartPostInfoDetailType( + ancillaryEndorsement=None, + hubId=hub_id, + indicia=options.fedex_smart_post_allowed_indicia.state, + specialServices=None, + ) + if hub_id is not None + else None + ), blockInsightVisibility=None, labelSpecification=fedex.LabelSpecificationType( labelFormatType="COMMON2D", @@ -488,7 +511,7 @@ def shipment_request( ) if ( customs.commercial_invoice is True - and not options.fedex_electronic_trade_documents.state + and not package.options.fedex_electronic_trade_documents.state ) else None ), @@ -538,7 +561,10 @@ def shipment_request( itemDescription=package.parcel.description, variableHandlingChargeDetail=None, packageSpecialServices=fedex.PackageSpecialServicesType( - specialServiceTypes=["SIGNATURE_OPTION"], + specialServiceTypes=[ + option.code + for option in package_options(package.options) + ], priorityAlertDetail=None, signatureOptionType=( package.options.fedex_signature_option.state diff --git a/modules/connectors/fedex/karrio/providers/fedex/units.py b/modules/connectors/fedex/karrio/providers/fedex/units.py index da2161a9e7..0a56c8e6e0 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/units.py +++ b/modules/connectors/fedex/karrio/providers/fedex/units.py @@ -186,6 +186,7 @@ class PaymentType(lib.Enum): class ConnectionConfig(lib.Enum): locale = lib.OptionEnum("locale") label_type = lib.OptionEnum("label_type") + smart_post_hub_id = lib.OptionEnum("smart_post_hub_id") shipping_options = lib.OptionEnum("shipping_options", list) shipping_services = lib.OptionEnum("shipping_services", list) @@ -231,19 +232,8 @@ class ShippingService(lib.Enum): fedex_distance_deferred = "FEDEX_DISTANCE_DEFERRED" -class RatingOption(lib.Enum): - fedex_one_rate = lib.OptionEnum("FEDEX_ONE_RATE", bool) - fedex_freight_guarantee = lib.OptionEnum("FREIGHT_GUARANTEE", bool) - fedex_saturday_delivery = lib.OptionEnum("SATURDAY_DELIVERY", bool) - fedex_smart_post_allowed_indicia = lib.OptionEnum( - "SMART_POST_ALLOWED_INDICIA", bool - ) - fedex_smart_post_hub_id = lib.OptionEnum("SMART_POST_HUB_ID", bool) - - class ShippingOption(lib.Enum): # fmt: off - fedex_appointment = lib.OptionEnum("APPOINTMENT", bool) fedex_broker_select_option = lib.OptionEnum("BROKER_SELECT_OPTION", bool) fedex_call_before_delivery = lib.OptionEnum("CALL_BEFORE_DELIVERY", bool) @@ -259,7 +249,6 @@ class ShippingOption(lib.Enum): fedex_inside_delivery = lib.OptionEnum("INSIDE_DELIVERY", bool) fedex_inside_pickup = lib.OptionEnum("INSIDE_PICKUP", bool) fedex_international_controlled_export_service = lib.OptionEnum("INTERNATIONAL_CONTROLLED_EXPORT_SERVICE", bool) - fedex_one_rate = lib.OptionEnum("FEDEX_ONE_RATE", bool) fedex_third_party_consignee = lib.OptionEnum("THIRD_PARTY_CONSIGNEE", bool) fedex_electronic_trade_documents = lib.OptionEnum("ELECTRONIC_TRADE_DOCUMENTS", bool) fedex_food = lib.OptionEnum("FOOD", bool) @@ -278,12 +267,17 @@ class ShippingOption(lib.Enum): fedex_protection_from_freezing = lib.OptionEnum("PROTECTION_FROM_FREEZING", bool) fedex_returns_clearance = lib.OptionEnum("RETURNS_CLEARANCE", bool) fedex_return_shipment = lib.OptionEnum("RETURN_SHIPMENT", bool) - fedex_saturday_delivery = lib.OptionEnum("SATURDAY_DELIVERY", bool) fedex_saturday_pickup = lib.OptionEnum("SATURDAY_PICKUP", bool) fedex_event_notification = lib.OptionEnum("EVENT_NOTIFICATION", bool) fedex_delivery_on_invoice_acceptance = lib.OptionEnum("DELIVERY_ON_INVOICE_ACCEPTANCE", bool) fedex_top_load = lib.OptionEnum("TOP_LOAD", bool) + + """ Rating Options """ + fedex_one_rate = lib.OptionEnum("FEDEX_ONE_RATE", bool) fedex_freight_guarantee = lib.OptionEnum("FREIGHT_GUARANTEE", bool) + fedex_saturday_delivery = lib.OptionEnum("SATURDAY_DELIVERY", bool) + fedex_smart_post_hub_id = lib.OptionEnum("SMART_POST_HUB_ID", bool) + fedex_smart_post_allowed_indicia = lib.OptionEnum("SMART_POST_ALLOWED_INDICIA", bool) """ Package Options """ @@ -304,15 +298,78 @@ class ShippingOption(lib.Enum): notification = fedex_event_notification paperless_trade = fedex_electronic_trade_documents doc_files = lib.OptionEnum("doc_files", lib.to_dict) - doc_references = lib.OptionEnum("WEIGHING", lib.to_dict) - + doc_references = lib.OptionEnum("doc_references", lib.to_dict) # fmt: on +RATING_OPTIONS = [ + "FREIGHT_GUARANTEE", + "SATURDAY_DELIVERY", + "SMART_POST_ALLOWED_INDICIA", + "SMART_POST_HUB_ID", +] +PACKAGE_OPTIONS = [ + "ALCOHOL", + "APPOINTMENT", + "BATTERY", + "COD", + "DANGEROUS_GOODS", + "DRY_ICE", + "PRIORITY_ALERT", + "PRIORITY_ALERT_PLUS", + "NON_STANDARD_CONTAINER", + "PIECE_COUNT_VERIFICATION", + "SIGNATURE_OPTION", + "EVENING", + "DATE_CERTAIN", + "SATURDAY_PICKUP", +] +SHIPMENT_OPTIONS = [ + "APPOINTMENT", + "BROKER_SELECT_OPTION", + "CALL_BEFORE_DELIVERY", + "COD", + "CUSTOM_DELIVERY_WINDOW", + "CUT_FLOWERS", + "DO_NOT_BREAK_DOWN_PALLETS", + "DO_NOT_STACK_PALLETS", + "DRY_ICE", + "EAST_COAST_SPECIAL", + "EXCLUDE_FROM_CONSOLIDATION", + "EXTREME_LENGTH", + "INSIDE_DELIVERY", + "INSIDE_PICKUP", + "INTERNATIONAL_CONTROLLED_EXPORT_SERVICE", + "FEDEX_ONE_RATE", + "THIRD_PARTY_CONSIGNEE", + "ELECTRONIC_TRADE_DOCUMENTS", + "FOOD", + "HOLD_AT_LOCATION", + "INTERNATIONAL_TRAFFIC_IN_ARMS_REGULATIONS", + "LIFTGATE_DELIVERY", + "LIFTGATE_PICKUP", + "LIMITED_ACCESS_DELIVERY", + "LIMITED_ACCESS_PICKUP", + "OVER_LENGTH", + "PENDING_SHIPMENT", + "PHARMACY_DELIVERY", + "POISON", + "HOME_DELIVERY_PREMIUM", + "PROTECTION_FROM_FREEZING", + "RETURNS_CLEARANCE", + "RETURN_SHIPMENT", + "SATURDAY_DELIVERY", + "SATURDAY_PICKUP", + "EVENT_NOTIFICATION", + "DELIVERY_ON_INVOICE_ACCEPTANCE", + "TOP_LOAD", + "FREIGHT_GUARANTEE", +] + + def shipping_options_initializer( options: dict, package_options: units.Options = None, - option_type: lib.Enum = ShippingOption, ) -> units.Options: """ Apply default values to the given options. @@ -335,9 +392,9 @@ def shipping_options_initializer( ) def items_filter(key: str) -> bool: - return key in option_type and key not in ["doc_files", "doc_references"] # type: ignore + return key in ShippingOption and key not in ["doc_files", "doc_references"] # type: ignore - return units.ShippingOptions(_options, option_type, items_filter=items_filter) + return units.ShippingOptions(_options, ShippingOption, items_filter=items_filter) class RateType(lib.Enum): diff --git a/modules/connectors/fedex/tests/fedex/test_rate.py b/modules/connectors/fedex/tests/fedex/test_rate.py index a73c2565d7..b618610c75 100644 --- a/modules/connectors/fedex/tests/fedex/test_rate.py +++ b/modules/connectors/fedex/tests/fedex/test_rate.py @@ -147,24 +147,22 @@ def test_parse_rate_response(self): "rateSortOrder": "COMMITASCENDING", "returnTransitTimes": True, "servicesNeededOnRateFailure": True, - "variableOptions": ["FEDEX_ONE_RATE", "SIGNATURE_OPTION"], }, "requestedShipment": { "documentShipment": False, "packagingType": "YOUR_PACKAGING", "pickupType": "DROPOFF_AT_FEDEX_LOCATION", - "preferredCurrency": { - "code": "currency", - "state": "USD", - "type": "", - }, + "preferredCurrency": "USD", "rateRequestType": ["LIST", "PREFERRED"], "recipient": { - "address": {"city": "Lome", "countryCode": "TG", "residential": False} + "address": { + "city": "Lome", + "countryCode": "TG", + "residential": False, + } }, "requestedPackageLineItems": [ { - "declaredValue": {"type": ""}, "dimensions": { "height": 3.0, "length": 10.0, @@ -176,7 +174,6 @@ def test_parse_rate_response(self): } ], "shipDateStamp": "2024-02-15", - "shipmentSpecialServices": {}, "shipper": { "address": { "countryCode": "CA", diff --git a/modules/connectors/fedex/tests/fedex/test_shipment.py b/modules/connectors/fedex/tests/fedex/test_shipment.py index a4148ac05a..9285a2cb92 100644 --- a/modules/connectors/fedex/tests/fedex/test_shipment.py +++ b/modules/connectors/fedex/tests/fedex/test_shipment.py @@ -310,7 +310,6 @@ def test_parse_cancel_shipment_response(self): ], "serviceType": "FEDEX_INTERNATIONAL_PRIORITY", "shipDatestamp": "2024-02-15", - "shipmentSpecialServices": {"specialServiceTypes": ["SIGNATURE_OPTION"]}, "shipper": { "accountNumber": "2349857", "address": { @@ -434,10 +433,10 @@ def test_parse_cancel_shipment_response(self): ], }, "contact": { - "companyName": "Input Your " "Information", + "companyName": "Input Your Information", "emailAddress": "Input " "Your " "Information", - "personName": "Input Your " "Information", - "phoneNumber": "Input Your " "Information", + "personName": "Input Your Information", + "phoneNumber": "Input Your Information", }, } ], @@ -461,14 +460,10 @@ def test_parse_cancel_shipment_response(self): "shipDatestamp": "2024-02-17", "shipmentSpecialServices": { "etdDetail": { - "attachedDocuments": [None], "attributes": ["POST_SHIPMENT_UPLOAD_REQUESTED"], "requestedDocumentTypes": ["COMMERCIAL_INVOICE"], }, - "specialServiceTypes": [ - "ELECTRONIC_TRADE_DOCUMENTS", - "SIGNATURE_OPTION", - ], + "specialServiceTypes": ["ELECTRONIC_TRADE_DOCUMENTS"], }, "shipper": { "accountNumber": "2349857", @@ -479,15 +474,15 @@ def test_parse_cancel_shipment_response(self): "residential": False, "stateOrProvinceCode": "TN", "streetLines": [ - "Input Your " "Information", - "Input Your " "Information", + "Input Your Information", + "Input Your Information", ], }, "contact": { - "companyName": "Input Your " "Information", - "emailAddress": "Input Your " "Information", - "personName": "Input Your " "Information", - "phoneNumber": "Input Your " "Information", + "companyName": "Input Your Information", + "emailAddress": "Input Your Information", + "personName": "Input Your Information", + "phoneNumber": "Input Your Information", }, }, "shippingChargesPayment": { @@ -502,15 +497,15 @@ def test_parse_cancel_shipment_response(self): "residential": False, "stateOrProvinceCode": "BC", "streetLines": [ - "Input Your " "Information", - "Input Your " "Information", + "Input Your Information", + "Input Your Information", ], }, "contact": { - "companyName": "Input Your " "Information", - "emailAddress": "Input Your " "Information", - "personName": "Input Your " "Information", - "phoneNumber": "Input Your " "Information", + "companyName": "Input Your Information", + "emailAddress": "Input Your Information", + "personName": "Input Your Information", + "phoneNumber": "Input Your Information", }, }, "totalPackageCount": 2, @@ -597,10 +592,10 @@ def test_parse_cancel_shipment_response(self): ], }, "contact": { - "companyName": "Input Your " "Information", + "companyName": "Input Your Information", "emailAddress": "Input " "Your " "Information", - "personName": "Input Your " "Information", - "phoneNumber": "Input Your " "Information", + "personName": "Input Your Information", + "phoneNumber": "Input Your Information", }, } ], @@ -624,14 +619,10 @@ def test_parse_cancel_shipment_response(self): "shipDatestamp": "2024-02-17", "shipmentSpecialServices": { "etdDetail": { - "attachedDocuments": [None], "attributes": ["POST_SHIPMENT_UPLOAD_REQUESTED"], "requestedDocumentTypes": ["COMMERCIAL_INVOICE"], }, - "specialServiceTypes": [ - "ELECTRONIC_TRADE_DOCUMENTS", - "SIGNATURE_OPTION", - ], + "specialServiceTypes": ["ELECTRONIC_TRADE_DOCUMENTS"], }, "shipper": { "accountNumber": "2349857", @@ -642,15 +633,15 @@ def test_parse_cancel_shipment_response(self): "residential": False, "stateOrProvinceCode": "TN", "streetLines": [ - "Input Your " "Information", - "Input Your " "Information", + "Input Your Information", + "Input Your Information", ], }, "contact": { - "companyName": "Input Your " "Information", - "emailAddress": "Input Your " "Information", - "personName": "Input Your " "Information", - "phoneNumber": "Input Your " "Information", + "companyName": "Input Your Information", + "emailAddress": "Input Your Information", + "personName": "Input Your Information", + "phoneNumber": "Input Your Information", }, }, "shippingChargesPayment": { @@ -665,15 +656,15 @@ def test_parse_cancel_shipment_response(self): "residential": False, "stateOrProvinceCode": "BC", "streetLines": [ - "Input Your " "Information", - "Input Your " "Information", + "Input Your Information", + "Input Your Information", ], }, "contact": { - "companyName": "Input Your " "Information", - "emailAddress": "Input Your " "Information", - "personName": "Input Your " "Information", - "phoneNumber": "Input Your " "Information", + "companyName": "Input Your Information", + "emailAddress": "Input Your Information", + "personName": "Input Your Information", + "phoneNumber": "Input Your Information", }, }, "totalPackageCount": 2, diff --git a/modules/connectors/fedex_ws/karrio/providers/fedex_ws/rate.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/rate.py index 89eafec0dc..fd269cf23b 100644 --- a/modules/connectors/fedex_ws/karrio/providers/fedex_ws/rate.py +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/rate.py @@ -1,22 +1,4 @@ -from karrio.schemas.fedex_ws.rate_service_v28 import ( - RateRequest as FedexRateRequest, - RateReplyDetail, - TransactionDetail, - VersionId, - RequestedShipment, - TaxpayerIdentification, - Party, - Contact, - Address, - Money, - Weight as FedexWeight, - ShipmentRateDetail, - RequestedPackageLineItem, - Dimensions, - CustomerReference, - CustomerReferenceType, -) - +import karrio.schemas.fedex_ws.rate_service_v28 as fedex import typing import datetime import karrio.lib as lib @@ -44,24 +26,24 @@ def _extract_details( settings: provider_utils.Settings, ctx: dict, ) -> typing.Optional[models.RateDetails]: - rate: RateReplyDetail = lib.to_object(RateReplyDetail, detail_node) + rate: fedex.RateReplyDetail = lib.to_object(fedex.RateReplyDetail, detail_node) service = provider_units.ServiceType.map(rate.ServiceType) rate_type = rate.ActualRateType applied_options = rate.AppliedOptions shipment_rate, shipment_discount = typing.cast( - typing.Tuple[ShipmentRateDetail, Money], + typing.Tuple[fedex.ShipmentRateDetail, fedex.Money], next( ( (r.ShipmentRateDetail, r.EffectiveNetDiscount) for r in rate.RatedShipmentDetails - if typing.cast(ShipmentRateDetail, r.ShipmentRateDetail).RateType + if typing.cast(fedex.ShipmentRateDetail, r.ShipmentRateDetail).RateType == rate_type ), (None, None), ), ) - currency = typing.cast(Money, shipment_rate.TotalBaseCharge).Currency + currency = typing.cast(fedex.Money, shipment_rate.TotalBaseCharge).Currency charges = [ ("Base charge", shipment_rate.TotalBaseCharge.Amount), ("Discount", getattr(shipment_discount, "Amount", None)), @@ -113,35 +95,56 @@ def rate_request( ) -> lib.Serializable: shipper = lib.to_address(payload.shipper) recipient = lib.to_address(payload.recipient) - packages = lib.to_packages( - payload.parcels, - provider_units.PackagePresets, - required=["weight"], - ) service = units.Services(payload.services, provider_units.ServiceType).first options = lib.to_shipping_options( payload.options, - package_options=packages.options, - option_type=provider_units.RatingOption, initializer=provider_units.shipping_options_initializer, ) + packages = lib.to_packages( + payload.parcels, + provider_units.PackagePresets, + required=["weight"], + options=payload.options, + package_option_type=provider_units.ShippingOption, + shipping_options_initializer=provider_units.shipping_options_initializer, + ) request_types = ["LIST"] + ([] if "currency" not in options else ["PREFERRED"]) shipment_date = lib.to_date(options.shipment_date.state or datetime.datetime.now()) + package_options = lambda _options: [ + option + for _, option in _options.items() + if _options.state is not False and option.code in provider_units.PACKAGE_OPTIONS + ] + rate_options = lambda _options: [ + option + for _, option in _options.items() + if _options.state is not False and option.code in provider_units.RATING_OPTIONS + ] + shipment_options = lambda _options: [ + option + for _, option in _options.items() + if _options.state is not False + and option.code in provider_units.SHIPMENT_OPTIONS + ] + hub_id = ( + lib.text(settings.connection_config.smart_post_hub_id.state) + or options.fedex_smart_post_hub_id.state + ) - request = FedexRateRequest( + request = fedex.RateRequest( WebAuthenticationDetail=settings.webAuthenticationDetail, ClientDetail=settings.clientDetail, - TransactionDetail=TransactionDetail(CustomerTransactionId="FTC"), - Version=VersionId(ServiceId="crs", Major=28, Intermediate=0, Minor=0), + TransactionDetail=fedex.TransactionDetail(CustomerTransactionId="FTC"), + Version=fedex.VersionId(ServiceId="crs", Major=28, Intermediate=0, Minor=0), ReturnTransitAndCommit=True, CarrierCodes=None, VariableOptions=( - [option.code for _, option in options.items()] - if any(options.items()) - else None + [option.code for option in rate_options(packages.options)] + if any(rate_options(packages.options)) + else [] ), ConsolidationKey=None, - RequestedShipment=RequestedShipment( + RequestedShipment=fedex.RequestedShipment( ShipTimestamp=shipment_date, DropoffType="REGULAR_PICKUP", ServiceType=(service.value if service is not None else None), @@ -149,22 +152,22 @@ def rate_request( packages.package_type or "your_packaging" ).value, VariationOptions=None, - TotalWeight=FedexWeight( + TotalWeight=fedex.Weight( Units=packages.weight.unit, Value=packages.weight.LB, ), TotalInsuredValue=None, PreferredCurrency=options.currency.state, ShipmentAuthorizationDetail=None, - Shipper=Party( + Shipper=fedex.Party( AccountNumber=settings.account_number, Tins=( - [TaxpayerIdentification(Number=tax) for tax in shipper.taxes] + [fedex.TaxpayerIdentification(Number=tax) for tax in shipper.taxes] if shipper.has_tax_info else None ), Contact=( - Contact( + fedex.Contact( ContactId=None, PersonName=shipper.person_name, Title=None, @@ -179,7 +182,7 @@ def rate_request( if shipper.has_contact_info else None ), - Address=Address( + Address=fedex.Address( StreetLines=shipper.address_lines, City=shipper.city, StateOrProvinceCode=shipper.state_code, @@ -191,15 +194,18 @@ def rate_request( GeographicCoordinates=None, ), ), - Recipient=Party( + Recipient=fedex.Party( AccountNumber=None, Tins=( - [TaxpayerIdentification(Number=tax) for tax in recipient.taxes] + [ + fedex.TaxpayerIdentification(Number=tax) + for tax in recipient.taxes + ] if recipient.has_tax_info else None ), Contact=( - Contact( + fedex.Contact( ContactId=None, PersonName=recipient.person_name, Title=None, @@ -214,7 +220,7 @@ def rate_request( if recipient.has_contact_info else None ), - Address=Address( + Address=fedex.Address( StreetLines=recipient.address_lines, City=recipient.city, StateOrProvinceCode=recipient.state_code, @@ -230,14 +236,47 @@ def rate_request( Origin=None, SoldTo=None, ShippingChargesPayment=None, - SpecialServicesRequested=None, + SpecialServicesRequested=( + fedex.ShipmentSpecialServicesRequested( + SpecialServiceTypes=( + [option.code for option in shipment_options(packages.options)] + if any(shipment_options(packages.options)) + else [] + ), + CodDetail=None, + DeliveryOnInvoiceAcceptanceDetail=None, + HoldAtLocationDetail=None, + EventNotificationDetail=None, + ReturnShipmentDetail=None, + PendingShipmentDetail=None, + InternationalControlledExportDetail=None, + InternationalTrafficInArmsRegulationsDetail=None, + ShipmentDryIceDetail=None, + HomeDeliveryPremiumDetail=None, + FlatbedTrailerDetail=None, + FreightGuaranteeDetail=None, + ) + if any(shipment_options(packages.options)) + else None + ), ExpressFreightDetail=None, FreightShipmentDetail=None, DeliveryInstructions=None, VariableHandlingChargeDetail=None, CustomsClearanceDetail=None, PickupDetail=None, - SmartPostDetail=None, + SmartPostDetail=( + fedex.SmartPostShipmentDetail( + ProcessingOptionsRequested=None, + Indicia=None, + AncillaryEndorsement=None, + SpecialServices=None, + HubId=hub_id, + CustomerManifestId=None, + ) + if hub_id + else None + ), BlockInsightVisibility=None, LabelSpecification=None, ShippingDocumentSpecification=None, @@ -247,14 +286,14 @@ def rate_request( ShipmentOnlyFields=None, ConfigurationData=None, RequestedPackageLineItems=[ - RequestedPackageLineItem( + fedex.RequestedPackageLineItem( SequenceNumber=index, GroupNumber=None, GroupPackageCount=1, VariableHandlingChargeDetail=None, InsuredValue=None, Weight=( - FedexWeight( + fedex.Weight( Units=package.weight.unit, Value=package.weight.value, ) @@ -262,7 +301,7 @@ def rate_request( else None ), Dimensions=( - Dimensions( + fedex.Dimensions( Length=package.length.map( provider_units.MeasurementOptions ).value, @@ -289,15 +328,31 @@ def rate_request( ItemDescriptionForClearance=None, CustomerReferences=( [ - CustomerReference( - CustomerReferenceType=CustomerReferenceType.CUSTOMER_REFERENCE, + fedex.CustomerReference( + CustomerReferenceType=fedex.CustomerReferenceType.CUSTOMER_REFERENCE, Value=payload.reference, ) ] if any(payload.reference or "") else None ), - SpecialServicesRequested=None, + SpecialServicesRequested=( + fedex.PackageSpecialServicesRequested( + SpecialServiceTypes=[ + option.code + for option in package_options(package.options) + ], + CodDetail=None, + DangerousGoodsDetail=None, + DryIceWeight=None, + SignatureOptionDetail=None, + PieceCountVerificationDetail=None, + PriorityAlertDetail=None, + AlcoholDetail=None, + ) + if any(package_options(package.options)) + else None + ), ContentRecords=None, ) for index, package in enumerate(packages, 1) @@ -312,7 +367,7 @@ def rate_request( ) -def _request_serializer(request: FedexRateRequest) -> str: +def _request_serializer(request: fedex.RateRequest) -> str: namespacedef_ = ( 'xmlns:tns="http://schemas.xmlsoap.org/soap/envelope/"' ' xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"' diff --git a/modules/connectors/fedex_ws/karrio/providers/fedex_ws/shipment/create.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/shipment/create.py index 6bd16a5267..308194e51c 100644 --- a/modules/connectors/fedex_ws/karrio/providers/fedex_ws/shipment/create.py +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/shipment/create.py @@ -89,16 +89,17 @@ def shipment_request( ) -> lib.Serializable: shipper = lib.to_address(payload.shipper) recipient = lib.to_address(payload.recipient) + options = lib.to_shipping_options( + payload.options, + initializer=provider_units.shipping_options_initializer, + ) packages = lib.to_packages( payload.parcels, provider_units.PackagePresets, required=["weight"], + options=payload.options, package_option_type=provider_units.ShippingOption, - ) - options = lib.to_shipping_options( - payload.options, - package_options=packages.options, - initializer=provider_units.shipping_options_initializer, + shipping_options_initializer=provider_units.shipping_options_initializer, ) weight_unit, dim_unit = ( provider_units.COUNTRY_PREFERED_UNITS.get(payload.shipper.country_code) @@ -110,12 +111,26 @@ def shipment_request( recipient=payload.recipient, weight_unit=weight_unit.value, ) - payment = payload.payment or models.Payment() service = provider_units.ServiceType.map(payload.service).value_or_key label_type, label_format = provider_units.LabelType.map( payload.label_type or "PDF_4x6" ).value + package_options = lambda _options: [ + option + for _, option in _options.items() + if _options.state is not False and option.code in provider_units.PACKAGE_OPTIONS + ] + shipment_options = lambda _options: [ + option + for _, option in _options.items() + if _options.state is not False + and option.code in provider_units.SHIPMENT_OPTIONS + ] + hub_id = ( + lib.text(settings.connection_config.smart_post_hub_id.state) + or options.fedex_smart_post_hub_id.state + ) requests = [ fedex.ProcessShipmentRequest( @@ -242,9 +257,12 @@ def shipment_request( SpecialServicesRequested=( fedex.ShipmentSpecialServicesRequested( SpecialServiceTypes=( - [option.code for _, option in options.items()] - if any(options.items()) - else None + [ + option.code + for option in shipment_options(package.options) + ] + if any(shipment_options(package.options)) + else [] ), CodDetail=( fedex.CodDetail( @@ -507,7 +525,18 @@ def shipment_request( else None ), PickupDetail=None, - SmartPostDetail=None, + SmartPostDetail=( + fedex.SmartPostShipmentDetail( + ProcessingOptionsRequested=None, + Indicia=options.fedex_smart_post_allowed_indicia.state, + AncillaryEndorsement=None, + SpecialServices=None, + HubId=hub_id, + CustomerManifestId=None, + ) + if hub_id + else None + ), BlockInsightVisibility=None, LabelSpecification=fedex.LabelSpecification( Dispositions=None, @@ -634,7 +663,16 @@ def shipment_request( else fedex.SignatureOptionType.SERVICE_DEFAULT ) ), - SpecialServiceTypes=["SIGNATURE_OPTION"], + SpecialServiceTypes=[ + option.code + for option in package_options(package.options) + ], + CodDetail=None, + BatteryDetails=None, + DryIceWeight=None, + PieceCountVerificationBoxCount=None, + PriorityAlertDetail=None, + AlcoholDetail=None, ), ContentRecords=None, ) diff --git a/modules/connectors/fedex_ws/karrio/providers/fedex_ws/units.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/units.py index 463ad7db6d..820ecd7163 100644 --- a/modules/connectors/fedex_ws/karrio/providers/fedex_ws/units.py +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/units.py @@ -240,6 +240,7 @@ class PaymentType(utils.StrEnum): class ConnectionConfig(utils.Enum): label_type = utils.OptionEnum("label_type") + smart_post_hub_id = utils.OptionEnum("smart_post_hub_id") shipping_options = utils.OptionEnum("shipping_options", list) shipping_services = utils.OptionEnum("shipping_services", list) @@ -317,17 +318,8 @@ class ServiceType(utils.Enum): ) -class RatingOption(utils.Enum): - fedex_one_rate = utils.OptionEnum("FEDEX_ONE_RATE", bool) - fedex_freight_guarantee = utils.OptionEnum("FREIGHT_GUARANTEE", bool) - fedex_saturday_delivery = utils.OptionEnum("SATURDAY_DELIVERY", bool) - fedex_smart_post_allowed_indicia = utils.OptionEnum( - "SMART_POST_ALLOWED_INDICIA", bool - ) - fedex_smart_post_hub_id = utils.OptionEnum("SMART_POST_HUB_ID", bool) - - class ShippingOption(utils.Enum): + # fmt: off fedex_blind_shipment = utils.OptionEnum("BLIND_SHIPMENT", bool) fedex_broker_select_option = utils.OptionEnum("BROKER_SELECT_OPTION", bool) fedex_call_before_delivery = utils.OptionEnum("CALL_BEFORE_DELIVERY", bool) @@ -335,45 +327,26 @@ class ShippingOption(utils.Enum): fedex_cod_remittance = utils.OptionEnum("COD_REMITTANCE", float) fedex_custom_delivery_window = utils.OptionEnum("CUSTOM_DELIVERY_WINDOW", bool) fedex_cut_flowers = utils.OptionEnum("CUT_FLOWERS", bool) - fedex_dangerous_goods = utils.OptionEnum("DANGEROUS_GOODS", bool) - fedex_delivery_on_invoice_acceptance = utils.OptionEnum( - "DELIVERY_ON_INVOICE_ACCEPTANCE", bool - ) + fedex_delivery_on_invoice_acceptance = utils.OptionEnum("DELIVERY_ON_INVOICE_ACCEPTANCE", bool) fedex_detention = utils.OptionEnum("DETENTION", bool) - fedex_do_not_break_down_pallets = utils.OptionEnum( - "DO_NOT_BREAK_DOWN_PALLETS", bool - ) + fedex_do_not_break_down_pallets = utils.OptionEnum("DO_NOT_BREAK_DOWN_PALLETS", bool) fedex_do_not_stack_pallets = utils.OptionEnum("DO_NOT_STACK_PALLETS", bool) fedex_dry_ice = utils.OptionEnum("DRY_ICE", bool) fedex_east_coast_special = utils.OptionEnum("EAST_COAST_SPECIAL", bool) - fedex_electronic_trade_documents = utils.OptionEnum( - "ELECTRONIC_TRADE_DOCUMENTS", bool - ) + fedex_electronic_trade_documents = utils.OptionEnum("ELECTRONIC_TRADE_DOCUMENTS", bool) fedex_event_notification = utils.OptionEnum("EVENT_NOTIFICATION", bool) - fedex_exclude_from_consolidation = utils.OptionEnum( - "EXCLUDE_FROM_CONSOLIDATION", bool - ) + fedex_exclude_from_consolidation = utils.OptionEnum("EXCLUDE_FROM_CONSOLIDATION", bool) fedex_exclusive_use = utils.OptionEnum("EXCLUSIVE_USE", bool) fedex_exhibition_delivery = utils.OptionEnum("EXHIBITION_DELIVERY", bool) fedex_exhibition_pickup = utils.OptionEnum("EXHIBITION_PICKUP", bool) - fedex_expedited_alternate_delivery_route = utils.OptionEnum( - "EXPEDITED_ALTERNATE_DELIVERY_ROUTE", bool - ) - fedex_expedited_one_day_earlier = utils.OptionEnum( - "EXPEDITED_ONE_DAY_EARLIER", bool - ) - fedex_expedited_service_monitoring_and_delivery = utils.OptionEnum( - "EXPEDITED_SERVICE_MONITORING_AND_DELIVERY", bool - ) - fedex_expedited_standard_day_early_delivery = utils.OptionEnum( - "EXPEDITED_STANDARD_DAY_EARLY_DELIVERY", bool - ) + fedex_expedited_alternate_delivery_route = utils.OptionEnum("EXPEDITED_ALTERNATE_DELIVERY_ROUTE", bool) + fedex_expedited_one_day_earlier = utils.OptionEnum("EXPEDITED_ONE_DAY_EARLIER", bool) + fedex_expedited_service_monitoring_and_delivery = utils.OptionEnum("EXPEDITED_SERVICE_MONITORING_AND_DELIVERY", bool) + fedex_expedited_standard_day_early_delivery = utils.OptionEnum("EXPEDITED_STANDARD_DAY_EARLY_DELIVERY", bool) fedex_extra_labor = utils.OptionEnum("EXTRA_LABOR", bool) fedex_extreme_length = utils.OptionEnum("EXTREME_LENGTH", bool) - fedex_one_rate = utils.OptionEnum("FEDEX_ONE_RATE", bool) fedex_flatbed_trailer = utils.OptionEnum("FLATBED_TRAILER", bool) fedex_food = utils.OptionEnum("FOOD", bool) - fedex_freight_guarantee = utils.OptionEnum("FREIGHT_GUARANTEE") fedex_freight_to_collect = utils.OptionEnum("FREIGHT_TO_COLLECT", float) fedex_future_day_shipment = utils.OptionEnum("FUTURE_DAY_SHIPMENT", bool) fedex_hold_at_location = utils.OptionEnum("HOLD_AT_LOCATION", bool) @@ -382,15 +355,9 @@ class ShippingOption(utils.Enum): fedex_home_delivery_premium = utils.OptionEnum("HOME_DELIVERY_PREMIUM", bool) fedex_inside_delivery = utils.OptionEnum("INSIDE_DELIVERY", bool) fedex_inside_pickup = utils.OptionEnum("INSIDE_PICKUP", bool) - fedex_international_controlled_export_service = utils.OptionEnum( - "INTERNATIONAL_CONTROLLED_EXPORT_SERVICE", bool - ) - fedex_international_mail_service = utils.OptionEnum( - "INTERNATIONAL_MAIL_SERVICE", bool - ) - fedex_international_traffic_in_arms_regulations = utils.OptionEnum( - "INTERNATIONAL_TRAFFIC_IN_ARMS_REGULATIONS", bool - ) + fedex_international_controlled_export_service = utils.OptionEnum("INTERNATIONAL_CONTROLLED_EXPORT_SERVICE", bool) + fedex_international_mail_service = utils.OptionEnum("INTERNATIONAL_MAIL_SERVICE", bool) + fedex_international_traffic_in_arms_regulations = utils.OptionEnum("INTERNATIONAL_TRAFFIC_IN_ARMS_REGULATIONS", bool) fedex_liftgate_delivery = utils.OptionEnum("LIFTGATE_DELIVERY", bool) fedex_liftgate_pickup = utils.OptionEnum("LIFTGATE_PICKUP", bool) fedex_limited_access_delivery = utils.OptionEnum("LIMITED_ACCESS_DELIVERY", bool) @@ -407,22 +374,15 @@ class ShippingOption(utils.Enum): fedex_poison = utils.OptionEnum("POISON", bool) fedex_port_delivery = utils.OptionEnum("PORT_DELIVERY", bool) fedex_port_pickup = utils.OptionEnum("PORT_PICKUP", bool) - fedex_pre_delivery_notification = utils.OptionEnum( - "PRE_DELIVERY_NOTIFICATION", bool - ) + fedex_pre_delivery_notification = utils.OptionEnum("PRE_DELIVERY_NOTIFICATION", bool) fedex_pre_eig_processing = utils.OptionEnum("PRE_EIG_PROCESSING", bool) - fedex_pre_multiplier_processing = utils.OptionEnum( - "PRE_MULTIPLIER_PROCESSING", bool - ) + fedex_pre_multiplier_processing = utils.OptionEnum("PRE_MULTIPLIER_PROCESSING", bool) fedex_protection_from_freezing = utils.OptionEnum("PROTECTION_FROM_FREEZING", bool) fedex_regional_mall_delivery = utils.OptionEnum("REGIONAL_MALL_DELIVERY", bool) fedex_regional_mall_pickup = utils.OptionEnum("REGIONAL_MALL_PICKUP", bool) fedex_return_shipment = utils.OptionEnum("RETURN_SHIPMENT", bool) fedex_returns_clearance = utils.OptionEnum("RETURNS_CLEARANCE", bool) - fedex_returns_clearance_special_routing_required = utils.OptionEnum( - "RETURNS_CLEARANCE_SPECIAL_ROUTING_REQUIRED", bool - ) - fedex_saturday_delivery = utils.OptionEnum("SATURDAY_DELIVERY", bool) + fedex_returns_clearance_special_routing_required = utils.OptionEnum("RETURNS_CLEARANCE_SPECIAL_ROUTING_REQUIRED", bool) fedex_saturday_pickup = utils.OptionEnum("SATURDAY_PICKUP", bool) fedex_shipment_assembly = utils.OptionEnum("SHIPMENT_ASSEMBLY", bool) fedex_sort_and_segregate = utils.OptionEnum("SORT_AND_SEGREGATE", bool) @@ -436,18 +396,104 @@ class ShippingOption(utils.Enum): fedex_usps_pickup = utils.OptionEnum("USPS_PICKUP", bool) fedex_weighing = utils.OptionEnum("WEIGHING", bool) + """ Rating Options """ + fedex_one_rate = utils.OptionEnum("FEDEX_ONE_RATE", bool) + fedex_freight_guarantee = utils.OptionEnum("FREIGHT_GUARANTEE", bool) + fedex_saturday_delivery = utils.OptionEnum("SATURDAY_DELIVERY", bool) + fedex_smart_post_hub_id = utils.OptionEnum("SMART_POST_HUB_ID", bool) + fedex_smart_post_allowed_indicia = utils.OptionEnum("SMART_POST_ALLOWED_INDICIA", bool) + + """ Package Options """ + + fedex_alcohol = utils.OptionEnum("ALCOHOL", bool) + fedex_battery = utils.OptionEnum("BATTERY", bool) + fedex_dangerous_goods = utils.OptionEnum("DANGEROUS_GOODS", bool) + fedex_priority_alert = utils.OptionEnum("PRIORITY_ALERT", bool) + fedex_priority_alert_plus = utils.OptionEnum("PRIORITY_ALERT_PLUS", bool) + fedex_non_standard_container = utils.OptionEnum("NON_STANDARD_CONTAINER", bool) + fedex_piece_count_verification = utils.OptionEnum("PIECE_COUNT_VERIFICATION", bool) + fedex_signature_option = utils.OptionEnum("SIGNATURE_OPTION", bool) + fedex_evening = utils.OptionEnum("EVENING", bool) + fedex_date_certain = utils.OptionEnum("DATE_CERTAIN", bool) + """ Unified Option type mapping """ notification = fedex_event_notification cash_on_delivery = fedex_cod paperless_trade = fedex_electronic_trade_documents doc_files = utils.OptionEnum("doc_files", utils.DP.to_dict) - doc_references = utils.OptionEnum("WEIGHING", utils.DP.to_dict) + doc_references = utils.OptionEnum("doc_references", utils.DP.to_dict) + # fmt: on + + +RATING_OPTIONS = [ + "FEDEX_ONE_RATE", + "FREIGHT_GUARANTEE", + "SATURDAY_DELIVERY", + "SMART_POST_ALLOWED_INDICIA", + "SMART_POST_HUB_ID", +] +PACKAGE_OPTIONS = [ + "ALCOHOL", + "APPOINTMENT", + "BATTERY", + "COD", + "DANGEROUS_GOODS", + "DRY_ICE", + "PRIORITY_ALERT", + "PRIORITY_ALERT_PLUS", + "NON_STANDARD_CONTAINER", + "PIECE_COUNT_VERIFICATION", + "SIGNATURE_OPTION", + "EVENING", + "DATE_CERTAIN", + "SATURDAY_PICKUP", +] +SHIPMENT_OPTIONS = [ + "APPOINTMENT", + "BROKER_SELECT_OPTION", + "CALL_BEFORE_DELIVERY", + "COD", + "CUSTOM_DELIVERY_WINDOW", + "CUT_FLOWERS", + "DO_NOT_BREAK_DOWN_PALLETS", + "DO_NOT_STACK_PALLETS", + "DRY_ICE", + "EAST_COAST_SPECIAL", + "EXCLUDE_FROM_CONSOLIDATION", + "EXTREME_LENGTH", + "INSIDE_DELIVERY", + "INSIDE_PICKUP", + "INTERNATIONAL_CONTROLLED_EXPORT_SERVICE", + "FEDEX_ONE_RATE", + "THIRD_PARTY_CONSIGNEE", + "ELECTRONIC_TRADE_DOCUMENTS", + "FOOD", + "HOLD_AT_LOCATION", + "INTERNATIONAL_TRAFFIC_IN_ARMS_REGULATIONS", + "LIFTGATE_DELIVERY", + "LIFTGATE_PICKUP", + "LIMITED_ACCESS_DELIVERY", + "LIMITED_ACCESS_PICKUP", + "OVER_LENGTH", + "PENDING_SHIPMENT", + "PHARMACY_DELIVERY", + "POISON", + "HOME_DELIVERY_PREMIUM", + "PROTECTION_FROM_FREEZING", + "RETURNS_CLEARANCE", + "RETURN_SHIPMENT", + "SATURDAY_DELIVERY", + "SATURDAY_PICKUP", + "EVENT_NOTIFICATION", + "DELIVERY_ON_INVOICE_ACCEPTANCE", + "TOP_LOAD", + "FREIGHT_GUARANTEE", +] def shipping_options_initializer( options: dict, package_options: units.Options = None, - option_type: utils.Enum = ShippingOption, ) -> units.Options: """ Apply default values to the given options. @@ -470,9 +516,9 @@ def shipping_options_initializer( ) def items_filter(key: str) -> bool: - return key in option_type and key not in ["doc_files", "doc_references"] # type: ignore + return key in ShippingOption and key not in ["doc_files", "doc_references"] # type: ignore - return units.ShippingOptions(_options, option_type, items_filter=items_filter) + return units.ShippingOptions(_options, ShippingOption, items_filter=items_filter) class RateType(utils.Enum): diff --git a/modules/connectors/fedex_ws/tests/fedex_ws/test_rate.py b/modules/connectors/fedex_ws/tests/fedex_ws/test_rate.py index 33d68b9cd6..a7a6178abf 100644 --- a/modules/connectors/fedex_ws/tests/fedex_ws/test_rate.py +++ b/modules/connectors/fedex_ws/tests/fedex_ws/test_rate.py @@ -283,6 +283,9 @@ def test_parse_rate_error_response(self): false + + FEDEX_ONE_RATE + LIST PREFERRED 1 @@ -299,6 +302,9 @@ def test_parse_rate_error_response(self): 3 IN + + SIGNATURE_OPTION + @@ -365,6 +371,9 @@ def test_parse_rate_error_response(self): LB 2.2 + + SIGNATURE_OPTION + From f6cf6efd245618ef96e7df7703d675bc5e21eb19 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Sun, 25 Feb 2024 02:21:59 -0800 Subject: [PATCH 13/20] feat(FedEx): Consolidate FedEx REST API and SmartPost integrations with live tests --- .../fedex/karrio/mappers/fedex/__init__.py | 6 +- .../fedex/karrio/mappers/fedex/proxy.py | 117 +- .../fedex/karrio/mappers/fedex/settings.py | 6 +- .../fedex/karrio/providers/fedex/rate.py | 5 +- .../karrio/providers/fedex/shipment/create.py | 7 +- .../fedex/karrio/providers/fedex/utils.py | 64 +- .../connectors/fedex/tests/fedex/fixture.py | 14 +- .../connectors/fedex/tests/fedex/test_rate.py | 2 +- .../fedex/tests/fedex/test_shipment.py | 4 +- .../karrio/providers/fedex_ws/rate.py | 5 +- .../providers/fedex_ws/shipment/create.py | 7 +- .../providers/extension/models/canadapost.py | 10 +- .../providers/extension/models/fedex.py | 8 +- ...68_fedexsettings_track_api_key_and_more.py | 38 + ...canadapostsettings_contract_id_and_more.py | 23 + .../0046_alter_surcharge_services.py | 3100 ++++++++++++++++ .../0047_alter_surcharge_services.py | 3171 +++++++++++++++++ modules/sdk/karrio/core/utils/helpers.py | 20 +- packages/types/graphql/admin/queries.ts | 4 + packages/types/graphql/admin/types.ts | 14 +- packages/types/graphql/queries.ts | 2 + packages/types/graphql/types.ts | 12 +- packages/ui/components/dropdown-input.tsx | 8 + packages/ui/modals/connect-provider-modal.tsx | 32 +- schemas/graphql-admin.json | 94 +- schemas/graphql.json | 94 +- 26 files changed, 6743 insertions(+), 124 deletions(-) create mode 100644 modules/core/karrio/server/providers/migrations/0068_fedexsettings_track_api_key_and_more.py create mode 100644 modules/core/karrio/server/providers/migrations/0069_alter_canadapostsettings_contract_id_and_more.py create mode 100644 modules/pricing/karrio/server/pricing/migrations/0046_alter_surcharge_services.py create mode 100644 modules/pricing/karrio/server/pricing/migrations/0047_alter_surcharge_services.py diff --git a/modules/connectors/fedex/karrio/mappers/fedex/__init__.py b/modules/connectors/fedex/karrio/mappers/fedex/__init__.py index 9e5e437a99..5e6bc32e6b 100644 --- a/modules/connectors/fedex/karrio/mappers/fedex/__init__.py +++ b/modules/connectors/fedex/karrio/mappers/fedex/__init__.py @@ -1,4 +1,3 @@ - from karrio.core.metadata import Metadata from karrio.mappers.fedex.mapper import Mapper @@ -15,5 +14,8 @@ Proxy=Proxy, Settings=Settings, # Data Units - is_hub=False + is_hub=False, + services=units.ShippingService, + options=units.ShippingOption, + connection_configs=units.ConnectionConfig, ) diff --git a/modules/connectors/fedex/karrio/mappers/fedex/proxy.py b/modules/connectors/fedex/karrio/mappers/fedex/proxy.py index 3f8fdf2984..539d29c128 100644 --- a/modules/connectors/fedex/karrio/mappers/fedex/proxy.py +++ b/modules/connectors/fedex/karrio/mappers/fedex/proxy.py @@ -1,25 +1,65 @@ +import gzip import urllib.parse import karrio.lib as lib import karrio.api.proxy as proxy -from karrio.mappers.fedex.settings import Settings +import karrio.providers.fedex.utils as provider_utils +import karrio.mappers.fedex.settings as provider_settings class Proxy(proxy.Proxy): - settings: Settings + settings: provider_settings.Settings def get_rates(self, request: lib.Serializable) -> lib.Deserializable: - response = self._send_request("/rate", request) + response = lib.request( + url=f"{self.settings.server_url}/rate/v1/rates/quotes", + data=lib.to_json(request.serialize()), + trace=self.trace_as("json"), + method="POST", + headers={ + "x-locale": "en_US", + "content-type": "application/json", + "authorization": f"Bearer {self.settings.access_token}", + }, + decoder=provider_utils.parse_response, + on_error=lambda b: provider_utils.parse_response(b.read()), + ) return lib.Deserializable(response, lib.to_dict, request.ctx) def get_tracking(self, request: lib.Serializable) -> lib.Deserializable: - response = self._send_request("/track/v1/trackingnumbers", request) + response = lib.request( + url=f"{self.settings.server_url}/track/v1/trackingnumbers", + data=lib.to_json(request.serialize()), + trace=self.trace_as("json"), + method="POST", + headers={ + "x-locale": "en_US", + "content-type": "application/json", + "authorization": f"Bearer {self.settings.track_access_token}", + }, + decoder=provider_utils.parse_response, + on_error=lambda b: provider_utils.parse_response(b.read()), + ) return lib.Deserializable(response, lib.to_dict) def create_shipment(self, request: lib.Serializable) -> lib.Deserializable: requests = request.serialize() - responses = [self._send_request("/ship", lib.Serializable(requests[0]))] + responses = [ + lib.request( + url=f"{self.settings.server_url}/ship/v1/shipments", + data=lib.to_json(requests[0]), + trace=self.trace_as("json"), + method="POST", + headers={ + "x-locale": "en_US", + "content-type": "application/json", + "authorization": f"Bearer {self.settings.access_token}", + }, + decoder=provider_utils.parse_response, + on_error=lambda b: provider_utils.parse_response(b.read()), + ) + ] master_id = ( lib.to_dict(responses[0]) .get("output", {}) @@ -29,13 +69,22 @@ def create_shipment(self, request: lib.Serializable) -> lib.Deserializable: if len(requests) > 1 and master_id is not None: responses += lib.run_asynchronously( - lambda _: self._send_request( - "/ship", - lib.Serializable( - request.replace( - "[MASTER_ID_TYPE]", master_id.TrackingIdType - ).replace("[MASTER_TRACKING_ID]", master_id.TrackingNumber), + lambda _: lib.request( + url=f"{self.settings.server_url}/ship/v1/shipments", + data=( + lib.to_json(_) + .replace("[MASTER_ID_TYPE]", master_id.TrackingIdType) + .replace("[MASTER_TRACKING_ID]", master_id.TrackingNumber) ), + trace=self.trace_as("json"), + method="POST", + headers={ + "x-locale": "en_US", + "content-type": "application/json", + "authorization": f"Bearer {self.settings.access_token}", + }, + decoder=provider_utils.parse_response, + on_error=lambda b: provider_utils.parse_response(b.read()), ), requests[1:], ) @@ -46,20 +95,37 @@ def create_shipment(self, request: lib.Serializable) -> lib.Deserializable: ) def cancel_shipment(self, request: lib.Serializable) -> lib.Deserializable: - response = self._send_request("/ship", request) + response = lib.request( + url=f"{self.settings.server_url}/ship/v1/shipments/cancel", + data=lib.to_json(request.serialize()), + trace=self.trace_as("json"), + method="PUT", + headers={ + "x-locale": "en_US", + "content-type": "application/json", + "authorization": f"Bearer {self.settings.access_token}", + }, + decoder=provider_utils.parse_response, + on_error=lambda b: provider_utils.parse_response(b.read()), + ) return lib.Deserializable(response, lib.to_dict) def upload_document(self, requests: lib.Serializable) -> lib.Deserializable: response = lib.run_asynchronously( - lambda _: self._send_request( + lambda _: lib.request( url=( "https://documentapitest.prod.fedex.com/sandbox/documents/v1/etds/upload" if self.settings.test_mode else "https://documentapi.prod.fedex.com/documents/v1/etds/upload" ), - request=lib.Serializable(_, urllib.parse.urlencode), - headers={"content-Type": "multipart/form-data"}, + data=urllib.parse.urlencode(_), + trace=self.trace_as("json"), + method="POST", + headers={ + "content-Type": "multipart/form-data", + "authorization": f"Bearer {self.settings.access_token}", + }, ), requests.serialize(), ) @@ -68,24 +134,3 @@ def upload_document(self, requests: lib.Serializable) -> lib.Deserializable: response, lambda __: [lib.to_dict(_) for _ in __], ) - - def _send_request( - self, - path: str = "/", - request: lib.Serializable = None, - method: str = "POST", - headers: dict = None, - url: str = None, - ) -> str: - return lib.request( - url=url or f"{self.settings.server_url}{path}", - trace=self.trace_as("json"), - method=method, - headers={ - "content-Type": "application/json", - "authorization": f"Bearer {self.settings.access_token}", - "x-locale": self.settings.connection_config.locale.state or "en_US", - **(headers or {}), - }, - **({"data": lib.to_json(request.serialize())} if request else {}), - ) diff --git a/modules/connectors/fedex/karrio/mappers/fedex/settings.py b/modules/connectors/fedex/karrio/mappers/fedex/settings.py index f76b7134be..3ed797bea0 100644 --- a/modules/connectors/fedex/karrio/mappers/fedex/settings.py +++ b/modules/connectors/fedex/karrio/mappers/fedex/settings.py @@ -10,9 +10,11 @@ class Settings(provider_utils.Settings): """FedEx connection settings.""" - api_key: str # type:ignore - secret_key: str # type:ignore + api_key: str = None + secret_key: str = None account_number: str = None + track_api_key: str = None + track_secret_key: str = None cache: lib.Cache = jstruct.JStruct[lib.Cache, False, dict(default=lib.Cache())] account_country_code: str = None diff --git a/modules/connectors/fedex/karrio/providers/fedex/rate.py b/modules/connectors/fedex/karrio/providers/fedex/rate.py index 18a844c41d..d288d846e9 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/rate.py +++ b/modules/connectors/fedex/karrio/providers/fedex/rate.py @@ -253,7 +253,10 @@ def rate_request( fedex.SmartPostInfoDetailType( ancillaryEndorsement=None, hubId=hub_id, - indicia=options.fedex_smart_post_allowed_indicia.state, + indicia=( + options.fedex_smart_post_allowed_indicia.state + or "PARCEL_SELECT" + ), specialServices=None, ) if hub_id is not None diff --git a/modules/connectors/fedex/karrio/providers/fedex/shipment/create.py b/modules/connectors/fedex/karrio/providers/fedex/shipment/create.py index 80271b6c77..41467a0e6a 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/shipment/create.py +++ b/modules/connectors/fedex/karrio/providers/fedex/shipment/create.py @@ -480,10 +480,13 @@ def shipment_request( fedex.SmartPostInfoDetailType( ancillaryEndorsement=None, hubId=hub_id, - indicia=options.fedex_smart_post_allowed_indicia.state, + indicia=( + options.fedex_smart_post_allowed_indicia.state + or "PARCEL_SELECT" + ), specialServices=None, ) - if hub_id is not None + if hub_id and service == "SMART_POST" else None ), blockInsightVisibility=None, diff --git a/modules/connectors/fedex/karrio/providers/fedex/utils.py b/modules/connectors/fedex/karrio/providers/fedex/utils.py index bad7a08c85..e562c345e6 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/utils.py +++ b/modules/connectors/fedex/karrio/providers/fedex/utils.py @@ -1,3 +1,4 @@ +import gzip import jstruct import datetime import urllib.parse @@ -9,9 +10,11 @@ class Settings(core.Settings): """FedEx connection settings.""" - api_key: str - secret_key: str + api_key: str = None + secret_key: str = None account_number: str = None + track_api_key: str = None + track_secret_key: str = None cache: lib.Cache = jstruct.JStruct[lib.Cache] account_country_code: str = None @@ -49,6 +52,11 @@ def access_token(self): """Retrieve the access_token using the api_key|secret_key pair or collect it from the cache if an unexpired access_token exist. """ + if not all([self.api_key, self.secret_key, self.account_number]): + raise Exception( + "The api_key, secret_key and account_number are required for Rate, Ship and Other API requests." + ) + cache_key = f"{self.carrier_name}|{self.api_key}|{self.secret_key}" now = datetime.datetime.now() + datetime.timedelta(minutes=30) @@ -59,13 +67,52 @@ def access_token(self): if token is not None and expiry is not None and expiry > now: return token - self.cache.set(cache_key, lambda: login(self)) + self.cache.set( + cache_key, + lambda: login( + self, + client_id=self.api_key, + client_secret=self.secret_key, + ), + ) + new_auth = self.cache.get(cache_key) + + return new_auth["access_token"] + + @property + def track_access_token(self): + """Retrieve the access_token using the track_api_key|track_secret_key pair + or collect it from the cache if an unexpired access_token exist. + """ + if not all([self.track_api_key, self.track_secret_key]): + raise Exception( + "The track_api_key and track_secret_key are required for Track API requests." + ) + + cache_key = f"{self.carrier_name}|{self.track_api_key}|{self.track_secret_key}" + now = datetime.datetime.now() + datetime.timedelta(minutes=30) + + auth = self.cache.get(cache_key) or {} + token = auth.get("access_token") + expiry = lib.to_date(auth.get("expiry"), current_format="%Y-%m-%d %H:%M:%S") + + if token is not None and expiry is not None and expiry > now: + return token + + self.cache.set( + cache_key, + lambda: login( + self, + client_id=self.track_api_key, + client_secret=self.track_secret_key, + ), + ) new_auth = self.cache.get(cache_key) return new_auth["access_token"] -def login(settings: Settings): +def login(settings: Settings, client_id: str = None, client_secret: str = None): import karrio.providers.fedex.error as error result = lib.request( @@ -77,8 +124,8 @@ def login(settings: Settings): data=urllib.parse.urlencode( dict( grant_type="client_credentials", - client_id=settings.api_key, - client_secret=settings.secret_key, + client_id=client_id, + client_secret=client_secret, ) ), ) @@ -94,3 +141,8 @@ def login(settings: Settings): ) return {**response, "expiry": lib.fdatetime(expiry)} + + +def parse_response(binary_string): + content = lib.failsafe(lambda: gzip.decompress(binary_string)) + return lib.decode(content) diff --git a/modules/connectors/fedex/tests/fedex/fixture.py b/modules/connectors/fedex/tests/fedex/fixture.py index 4613a0db1a..9922b4ab08 100644 --- a/modules/connectors/fedex/tests/fedex/fixture.py +++ b/modules/connectors/fedex/tests/fedex/fixture.py @@ -5,6 +5,9 @@ expiry = datetime.datetime.now() + datetime.timedelta(days=1) api_key = "api_key" secret_key = "secret_key" +track_api_key = "api_key" +track_secret_key = "secret_key" + cached_auth = { f"fedex|{api_key}|{secret_key}": dict( access_token="access_token", @@ -12,13 +15,22 @@ expires_in=3599, scope="CXS-TP", expiry=expiry.strftime("%Y-%m-%d %H:%M:%S"), - ) + ), + f"fedex|{track_api_key}|{track_secret_key}": dict( + access_token="access_token", + token_type="bearer", + expires_in=3599, + scope="CXS-TP", + expiry=expiry.strftime("%Y-%m-%d %H:%M:%S"), + ), } gateway = karrio.gateway["fedex"].create( dict( api_key=api_key, secret_key=secret_key, + track_api_key=track_api_key, + track_secret_key=track_secret_key, account_number="2349857", cache=lib.Cache(**cached_auth), ) diff --git a/modules/connectors/fedex/tests/fedex/test_rate.py b/modules/connectors/fedex/tests/fedex/test_rate.py index b618610c75..22142807f9 100644 --- a/modules/connectors/fedex/tests/fedex/test_rate.py +++ b/modules/connectors/fedex/tests/fedex/test_rate.py @@ -24,7 +24,7 @@ def test_get_rate(self): self.assertEqual( mock.call_args[1]["url"], - f"{gateway.settings.server_url}/rate", + f"{gateway.settings.server_url}/rate/v1/rates/quotes", ) def test_parse_rate_response(self): diff --git a/modules/connectors/fedex/tests/fedex/test_shipment.py b/modules/connectors/fedex/tests/fedex/test_shipment.py index 9285a2cb92..f6b621df1e 100644 --- a/modules/connectors/fedex/tests/fedex/test_shipment.py +++ b/modules/connectors/fedex/tests/fedex/test_shipment.py @@ -42,7 +42,7 @@ def test_create_shipment(self): self.assertEqual( mock.call_args[1]["url"], - f"{gateway.settings.server_url}/ship", + f"{gateway.settings.server_url}/ship/v1/shipments", ) def test_cancel_shipment(self): @@ -52,7 +52,7 @@ def test_cancel_shipment(self): self.assertEqual( mock.call_args[1]["url"], - f"{gateway.settings.server_url}/ship", + f"{gateway.settings.server_url}/ship/v1/shipments/cancel", ) def test_parse_shipment_response(self): diff --git a/modules/connectors/fedex_ws/karrio/providers/fedex_ws/rate.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/rate.py index fd269cf23b..1f1a1bcaee 100644 --- a/modules/connectors/fedex_ws/karrio/providers/fedex_ws/rate.py +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/rate.py @@ -268,7 +268,10 @@ def rate_request( SmartPostDetail=( fedex.SmartPostShipmentDetail( ProcessingOptionsRequested=None, - Indicia=None, + indicia=( + options.fedex_smart_post_allowed_indicia.state + or "PARCEL_SELECT" + ), AncillaryEndorsement=None, SpecialServices=None, HubId=hub_id, diff --git a/modules/connectors/fedex_ws/karrio/providers/fedex_ws/shipment/create.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/shipment/create.py index 308194e51c..cdba9f7b60 100644 --- a/modules/connectors/fedex_ws/karrio/providers/fedex_ws/shipment/create.py +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/shipment/create.py @@ -528,13 +528,16 @@ def shipment_request( SmartPostDetail=( fedex.SmartPostShipmentDetail( ProcessingOptionsRequested=None, - Indicia=options.fedex_smart_post_allowed_indicia.state, + indicia=( + options.fedex_smart_post_allowed_indicia.state + or "PARCEL_SELECT" + ), AncillaryEndorsement=None, SpecialServices=None, HubId=hub_id, CustomerManifestId=None, ) - if hub_id + if hub_id and service == "SMART_POST" else None ), BlockInsightVisibility=None, diff --git a/modules/core/karrio/server/providers/extension/models/canadapost.py b/modules/core/karrio/server/providers/extension/models/canadapost.py index cc0dbd3710..681c387b17 100644 --- a/modules/core/karrio/server/providers/extension/models/canadapost.py +++ b/modules/core/karrio/server/providers/extension/models/canadapost.py @@ -5,17 +5,17 @@ class CanadaPostSettings(Carrier): class Meta: db_table = "canada-post-settings" - verbose_name = 'Canada Post Settings' - verbose_name_plural = 'Canada Post Settings' + verbose_name = "Canada Post Settings" + verbose_name_plural = "Canada Post Settings" username = models.CharField(max_length=200) password = models.CharField(max_length=200) - customer_number = models.CharField(max_length=200, blank=True) - contract_id = models.CharField(max_length=200, blank=True) + customer_number = models.CharField(max_length=200, blank=True, null=True) + contract_id = models.CharField(max_length=200, blank=True, null=True) @property def carrier_name(self) -> str: - return 'canadapost' + return "canadapost" SETTINGS = CanadaPostSettings diff --git a/modules/core/karrio/server/providers/extension/models/fedex.py b/modules/core/karrio/server/providers/extension/models/fedex.py index 64523373b5..95ee905693 100644 --- a/modules/core/karrio/server/providers/extension/models/fedex.py +++ b/modules/core/karrio/server/providers/extension/models/fedex.py @@ -9,9 +9,11 @@ class Meta: verbose_name = "FedEx Settings" verbose_name_plural = "FedEx Settings" - api_key = models.CharField(max_length=200) - secret_key = models.CharField(max_length=200) - account_number = models.CharField(max_length=200) + api_key = models.CharField(max_length=100, blank=True, null=True) + secret_key = models.CharField(max_length=100, blank=True, null=True) + track_api_key = models.CharField(max_length=100, blank=True, null=True) + track_secret_key = models.CharField(max_length=100, blank=True, null=True) + account_number = models.CharField(max_length=50, blank=True, null=True) account_country_code = models.CharField( max_length=3, blank=True, null=True, choices=providers.COUNTRIES ) diff --git a/modules/core/karrio/server/providers/migrations/0068_fedexsettings_track_api_key_and_more.py b/modules/core/karrio/server/providers/migrations/0068_fedexsettings_track_api_key_and_more.py new file mode 100644 index 0000000000..01337f7aab --- /dev/null +++ b/modules/core/karrio/server/providers/migrations/0068_fedexsettings_track_api_key_and_more.py @@ -0,0 +1,38 @@ +# Generated by Django 4.2.10 on 2024-02-25 09:11 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("providers", "0067_fedexsettings"), + ] + + operations = [ + migrations.AddField( + model_name="fedexsettings", + name="track_api_key", + field=models.CharField(blank=True, max_length=100, null=True), + ), + migrations.AddField( + model_name="fedexsettings", + name="track_secret_key", + field=models.CharField(blank=True, max_length=100, null=True), + ), + migrations.AlterField( + model_name="fedexsettings", + name="account_number", + field=models.CharField(blank=True, max_length=50, null=True), + ), + migrations.AlterField( + model_name="fedexsettings", + name="api_key", + field=models.CharField(blank=True, max_length=100, null=True), + ), + migrations.AlterField( + model_name="fedexsettings", + name="secret_key", + field=models.CharField(blank=True, max_length=100, null=True), + ), + ] diff --git a/modules/core/karrio/server/providers/migrations/0069_alter_canadapostsettings_contract_id_and_more.py b/modules/core/karrio/server/providers/migrations/0069_alter_canadapostsettings_contract_id_and_more.py new file mode 100644 index 0000000000..3be7cd4c6e --- /dev/null +++ b/modules/core/karrio/server/providers/migrations/0069_alter_canadapostsettings_contract_id_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.10 on 2024-02-25 10:20 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("providers", "0068_fedexsettings_track_api_key_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="canadapostsettings", + name="contract_id", + field=models.CharField(blank=True, max_length=200, null=True), + ), + migrations.AlterField( + model_name="canadapostsettings", + name="customer_number", + field=models.CharField(blank=True, max_length=200, null=True), + ), + ] diff --git a/modules/pricing/karrio/server/pricing/migrations/0046_alter_surcharge_services.py b/modules/pricing/karrio/server/pricing/migrations/0046_alter_surcharge_services.py new file mode 100644 index 0000000000..e251e57fc2 --- /dev/null +++ b/modules/pricing/karrio/server/pricing/migrations/0046_alter_surcharge_services.py @@ -0,0 +1,3100 @@ +# Generated by Django 4.2.10 on 2024-02-25 09:11 + +from django.db import migrations +import karrio.server.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ("pricing", "0045_alter_surcharge_carriers"), + ] + + operations = [ + migrations.AlterField( + model_name="surcharge", + name="services", + field=karrio.server.core.fields.MultiChoiceField( + blank=True, + choices=[ + ("allied_road_service", "allied_road_service"), + ("allied_parcel_service", "allied_parcel_service"), + ( + "allied_standard_pallet_service", + "allied_standard_pallet_service", + ), + ( + "allied_oversized_pallet_service", + "allied_oversized_pallet_service", + ), + ("allied_road_service", "allied_road_service"), + ("allied_parcel_service", "allied_parcel_service"), + ( + "allied_standard_pallet_service", + "allied_standard_pallet_service", + ), + ( + "allied_oversized_pallet_service", + "allied_oversized_pallet_service", + ), + ("allied_local_normal_service", "allied_local_normal_service"), + ("allied_local_vip_service", "allied_local_vip_service"), + ( + "allied_local_executive_service", + "allied_local_executive_service", + ), + ("allied_local_gold_service", "allied_local_gold_service"), + ("amazon_shipping_ground", "amazon_shipping_ground"), + ("amazon_shipping_standard", "amazon_shipping_standard"), + ("amazon_shipping_premium", "amazon_shipping_premium"), + ("asendia_us_e_com_tracked_ddp", "asendia_us_e_com_tracked_ddp"), + ("asendia_us_fully_tracked", "asendia_us_fully_tracked"), + ("asendia_us_country_tracked", "asendia_us_country_tracked"), + ("australiapost_parcel_post", "australiapost_parcel_post"), + ("australiapost_express_post", "australiapost_express_post"), + ( + "australiapost_parcel_post_signature", + "australiapost_parcel_post_signature", + ), + ( + "australiapost_express_post_signature", + "australiapost_express_post_signature", + ), + ("boxknight_sameday", "boxknight_sameday"), + ("boxknight_nextday", "boxknight_nextday"), + ("boxknight_scheduled", "boxknight_scheduled"), + ("bpack_24h_pro", "bpack_24h_pro"), + ("bpack_24h_business", "bpack_24h_business"), + ("bpack_bus", "bpack_bus"), + ("bpack_pallet", "bpack_pallet"), + ("bpack_easy_retour", "bpack_easy_retour"), + ("bpack_xl", "bpack_xl"), + ("bpack_bpost", "bpack_bpost"), + ("bpack_24_7", "bpack_24_7"), + ("bpack_world_business", "bpack_world_business"), + ("bpack_world_express_pro", "bpack_world_express_pro"), + ("bpack_europe_business", "bpack_europe_business"), + ("bpack_world_easy_return", "bpack_world_easy_return"), + ("bpack_bpost_international", "bpack_bpost_international"), + ("bpack_24_7_international", "bpack_24_7_international"), + ("canadapost_regular_parcel", "canadapost_regular_parcel"), + ("canadapost_expedited_parcel", "canadapost_expedited_parcel"), + ("canadapost_xpresspost", "canadapost_xpresspost"), + ( + "canadapost_xpresspost_certified", + "canadapost_xpresspost_certified", + ), + ("canadapost_priority", "canadapost_priority"), + ("canadapost_library_books", "canadapost_library_books"), + ( + "canadapost_expedited_parcel_usa", + "canadapost_expedited_parcel_usa", + ), + ( + "canadapost_priority_worldwide_envelope_usa", + "canadapost_priority_worldwide_envelope_usa", + ), + ( + "canadapost_priority_worldwide_pak_usa", + "canadapost_priority_worldwide_pak_usa", + ), + ( + "canadapost_priority_worldwide_parcel_usa", + "canadapost_priority_worldwide_parcel_usa", + ), + ( + "canadapost_small_packet_usa_air", + "canadapost_small_packet_usa_air", + ), + ("canadapost_tracked_packet_usa", "canadapost_tracked_packet_usa"), + ( + "canadapost_tracked_packet_usa_lvm", + "canadapost_tracked_packet_usa_lvm", + ), + ("canadapost_xpresspost_usa", "canadapost_xpresspost_usa"), + ( + "canadapost_xpresspost_international", + "canadapost_xpresspost_international", + ), + ( + "canadapost_international_parcel_air", + "canadapost_international_parcel_air", + ), + ( + "canadapost_international_parcel_surface", + "canadapost_international_parcel_surface", + ), + ( + "canadapost_priority_worldwide_envelope_intl", + "canadapost_priority_worldwide_envelope_intl", + ), + ( + "canadapost_priority_worldwide_pak_intl", + "canadapost_priority_worldwide_pak_intl", + ), + ( + "canadapost_priority_worldwide_parcel_intl", + "canadapost_priority_worldwide_parcel_intl", + ), + ( + "canadapost_small_packet_international_air", + "canadapost_small_packet_international_air", + ), + ( + "canadapost_small_packet_international_surface", + "canadapost_small_packet_international_surface", + ), + ( + "canadapost_tracked_packet_international", + "canadapost_tracked_packet_international", + ), + ("chronopost_retrait_bureau", "chronopost_retrait_bureau"), + ("chronopost_13", "chronopost_13"), + ("chronopost_10", "chronopost_10"), + ("chronopost_18", "chronopost_18"), + ("chronopost_relais", "chronopost_relais"), + ( + "chronopost_express_international", + "chronopost_express_international", + ), + ( + "chronopost_premium_international", + "chronopost_premium_international", + ), + ( + "chronopost_classic_international", + "chronopost_classic_international", + ), + ( + "colissimo_home_without_signature", + "colissimo_home_without_signature", + ), + ("colissimo_home_with_signature", "colissimo_home_with_signature"), + ("colissimo_eco_france", "colissimo_eco_france"), + ("colissimo_return_france", "colissimo_return_france"), + ( + "colissimo_flash_without_signature", + "colissimo_flash_without_signature", + ), + ( + "colissimo_flash_with_signature", + "colissimo_flash_with_signature", + ), + ( + "colissimo_oversea_home_without_signature", + "colissimo_oversea_home_without_signature", + ), + ( + "colissimo_oversea_home_with_signature", + "colissimo_oversea_home_with_signature", + ), + ( + "colissimo_eco_om_without_signature", + "colissimo_eco_om_without_signature", + ), + ( + "colissimo_eco_om_with_signature", + "colissimo_eco_om_with_signature", + ), + ("colissimo_retour_om", "colissimo_retour_om"), + ( + "colissimo_return_international_from_france", + "colissimo_return_international_from_france", + ), + ( + "colissimo_economical_big_export_offer", + "colissimo_economical_big_export_offer", + ), + ( + "colissimo_out_of_home_national_international", + "colissimo_out_of_home_national_international", + ), + ("dhl_logistics_services", "dhl_logistics_services"), + ("dhl_domestic_express_12_00", "dhl_domestic_express_12_00"), + ("dhl_express_choice", "dhl_express_choice"), + ("dhl_express_choice_nondoc", "dhl_express_choice_nondoc"), + ("dhl_jetline", "dhl_jetline"), + ("dhl_sprintline", "dhl_sprintline"), + ("dhl_air_capacity_sales", "dhl_air_capacity_sales"), + ("dhl_express_easy", "dhl_express_easy"), + ("dhl_express_easy_nondoc", "dhl_express_easy_nondoc"), + ("dhl_parcel_product", "dhl_parcel_product"), + ("dhl_accounting", "dhl_accounting"), + ("dhl_breakbulk_express", "dhl_breakbulk_express"), + ("dhl_medical_express", "dhl_medical_express"), + ("dhl_express_worldwide_doc", "dhl_express_worldwide_doc"), + ("dhl_express_9_00_nondoc", "dhl_express_9_00_nondoc"), + ("dhl_freight_worldwide_nondoc", "dhl_freight_worldwide_nondoc"), + ("dhl_economy_select_domestic", "dhl_economy_select_domestic"), + ("dhl_economy_select_nondoc", "dhl_economy_select_nondoc"), + ("dhl_express_domestic_9_00", "dhl_express_domestic_9_00"), + ("dhl_jumbo_box_nondoc", "dhl_jumbo_box_nondoc"), + ("dhl_express_9_00", "dhl_express_9_00"), + ("dhl_express_10_30", "dhl_express_10_30"), + ("dhl_express_10_30_nondoc", "dhl_express_10_30_nondoc"), + ("dhl_express_domestic", "dhl_express_domestic"), + ("dhl_express_domestic_10_30", "dhl_express_domestic_10_30"), + ("dhl_express_worldwide_nondoc", "dhl_express_worldwide_nondoc"), + ("dhl_medical_express_nondoc", "dhl_medical_express_nondoc"), + ("dhl_globalmail", "dhl_globalmail"), + ("dhl_same_day", "dhl_same_day"), + ("dhl_express_12_00", "dhl_express_12_00"), + ("dhl_express_worldwide", "dhl_express_worldwide"), + ("dhl_parcel_product_nondoc", "dhl_parcel_product_nondoc"), + ("dhl_economy_select", "dhl_economy_select"), + ("dhl_express_envelope", "dhl_express_envelope"), + ("dhl_express_12_00_nondoc", "dhl_express_12_00_nondoc"), + ("dhl_destination_charges", "dhl_destination_charges"), + ("dhl_express_all", "dhl_express_all"), + ("deutschepost_paket", "deutschepost_paket"), + ("deutschepost_warenpost", "deutschepost_warenpost"), + ("deutschepost_europaket", "deutschepost_europaket"), + ( + "deutschepost_paket_international", + "deutschepost_paket_international", + ), + ( + "deutschepost_warenpost_international", + "deutschepost_warenpost_international", + ), + ("dhl_poland_premium", "dhl_poland_premium"), + ("dhl_poland_polska", "dhl_poland_polska"), + ("dhl_poland_09", "dhl_poland_09"), + ("dhl_poland_12", "dhl_poland_12"), + ("dhl_poland_connect", "dhl_poland_connect"), + ("dhl_poland_international", "dhl_poland_international"), + ("dpd_cl", "dpd_cl"), + ("dpd_express_10h", "dpd_express_10h"), + ("dpd_express_12h", "dpd_express_12h"), + ("dpd_express_18h_guarantee", "dpd_express_18h_guarantee"), + ("dpd_express_b2b_predict", "dpd_express_b2b_predict"), + ("dpdhl_paket", "dpdhl_paket"), + ("dpdhl_paket_international", "dpdhl_paket_international"), + ("dpdhl_europaket", "dpdhl_europaket"), + ("dpdhl_paket_connect", "dpdhl_paket_connect"), + ("dpdhl_warenpost", "dpdhl_warenpost"), + ("dpdhl_warenpost_international", "dpdhl_warenpost_international"), + ("dpdhl_retoure", "dpdhl_retoure"), + ("easypost_amazonmws_ups_rates", "easypost_amazonmws_ups_rates"), + ("easypost_amazonmws_usps_rates", "easypost_amazonmws_usps_rates"), + ( + "easypost_amazonmws_fedex_rates", + "easypost_amazonmws_fedex_rates", + ), + ("easypost_amazonmws_ups_labels", "easypost_amazonmws_ups_labels"), + ( + "easypost_amazonmws_usps_labels", + "easypost_amazonmws_usps_labels", + ), + ( + "easypost_amazonmws_fedex_labels", + "easypost_amazonmws_fedex_labels", + ), + ( + "easypost_amazonmws_ups_tracking", + "easypost_amazonmws_ups_tracking", + ), + ( + "easypost_amazonmws_usps_tracking", + "easypost_amazonmws_usps_tracking", + ), + ( + "easypost_amazonmws_fedex_tracking", + "easypost_amazonmws_fedex_tracking", + ), + ( + "easypost_apc_parcel_connect_book_service", + "easypost_apc_parcel_connect_book_service", + ), + ( + "easypost_apc_parcel_connect_expedited_ddp", + "easypost_apc_parcel_connect_expedited_ddp", + ), + ( + "easypost_apc_parcel_connect_expedited_ddu", + "easypost_apc_parcel_connect_expedited_ddu", + ), + ( + "easypost_apc_parcel_connect_priority_ddp", + "easypost_apc_parcel_connect_priority_ddp", + ), + ( + "easypost_apc_parcel_connect_priority_ddp_delcon", + "easypost_apc_parcel_connect_priority_ddp_delcon", + ), + ( + "easypost_apc_parcel_connect_priority_ddu", + "easypost_apc_parcel_connect_priority_ddu", + ), + ( + "easypost_apc_parcel_connect_priority_ddu_delcon", + "easypost_apc_parcel_connect_priority_ddu_delcon", + ), + ( + "easypost_apc_parcel_connect_priority_ddupqw", + "easypost_apc_parcel_connect_priority_ddupqw", + ), + ( + "easypost_apc_parcel_connect_standard_ddu", + "easypost_apc_parcel_connect_standard_ddu", + ), + ( + "easypost_apc_parcel_connect_standard_ddupqw", + "easypost_apc_parcel_connect_standard_ddupqw", + ), + ( + "easypost_apc_parcel_connect_packet_ddu", + "easypost_apc_parcel_connect_packet_ddu", + ), + ("easypost_asendia_pmi", "easypost_asendia_pmi"), + ("easypost_asendia_e_packet", "easypost_asendia_e_packet"), + ("easypost_asendia_ipa", "easypost_asendia_ipa"), + ("easypost_asendia_isal", "easypost_asendia_isal"), + ("easypost_asendia_us_ads", "easypost_asendia_us_ads"), + ( + "easypost_asendia_us_air_freight_inbound", + "easypost_asendia_us_air_freight_inbound", + ), + ( + "easypost_asendia_us_air_freight_outbound", + "easypost_asendia_us_air_freight_outbound", + ), + ( + "easypost_asendia_us_domestic_bound_printer_matter_expedited", + "easypost_asendia_us_domestic_bound_printer_matter_expedited", + ), + ( + "easypost_asendia_us_domestic_bound_printer_matter_ground", + "easypost_asendia_us_domestic_bound_printer_matter_ground", + ), + ( + "easypost_asendia_us_domestic_flats_expedited", + "easypost_asendia_us_domestic_flats_expedited", + ), + ( + "easypost_asendia_us_domestic_flats_ground", + "easypost_asendia_us_domestic_flats_ground", + ), + ( + "easypost_asendia_us_domestic_parcel_ground_over1lb", + "easypost_asendia_us_domestic_parcel_ground_over1lb", + ), + ( + "easypost_asendia_us_domestic_parcel_ground_under1lb", + "easypost_asendia_us_domestic_parcel_ground_under1lb", + ), + ( + "easypost_asendia_us_domestic_parcel_max_over1lb", + "easypost_asendia_us_domestic_parcel_max_over1lb", + ), + ( + "easypost_asendia_us_domestic_parcel_max_under1lb", + "easypost_asendia_us_domestic_parcel_max_under1lb", + ), + ( + "easypost_asendia_us_domestic_parcel_over1lb_expedited", + "easypost_asendia_us_domestic_parcel_over1lb_expedited", + ), + ( + "easypost_asendia_us_domestic_parcel_under1lb_expedited", + "easypost_asendia_us_domestic_parcel_under1lb_expedited", + ), + ( + "easypost_asendia_us_domestic_promo_parcel_expedited", + "easypost_asendia_us_domestic_promo_parcel_expedited", + ), + ( + "easypost_asendia_us_domestic_promo_parcel_ground", + "easypost_asendia_us_domestic_promo_parcel_ground", + ), + ( + "easypost_asendia_us_bulk_freight", + "easypost_asendia_us_bulk_freight", + ), + ( + "easypost_asendia_us_business_mail_canada_lettermail", + "easypost_asendia_us_business_mail_canada_lettermail", + ), + ( + "easypost_asendia_us_business_mail_canada_lettermail_machineable", + "easypost_asendia_us_business_mail_canada_lettermail_machineable", + ), + ( + "easypost_asendia_us_business_mail_economy", + "easypost_asendia_us_business_mail_economy", + ), + ( + "easypost_asendia_us_business_mail_economy_lp_wholesale", + "easypost_asendia_us_business_mail_economy_lp_wholesale", + ), + ( + "easypost_asendia_us_business_mail_economy_sp_wholesale", + "easypost_asendia_us_business_mail_economy_sp_wholesale", + ), + ( + "easypost_asendia_us_business_mail_ipa", + "easypost_asendia_us_business_mail_ipa", + ), + ( + "easypost_asendia_us_business_mail_isal", + "easypost_asendia_us_business_mail_isal", + ), + ( + "easypost_asendia_us_business_mail_priority", + "easypost_asendia_us_business_mail_priority", + ), + ( + "easypost_asendia_us_business_mail_priority_lp_wholesale", + "easypost_asendia_us_business_mail_priority_lp_wholesale", + ), + ( + "easypost_asendia_us_business_mail_priority_sp_wholesale", + "easypost_asendia_us_business_mail_priority_sp_wholesale", + ), + ( + "easypost_asendia_us_marketing_mail_canada_personalized_lcp", + "easypost_asendia_us_marketing_mail_canada_personalized_lcp", + ), + ( + "easypost_asendia_us_marketing_mail_canada_personalized_machineable", + "easypost_asendia_us_marketing_mail_canada_personalized_machineable", + ), + ( + "easypost_asendia_us_marketing_mail_canada_personalized_ndg", + "easypost_asendia_us_marketing_mail_canada_personalized_ndg", + ), + ( + "easypost_asendia_us_marketing_mail_economy", + "easypost_asendia_us_marketing_mail_economy", + ), + ( + "easypost_asendia_us_marketing_mail_ipa", + "easypost_asendia_us_marketing_mail_ipa", + ), + ( + "easypost_asendia_us_marketing_mail_isal", + "easypost_asendia_us_marketing_mail_isal", + ), + ( + "easypost_asendia_us_marketing_mail_priority", + "easypost_asendia_us_marketing_mail_priority", + ), + ( + "easypost_asendia_us_publications_canada_lcp", + "easypost_asendia_us_publications_canada_lcp", + ), + ( + "easypost_asendia_us_publications_canada_ndg", + "easypost_asendia_us_publications_canada_ndg", + ), + ( + "easypost_asendia_us_publications_economy", + "easypost_asendia_us_publications_economy", + ), + ( + "easypost_asendia_us_publications_ipa", + "easypost_asendia_us_publications_ipa", + ), + ( + "easypost_asendia_us_publications_isal", + "easypost_asendia_us_publications_isal", + ), + ( + "easypost_asendia_us_publications_priority", + "easypost_asendia_us_publications_priority", + ), + ( + "easypost_asendia_us_epaq_elite", + "easypost_asendia_us_epaq_elite", + ), + ( + "easypost_asendia_us_epaq_elite_custom", + "easypost_asendia_us_epaq_elite_custom", + ), + ( + "easypost_asendia_us_epaq_elite_dap", + "easypost_asendia_us_epaq_elite_dap", + ), + ( + "easypost_asendia_us_epaq_elite_ddp", + "easypost_asendia_us_epaq_elite_ddp", + ), + ( + "easypost_asendia_us_epaq_elite_ddp_oversized", + "easypost_asendia_us_epaq_elite_ddp_oversized", + ), + ( + "easypost_asendia_us_epaq_elite_dpd", + "easypost_asendia_us_epaq_elite_dpd", + ), + ( + "easypost_asendia_us_epaq_elite_direct_access_canada_ddp", + "easypost_asendia_us_epaq_elite_direct_access_canada_ddp", + ), + ( + "easypost_asendia_us_epaq_elite_oversized", + "easypost_asendia_us_epaq_elite_oversized", + ), + ("easypost_asendia_us_epaq_plus", "easypost_asendia_us_epaq_plus"), + ( + "easypost_asendia_us_epaq_plus_custom", + "easypost_asendia_us_epaq_plus_custom", + ), + ( + "easypost_asendia_us_epaq_plus_customs_prepaid", + "easypost_asendia_us_epaq_plus_customs_prepaid", + ), + ( + "easypost_asendia_us_epaq_plus_dap", + "easypost_asendia_us_epaq_plus_dap", + ), + ( + "easypost_asendia_us_epaq_plus_ddp", + "easypost_asendia_us_epaq_plus_ddp", + ), + ( + "easypost_asendia_us_epaq_plus_economy", + "easypost_asendia_us_epaq_plus_economy", + ), + ( + "easypost_asendia_us_epaq_plus_wholesale", + "easypost_asendia_us_epaq_plus_wholesale", + ), + ( + "easypost_asendia_us_epaq_pluse_packet", + "easypost_asendia_us_epaq_pluse_packet", + ), + ( + "easypost_asendia_us_epaq_pluse_packet_canada_customs_pre_paid", + "easypost_asendia_us_epaq_pluse_packet_canada_customs_pre_paid", + ), + ( + "easypost_asendia_us_epaq_pluse_packet_canada_ddp", + "easypost_asendia_us_epaq_pluse_packet_canada_ddp", + ), + ( + "easypost_asendia_us_epaq_returns_domestic", + "easypost_asendia_us_epaq_returns_domestic", + ), + ( + "easypost_asendia_us_epaq_returns_international", + "easypost_asendia_us_epaq_returns_international", + ), + ( + "easypost_asendia_us_epaq_select", + "easypost_asendia_us_epaq_select", + ), + ( + "easypost_asendia_us_epaq_select_custom", + "easypost_asendia_us_epaq_select_custom", + ), + ( + "easypost_asendia_us_epaq_select_customs_prepaid_by_shopper", + "easypost_asendia_us_epaq_select_customs_prepaid_by_shopper", + ), + ( + "easypost_asendia_us_epaq_select_dap", + "easypost_asendia_us_epaq_select_dap", + ), + ( + "easypost_asendia_us_epaq_select_ddp", + "easypost_asendia_us_epaq_select_ddp", + ), + ( + "easypost_asendia_us_epaq_select_ddp_direct_access", + "easypost_asendia_us_epaq_select_ddp_direct_access", + ), + ( + "easypost_asendia_us_epaq_select_direct_access", + "easypost_asendia_us_epaq_select_direct_access", + ), + ( + "easypost_asendia_us_epaq_select_direct_access_canada_ddp", + "easypost_asendia_us_epaq_select_direct_access_canada_ddp", + ), + ( + "easypost_asendia_us_epaq_select_economy", + "easypost_asendia_us_epaq_select_economy", + ), + ( + "easypost_asendia_us_epaq_select_oversized", + "easypost_asendia_us_epaq_select_oversized", + ), + ( + "easypost_asendia_us_epaq_select_oversized_ddp", + "easypost_asendia_us_epaq_select_oversized_ddp", + ), + ( + "easypost_asendia_us_epaq_select_pmei", + "easypost_asendia_us_epaq_select_pmei", + ), + ( + "easypost_asendia_us_epaq_select_pmei_canada_customs_pre_paid", + "easypost_asendia_us_epaq_select_pmei_canada_customs_pre_paid", + ), + ( + "easypost_asendia_us_epaq_select_pmeipc_postage", + "easypost_asendia_us_epaq_select_pmeipc_postage", + ), + ( + "easypost_asendia_us_epaq_select_pmi", + "easypost_asendia_us_epaq_select_pmi", + ), + ( + "easypost_asendia_us_epaq_select_pmi_canada_customs_prepaid", + "easypost_asendia_us_epaq_select_pmi_canada_customs_prepaid", + ), + ( + "easypost_asendia_us_epaq_select_pmi_canada_ddp", + "easypost_asendia_us_epaq_select_pmi_canada_ddp", + ), + ( + "easypost_asendia_us_epaq_select_pmi_non_presort", + "easypost_asendia_us_epaq_select_pmi_non_presort", + ), + ( + "easypost_asendia_us_epaq_select_pmipc_postage", + "easypost_asendia_us_epaq_select_pmipc_postage", + ), + ( + "easypost_asendia_us_epaq_standard", + "easypost_asendia_us_epaq_standard", + ), + ( + "easypost_asendia_us_epaq_standard_custom", + "easypost_asendia_us_epaq_standard_custom", + ), + ( + "easypost_asendia_us_epaq_standard_economy", + "easypost_asendia_us_epaq_standard_economy", + ), + ( + "easypost_asendia_us_epaq_standard_ipa", + "easypost_asendia_us_epaq_standard_ipa", + ), + ( + "easypost_asendia_us_epaq_standard_isal", + "easypost_asendia_us_epaq_standard_isal", + ), + ( + "easypost_asendia_us_epaq_select_pmei_non_presort", + "easypost_asendia_us_epaq_select_pmei_non_presort", + ), + ( + "easypost_australiapost_express_post", + "easypost_australiapost_express_post", + ), + ( + "easypost_australiapost_express_post_signature", + "easypost_australiapost_express_post_signature", + ), + ( + "easypost_australiapost_parcel_post", + "easypost_australiapost_parcel_post", + ), + ( + "easypost_australiapost_parcel_post_signature", + "easypost_australiapost_parcel_post_signature", + ), + ( + "easypost_australiapost_parcel_post_extra", + "easypost_australiapost_parcel_post_extra", + ), + ( + "easypost_australiapost_parcel_post_wine_plus_signature", + "easypost_australiapost_parcel_post_wine_plus_signature", + ), + ("easypost_axlehire_delivery", "easypost_axlehire_delivery"), + ( + "easypost_better_trucks_next_day", + "easypost_better_trucks_next_day", + ), + ("easypost_bond_standard", "easypost_bond_standard"), + ( + "easypost_canadapost_regular_parcel", + "easypost_canadapost_regular_parcel", + ), + ( + "easypost_canadapost_expedited_parcel", + "easypost_canadapost_expedited_parcel", + ), + ( + "easypost_canadapost_xpresspost", + "easypost_canadapost_xpresspost", + ), + ( + "easypost_canadapost_xpresspost_certified", + "easypost_canadapost_xpresspost_certified", + ), + ("easypost_canadapost_priority", "easypost_canadapost_priority"), + ( + "easypost_canadapost_library_books", + "easypost_canadapost_library_books", + ), + ( + "easypost_canadapost_expedited_parcel_usa", + "easypost_canadapost_expedited_parcel_usa", + ), + ( + "easypost_canadapost_priority_worldwide_envelope_usa", + "easypost_canadapost_priority_worldwide_envelope_usa", + ), + ( + "easypost_canadapost_priority_worldwide_pak_usa", + "easypost_canadapost_priority_worldwide_pak_usa", + ), + ( + "easypost_canadapost_priority_worldwide_parcel_usa", + "easypost_canadapost_priority_worldwide_parcel_usa", + ), + ( + "easypost_canadapost_small_packet_usa_air", + "easypost_canadapost_small_packet_usa_air", + ), + ( + "easypost_canadapost_tracked_packet_usa", + "easypost_canadapost_tracked_packet_usa", + ), + ( + "easypost_canadapost_tracked_packet_usalvm", + "easypost_canadapost_tracked_packet_usalvm", + ), + ( + "easypost_canadapost_xpresspost_usa", + "easypost_canadapost_xpresspost_usa", + ), + ( + "easypost_canadapost_xpresspost_international", + "easypost_canadapost_xpresspost_international", + ), + ( + "easypost_canadapost_international_parcel_air", + "easypost_canadapost_international_parcel_air", + ), + ( + "easypost_canadapost_international_parcel_surface", + "easypost_canadapost_international_parcel_surface", + ), + ( + "easypost_canadapost_priority_worldwide_envelope_intl", + "easypost_canadapost_priority_worldwide_envelope_intl", + ), + ( + "easypost_canadapost_priority_worldwide_pak_intl", + "easypost_canadapost_priority_worldwide_pak_intl", + ), + ( + "easypost_canadapost_priority_worldwide_parcel_intl", + "easypost_canadapost_priority_worldwide_parcel_intl", + ), + ( + "easypost_canadapost_small_packet_international_air", + "easypost_canadapost_small_packet_international_air", + ), + ( + "easypost_canadapost_small_packet_international_surface", + "easypost_canadapost_small_packet_international_surface", + ), + ( + "easypost_canadapost_tracked_packet_international", + "easypost_canadapost_tracked_packet_international", + ), + ("easypost_canpar_ground", "easypost_canpar_ground"), + ("easypost_canpar_select_letter", "easypost_canpar_select_letter"), + ("easypost_canpar_select_pak", "easypost_canpar_select_pak"), + ("easypost_canpar_select", "easypost_canpar_select"), + ( + "easypost_canpar_overnight_letter", + "easypost_canpar_overnight_letter", + ), + ("easypost_canpar_overnight_pak", "easypost_canpar_overnight_pak"), + ("easypost_canpar_overnight", "easypost_canpar_overnight"), + ("easypost_canpar_select_usa", "easypost_canpar_select_usa"), + ("easypost_canpar_usa_pak", "easypost_canpar_usa_pak"), + ("easypost_canpar_usa_letter", "easypost_canpar_usa_letter"), + ("easypost_canpar_usa", "easypost_canpar_usa"), + ("easypost_canpar_international", "easypost_canpar_international"), + ("easypost_cdl_distribution", "easypost_cdl_distribution"), + ("easypost_cdl_same_day", "easypost_cdl_same_day"), + ( + "easypost_courier_express_basic_parcel", + "easypost_courier_express_basic_parcel", + ), + ( + "easypost_couriersplease_domestic_priority_signature", + "easypost_couriersplease_domestic_priority_signature", + ), + ( + "easypost_couriersplease_domestic_priority", + "easypost_couriersplease_domestic_priority", + ), + ( + "easypost_couriersplease_domestic_off_peak_signature", + "easypost_couriersplease_domestic_off_peak_signature", + ), + ( + "easypost_couriersplease_domestic_off_peak", + "easypost_couriersplease_domestic_off_peak", + ), + ( + "easypost_couriersplease_gold_domestic_signature", + "easypost_couriersplease_gold_domestic_signature", + ), + ( + "easypost_couriersplease_gold_domestic", + "easypost_couriersplease_gold_domestic", + ), + ( + "easypost_couriersplease_australian_city_express_signature", + "easypost_couriersplease_australian_city_express_signature", + ), + ( + "easypost_couriersplease_australian_city_express", + "easypost_couriersplease_australian_city_express", + ), + ( + "easypost_couriersplease_domestic_saver_signature", + "easypost_couriersplease_domestic_saver_signature", + ), + ( + "easypost_couriersplease_domestic_saver", + "easypost_couriersplease_domestic_saver", + ), + ( + "easypost_couriersplease_road_express", + "easypost_couriersplease_road_express", + ), + ( + "easypost_couriersplease_5_kg_satchel", + "easypost_couriersplease_5_kg_satchel", + ), + ( + "easypost_couriersplease_3_kg_satchel", + "easypost_couriersplease_3_kg_satchel", + ), + ( + "easypost_couriersplease_1_kg_satchel", + "easypost_couriersplease_1_kg_satchel", + ), + ( + "easypost_couriersplease_5_kg_satchel_atl", + "easypost_couriersplease_5_kg_satchel_atl", + ), + ( + "easypost_couriersplease_3_kg_satchel_atl", + "easypost_couriersplease_3_kg_satchel_atl", + ), + ( + "easypost_couriersplease_1_kg_satchel_atl", + "easypost_couriersplease_1_kg_satchel_atl", + ), + ( + "easypost_couriersplease_500_gram_satchel", + "easypost_couriersplease_500_gram_satchel", + ), + ( + "easypost_couriersplease_500_gram_satchel_atl", + "easypost_couriersplease_500_gram_satchel_atl", + ), + ( + "easypost_couriersplease_25_kg_parcel", + "easypost_couriersplease_25_kg_parcel", + ), + ( + "easypost_couriersplease_10_kg_parcel", + "easypost_couriersplease_10_kg_parcel", + ), + ( + "easypost_couriersplease_5_kg_parcel", + "easypost_couriersplease_5_kg_parcel", + ), + ( + "easypost_couriersplease_3_kg_parcel", + "easypost_couriersplease_3_kg_parcel", + ), + ( + "easypost_couriersplease_1_kg_parcel", + "easypost_couriersplease_1_kg_parcel", + ), + ( + "easypost_couriersplease_500_gram_parcel", + "easypost_couriersplease_500_gram_parcel", + ), + ( + "easypost_couriersplease_500_gram_parcel_atl", + "easypost_couriersplease_500_gram_parcel_atl", + ), + ( + "easypost_couriersplease_express_international_priority", + "easypost_couriersplease_express_international_priority", + ), + ( + "easypost_couriersplease_international_saver", + "easypost_couriersplease_international_saver", + ), + ( + "easypost_couriersplease_international_express_import", + "easypost_couriersplease_international_express_import", + ), + ( + "easypost_couriersplease_domestic_tracked", + "easypost_couriersplease_domestic_tracked", + ), + ( + "easypost_couriersplease_international_economy", + "easypost_couriersplease_international_economy", + ), + ( + "easypost_couriersplease_international_standard", + "easypost_couriersplease_international_standard", + ), + ( + "easypost_couriersplease_international_express", + "easypost_couriersplease_international_express", + ), + ( + "easypost_deutschepost_packet_plus", + "easypost_deutschepost_packet_plus", + ), + ( + "easypost_deutschepost_uk_priority_packet_plus", + "easypost_deutschepost_uk_priority_packet_plus", + ), + ( + "easypost_deutschepost_uk_priority_packet", + "easypost_deutschepost_uk_priority_packet", + ), + ( + "easypost_deutschepost_uk_priority_packet_tracked", + "easypost_deutschepost_uk_priority_packet_tracked", + ), + ( + "easypost_deutschepost_uk_business_mail_registered", + "easypost_deutschepost_uk_business_mail_registered", + ), + ( + "easypost_deutschepost_uk_standard_packet", + "easypost_deutschepost_uk_standard_packet", + ), + ( + "easypost_deutschepost_uk_business_mail_standard", + "easypost_deutschepost_uk_business_mail_standard", + ), + ("easypost_dhl_ecom_asia_packet", "easypost_dhl_ecom_asia_packet"), + ( + "easypost_dhl_ecom_asia_parcel_direct", + "easypost_dhl_ecom_asia_parcel_direct", + ), + ( + "easypost_dhl_ecom_asia_parcel_direct_expedited", + "easypost_dhl_ecom_asia_parcel_direct_expedited", + ), + ( + "easypost_dhl_ecom_parcel_expedited", + "easypost_dhl_ecom_parcel_expedited", + ), + ( + "easypost_dhl_ecom_parcel_expedited_max", + "easypost_dhl_ecom_parcel_expedited_max", + ), + ( + "easypost_dhl_ecom_parcel_ground", + "easypost_dhl_ecom_parcel_ground", + ), + ( + "easypost_dhl_ecom_bpm_expedited", + "easypost_dhl_ecom_bpm_expedited", + ), + ("easypost_dhl_ecom_bpm_ground", "easypost_dhl_ecom_bpm_ground"), + ( + "easypost_dhl_ecom_parcel_international_direct", + "easypost_dhl_ecom_parcel_international_direct", + ), + ( + "easypost_dhl_ecom_parcel_international_standard", + "easypost_dhl_ecom_parcel_international_standard", + ), + ( + "easypost_dhl_ecom_packet_international", + "easypost_dhl_ecom_packet_international", + ), + ( + "easypost_dhl_ecom_parcel_international_direct_priority", + "easypost_dhl_ecom_parcel_international_direct_priority", + ), + ( + "easypost_dhl_ecom_parcel_international_direct_standard", + "easypost_dhl_ecom_parcel_international_direct_standard", + ), + ( + "easypost_dhl_express_break_bulk_economy", + "easypost_dhl_express_break_bulk_economy", + ), + ( + "easypost_dhl_express_break_bulk_express", + "easypost_dhl_express_break_bulk_express", + ), + ( + "easypost_dhl_express_domestic_economy_select", + "easypost_dhl_express_domestic_economy_select", + ), + ( + "easypost_dhl_express_domestic_express", + "easypost_dhl_express_domestic_express", + ), + ( + "easypost_dhl_express_domestic_express1030", + "easypost_dhl_express_domestic_express1030", + ), + ( + "easypost_dhl_express_domestic_express1200", + "easypost_dhl_express_domestic_express1200", + ), + ( + "easypost_dhl_express_economy_select", + "easypost_dhl_express_economy_select", + ), + ( + "easypost_dhl_express_economy_select_non_doc", + "easypost_dhl_express_economy_select_non_doc", + ), + ( + "easypost_dhl_express_euro_pack", + "easypost_dhl_express_euro_pack", + ), + ( + "easypost_dhl_express_europack_non_doc", + "easypost_dhl_express_europack_non_doc", + ), + ( + "easypost_dhl_express_express1030", + "easypost_dhl_express_express1030", + ), + ( + "easypost_dhl_express_express1030_non_doc", + "easypost_dhl_express_express1030_non_doc", + ), + ( + "easypost_dhl_express_express1200_non_doc", + "easypost_dhl_express_express1200_non_doc", + ), + ( + "easypost_dhl_express_express1200", + "easypost_dhl_express_express1200", + ), + ( + "easypost_dhl_express_express900", + "easypost_dhl_express_express900", + ), + ( + "easypost_dhl_express_express900_non_doc", + "easypost_dhl_express_express900_non_doc", + ), + ( + "easypost_dhl_express_express_easy", + "easypost_dhl_express_express_easy", + ), + ( + "easypost_dhl_express_express_easy_non_doc", + "easypost_dhl_express_express_easy_non_doc", + ), + ( + "easypost_dhl_express_express_envelope", + "easypost_dhl_express_express_envelope", + ), + ( + "easypost_dhl_express_express_worldwide", + "easypost_dhl_express_express_worldwide", + ), + ( + "easypost_dhl_express_express_worldwide_b2_c", + "easypost_dhl_express_express_worldwide_b2_c", + ), + ( + "easypost_dhl_express_express_worldwide_b2_c_non_doc", + "easypost_dhl_express_express_worldwide_b2_c_non_doc", + ), + ( + "easypost_dhl_express_express_worldwide_ecx", + "easypost_dhl_express_express_worldwide_ecx", + ), + ( + "easypost_dhl_express_express_worldwide_non_doc", + "easypost_dhl_express_express_worldwide_non_doc", + ), + ( + "easypost_dhl_express_freight_worldwide", + "easypost_dhl_express_freight_worldwide", + ), + ( + "easypost_dhl_express_globalmail_business", + "easypost_dhl_express_globalmail_business", + ), + ("easypost_dhl_express_jet_line", "easypost_dhl_express_jet_line"), + ( + "easypost_dhl_express_jumbo_box", + "easypost_dhl_express_jumbo_box", + ), + ( + "easypost_dhl_express_logistics_services", + "easypost_dhl_express_logistics_services", + ), + ("easypost_dhl_express_same_day", "easypost_dhl_express_same_day"), + ( + "easypost_dhl_express_secure_line", + "easypost_dhl_express_secure_line", + ), + ( + "easypost_dhl_express_sprint_line", + "easypost_dhl_express_sprint_line", + ), + ("easypost_dpd_classic", "easypost_dpd_classic"), + ("easypost_dpd_8_30", "easypost_dpd_8_30"), + ("easypost_dpd_10_00", "easypost_dpd_10_00"), + ("easypost_dpd_12_00", "easypost_dpd_12_00"), + ("easypost_dpd_18_00", "easypost_dpd_18_00"), + ("easypost_dpd_express", "easypost_dpd_express"), + ("easypost_dpd_parcelletter", "easypost_dpd_parcelletter"), + ("easypost_dpd_parcelletterplus", "easypost_dpd_parcelletterplus"), + ( + "easypost_dpd_internationalmail", + "easypost_dpd_internationalmail", + ), + ( + "easypost_dpd_uk_air_express_international_air", + "easypost_dpd_uk_air_express_international_air", + ), + ( + "easypost_dpd_uk_air_classic_international_air", + "easypost_dpd_uk_air_classic_international_air", + ), + ("easypost_dpd_uk_parcel_sunday", "easypost_dpd_uk_parcel_sunday"), + ( + "easypost_dpd_uk_freight_parcel_sunday", + "easypost_dpd_uk_freight_parcel_sunday", + ), + ("easypost_dpd_uk_pallet_sunday", "easypost_dpd_uk_pallet_sunday"), + ( + "easypost_dpd_uk_pallet_dpd_classic", + "easypost_dpd_uk_pallet_dpd_classic", + ), + ( + "easypost_dpd_uk_expresspak_dpd_classic", + "easypost_dpd_uk_expresspak_dpd_classic", + ), + ( + "easypost_dpd_uk_expresspak_sunday", + "easypost_dpd_uk_expresspak_sunday", + ), + ( + "easypost_dpd_uk_parcel_dpd_classic", + "easypost_dpd_uk_parcel_dpd_classic", + ), + ( + "easypost_dpd_uk_parcel_dpd_two_day", + "easypost_dpd_uk_parcel_dpd_two_day", + ), + ( + "easypost_dpd_uk_parcel_dpd_next_day", + "easypost_dpd_uk_parcel_dpd_next_day", + ), + ("easypost_dpd_uk_parcel_dpd12", "easypost_dpd_uk_parcel_dpd12"), + ("easypost_dpd_uk_parcel_dpd10", "easypost_dpd_uk_parcel_dpd10"), + ( + "easypost_dpd_uk_parcel_return_to_shop", + "easypost_dpd_uk_parcel_return_to_shop", + ), + ( + "easypost_dpd_uk_parcel_saturday", + "easypost_dpd_uk_parcel_saturday", + ), + ( + "easypost_dpd_uk_parcel_saturday12", + "easypost_dpd_uk_parcel_saturday12", + ), + ( + "easypost_dpd_uk_parcel_saturday10", + "easypost_dpd_uk_parcel_saturday10", + ), + ( + "easypost_dpd_uk_parcel_sunday12", + "easypost_dpd_uk_parcel_sunday12", + ), + ( + "easypost_dpd_uk_freight_parcel_dpd_classic", + "easypost_dpd_uk_freight_parcel_dpd_classic", + ), + ( + "easypost_dpd_uk_freight_parcel_sunday12", + "easypost_dpd_uk_freight_parcel_sunday12", + ), + ( + "easypost_dpd_uk_expresspak_dpd_next_day", + "easypost_dpd_uk_expresspak_dpd_next_day", + ), + ( + "easypost_dpd_uk_expresspak_dpd12", + "easypost_dpd_uk_expresspak_dpd12", + ), + ( + "easypost_dpd_uk_expresspak_dpd10", + "easypost_dpd_uk_expresspak_dpd10", + ), + ( + "easypost_dpd_uk_expresspak_saturday", + "easypost_dpd_uk_expresspak_saturday", + ), + ( + "easypost_dpd_uk_expresspak_saturday12", + "easypost_dpd_uk_expresspak_saturday12", + ), + ( + "easypost_dpd_uk_expresspak_saturday10", + "easypost_dpd_uk_expresspak_saturday10", + ), + ( + "easypost_dpd_uk_expresspak_sunday12", + "easypost_dpd_uk_expresspak_sunday12", + ), + ( + "easypost_dpd_uk_pallet_sunday12", + "easypost_dpd_uk_pallet_sunday12", + ), + ( + "easypost_dpd_uk_pallet_dpd_two_day", + "easypost_dpd_uk_pallet_dpd_two_day", + ), + ( + "easypost_dpd_uk_pallet_dpd_next_day", + "easypost_dpd_uk_pallet_dpd_next_day", + ), + ("easypost_dpd_uk_pallet_dpd12", "easypost_dpd_uk_pallet_dpd12"), + ("easypost_dpd_uk_pallet_dpd10", "easypost_dpd_uk_pallet_dpd10"), + ( + "easypost_dpd_uk_pallet_saturday", + "easypost_dpd_uk_pallet_saturday", + ), + ( + "easypost_dpd_uk_pallet_saturday12", + "easypost_dpd_uk_pallet_saturday12", + ), + ( + "easypost_dpd_uk_pallet_saturday10", + "easypost_dpd_uk_pallet_saturday10", + ), + ( + "easypost_dpd_uk_freight_parcel_dpd_two_day", + "easypost_dpd_uk_freight_parcel_dpd_two_day", + ), + ( + "easypost_dpd_uk_freight_parcel_dpd_next_day", + "easypost_dpd_uk_freight_parcel_dpd_next_day", + ), + ( + "easypost_dpd_uk_freight_parcel_dpd12", + "easypost_dpd_uk_freight_parcel_dpd12", + ), + ( + "easypost_dpd_uk_freight_parcel_dpd10", + "easypost_dpd_uk_freight_parcel_dpd10", + ), + ( + "easypost_dpd_uk_freight_parcel_saturday", + "easypost_dpd_uk_freight_parcel_saturday", + ), + ( + "easypost_dpd_uk_freight_parcel_saturday12", + "easypost_dpd_uk_freight_parcel_saturday12", + ), + ( + "easypost_dpd_uk_freight_parcel_saturday10", + "easypost_dpd_uk_freight_parcel_saturday10", + ), + ( + "easypost_epost_courier_service_ddp", + "easypost_epost_courier_service_ddp", + ), + ( + "easypost_epost_courier_service_ddu", + "easypost_epost_courier_service_ddu", + ), + ( + "easypost_epost_domestic_economy_parcel", + "easypost_epost_domestic_economy_parcel", + ), + ( + "easypost_epost_domestic_parcel_bpm", + "easypost_epost_domestic_parcel_bpm", + ), + ( + "easypost_epost_domestic_priority_parcel", + "easypost_epost_domestic_priority_parcel", + ), + ( + "easypost_epost_domestic_priority_parcel_bpm", + "easypost_epost_domestic_priority_parcel_bpm", + ), + ("easypost_epost_emi_service", "easypost_epost_emi_service"), + ( + "easypost_epost_economy_parcel_service", + "easypost_epost_economy_parcel_service", + ), + ("easypost_epost_ipa_service", "easypost_epost_ipa_service"), + ("easypost_epost_isal_service", "easypost_epost_isal_service"), + ("easypost_epost_pmi_service", "easypost_epost_pmi_service"), + ( + "easypost_epost_priority_parcel_ddp", + "easypost_epost_priority_parcel_ddp", + ), + ( + "easypost_epost_priority_parcel_ddu", + "easypost_epost_priority_parcel_ddu", + ), + ( + "easypost_epost_priority_parcel_delivery_confirmation_ddp", + "easypost_epost_priority_parcel_delivery_confirmation_ddp", + ), + ( + "easypost_epost_priority_parcel_delivery_confirmation_ddu", + "easypost_epost_priority_parcel_delivery_confirmation_ddu", + ), + ( + "easypost_epost_epacket_service", + "easypost_epost_epacket_service", + ), + ( + "easypost_estafeta_next_day_by930", + "easypost_estafeta_next_day_by930", + ), + ( + "easypost_estafeta_next_day_by1130", + "easypost_estafeta_next_day_by1130", + ), + ("easypost_estafeta_next_day", "easypost_estafeta_next_day"), + ("easypost_estafeta_two_day", "easypost_estafeta_two_day"), + ("easypost_estafeta_ltl", "easypost_estafeta_ltl"), + ("easypost_fastway_parcel", "easypost_fastway_parcel"), + ("easypost_fastway_satchel", "easypost_fastway_satchel"), + ("easypost_fedex_ground", "easypost_fedex_ground"), + ("easypost_fedex_2_day", "easypost_fedex_2_day"), + ("easypost_fedex_2_day_am", "easypost_fedex_2_day_am"), + ("easypost_fedex_express_saver", "easypost_fedex_express_saver"), + ( + "easypost_fedex_standard_overnight", + "easypost_fedex_standard_overnight", + ), + ( + "easypost_fedex_first_overnight", + "easypost_fedex_first_overnight", + ), + ( + "easypost_fedex_priority_overnight", + "easypost_fedex_priority_overnight", + ), + ( + "easypost_fedex_international_economy", + "easypost_fedex_international_economy", + ), + ( + "easypost_fedex_international_first", + "easypost_fedex_international_first", + ), + ( + "easypost_fedex_international_priority", + "easypost_fedex_international_priority", + ), + ( + "easypost_fedex_ground_home_delivery", + "easypost_fedex_ground_home_delivery", + ), + ( + "easypost_fedex_crossborder_cbec", + "easypost_fedex_crossborder_cbec", + ), + ( + "easypost_fedex_crossborder_cbecl", + "easypost_fedex_crossborder_cbecl", + ), + ( + "easypost_fedex_crossborder_cbecp", + "easypost_fedex_crossborder_cbecp", + ), + ( + "easypost_fedex_sameday_city_economy_service", + "easypost_fedex_sameday_city_economy_service", + ), + ( + "easypost_fedex_sameday_city_standard_service", + "easypost_fedex_sameday_city_standard_service", + ), + ( + "easypost_fedex_sameday_city_priority_service", + "easypost_fedex_sameday_city_priority_service", + ), + ( + "easypost_fedex_sameday_city_last_mile", + "easypost_fedex_sameday_city_last_mile", + ), + ("easypost_fedex_smart_post", "easypost_fedex_smart_post"), + ("easypost_globegistics_pmei", "easypost_globegistics_pmei"), + ( + "easypost_globegistics_ecom_domestic", + "easypost_globegistics_ecom_domestic", + ), + ( + "easypost_globegistics_ecom_europe", + "easypost_globegistics_ecom_europe", + ), + ( + "easypost_globegistics_ecom_express", + "easypost_globegistics_ecom_express", + ), + ( + "easypost_globegistics_ecom_extra", + "easypost_globegistics_ecom_extra", + ), + ( + "easypost_globegistics_ecom_ipa", + "easypost_globegistics_ecom_ipa", + ), + ( + "easypost_globegistics_ecom_isal", + "easypost_globegistics_ecom_isal", + ), + ( + "easypost_globegistics_ecom_pmei_duty_paid", + "easypost_globegistics_ecom_pmei_duty_paid", + ), + ( + "easypost_globegistics_ecom_pmi_duty_paid", + "easypost_globegistics_ecom_pmi_duty_paid", + ), + ( + "easypost_globegistics_ecom_packet", + "easypost_globegistics_ecom_packet", + ), + ( + "easypost_globegistics_ecom_packet_ddp", + "easypost_globegistics_ecom_packet_ddp", + ), + ( + "easypost_globegistics_ecom_priority", + "easypost_globegistics_ecom_priority", + ), + ( + "easypost_globegistics_ecom_standard", + "easypost_globegistics_ecom_standard", + ), + ( + "easypost_globegistics_ecom_tracked_ddp", + "easypost_globegistics_ecom_tracked_ddp", + ), + ( + "easypost_globegistics_ecom_tracked_ddu", + "easypost_globegistics_ecom_tracked_ddu", + ), + ( + "easypost_gso_early_priority_overnight", + "easypost_gso_early_priority_overnight", + ), + ( + "easypost_gso_priority_overnight", + "easypost_gso_priority_overnight", + ), + ( + "easypost_gso_california_parcel_service", + "easypost_gso_california_parcel_service", + ), + ( + "easypost_gso_saturday_delivery_service", + "easypost_gso_saturday_delivery_service", + ), + ( + "easypost_gso_early_saturday_service", + "easypost_gso_early_saturday_service", + ), + ( + "easypost_hermes_domestic_delivery", + "easypost_hermes_domestic_delivery", + ), + ( + "easypost_hermes_domestic_delivery_signed", + "easypost_hermes_domestic_delivery_signed", + ), + ( + "easypost_hermes_international_delivery", + "easypost_hermes_international_delivery", + ), + ( + "easypost_hermes_international_delivery_signed", + "easypost_hermes_international_delivery_signed", + ), + ( + "easypost_interlink_air_classic_international_air", + "easypost_interlink_air_classic_international_air", + ), + ( + "easypost_interlink_air_express_international_air", + "easypost_interlink_air_express_international_air", + ), + ( + "easypost_interlink_expresspak1_by10_30", + "easypost_interlink_expresspak1_by10_30", + ), + ( + "easypost_interlink_expresspak1_by12", + "easypost_interlink_expresspak1_by12", + ), + ( + "easypost_interlink_expresspak1_next_day", + "easypost_interlink_expresspak1_next_day", + ), + ( + "easypost_interlink_expresspak1_saturday", + "easypost_interlink_expresspak1_saturday", + ), + ( + "easypost_interlink_expresspak1_saturday_by10_30", + "easypost_interlink_expresspak1_saturday_by10_30", + ), + ( + "easypost_interlink_expresspak1_saturday_by12", + "easypost_interlink_expresspak1_saturday_by12", + ), + ( + "easypost_interlink_expresspak1_sunday", + "easypost_interlink_expresspak1_sunday", + ), + ( + "easypost_interlink_expresspak1_sunday_by12", + "easypost_interlink_expresspak1_sunday_by12", + ), + ( + "easypost_interlink_expresspak5_by10", + "easypost_interlink_expresspak5_by10", + ), + ( + "easypost_interlink_expresspak5_by10_30", + "easypost_interlink_expresspak5_by10_30", + ), + ( + "easypost_interlink_expresspak5_by12", + "easypost_interlink_expresspak5_by12", + ), + ( + "easypost_interlink_expresspak5_next_day", + "easypost_interlink_expresspak5_next_day", + ), + ( + "easypost_interlink_expresspak5_saturday", + "easypost_interlink_expresspak5_saturday", + ), + ( + "easypost_interlink_expresspak5_saturday_by10", + "easypost_interlink_expresspak5_saturday_by10", + ), + ( + "easypost_interlink_expresspak5_saturday_by10_30", + "easypost_interlink_expresspak5_saturday_by10_30", + ), + ( + "easypost_interlink_expresspak5_saturday_by12", + "easypost_interlink_expresspak5_saturday_by12", + ), + ( + "easypost_interlink_expresspak5_sunday", + "easypost_interlink_expresspak5_sunday", + ), + ( + "easypost_interlink_expresspak5_sunday_by12", + "easypost_interlink_expresspak5_sunday_by12", + ), + ( + "easypost_interlink_freight_by10", + "easypost_interlink_freight_by10", + ), + ( + "easypost_interlink_freight_by12", + "easypost_interlink_freight_by12", + ), + ( + "easypost_interlink_freight_next_day", + "easypost_interlink_freight_next_day", + ), + ( + "easypost_interlink_freight_saturday", + "easypost_interlink_freight_saturday", + ), + ( + "easypost_interlink_freight_saturday_by10", + "easypost_interlink_freight_saturday_by10", + ), + ( + "easypost_interlink_freight_saturday_by12", + "easypost_interlink_freight_saturday_by12", + ), + ( + "easypost_interlink_freight_sunday", + "easypost_interlink_freight_sunday", + ), + ( + "easypost_interlink_freight_sunday_by12", + "easypost_interlink_freight_sunday_by12", + ), + ( + "easypost_interlink_parcel_by10", + "easypost_interlink_parcel_by10", + ), + ( + "easypost_interlink_parcel_by10_30", + "easypost_interlink_parcel_by10_30", + ), + ( + "easypost_interlink_parcel_by12", + "easypost_interlink_parcel_by12", + ), + ( + "easypost_interlink_parcel_dpd_europe_by_road", + "easypost_interlink_parcel_dpd_europe_by_road", + ), + ( + "easypost_interlink_parcel_next_day", + "easypost_interlink_parcel_next_day", + ), + ( + "easypost_interlink_parcel_return", + "easypost_interlink_parcel_return", + ), + ( + "easypost_interlink_parcel_return_to_shop", + "easypost_interlink_parcel_return_to_shop", + ), + ( + "easypost_interlink_parcel_saturday", + "easypost_interlink_parcel_saturday", + ), + ( + "easypost_interlink_parcel_saturday_by10", + "easypost_interlink_parcel_saturday_by10", + ), + ( + "easypost_interlink_parcel_saturday_by10_30", + "easypost_interlink_parcel_saturday_by10_30", + ), + ( + "easypost_interlink_parcel_saturday_by12", + "easypost_interlink_parcel_saturday_by12", + ), + ( + "easypost_interlink_parcel_ship_to_shop", + "easypost_interlink_parcel_ship_to_shop", + ), + ( + "easypost_interlink_parcel_sunday", + "easypost_interlink_parcel_sunday", + ), + ( + "easypost_interlink_parcel_sunday_by12", + "easypost_interlink_parcel_sunday_by12", + ), + ( + "easypost_interlink_parcel_two_day", + "easypost_interlink_parcel_two_day", + ), + ( + "easypost_interlink_pickup_parcel_dpd_europe_by_road", + "easypost_interlink_pickup_parcel_dpd_europe_by_road", + ), + ("easypost_lasership_weekend", "easypost_lasership_weekend"), + ("easypost_loomis_ground", "easypost_loomis_ground"), + ("easypost_loomis_express1800", "easypost_loomis_express1800"), + ("easypost_loomis_express1200", "easypost_loomis_express1200"), + ("easypost_loomis_express900", "easypost_loomis_express900"), + ("easypost_lso_ground_early", "easypost_lso_ground_early"), + ("easypost_lso_ground_basic", "easypost_lso_ground_basic"), + ("easypost_lso_priority_basic", "easypost_lso_priority_basic"), + ("easypost_lso_priority_early", "easypost_lso_priority_early"), + ( + "easypost_lso_priority_saturday", + "easypost_lso_priority_saturday", + ), + ("easypost_lso_priority2nd_day", "easypost_lso_priority2nd_day"), + ( + "easypost_newgistics_parcel_select", + "easypost_newgistics_parcel_select", + ), + ( + "easypost_newgistics_parcel_select_lightweight", + "easypost_newgistics_parcel_select_lightweight", + ), + ("easypost_newgistics_express", "easypost_newgistics_express"), + ( + "easypost_newgistics_first_class_mail", + "easypost_newgistics_first_class_mail", + ), + ( + "easypost_newgistics_priority_mail", + "easypost_newgistics_priority_mail", + ), + ( + "easypost_newgistics_bound_printed_matter", + "easypost_newgistics_bound_printed_matter", + ), + ("easypost_ontrac_sunrise", "easypost_ontrac_sunrise"), + ("easypost_ontrac_gold", "easypost_ontrac_gold"), + ( + "easypost_ontrac_on_trac_ground", + "easypost_ontrac_on_trac_ground", + ), + ( + "easypost_ontrac_palletized_freight", + "easypost_ontrac_palletized_freight", + ), + ("easypost_osm_first", "easypost_osm_first"), + ("easypost_osm_expedited", "easypost_osm_expedited"), + ("easypost_osm_bpm", "easypost_osm_bpm"), + ("easypost_osm_media_mail", "easypost_osm_media_mail"), + ("easypost_osm_marketing_parcel", "easypost_osm_marketing_parcel"), + ( + "easypost_osm_marketing_parcel_tracked", + "easypost_osm_marketing_parcel_tracked", + ), + ("easypost_parcll_economy_west", "easypost_parcll_economy_west"), + ("easypost_parcll_economy_east", "easypost_parcll_economy_east"), + ( + "easypost_parcll_economy_central", + "easypost_parcll_economy_central", + ), + ( + "easypost_parcll_economy_northeast", + "easypost_parcll_economy_northeast", + ), + ("easypost_parcll_economy_south", "easypost_parcll_economy_south"), + ( + "easypost_parcll_expedited_west", + "easypost_parcll_expedited_west", + ), + ( + "easypost_parcll_expedited_northeast", + "easypost_parcll_expedited_northeast", + ), + ("easypost_parcll_regional_west", "easypost_parcll_regional_west"), + ("easypost_parcll_regional_east", "easypost_parcll_regional_east"), + ( + "easypost_parcll_regional_central", + "easypost_parcll_regional_central", + ), + ( + "easypost_parcll_regional_northeast", + "easypost_parcll_regional_northeast", + ), + ( + "easypost_parcll_regional_south", + "easypost_parcll_regional_south", + ), + ( + "easypost_parcll_us_to_canada_economy_west", + "easypost_parcll_us_to_canada_economy_west", + ), + ( + "easypost_parcll_us_to_canada_economy_central", + "easypost_parcll_us_to_canada_economy_central", + ), + ( + "easypost_parcll_us_to_canada_economy_northeast", + "easypost_parcll_us_to_canada_economy_northeast", + ), + ( + "easypost_parcll_us_to_europe_economy_west", + "easypost_parcll_us_to_europe_economy_west", + ), + ( + "easypost_parcll_us_to_europe_economy_northeast", + "easypost_parcll_us_to_europe_economy_northeast", + ), + ("easypost_purolator_express", "easypost_purolator_express"), + ( + "easypost_purolator_express12_pm", + "easypost_purolator_express12_pm", + ), + ( + "easypost_purolator_express_pack12_pm", + "easypost_purolator_express_pack12_pm", + ), + ( + "easypost_purolator_express_box12_pm", + "easypost_purolator_express_box12_pm", + ), + ( + "easypost_purolator_express_envelope12_pm", + "easypost_purolator_express_envelope12_pm", + ), + ( + "easypost_purolator_express1030_am", + "easypost_purolator_express1030_am", + ), + ( + "easypost_purolator_express9_am", + "easypost_purolator_express9_am", + ), + ( + "easypost_purolator_express_box", + "easypost_purolator_express_box", + ), + ( + "easypost_purolator_express_box1030_am", + "easypost_purolator_express_box1030_am", + ), + ( + "easypost_purolator_express_box9_am", + "easypost_purolator_express_box9_am", + ), + ( + "easypost_purolator_express_box_evening", + "easypost_purolator_express_box_evening", + ), + ( + "easypost_purolator_express_box_international", + "easypost_purolator_express_box_international", + ), + ( + "easypost_purolator_express_box_international1030_am", + "easypost_purolator_express_box_international1030_am", + ), + ( + "easypost_purolator_express_box_international1200", + "easypost_purolator_express_box_international1200", + ), + ( + "easypost_purolator_express_box_international9_am", + "easypost_purolator_express_box_international9_am", + ), + ( + "easypost_purolator_express_box_us", + "easypost_purolator_express_box_us", + ), + ( + "easypost_purolator_express_box_us1030_am", + "easypost_purolator_express_box_us1030_am", + ), + ( + "easypost_purolator_express_box_us1200", + "easypost_purolator_express_box_us1200", + ), + ( + "easypost_purolator_express_box_us9_am", + "easypost_purolator_express_box_us9_am", + ), + ( + "easypost_purolator_express_envelope", + "easypost_purolator_express_envelope", + ), + ( + "easypost_purolator_express_envelope1030_am", + "easypost_purolator_express_envelope1030_am", + ), + ( + "easypost_purolator_express_envelope9_am", + "easypost_purolator_express_envelope9_am", + ), + ( + "easypost_purolator_express_envelope_evening", + "easypost_purolator_express_envelope_evening", + ), + ( + "easypost_purolator_express_envelope_international", + "easypost_purolator_express_envelope_international", + ), + ( + "easypost_purolator_express_envelope_international1030_am", + "easypost_purolator_express_envelope_international1030_am", + ), + ( + "easypost_purolator_express_envelope_international1200", + "easypost_purolator_express_envelope_international1200", + ), + ( + "easypost_purolator_express_envelope_international9_am", + "easypost_purolator_express_envelope_international9_am", + ), + ( + "easypost_purolator_express_envelope_us", + "easypost_purolator_express_envelope_us", + ), + ( + "easypost_purolator_express_envelope_us1030_am", + "easypost_purolator_express_envelope_us1030_am", + ), + ( + "easypost_purolator_express_envelope_us1200", + "easypost_purolator_express_envelope_us1200", + ), + ( + "easypost_purolator_express_envelope_us9_am", + "easypost_purolator_express_envelope_us9_am", + ), + ( + "easypost_purolator_express_evening", + "easypost_purolator_express_evening", + ), + ( + "easypost_purolator_express_international", + "easypost_purolator_express_international", + ), + ( + "easypost_purolator_express_international1030_am", + "easypost_purolator_express_international1030_am", + ), + ( + "easypost_purolator_express_international1200", + "easypost_purolator_express_international1200", + ), + ( + "easypost_purolator_express_international9_am", + "easypost_purolator_express_international9_am", + ), + ( + "easypost_purolator_express_pack", + "easypost_purolator_express_pack", + ), + ( + "easypost_purolator_express_pack1030_am", + "easypost_purolator_express_pack1030_am", + ), + ( + "easypost_purolator_express_pack9_am", + "easypost_purolator_express_pack9_am", + ), + ( + "easypost_purolator_express_pack_evening", + "easypost_purolator_express_pack_evening", + ), + ( + "easypost_purolator_express_pack_international", + "easypost_purolator_express_pack_international", + ), + ( + "easypost_purolator_express_pack_international1030_am", + "easypost_purolator_express_pack_international1030_am", + ), + ( + "easypost_purolator_express_pack_international1200", + "easypost_purolator_express_pack_international1200", + ), + ( + "easypost_purolator_express_pack_international9_am", + "easypost_purolator_express_pack_international9_am", + ), + ( + "easypost_purolator_express_pack_us", + "easypost_purolator_express_pack_us", + ), + ( + "easypost_purolator_express_pack_us1030_am", + "easypost_purolator_express_pack_us1030_am", + ), + ( + "easypost_purolator_express_pack_us1200", + "easypost_purolator_express_pack_us1200", + ), + ( + "easypost_purolator_express_pack_us9_am", + "easypost_purolator_express_pack_us9_am", + ), + ("easypost_purolator_express_us", "easypost_purolator_express_us"), + ( + "easypost_purolator_express_us1030_am", + "easypost_purolator_express_us1030_am", + ), + ( + "easypost_purolator_express_us1200", + "easypost_purolator_express_us1200", + ), + ( + "easypost_purolator_express_us9_am", + "easypost_purolator_express_us9_am", + ), + ("easypost_purolator_ground", "easypost_purolator_ground"), + ( + "easypost_purolator_ground1030_am", + "easypost_purolator_ground1030_am", + ), + ("easypost_purolator_ground9_am", "easypost_purolator_ground9_am"), + ( + "easypost_purolator_ground_distribution", + "easypost_purolator_ground_distribution", + ), + ( + "easypost_purolator_ground_evening", + "easypost_purolator_ground_evening", + ), + ( + "easypost_purolator_ground_regional", + "easypost_purolator_ground_regional", + ), + ("easypost_purolator_ground_us", "easypost_purolator_ground_us"), + ( + "easypost_royalmail_international_signed", + "easypost_royalmail_international_signed", + ), + ( + "easypost_royalmail_international_tracked", + "easypost_royalmail_international_tracked", + ), + ( + "easypost_royalmail_international_tracked_and_signed", + "easypost_royalmail_international_tracked_and_signed", + ), + ("easypost_royalmail_1st_class", "easypost_royalmail_1st_class"), + ( + "easypost_royalmail_1st_class_signed_for", + "easypost_royalmail_1st_class_signed_for", + ), + ("easypost_royalmail_2nd_class", "easypost_royalmail_2nd_class"), + ( + "easypost_royalmail_2nd_class_signed_for", + "easypost_royalmail_2nd_class_signed_for", + ), + ( + "easypost_royalmail_royal_mail24", + "easypost_royalmail_royal_mail24", + ), + ( + "easypost_royalmail_royal_mail24_signed_for", + "easypost_royalmail_royal_mail24_signed_for", + ), + ( + "easypost_royalmail_royal_mail48", + "easypost_royalmail_royal_mail48", + ), + ( + "easypost_royalmail_royal_mail48_signed_for", + "easypost_royalmail_royal_mail48_signed_for", + ), + ( + "easypost_royalmail_special_delivery_guaranteed1pm", + "easypost_royalmail_special_delivery_guaranteed1pm", + ), + ( + "easypost_royalmail_special_delivery_guaranteed9am", + "easypost_royalmail_special_delivery_guaranteed9am", + ), + ( + "easypost_royalmail_standard_letter1st_class", + "easypost_royalmail_standard_letter1st_class", + ), + ( + "easypost_royalmail_standard_letter1st_class_signed_for", + "easypost_royalmail_standard_letter1st_class_signed_for", + ), + ( + "easypost_royalmail_standard_letter2nd_class", + "easypost_royalmail_standard_letter2nd_class", + ), + ( + "easypost_royalmail_standard_letter2nd_class_signed_for", + "easypost_royalmail_standard_letter2nd_class_signed_for", + ), + ("easypost_royalmail_tracked24", "easypost_royalmail_tracked24"), + ( + "easypost_royalmail_tracked24_high_volume", + "easypost_royalmail_tracked24_high_volume", + ), + ( + "easypost_royalmail_tracked24_high_volume_signature", + "easypost_royalmail_tracked24_high_volume_signature", + ), + ( + "easypost_royalmail_tracked24_signature", + "easypost_royalmail_tracked24_signature", + ), + ("easypost_royalmail_tracked48", "easypost_royalmail_tracked48"), + ( + "easypost_royalmail_tracked48_high_volume", + "easypost_royalmail_tracked48_high_volume", + ), + ( + "easypost_royalmail_tracked48_high_volume_signature", + "easypost_royalmail_tracked48_high_volume_signature", + ), + ( + "easypost_royalmail_tracked48_signature", + "easypost_royalmail_tracked48_signature", + ), + ( + "easypost_seko_ecommerce_standard_tracked", + "easypost_seko_ecommerce_standard_tracked", + ), + ( + "easypost_seko_ecommerce_express_tracked", + "easypost_seko_ecommerce_express_tracked", + ), + ( + "easypost_seko_domestic_express", + "easypost_seko_domestic_express", + ), + ( + "easypost_seko_domestic_standard", + "easypost_seko_domestic_standard", + ), + ("easypost_sendle_easy", "easypost_sendle_easy"), + ("easypost_sendle_pro", "easypost_sendle_pro"), + ("easypost_sendle_plus", "easypost_sendle_plus"), + ( + "easypost_sfexpress_international_standard_express_doc", + "easypost_sfexpress_international_standard_express_doc", + ), + ( + "easypost_sfexpress_international_standard_express_parcel", + "easypost_sfexpress_international_standard_express_parcel", + ), + ( + "easypost_sfexpress_international_economy_express_pilot", + "easypost_sfexpress_international_economy_express_pilot", + ), + ( + "easypost_sfexpress_international_economy_express_doc", + "easypost_sfexpress_international_economy_express_doc", + ), + ("easypost_speedee_delivery", "easypost_speedee_delivery"), + ("easypost_startrack_express", "easypost_startrack_express"), + ("easypost_startrack_premium", "easypost_startrack_premium"), + ( + "easypost_startrack_fixed_price_premium", + "easypost_startrack_fixed_price_premium", + ), + ( + "easypost_tforce_same_day_white_glove", + "easypost_tforce_same_day_white_glove", + ), + ( + "easypost_tforce_next_day_white_glove", + "easypost_tforce_next_day_white_glove", + ), + ("easypost_uds_delivery_service", "easypost_uds_delivery_service"), + ("easypost_ups_standard", "easypost_ups_standard"), + ("easypost_ups_saver", "easypost_ups_saver"), + ("easypost_ups_express_plus", "easypost_ups_express_plus"), + ("easypost_ups_next_day_air", "easypost_ups_next_day_air"), + ( + "easypost_ups_next_day_air_saver", + "easypost_ups_next_day_air_saver", + ), + ( + "easypost_ups_next_day_air_early_am", + "easypost_ups_next_day_air_early_am", + ), + ("easypost_ups_2nd_day_air", "easypost_ups_2nd_day_air"), + ("easypost_ups_2nd_day_air_am", "easypost_ups_2nd_day_air_am"), + ("easypost_ups_3_day_select", "easypost_ups_3_day_select"), + ( + "easypost_ups_mail_expedited_mail_innovations", + "easypost_ups_mail_expedited_mail_innovations", + ), + ( + "easypost_ups_mail_priority_mail_innovations", + "easypost_ups_mail_priority_mail_innovations", + ), + ( + "easypost_ups_mail_economy_mail_innovations", + "easypost_ups_mail_economy_mail_innovations", + ), + ("easypost_usps_library_mail", "easypost_usps_library_mail"), + ( + "easypost_usps_first_class_mail_international", + "easypost_usps_first_class_mail_international", + ), + ( + "easypost_usps_first_class_package_international_service", + "easypost_usps_first_class_package_international_service", + ), + ( + "easypost_usps_priority_mail_international", + "easypost_usps_priority_mail_international", + ), + ( + "easypost_usps_express_mail_international", + "easypost_usps_express_mail_international", + ), + ("easypost_veho_next_day", "easypost_veho_next_day"), + ("easypost_veho_same_day", "easypost_veho_same_day"), + ("eshipper_all", "eshipper_all"), + ("eshipper_fedex_priority", "eshipper_fedex_priority"), + ( + "eshipper_fedex_first_overnight", + "eshipper_fedex_first_overnight", + ), + ("eshipper_fedex_ground", "eshipper_fedex_ground"), + ( + "eshipper_fedex_standard_overnight", + "eshipper_fedex_standard_overnight", + ), + ("eshipper_fedex_2nd_day", "eshipper_fedex_2nd_day"), + ("eshipper_fedex_express_saver", "eshipper_fedex_express_saver"), + ( + "eshipper_fedex_international_economy", + "eshipper_fedex_international_economy", + ), + ("eshipper_purolator_air", "eshipper_purolator_air"), + ("eshipper_purolator_air_9_am", "eshipper_purolator_air_9_am"), + ("eshipper_purolator_air_10_30", "eshipper_purolator_air_10_30"), + ("eshipper_purolator_letter", "eshipper_purolator_letter"), + ( + "eshipper_purolator_letter_9_am", + "eshipper_purolator_letter_9_am", + ), + ( + "eshipper_purolator_letter_10_30", + "eshipper_purolator_letter_10_30", + ), + ("eshipper_purolator_pak", "eshipper_purolator_pak"), + ("eshipper_purolator_pak_9_am", "eshipper_purolator_pak_9_am"), + ("eshipper_purolator_pak_10_30", "eshipper_purolator_pak_10_30"), + ("eshipper_purolator_ground", "eshipper_purolator_ground"), + ( + "eshipper_purolator_ground_9_am", + "eshipper_purolator_ground_9_am", + ), + ( + "eshipper_purolator_ground_10_30", + "eshipper_purolator_ground_10_30", + ), + ( + "eshipper_canada_worldwide_same_day", + "eshipper_canada_worldwide_same_day", + ), + ( + "eshipper_canada_worldwide_next_flight_out", + "eshipper_canada_worldwide_next_flight_out", + ), + ( + "eshipper_canada_worldwide_air_freight", + "eshipper_canada_worldwide_air_freight", + ), + ("eshipper_canada_worldwide_ltl", "eshipper_canada_worldwide_ltl"), + ( + "eshipper_dhl_express_worldwide", + "eshipper_dhl_express_worldwide", + ), + ("eshipper_dhl_express_12_pm", "eshipper_dhl_express_12_pm"), + ("eshipper_dhl_express_10_30_am", "eshipper_dhl_express_10_30_am"), + ("eshipper_dhl_esi_export", "eshipper_dhl_esi_export"), + ( + "eshipper_dhl_international_express", + "eshipper_dhl_international_express", + ), + ( + "eshipper_ups_express_next_day_air", + "eshipper_ups_express_next_day_air", + ), + ( + "eshipper_ups_expedited_second_day_air", + "eshipper_ups_expedited_second_day_air", + ), + ( + "eshipper_ups_worldwide_express", + "eshipper_ups_worldwide_express", + ), + ( + "eshipper_ups_worldwide_expedited", + "eshipper_ups_worldwide_expedited", + ), + ("eshipper_ups_standard_ground", "eshipper_ups_standard_ground"), + ( + "eshipper_ups_express_early_am_next_day_air_early_am", + "eshipper_ups_express_early_am_next_day_air_early_am", + ), + ("eshipper_ups_three_day_select", "eshipper_ups_three_day_select"), + ("eshipper_ups_saver", "eshipper_ups_saver"), + ("eshipper_ups_ground", "eshipper_ups_ground"), + ("eshipper_ups_next_day_saver", "eshipper_ups_next_day_saver"), + ( + "eshipper_ups_worldwide_express_plus", + "eshipper_ups_worldwide_express_plus", + ), + ( + "eshipper_ups_second_day_air_am", + "eshipper_ups_second_day_air_am", + ), + ("eshipper_canada_post_priority", "eshipper_canada_post_priority"), + ( + "eshipper_canada_post_xpresspost", + "eshipper_canada_post_xpresspost", + ), + ( + "eshipper_canada_post_expedited", + "eshipper_canada_post_expedited", + ), + ("eshipper_canada_post_regular", "eshipper_canada_post_regular"), + ( + "eshipper_canada_post_xpresspost_usa", + "eshipper_canada_post_xpresspost_usa", + ), + ( + "eshipper_canada_post_xpresspost_intl", + "eshipper_canada_post_xpresspost_intl", + ), + ( + "eshipper_canada_post_air_parcel_intl", + "eshipper_canada_post_air_parcel_intl", + ), + ( + "eshipper_canada_post_surface_parcel_intl", + "eshipper_canada_post_surface_parcel_intl", + ), + ( + "eshipper_canada_post_expedited_parcel_usa", + "eshipper_canada_post_expedited_parcel_usa", + ), + ("eshipper_tst_ltl", "eshipper_tst_ltl"), + ( + "eshipper_ltl_chicago_suburban_express", + "eshipper_ltl_chicago_suburban_express", + ), + ( + "eshipper_ltl_fedex_freight_east", + "eshipper_ltl_fedex_freight_east", + ), + ( + "eshipper_ltl_fedex_freight_west", + "eshipper_ltl_fedex_freight_west", + ), + ( + "eshipper_ltl_mid_states_express", + "eshipper_ltl_mid_states_express", + ), + ( + "eshipper_ltl_new_england_motor_freight", + "eshipper_ltl_new_england_motor_freight", + ), + ("eshipper_ltl_new_penn", "eshipper_ltl_new_penn"), + ("eshipper_ltl_oak_harbor", "eshipper_ltl_oak_harbor"), + ("eshipper_ltl_pitt_ohio", "eshipper_ltl_pitt_ohio"), + ("eshipper_ltl_r_l_carriers", "eshipper_ltl_r_l_carriers"), + ("eshipper_ltl_saia", "eshipper_ltl_saia"), + ("eshipper_ltl_usf_reddaway", "eshipper_ltl_usf_reddaway"), + ("eshipper_ltl_vitran_express", "eshipper_ltl_vitran_express"), + ("eshipper_ltl_wilson_trucking", "eshipper_ltl_wilson_trucking"), + ( + "eshipper_ltl_yellow_transportation", + "eshipper_ltl_yellow_transportation", + ), + ("eshipper_ltl_roadway", "eshipper_ltl_roadway"), + ("eshipper_ltl_fedex_national", "eshipper_ltl_fedex_national"), + ("eshipper_wilson_trucking_tfc", "eshipper_wilson_trucking_tfc"), + ( + "eshipper_aaa_cooper_transportation", + "eshipper_aaa_cooper_transportation", + ), + ("eshipper_roadrunner_dawes", "eshipper_roadrunner_dawes"), + ( + "eshipper_new_england_motor_freight", + "eshipper_new_england_motor_freight", + ), + ( + "eshipper_new_penn_motor_express", + "eshipper_new_penn_motor_express", + ), + ("eshipper_dayton_freight", "eshipper_dayton_freight"), + ( + "eshipper_southeastern_freightway", + "eshipper_southeastern_freightway", + ), + ("eshipper_saia_inc", "eshipper_saia_inc"), + ("eshipper_conway", "eshipper_conway"), + ("eshipper_roadway", "eshipper_roadway"), + ("eshipper_usf_reddaway", "eshipper_usf_reddaway"), + ("eshipper_usf_holland", "eshipper_usf_holland"), + ( + "eshipper_dependable_highway_express", + "eshipper_dependable_highway_express", + ), + ("eshipper_day_and_ross", "eshipper_day_and_ross"), + ("eshipper_day_and_ross_r_and_l", "eshipper_day_and_ross_r_and_l"), + ("eshipper_ups", "eshipper_ups"), + ("eshipper_aaa_cooper", "eshipper_aaa_cooper"), + ("eshipper_ama_transportation", "eshipper_ama_transportation"), + ("eshipper_averitt_express", "eshipper_averitt_express"), + ("eshipper_central_freight", "eshipper_central_freight"), + ("eshipper_conway_us", "eshipper_conway_us"), + ("eshipper_dayton", "eshipper_dayton"), + ("eshipper_drug_transport", "eshipper_drug_transport"), + ("eshipper_estes", "eshipper_estes"), + ("eshipper_land_air_express", "eshipper_land_air_express"), + ("eshipper_fedex_west", "eshipper_fedex_west"), + ("eshipper_fedex_national", "eshipper_fedex_national"), + ("eshipper_usf_holland_us", "eshipper_usf_holland_us"), + ("eshipper_lakeville_m_express", "eshipper_lakeville_m_express"), + ("eshipper_milan_express", "eshipper_milan_express"), + ("eshipper_nebraska_transport", "eshipper_nebraska_transport"), + ("eshipper_new_england", "eshipper_new_england"), + ("eshipper_new_penn", "eshipper_new_penn"), + ("eshipper_a_duie_pyle", "eshipper_a_duie_pyle"), + ("eshipper_roadway_us", "eshipper_roadway_us"), + ("eshipper_usf_reddaway_us", "eshipper_usf_reddaway_us"), + ("eshipper_rhody_transportation", "eshipper_rhody_transportation"), + ("eshipper_saia_motor_freight", "eshipper_saia_motor_freight"), + ("eshipper_southeastern_frgt", "eshipper_southeastern_frgt"), + ("eshipper_pitt_ohio", "eshipper_pitt_ohio"), + ("eshipper_ward", "eshipper_ward"), + ("eshipper_wilson", "eshipper_wilson"), + ("eshipper_chi_cargo", "eshipper_chi_cargo"), + ("eshipper_tax_air", "eshipper_tax_air"), + ("eshipper_fedex_east", "eshipper_fedex_east"), + ("eshipper_central_transport", "eshipper_central_transport"), + ("eshipper_roadrunner", "eshipper_roadrunner"), + ("eshipper_r_and_l_carriers", "eshipper_r_and_l_carriers"), + ("eshipper_estes_us", "eshipper_estes_us"), + ("eshipper_yrc_roadway", "eshipper_yrc_roadway"), + ("eshipper_central_transport_us", "eshipper_central_transport_us"), + ( + "eshipper_absolute_transportation_services", + "eshipper_absolute_transportation_services", + ), + ("eshipper_blue_sky_express", "eshipper_blue_sky_express"), + ("eshipper_galasso_trucking", "eshipper_galasso_trucking"), + ("eshipper_griley_air_freight", "eshipper_griley_air_freight"), + ("eshipper_jet_transportation", "eshipper_jet_transportation"), + ( + "eshipper_metro_transportation_logistics", + "eshipper_metro_transportation_logistics", + ), + ("eshipper_oak_harbor", "eshipper_oak_harbor"), + ("eshipper_stream_links_express", "eshipper_stream_links_express"), + ("eshipper_tiffany_trucking", "eshipper_tiffany_trucking"), + ("eshipper_ups_freight", "eshipper_ups_freight"), + ("eshipper_roadrunner_us", "eshipper_roadrunner_us"), + ( + "eshipper_global_mail_parcel_priority", + "eshipper_global_mail_parcel_priority", + ), + ( + "eshipper_global_mail_parcel_standard", + "eshipper_global_mail_parcel_standard", + ), + ( + "eshipper_global_mail_packet_plus_priority", + "eshipper_global_mail_packet_plus_priority", + ), + ( + "eshipper_global_mail_packet_priority", + "eshipper_global_mail_packet_priority", + ), + ( + "eshipper_global_mail_packet_standard", + "eshipper_global_mail_packet_standard", + ), + ( + "eshipper_global_mail_business_priority", + "eshipper_global_mail_business_priority", + ), + ( + "eshipper_global_mail_business_standard", + "eshipper_global_mail_business_standard", + ), + ( + "eshipper_global_mail_parcel_direct_priority", + "eshipper_global_mail_parcel_direct_priority", + ), + ( + "eshipper_global_mail_parcel_direct_standard", + "eshipper_global_mail_parcel_direct_standard", + ), + ("eshipper_canpar_ground", "eshipper_canpar_ground"), + ("eshipper_canpar_select_parcel", "eshipper_canpar_select_parcel"), + ( + "eshipper_canpar_express_parcel", + "eshipper_canpar_express_parcel", + ), + ("eshipper_fleet_optics_ground", "eshipper_fleet_optics_ground"), + ( + "fedex_europe_first_international_priority", + "fedex_europe_first_international_priority", + ), + ("fedex_1_day_freight", "fedex_1_day_freight"), + ("fedex_2_day", "fedex_2_day"), + ("fedex_2_day_am", "fedex_2_day_am"), + ("fedex_2_day_freight", "fedex_2_day_freight"), + ("fedex_3_day_freight", "fedex_3_day_freight"), + ( + "fedex_cargo_airport_to_airport", + "fedex_cargo_airport_to_airport", + ), + ( + "fedex_cargo_freight_forwarding", + "fedex_cargo_freight_forwarding", + ), + ( + "fedex_cargo_international_express_freight", + "fedex_cargo_international_express_freight", + ), + ( + "fedex_cargo_international_premium", + "fedex_cargo_international_premium", + ), + ("fedex_cargo_mail", "fedex_cargo_mail"), + ("fedex_cargo_registered_mail", "fedex_cargo_registered_mail"), + ("fedex_cargo_surface_mail", "fedex_cargo_surface_mail"), + ( + "fedex_custom_critical_air_expedite", + "fedex_custom_critical_air_expedite", + ), + ( + "fedex_custom_critical_air_expedite_exclusive_use", + "fedex_custom_critical_air_expedite_exclusive_use", + ), + ( + "fedex_custom_critical_air_expedite_network", + "fedex_custom_critical_air_expedite_network", + ), + ( + "fedex_custom_critical_charter_air", + "fedex_custom_critical_charter_air", + ), + ( + "fedex_custom_critical_point_to_point", + "fedex_custom_critical_point_to_point", + ), + ( + "fedex_custom_critical_surface_expedite", + "fedex_custom_critical_surface_expedite", + ), + ( + "fedex_custom_critical_surface_expedite_exclusive_use", + "fedex_custom_critical_surface_expedite_exclusive_use", + ), + ( + "fedex_custom_critical_temp_assure_air", + "fedex_custom_critical_temp_assure_air", + ), + ( + "fedex_custom_critical_temp_assure_validated_air", + "fedex_custom_critical_temp_assure_validated_air", + ), + ( + "fedex_custom_critical_white_glove_services", + "fedex_custom_critical_white_glove_services", + ), + ("fedex_distance_deferred", "fedex_distance_deferred"), + ("fedex_express_saver", "fedex_express_saver"), + ("fedex_first_freight", "fedex_first_freight"), + ("fedex_freight_economy", "fedex_freight_economy"), + ("fedex_freight_priority", "fedex_freight_priority"), + ("fedex_ground", "fedex_ground"), + ( + "fedex_international_priority_plus", + "fedex_international_priority_plus", + ), + ("fedex_next_day_afternoon", "fedex_next_day_afternoon"), + ("fedex_next_day_early_morning", "fedex_next_day_early_morning"), + ("fedex_next_day_end_of_day", "fedex_next_day_end_of_day"), + ("fedex_next_day_freight", "fedex_next_day_freight"), + ("fedex_next_day_mid_morning", "fedex_next_day_mid_morning"), + ("fedex_first_overnight", "fedex_first_overnight"), + ("fedex_ground_home_delivery", "fedex_ground_home_delivery"), + ( + "fedex_international_distribution_freight", + "fedex_international_distribution_freight", + ), + ("fedex_international_economy", "fedex_international_economy"), + ( + "fedex_international_economy_distribution", + "fedex_international_economy_distribution", + ), + ( + "fedex_international_economy_freight", + "fedex_international_economy_freight", + ), + ("fedex_international_first", "fedex_international_first"), + ("fedex_international_ground", "fedex_international_ground"), + ("fedex_international_priority", "fedex_international_priority"), + ( + "fedex_international_priority_distribution", + "fedex_international_priority_distribution", + ), + ( + "fedex_international_priority_express", + "fedex_international_priority_express", + ), + ( + "fedex_international_priority_freight", + "fedex_international_priority_freight", + ), + ("fedex_priority_overnight", "fedex_priority_overnight"), + ("fedex_same_day", "fedex_same_day"), + ("fedex_same_day_city", "fedex_same_day_city"), + ( + "fedex_same_day_metro_afternoon", + "fedex_same_day_metro_afternoon", + ), + ("fedex_same_day_metro_morning", "fedex_same_day_metro_morning"), + ("fedex_same_day_metro_rush", "fedex_same_day_metro_rush"), + ("fedex_smart_post", "fedex_smart_post"), + ("fedex_standard_overnight", "fedex_standard_overnight"), + ( + "fedex_transborder_distribution_consolidation", + "fedex_transborder_distribution_consolidation", + ), + ("freightcom_all", "freightcom_all"), + ("freightcom_usf_holland", "freightcom_usf_holland"), + ("freightcom_central_transport", "freightcom_central_transport"), + ("freightcom_estes", "freightcom_estes"), + ("freightcom_canpar_ground", "freightcom_canpar_ground"), + ("freightcom_canpar_select", "freightcom_canpar_select"), + ("freightcom_canpar_overnight", "freightcom_canpar_overnight"), + ("freightcom_dicom_ground", "freightcom_dicom_ground"), + ("freightcom_purolator_ground", "freightcom_purolator_ground"), + ("freightcom_purolator_express", "freightcom_purolator_express"), + ( + "freightcom_purolator_express_9_am", + "freightcom_purolator_express_9_am", + ), + ( + "freightcom_purolator_express_10_30_am", + "freightcom_purolator_express_10_30_am", + ), + ( + "freightcom_purolator_ground_us", + "freightcom_purolator_ground_us", + ), + ( + "freightcom_purolator_express_us", + "freightcom_purolator_express_us", + ), + ( + "freightcom_purolator_express_us_9_am", + "freightcom_purolator_express_us_9_am", + ), + ( + "freightcom_purolator_express_us_10_30_am", + "freightcom_purolator_express_us_10_30_am", + ), + ( + "freightcom_fedex_express_saver", + "freightcom_fedex_express_saver", + ), + ("freightcom_fedex_ground", "freightcom_fedex_ground"), + ("freightcom_fedex_2day", "freightcom_fedex_2day"), + ( + "freightcom_fedex_priority_overnight", + "freightcom_fedex_priority_overnight", + ), + ( + "freightcom_fedex_standard_overnight", + "freightcom_fedex_standard_overnight", + ), + ( + "freightcom_fedex_first_overnight", + "freightcom_fedex_first_overnight", + ), + ( + "freightcom_fedex_international_priority", + "freightcom_fedex_international_priority", + ), + ( + "freightcom_fedex_international_economy", + "freightcom_fedex_international_economy", + ), + ("freightcom_ups_standard", "freightcom_ups_standard"), + ("freightcom_ups_expedited", "freightcom_ups_expedited"), + ("freightcom_ups_express_saver", "freightcom_ups_express_saver"), + ("freightcom_ups_express", "freightcom_ups_express"), + ("freightcom_ups_express_early", "freightcom_ups_express_early"), + ("freightcom_ups_3day_select", "freightcom_ups_3day_select"), + ( + "freightcom_ups_worldwide_expedited", + "freightcom_ups_worldwide_expedited", + ), + ( + "freightcom_ups_worldwide_express", + "freightcom_ups_worldwide_express", + ), + ( + "freightcom_ups_worldwide_express_plus", + "freightcom_ups_worldwide_express_plus", + ), + ( + "freightcom_ups_worldwide_express_saver", + "freightcom_ups_worldwide_express_saver", + ), + ("freightcom_dhl_express_easy", "freightcom_dhl_express_easy"), + ("freightcom_dhl_express_10_30", "freightcom_dhl_express_10_30"), + ( + "freightcom_dhl_express_worldwide", + "freightcom_dhl_express_worldwide", + ), + ("freightcom_dhl_express_12_00", "freightcom_dhl_express_12_00"), + ("freightcom_dhl_economy_select", "freightcom_dhl_economy_select"), + ( + "freightcom_dhl_ecommerce_am_service", + "freightcom_dhl_ecommerce_am_service", + ), + ( + "freightcom_dhl_ecommerce_ground_service", + "freightcom_dhl_ecommerce_ground_service", + ), + ( + "freightcom_canadapost_regular_parcel", + "freightcom_canadapost_regular_parcel", + ), + ( + "freightcom_canadapost_expedited_parcel", + "freightcom_canadapost_expedited_parcel", + ), + ( + "freightcom_canadapost_xpresspost", + "freightcom_canadapost_xpresspost", + ), + ( + "freightcom_canadapost_priority", + "freightcom_canadapost_priority", + ), + ("standard_service", "standard_service"), + ("geodis_EXP", "geodis_EXP"), + ("geodis_MES", "geodis_MES"), + ("geodis_express_france", "geodis_express_france"), + ( + "geodis_retour_trans_fr_messagerie_plus", + "geodis_retour_trans_fr_messagerie_plus", + ), + ("locate2u_local_delivery", "locate2u_local_delivery"), + ("purolator_express_9_am", "purolator_express_9_am"), + ("purolator_express_us", "purolator_express_us"), + ("purolator_express_10_30_am", "purolator_express_10_30_am"), + ("purolator_express_us_9_am", "purolator_express_us_9_am"), + ("purolator_express_12_pm", "purolator_express_12_pm"), + ("purolator_express_us_10_30_am", "purolator_express_us_10_30_am"), + ("purolator_express", "purolator_express"), + ("purolator_express_us_12_00", "purolator_express_us_12_00"), + ("purolator_express_evening", "purolator_express_evening"), + ("purolator_express_envelope_us", "purolator_express_envelope_us"), + ( + "purolator_express_envelope_9_am", + "purolator_express_envelope_9_am", + ), + ( + "purolator_express_us_envelope_9_am", + "purolator_express_us_envelope_9_am", + ), + ( + "purolator_express_envelope_10_30_am", + "purolator_express_envelope_10_30_am", + ), + ( + "purolator_express_us_envelope_10_30_am", + "purolator_express_us_envelope_10_30_am", + ), + ( + "purolator_express_envelope_12_pm", + "purolator_express_envelope_12_pm", + ), + ( + "purolator_express_us_envelope_12_00", + "purolator_express_us_envelope_12_00", + ), + ("purolator_express_envelope", "purolator_express_envelope"), + ("purolator_express_pack_us", "purolator_express_pack_us"), + ( + "purolator_express_envelope_evening", + "purolator_express_envelope_evening", + ), + ( + "purolator_express_us_pack_9_am", + "purolator_express_us_pack_9_am", + ), + ("purolator_express_pack_9_am", "purolator_express_pack_9_am"), + ( + "purolator_express_us_pack_10_30_am", + "purolator_express_us_pack_10_30_am", + ), + ( + "purolator_express_pack10_30_am", + "purolator_express_pack10_30_am", + ), + ( + "purolator_express_us_pack_12_00", + "purolator_express_us_pack_12_00", + ), + ("purolator_express_pack_12_pm", "purolator_express_pack_12_pm"), + ("purolator_express_box_us", "purolator_express_box_us"), + ("purolator_express_pack", "purolator_express_pack"), + ("purolator_express_us_box_9_am", "purolator_express_us_box_9_am"), + ( + "purolator_express_pack_evening", + "purolator_express_pack_evening", + ), + ( + "purolator_express_us_box_10_30_am", + "purolator_express_us_box_10_30_am", + ), + ("purolator_express_box_9_am", "purolator_express_box_9_am"), + ( + "purolator_express_us_box_12_00", + "purolator_express_us_box_12_00", + ), + ( + "purolator_express_box_10_30_am", + "purolator_express_box_10_30_am", + ), + ("purolator_ground_us", "purolator_ground_us"), + ("purolator_express_box_12_pm", "purolator_express_box_12_pm"), + ( + "purolator_express_international", + "purolator_express_international", + ), + ("purolator_express_box", "purolator_express_box"), + ( + "purolator_express_international_9_am", + "purolator_express_international_9_am", + ), + ("purolator_express_box_evening", "purolator_express_box_evening"), + ( + "purolator_express_international_10_30_am", + "purolator_express_international_10_30_am", + ), + ("purolator_ground", "purolator_ground"), + ( + "purolator_express_international_12_00", + "purolator_express_international_12_00", + ), + ("purolator_ground_9_am", "purolator_ground_9_am"), + ( + "purolator_express_envelope_international", + "purolator_express_envelope_international", + ), + ("purolator_ground_10_30_am", "purolator_ground_10_30_am"), + ( + "purolator_express_international_envelope_9_am", + "purolator_express_international_envelope_9_am", + ), + ("purolator_ground_evening", "purolator_ground_evening"), + ( + "purolator_express_international_envelope_10_30_am", + "purolator_express_international_envelope_10_30_am", + ), + ("purolator_quick_ship", "purolator_quick_ship"), + ( + "purolator_express_international_envelope_12_00", + "purolator_express_international_envelope_12_00", + ), + ("purolator_quick_ship_envelope", "purolator_quick_ship_envelope"), + ( + "purolator_express_pack_international", + "purolator_express_pack_international", + ), + ("purolator_quick_ship_pack", "purolator_quick_ship_pack"), + ( + "purolator_express_international_pack_9_am", + "purolator_express_international_pack_9_am", + ), + ("purolator_quick_ship_box", "purolator_quick_ship_box"), + ( + "purolator_express_international_pack_10_30_am", + "purolator_express_international_pack_10_30_am", + ), + ( + "purolator_express_international_pack_12_00", + "purolator_express_international_pack_12_00", + ), + ( + "purolator_express_box_international", + "purolator_express_box_international", + ), + ( + "purolator_express_international_box_9_am", + "purolator_express_international_box_9_am", + ), + ( + "purolator_express_international_box_10_30_am", + "purolator_express_international_box_10_30_am", + ), + ( + "purolator_express_international_box_12_00", + "purolator_express_international_box_12_00", + ), + ("roadie_local_delivery", "roadie_local_delivery"), + ("sendle_standard_pickup", "sendle_standard_pickup"), + ("sendle_standard_dropoff", "sendle_standard_dropoff"), + ("sendle_express_pickup", "sendle_express_pickup"), + ("tnt_special_express", "tnt_special_express"), + ("tnt_9_00_express", "tnt_9_00_express"), + ("tnt_10_00_express", "tnt_10_00_express"), + ("tnt_12_00_express", "tnt_12_00_express"), + ("tnt_express", "tnt_express"), + ("tnt_economy_express", "tnt_economy_express"), + ("tnt_global_express", "tnt_global_express"), + ("ups_standard", "ups_standard"), + ("ups_worldwide_express", "ups_worldwide_express"), + ("ups_worldwide_expedited", "ups_worldwide_expedited"), + ("ups_worldwide_express_plus", "ups_worldwide_express_plus"), + ("ups_worldwide_saver", "ups_worldwide_saver"), + ("ups_2nd_day_air", "ups_2nd_day_air"), + ("ups_2nd_day_air_am", "ups_2nd_day_air_am"), + ("ups_3_day_select", "ups_3_day_select"), + ("ups_ground", "ups_ground"), + ("ups_next_day_air", "ups_next_day_air"), + ("ups_next_day_air_early", "ups_next_day_air_early"), + ("ups_next_day_air_saver", "ups_next_day_air_saver"), + ("ups_expedited_ca", "ups_expedited_ca"), + ("ups_express_saver_ca", "ups_express_saver_ca"), + ("ups_3_day_select_ca_us", "ups_3_day_select_ca_us"), + ("ups_access_point_economy_ca", "ups_access_point_economy_ca"), + ("ups_express_ca", "ups_express_ca"), + ("ups_express_early_ca", "ups_express_early_ca"), + ("ups_express_saver_intl_ca", "ups_express_saver_intl_ca"), + ("ups_standard_ca", "ups_standard_ca"), + ("ups_worldwide_expedited_ca", "ups_worldwide_expedited_ca"), + ("ups_worldwide_express_ca", "ups_worldwide_express_ca"), + ("ups_worldwide_express_plus_ca", "ups_worldwide_express_plus_ca"), + ("ups_express_early_ca_us", "ups_express_early_ca_us"), + ("ups_access_point_economy_eu", "ups_access_point_economy_eu"), + ("ups_expedited_eu", "ups_expedited_eu"), + ("ups_express_eu", "ups_express_eu"), + ("ups_standard_eu", "ups_standard_eu"), + ("ups_worldwide_express_plus_eu", "ups_worldwide_express_plus_eu"), + ("ups_worldwide_saver_eu", "ups_worldwide_saver_eu"), + ("ups_access_point_economy_mx", "ups_access_point_economy_mx"), + ("ups_expedited_mx", "ups_expedited_mx"), + ("ups_express_mx", "ups_express_mx"), + ("ups_standard_mx", "ups_standard_mx"), + ("ups_worldwide_express_plus_mx", "ups_worldwide_express_plus_mx"), + ("ups_worldwide_saver_mx", "ups_worldwide_saver_mx"), + ("ups_access_point_economy_pl", "ups_access_point_economy_pl"), + ( + "ups_today_dedicated_courrier_pl", + "ups_today_dedicated_courrier_pl", + ), + ("ups_today_express_pl", "ups_today_express_pl"), + ("ups_today_express_saver_pl", "ups_today_express_saver_pl"), + ("ups_today_standard_pl", "ups_today_standard_pl"), + ("ups_expedited_pl", "ups_expedited_pl"), + ("ups_express_pl", "ups_express_pl"), + ("ups_express_plus_pl", "ups_express_plus_pl"), + ("ups_express_saver_pl", "ups_express_saver_pl"), + ("ups_standard_pl", "ups_standard_pl"), + ("ups_2nd_day_air_pr", "ups_2nd_day_air_pr"), + ("ups_ground_pr", "ups_ground_pr"), + ("ups_next_day_air_pr", "ups_next_day_air_pr"), + ("ups_next_day_air_early_pr", "ups_next_day_air_early_pr"), + ("ups_worldwide_expedited_pr", "ups_worldwide_expedited_pr"), + ("ups_worldwide_express_pr", "ups_worldwide_express_pr"), + ("ups_worldwide_express_plus_pr", "ups_worldwide_express_plus_pr"), + ("ups_worldwide_saver_pr", "ups_worldwide_saver_pr"), + ("ups_express_12_00_de", "ups_express_12_00_de"), + ("ups_worldwide_express_freight", "ups_worldwide_express_freight"), + ( + "ups_worldwide_express_freight_midday", + "ups_worldwide_express_freight_midday", + ), + ("ups_worldwide_economy_ddu", "ups_worldwide_economy_ddu"), + ("ups_worldwide_economy_ddp", "ups_worldwide_economy_ddp"), + ("usps_first_class", "usps_first_class"), + ("usps_first_class_commercial", "usps_first_class_commercial"), + ( + "usps_first_class_hfp_commercial", + "usps_first_class_hfp_commercial", + ), + ("usps_priority", "usps_priority"), + ("usps_priority_commercial", "usps_priority_commercial"), + ("usps_priority_cpp", "usps_priority_cpp"), + ("usps_priority_hfp_commercial", "usps_priority_hfp_commercial"), + ("usps_priority_hfp_cpp", "usps_priority_hfp_cpp"), + ("usps_priority_mail_express", "usps_priority_mail_express"), + ( + "usps_priority_mail_express_commercial", + "usps_priority_mail_express_commercial", + ), + ( + "usps_priority_mail_express_cpp", + "usps_priority_mail_express_cpp", + ), + ("usps_priority_mail_express_sh", "usps_priority_mail_express_sh"), + ( + "usps_priority_mail_express_sh_commercial", + "usps_priority_mail_express_sh_commercial", + ), + ( + "usps_priority_mail_express_hfp", + "usps_priority_mail_express_hfp", + ), + ( + "usps_priority_mail_express_hfp_commercial", + "usps_priority_mail_express_hfp_commercial", + ), + ( + "usps_priority_mail_express_hfp_cpp", + "usps_priority_mail_express_hfp_cpp", + ), + ("usps_priority_mail_cubic", "usps_priority_mail_cubic"), + ("usps_retail_ground", "usps_retail_ground"), + ("usps_media", "usps_media"), + ("usps_library", "usps_library"), + ("usps_all", "usps_all"), + ("usps_online", "usps_online"), + ("usps_plus", "usps_plus"), + ("usps_bpm", "usps_bpm"), + ("usps_ground_advantage", "usps_ground_advantage"), + ( + "usps_ground_advantage_commercial", + "usps_ground_advantage_commercial", + ), + ("usps_ground_advantage_hfp", "usps_ground_advantage_hfp"), + ( + "usps_ground_advantage_hfp_commercial", + "usps_ground_advantage_hfp_commercial", + ), + ("usps_ground_advantage_cubic", "usps_ground_advantage_cubic"), + ("usps_first_class", "usps_first_class"), + ("usps_first_class_commercial", "usps_first_class_commercial"), + ( + "usps_first_class_hfp_commercial", + "usps_first_class_hfp_commercial", + ), + ("usps_priority", "usps_priority"), + ("usps_priority_commercial", "usps_priority_commercial"), + ("usps_priority_cpp", "usps_priority_cpp"), + ("usps_priority_hfp_commercial", "usps_priority_hfp_commercial"), + ("usps_priority_hfp_cpp", "usps_priority_hfp_cpp"), + ("usps_priority_mail_express", "usps_priority_mail_express"), + ( + "usps_priority_mail_express_commercial", + "usps_priority_mail_express_commercial", + ), + ( + "usps_priority_mail_express_cpp", + "usps_priority_mail_express_cpp", + ), + ("usps_priority_mail_express_sh", "usps_priority_mail_express_sh"), + ( + "usps_priority_mail_express_sh_commercial", + "usps_priority_mail_express_sh_commercial", + ), + ( + "usps_priority_mail_express_hfp", + "usps_priority_mail_express_hfp", + ), + ( + "usps_priority_mail_express_hfp_commercial", + "usps_priority_mail_express_hfp_commercial", + ), + ( + "usps_priority_mail_express_hfp_cpp", + "usps_priority_mail_express_hfp_cpp", + ), + ("usps_priority_mail_cubic", "usps_priority_mail_cubic"), + ("usps_retail_ground", "usps_retail_ground"), + ("usps_media", "usps_media"), + ("usps_library", "usps_library"), + ("usps_all", "usps_all"), + ("usps_online", "usps_online"), + ("usps_plus", "usps_plus"), + ("usps_bpm", "usps_bpm"), + ("zoom2u_VIP", "zoom2u_VIP"), + ("zoom2u_3_hour", "zoom2u_3_hour"), + ("zoom2u_same_day", "zoom2u_same_day"), + ], + help_text="\n The list of services you want to apply the surcharge to.\n
\n Note that by default, the surcharge is applied to all services\n ", + null=True, + ), + ), + ] diff --git a/modules/pricing/karrio/server/pricing/migrations/0047_alter_surcharge_services.py b/modules/pricing/karrio/server/pricing/migrations/0047_alter_surcharge_services.py new file mode 100644 index 0000000000..884f63caa2 --- /dev/null +++ b/modules/pricing/karrio/server/pricing/migrations/0047_alter_surcharge_services.py @@ -0,0 +1,3171 @@ +# Generated by Django 4.2.10 on 2024-02-25 10:20 + +from django.db import migrations +import karrio.server.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ("pricing", "0046_alter_surcharge_services"), + ] + + operations = [ + migrations.AlterField( + model_name="surcharge", + name="services", + field=karrio.server.core.fields.MultiChoiceField( + blank=True, + choices=[ + ("allied_road_service", "allied_road_service"), + ("allied_parcel_service", "allied_parcel_service"), + ( + "allied_standard_pallet_service", + "allied_standard_pallet_service", + ), + ( + "allied_oversized_pallet_service", + "allied_oversized_pallet_service", + ), + ("allied_road_service", "allied_road_service"), + ("allied_parcel_service", "allied_parcel_service"), + ( + "allied_standard_pallet_service", + "allied_standard_pallet_service", + ), + ( + "allied_oversized_pallet_service", + "allied_oversized_pallet_service", + ), + ("allied_local_normal_service", "allied_local_normal_service"), + ("allied_local_vip_service", "allied_local_vip_service"), + ( + "allied_local_executive_service", + "allied_local_executive_service", + ), + ("allied_local_gold_service", "allied_local_gold_service"), + ("amazon_shipping_ground", "amazon_shipping_ground"), + ("amazon_shipping_standard", "amazon_shipping_standard"), + ("amazon_shipping_premium", "amazon_shipping_premium"), + ("asendia_us_e_com_tracked_ddp", "asendia_us_e_com_tracked_ddp"), + ("asendia_us_fully_tracked", "asendia_us_fully_tracked"), + ("asendia_us_country_tracked", "asendia_us_country_tracked"), + ("australiapost_parcel_post", "australiapost_parcel_post"), + ("australiapost_express_post", "australiapost_express_post"), + ( + "australiapost_parcel_post_signature", + "australiapost_parcel_post_signature", + ), + ( + "australiapost_express_post_signature", + "australiapost_express_post_signature", + ), + ("boxknight_sameday", "boxknight_sameday"), + ("boxknight_nextday", "boxknight_nextday"), + ("boxknight_scheduled", "boxknight_scheduled"), + ("bpack_24h_pro", "bpack_24h_pro"), + ("bpack_24h_business", "bpack_24h_business"), + ("bpack_bus", "bpack_bus"), + ("bpack_pallet", "bpack_pallet"), + ("bpack_easy_retour", "bpack_easy_retour"), + ("bpack_xl", "bpack_xl"), + ("bpack_bpost", "bpack_bpost"), + ("bpack_24_7", "bpack_24_7"), + ("bpack_world_business", "bpack_world_business"), + ("bpack_world_express_pro", "bpack_world_express_pro"), + ("bpack_europe_business", "bpack_europe_business"), + ("bpack_world_easy_return", "bpack_world_easy_return"), + ("bpack_bpost_international", "bpack_bpost_international"), + ("bpack_24_7_international", "bpack_24_7_international"), + ("canadapost_regular_parcel", "canadapost_regular_parcel"), + ("canadapost_expedited_parcel", "canadapost_expedited_parcel"), + ("canadapost_xpresspost", "canadapost_xpresspost"), + ( + "canadapost_xpresspost_certified", + "canadapost_xpresspost_certified", + ), + ("canadapost_priority", "canadapost_priority"), + ("canadapost_library_books", "canadapost_library_books"), + ( + "canadapost_expedited_parcel_usa", + "canadapost_expedited_parcel_usa", + ), + ( + "canadapost_priority_worldwide_envelope_usa", + "canadapost_priority_worldwide_envelope_usa", + ), + ( + "canadapost_priority_worldwide_pak_usa", + "canadapost_priority_worldwide_pak_usa", + ), + ( + "canadapost_priority_worldwide_parcel_usa", + "canadapost_priority_worldwide_parcel_usa", + ), + ( + "canadapost_small_packet_usa_air", + "canadapost_small_packet_usa_air", + ), + ("canadapost_tracked_packet_usa", "canadapost_tracked_packet_usa"), + ( + "canadapost_tracked_packet_usa_lvm", + "canadapost_tracked_packet_usa_lvm", + ), + ("canadapost_xpresspost_usa", "canadapost_xpresspost_usa"), + ( + "canadapost_xpresspost_international", + "canadapost_xpresspost_international", + ), + ( + "canadapost_international_parcel_air", + "canadapost_international_parcel_air", + ), + ( + "canadapost_international_parcel_surface", + "canadapost_international_parcel_surface", + ), + ( + "canadapost_priority_worldwide_envelope_intl", + "canadapost_priority_worldwide_envelope_intl", + ), + ( + "canadapost_priority_worldwide_pak_intl", + "canadapost_priority_worldwide_pak_intl", + ), + ( + "canadapost_priority_worldwide_parcel_intl", + "canadapost_priority_worldwide_parcel_intl", + ), + ( + "canadapost_small_packet_international_air", + "canadapost_small_packet_international_air", + ), + ( + "canadapost_small_packet_international_surface", + "canadapost_small_packet_international_surface", + ), + ( + "canadapost_tracked_packet_international", + "canadapost_tracked_packet_international", + ), + ("chronopost_retrait_bureau", "chronopost_retrait_bureau"), + ("chronopost_13", "chronopost_13"), + ("chronopost_10", "chronopost_10"), + ("chronopost_18", "chronopost_18"), + ("chronopost_relais", "chronopost_relais"), + ( + "chronopost_express_international", + "chronopost_express_international", + ), + ( + "chronopost_premium_international", + "chronopost_premium_international", + ), + ( + "chronopost_classic_international", + "chronopost_classic_international", + ), + ( + "colissimo_home_without_signature", + "colissimo_home_without_signature", + ), + ("colissimo_home_with_signature", "colissimo_home_with_signature"), + ("colissimo_eco_france", "colissimo_eco_france"), + ("colissimo_return_france", "colissimo_return_france"), + ( + "colissimo_flash_without_signature", + "colissimo_flash_without_signature", + ), + ( + "colissimo_flash_with_signature", + "colissimo_flash_with_signature", + ), + ( + "colissimo_oversea_home_without_signature", + "colissimo_oversea_home_without_signature", + ), + ( + "colissimo_oversea_home_with_signature", + "colissimo_oversea_home_with_signature", + ), + ( + "colissimo_eco_om_without_signature", + "colissimo_eco_om_without_signature", + ), + ( + "colissimo_eco_om_with_signature", + "colissimo_eco_om_with_signature", + ), + ("colissimo_retour_om", "colissimo_retour_om"), + ( + "colissimo_return_international_from_france", + "colissimo_return_international_from_france", + ), + ( + "colissimo_economical_big_export_offer", + "colissimo_economical_big_export_offer", + ), + ( + "colissimo_out_of_home_national_international", + "colissimo_out_of_home_national_international", + ), + ("dhl_logistics_services", "dhl_logistics_services"), + ("dhl_domestic_express_12_00", "dhl_domestic_express_12_00"), + ("dhl_express_choice", "dhl_express_choice"), + ("dhl_express_choice_nondoc", "dhl_express_choice_nondoc"), + ("dhl_jetline", "dhl_jetline"), + ("dhl_sprintline", "dhl_sprintline"), + ("dhl_air_capacity_sales", "dhl_air_capacity_sales"), + ("dhl_express_easy", "dhl_express_easy"), + ("dhl_express_easy_nondoc", "dhl_express_easy_nondoc"), + ("dhl_parcel_product", "dhl_parcel_product"), + ("dhl_accounting", "dhl_accounting"), + ("dhl_breakbulk_express", "dhl_breakbulk_express"), + ("dhl_medical_express", "dhl_medical_express"), + ("dhl_express_worldwide_doc", "dhl_express_worldwide_doc"), + ("dhl_express_9_00_nondoc", "dhl_express_9_00_nondoc"), + ("dhl_freight_worldwide_nondoc", "dhl_freight_worldwide_nondoc"), + ("dhl_economy_select_domestic", "dhl_economy_select_domestic"), + ("dhl_economy_select_nondoc", "dhl_economy_select_nondoc"), + ("dhl_express_domestic_9_00", "dhl_express_domestic_9_00"), + ("dhl_jumbo_box_nondoc", "dhl_jumbo_box_nondoc"), + ("dhl_express_9_00", "dhl_express_9_00"), + ("dhl_express_10_30", "dhl_express_10_30"), + ("dhl_express_10_30_nondoc", "dhl_express_10_30_nondoc"), + ("dhl_express_domestic", "dhl_express_domestic"), + ("dhl_express_domestic_10_30", "dhl_express_domestic_10_30"), + ("dhl_express_worldwide_nondoc", "dhl_express_worldwide_nondoc"), + ("dhl_medical_express_nondoc", "dhl_medical_express_nondoc"), + ("dhl_globalmail", "dhl_globalmail"), + ("dhl_same_day", "dhl_same_day"), + ("dhl_express_12_00", "dhl_express_12_00"), + ("dhl_express_worldwide", "dhl_express_worldwide"), + ("dhl_parcel_product_nondoc", "dhl_parcel_product_nondoc"), + ("dhl_economy_select", "dhl_economy_select"), + ("dhl_express_envelope", "dhl_express_envelope"), + ("dhl_express_12_00_nondoc", "dhl_express_12_00_nondoc"), + ("dhl_destination_charges", "dhl_destination_charges"), + ("dhl_express_all", "dhl_express_all"), + ("deutschepost_paket", "deutschepost_paket"), + ("deutschepost_warenpost", "deutschepost_warenpost"), + ("deutschepost_europaket", "deutschepost_europaket"), + ( + "deutschepost_paket_international", + "deutschepost_paket_international", + ), + ( + "deutschepost_warenpost_international", + "deutschepost_warenpost_international", + ), + ("dhl_poland_premium", "dhl_poland_premium"), + ("dhl_poland_polska", "dhl_poland_polska"), + ("dhl_poland_09", "dhl_poland_09"), + ("dhl_poland_12", "dhl_poland_12"), + ("dhl_poland_connect", "dhl_poland_connect"), + ("dhl_poland_international", "dhl_poland_international"), + ("dpd_cl", "dpd_cl"), + ("dpd_express_10h", "dpd_express_10h"), + ("dpd_express_12h", "dpd_express_12h"), + ("dpd_express_18h_guarantee", "dpd_express_18h_guarantee"), + ("dpd_express_b2b_predict", "dpd_express_b2b_predict"), + ("dpdhl_paket", "dpdhl_paket"), + ("dpdhl_paket_international", "dpdhl_paket_international"), + ("dpdhl_europaket", "dpdhl_europaket"), + ("dpdhl_paket_connect", "dpdhl_paket_connect"), + ("dpdhl_warenpost", "dpdhl_warenpost"), + ("dpdhl_warenpost_international", "dpdhl_warenpost_international"), + ("dpdhl_retoure", "dpdhl_retoure"), + ("easypost_amazonmws_ups_rates", "easypost_amazonmws_ups_rates"), + ("easypost_amazonmws_usps_rates", "easypost_amazonmws_usps_rates"), + ( + "easypost_amazonmws_fedex_rates", + "easypost_amazonmws_fedex_rates", + ), + ("easypost_amazonmws_ups_labels", "easypost_amazonmws_ups_labels"), + ( + "easypost_amazonmws_usps_labels", + "easypost_amazonmws_usps_labels", + ), + ( + "easypost_amazonmws_fedex_labels", + "easypost_amazonmws_fedex_labels", + ), + ( + "easypost_amazonmws_ups_tracking", + "easypost_amazonmws_ups_tracking", + ), + ( + "easypost_amazonmws_usps_tracking", + "easypost_amazonmws_usps_tracking", + ), + ( + "easypost_amazonmws_fedex_tracking", + "easypost_amazonmws_fedex_tracking", + ), + ( + "easypost_apc_parcel_connect_book_service", + "easypost_apc_parcel_connect_book_service", + ), + ( + "easypost_apc_parcel_connect_expedited_ddp", + "easypost_apc_parcel_connect_expedited_ddp", + ), + ( + "easypost_apc_parcel_connect_expedited_ddu", + "easypost_apc_parcel_connect_expedited_ddu", + ), + ( + "easypost_apc_parcel_connect_priority_ddp", + "easypost_apc_parcel_connect_priority_ddp", + ), + ( + "easypost_apc_parcel_connect_priority_ddp_delcon", + "easypost_apc_parcel_connect_priority_ddp_delcon", + ), + ( + "easypost_apc_parcel_connect_priority_ddu", + "easypost_apc_parcel_connect_priority_ddu", + ), + ( + "easypost_apc_parcel_connect_priority_ddu_delcon", + "easypost_apc_parcel_connect_priority_ddu_delcon", + ), + ( + "easypost_apc_parcel_connect_priority_ddupqw", + "easypost_apc_parcel_connect_priority_ddupqw", + ), + ( + "easypost_apc_parcel_connect_standard_ddu", + "easypost_apc_parcel_connect_standard_ddu", + ), + ( + "easypost_apc_parcel_connect_standard_ddupqw", + "easypost_apc_parcel_connect_standard_ddupqw", + ), + ( + "easypost_apc_parcel_connect_packet_ddu", + "easypost_apc_parcel_connect_packet_ddu", + ), + ("easypost_asendia_pmi", "easypost_asendia_pmi"), + ("easypost_asendia_e_packet", "easypost_asendia_e_packet"), + ("easypost_asendia_ipa", "easypost_asendia_ipa"), + ("easypost_asendia_isal", "easypost_asendia_isal"), + ("easypost_asendia_us_ads", "easypost_asendia_us_ads"), + ( + "easypost_asendia_us_air_freight_inbound", + "easypost_asendia_us_air_freight_inbound", + ), + ( + "easypost_asendia_us_air_freight_outbound", + "easypost_asendia_us_air_freight_outbound", + ), + ( + "easypost_asendia_us_domestic_bound_printer_matter_expedited", + "easypost_asendia_us_domestic_bound_printer_matter_expedited", + ), + ( + "easypost_asendia_us_domestic_bound_printer_matter_ground", + "easypost_asendia_us_domestic_bound_printer_matter_ground", + ), + ( + "easypost_asendia_us_domestic_flats_expedited", + "easypost_asendia_us_domestic_flats_expedited", + ), + ( + "easypost_asendia_us_domestic_flats_ground", + "easypost_asendia_us_domestic_flats_ground", + ), + ( + "easypost_asendia_us_domestic_parcel_ground_over1lb", + "easypost_asendia_us_domestic_parcel_ground_over1lb", + ), + ( + "easypost_asendia_us_domestic_parcel_ground_under1lb", + "easypost_asendia_us_domestic_parcel_ground_under1lb", + ), + ( + "easypost_asendia_us_domestic_parcel_max_over1lb", + "easypost_asendia_us_domestic_parcel_max_over1lb", + ), + ( + "easypost_asendia_us_domestic_parcel_max_under1lb", + "easypost_asendia_us_domestic_parcel_max_under1lb", + ), + ( + "easypost_asendia_us_domestic_parcel_over1lb_expedited", + "easypost_asendia_us_domestic_parcel_over1lb_expedited", + ), + ( + "easypost_asendia_us_domestic_parcel_under1lb_expedited", + "easypost_asendia_us_domestic_parcel_under1lb_expedited", + ), + ( + "easypost_asendia_us_domestic_promo_parcel_expedited", + "easypost_asendia_us_domestic_promo_parcel_expedited", + ), + ( + "easypost_asendia_us_domestic_promo_parcel_ground", + "easypost_asendia_us_domestic_promo_parcel_ground", + ), + ( + "easypost_asendia_us_bulk_freight", + "easypost_asendia_us_bulk_freight", + ), + ( + "easypost_asendia_us_business_mail_canada_lettermail", + "easypost_asendia_us_business_mail_canada_lettermail", + ), + ( + "easypost_asendia_us_business_mail_canada_lettermail_machineable", + "easypost_asendia_us_business_mail_canada_lettermail_machineable", + ), + ( + "easypost_asendia_us_business_mail_economy", + "easypost_asendia_us_business_mail_economy", + ), + ( + "easypost_asendia_us_business_mail_economy_lp_wholesale", + "easypost_asendia_us_business_mail_economy_lp_wholesale", + ), + ( + "easypost_asendia_us_business_mail_economy_sp_wholesale", + "easypost_asendia_us_business_mail_economy_sp_wholesale", + ), + ( + "easypost_asendia_us_business_mail_ipa", + "easypost_asendia_us_business_mail_ipa", + ), + ( + "easypost_asendia_us_business_mail_isal", + "easypost_asendia_us_business_mail_isal", + ), + ( + "easypost_asendia_us_business_mail_priority", + "easypost_asendia_us_business_mail_priority", + ), + ( + "easypost_asendia_us_business_mail_priority_lp_wholesale", + "easypost_asendia_us_business_mail_priority_lp_wholesale", + ), + ( + "easypost_asendia_us_business_mail_priority_sp_wholesale", + "easypost_asendia_us_business_mail_priority_sp_wholesale", + ), + ( + "easypost_asendia_us_marketing_mail_canada_personalized_lcp", + "easypost_asendia_us_marketing_mail_canada_personalized_lcp", + ), + ( + "easypost_asendia_us_marketing_mail_canada_personalized_machineable", + "easypost_asendia_us_marketing_mail_canada_personalized_machineable", + ), + ( + "easypost_asendia_us_marketing_mail_canada_personalized_ndg", + "easypost_asendia_us_marketing_mail_canada_personalized_ndg", + ), + ( + "easypost_asendia_us_marketing_mail_economy", + "easypost_asendia_us_marketing_mail_economy", + ), + ( + "easypost_asendia_us_marketing_mail_ipa", + "easypost_asendia_us_marketing_mail_ipa", + ), + ( + "easypost_asendia_us_marketing_mail_isal", + "easypost_asendia_us_marketing_mail_isal", + ), + ( + "easypost_asendia_us_marketing_mail_priority", + "easypost_asendia_us_marketing_mail_priority", + ), + ( + "easypost_asendia_us_publications_canada_lcp", + "easypost_asendia_us_publications_canada_lcp", + ), + ( + "easypost_asendia_us_publications_canada_ndg", + "easypost_asendia_us_publications_canada_ndg", + ), + ( + "easypost_asendia_us_publications_economy", + "easypost_asendia_us_publications_economy", + ), + ( + "easypost_asendia_us_publications_ipa", + "easypost_asendia_us_publications_ipa", + ), + ( + "easypost_asendia_us_publications_isal", + "easypost_asendia_us_publications_isal", + ), + ( + "easypost_asendia_us_publications_priority", + "easypost_asendia_us_publications_priority", + ), + ( + "easypost_asendia_us_epaq_elite", + "easypost_asendia_us_epaq_elite", + ), + ( + "easypost_asendia_us_epaq_elite_custom", + "easypost_asendia_us_epaq_elite_custom", + ), + ( + "easypost_asendia_us_epaq_elite_dap", + "easypost_asendia_us_epaq_elite_dap", + ), + ( + "easypost_asendia_us_epaq_elite_ddp", + "easypost_asendia_us_epaq_elite_ddp", + ), + ( + "easypost_asendia_us_epaq_elite_ddp_oversized", + "easypost_asendia_us_epaq_elite_ddp_oversized", + ), + ( + "easypost_asendia_us_epaq_elite_dpd", + "easypost_asendia_us_epaq_elite_dpd", + ), + ( + "easypost_asendia_us_epaq_elite_direct_access_canada_ddp", + "easypost_asendia_us_epaq_elite_direct_access_canada_ddp", + ), + ( + "easypost_asendia_us_epaq_elite_oversized", + "easypost_asendia_us_epaq_elite_oversized", + ), + ("easypost_asendia_us_epaq_plus", "easypost_asendia_us_epaq_plus"), + ( + "easypost_asendia_us_epaq_plus_custom", + "easypost_asendia_us_epaq_plus_custom", + ), + ( + "easypost_asendia_us_epaq_plus_customs_prepaid", + "easypost_asendia_us_epaq_plus_customs_prepaid", + ), + ( + "easypost_asendia_us_epaq_plus_dap", + "easypost_asendia_us_epaq_plus_dap", + ), + ( + "easypost_asendia_us_epaq_plus_ddp", + "easypost_asendia_us_epaq_plus_ddp", + ), + ( + "easypost_asendia_us_epaq_plus_economy", + "easypost_asendia_us_epaq_plus_economy", + ), + ( + "easypost_asendia_us_epaq_plus_wholesale", + "easypost_asendia_us_epaq_plus_wholesale", + ), + ( + "easypost_asendia_us_epaq_pluse_packet", + "easypost_asendia_us_epaq_pluse_packet", + ), + ( + "easypost_asendia_us_epaq_pluse_packet_canada_customs_pre_paid", + "easypost_asendia_us_epaq_pluse_packet_canada_customs_pre_paid", + ), + ( + "easypost_asendia_us_epaq_pluse_packet_canada_ddp", + "easypost_asendia_us_epaq_pluse_packet_canada_ddp", + ), + ( + "easypost_asendia_us_epaq_returns_domestic", + "easypost_asendia_us_epaq_returns_domestic", + ), + ( + "easypost_asendia_us_epaq_returns_international", + "easypost_asendia_us_epaq_returns_international", + ), + ( + "easypost_asendia_us_epaq_select", + "easypost_asendia_us_epaq_select", + ), + ( + "easypost_asendia_us_epaq_select_custom", + "easypost_asendia_us_epaq_select_custom", + ), + ( + "easypost_asendia_us_epaq_select_customs_prepaid_by_shopper", + "easypost_asendia_us_epaq_select_customs_prepaid_by_shopper", + ), + ( + "easypost_asendia_us_epaq_select_dap", + "easypost_asendia_us_epaq_select_dap", + ), + ( + "easypost_asendia_us_epaq_select_ddp", + "easypost_asendia_us_epaq_select_ddp", + ), + ( + "easypost_asendia_us_epaq_select_ddp_direct_access", + "easypost_asendia_us_epaq_select_ddp_direct_access", + ), + ( + "easypost_asendia_us_epaq_select_direct_access", + "easypost_asendia_us_epaq_select_direct_access", + ), + ( + "easypost_asendia_us_epaq_select_direct_access_canada_ddp", + "easypost_asendia_us_epaq_select_direct_access_canada_ddp", + ), + ( + "easypost_asendia_us_epaq_select_economy", + "easypost_asendia_us_epaq_select_economy", + ), + ( + "easypost_asendia_us_epaq_select_oversized", + "easypost_asendia_us_epaq_select_oversized", + ), + ( + "easypost_asendia_us_epaq_select_oversized_ddp", + "easypost_asendia_us_epaq_select_oversized_ddp", + ), + ( + "easypost_asendia_us_epaq_select_pmei", + "easypost_asendia_us_epaq_select_pmei", + ), + ( + "easypost_asendia_us_epaq_select_pmei_canada_customs_pre_paid", + "easypost_asendia_us_epaq_select_pmei_canada_customs_pre_paid", + ), + ( + "easypost_asendia_us_epaq_select_pmeipc_postage", + "easypost_asendia_us_epaq_select_pmeipc_postage", + ), + ( + "easypost_asendia_us_epaq_select_pmi", + "easypost_asendia_us_epaq_select_pmi", + ), + ( + "easypost_asendia_us_epaq_select_pmi_canada_customs_prepaid", + "easypost_asendia_us_epaq_select_pmi_canada_customs_prepaid", + ), + ( + "easypost_asendia_us_epaq_select_pmi_canada_ddp", + "easypost_asendia_us_epaq_select_pmi_canada_ddp", + ), + ( + "easypost_asendia_us_epaq_select_pmi_non_presort", + "easypost_asendia_us_epaq_select_pmi_non_presort", + ), + ( + "easypost_asendia_us_epaq_select_pmipc_postage", + "easypost_asendia_us_epaq_select_pmipc_postage", + ), + ( + "easypost_asendia_us_epaq_standard", + "easypost_asendia_us_epaq_standard", + ), + ( + "easypost_asendia_us_epaq_standard_custom", + "easypost_asendia_us_epaq_standard_custom", + ), + ( + "easypost_asendia_us_epaq_standard_economy", + "easypost_asendia_us_epaq_standard_economy", + ), + ( + "easypost_asendia_us_epaq_standard_ipa", + "easypost_asendia_us_epaq_standard_ipa", + ), + ( + "easypost_asendia_us_epaq_standard_isal", + "easypost_asendia_us_epaq_standard_isal", + ), + ( + "easypost_asendia_us_epaq_select_pmei_non_presort", + "easypost_asendia_us_epaq_select_pmei_non_presort", + ), + ( + "easypost_australiapost_express_post", + "easypost_australiapost_express_post", + ), + ( + "easypost_australiapost_express_post_signature", + "easypost_australiapost_express_post_signature", + ), + ( + "easypost_australiapost_parcel_post", + "easypost_australiapost_parcel_post", + ), + ( + "easypost_australiapost_parcel_post_signature", + "easypost_australiapost_parcel_post_signature", + ), + ( + "easypost_australiapost_parcel_post_extra", + "easypost_australiapost_parcel_post_extra", + ), + ( + "easypost_australiapost_parcel_post_wine_plus_signature", + "easypost_australiapost_parcel_post_wine_plus_signature", + ), + ("easypost_axlehire_delivery", "easypost_axlehire_delivery"), + ( + "easypost_better_trucks_next_day", + "easypost_better_trucks_next_day", + ), + ("easypost_bond_standard", "easypost_bond_standard"), + ( + "easypost_canadapost_regular_parcel", + "easypost_canadapost_regular_parcel", + ), + ( + "easypost_canadapost_expedited_parcel", + "easypost_canadapost_expedited_parcel", + ), + ( + "easypost_canadapost_xpresspost", + "easypost_canadapost_xpresspost", + ), + ( + "easypost_canadapost_xpresspost_certified", + "easypost_canadapost_xpresspost_certified", + ), + ("easypost_canadapost_priority", "easypost_canadapost_priority"), + ( + "easypost_canadapost_library_books", + "easypost_canadapost_library_books", + ), + ( + "easypost_canadapost_expedited_parcel_usa", + "easypost_canadapost_expedited_parcel_usa", + ), + ( + "easypost_canadapost_priority_worldwide_envelope_usa", + "easypost_canadapost_priority_worldwide_envelope_usa", + ), + ( + "easypost_canadapost_priority_worldwide_pak_usa", + "easypost_canadapost_priority_worldwide_pak_usa", + ), + ( + "easypost_canadapost_priority_worldwide_parcel_usa", + "easypost_canadapost_priority_worldwide_parcel_usa", + ), + ( + "easypost_canadapost_small_packet_usa_air", + "easypost_canadapost_small_packet_usa_air", + ), + ( + "easypost_canadapost_tracked_packet_usa", + "easypost_canadapost_tracked_packet_usa", + ), + ( + "easypost_canadapost_tracked_packet_usalvm", + "easypost_canadapost_tracked_packet_usalvm", + ), + ( + "easypost_canadapost_xpresspost_usa", + "easypost_canadapost_xpresspost_usa", + ), + ( + "easypost_canadapost_xpresspost_international", + "easypost_canadapost_xpresspost_international", + ), + ( + "easypost_canadapost_international_parcel_air", + "easypost_canadapost_international_parcel_air", + ), + ( + "easypost_canadapost_international_parcel_surface", + "easypost_canadapost_international_parcel_surface", + ), + ( + "easypost_canadapost_priority_worldwide_envelope_intl", + "easypost_canadapost_priority_worldwide_envelope_intl", + ), + ( + "easypost_canadapost_priority_worldwide_pak_intl", + "easypost_canadapost_priority_worldwide_pak_intl", + ), + ( + "easypost_canadapost_priority_worldwide_parcel_intl", + "easypost_canadapost_priority_worldwide_parcel_intl", + ), + ( + "easypost_canadapost_small_packet_international_air", + "easypost_canadapost_small_packet_international_air", + ), + ( + "easypost_canadapost_small_packet_international_surface", + "easypost_canadapost_small_packet_international_surface", + ), + ( + "easypost_canadapost_tracked_packet_international", + "easypost_canadapost_tracked_packet_international", + ), + ("easypost_canpar_ground", "easypost_canpar_ground"), + ("easypost_canpar_select_letter", "easypost_canpar_select_letter"), + ("easypost_canpar_select_pak", "easypost_canpar_select_pak"), + ("easypost_canpar_select", "easypost_canpar_select"), + ( + "easypost_canpar_overnight_letter", + "easypost_canpar_overnight_letter", + ), + ("easypost_canpar_overnight_pak", "easypost_canpar_overnight_pak"), + ("easypost_canpar_overnight", "easypost_canpar_overnight"), + ("easypost_canpar_select_usa", "easypost_canpar_select_usa"), + ("easypost_canpar_usa_pak", "easypost_canpar_usa_pak"), + ("easypost_canpar_usa_letter", "easypost_canpar_usa_letter"), + ("easypost_canpar_usa", "easypost_canpar_usa"), + ("easypost_canpar_international", "easypost_canpar_international"), + ("easypost_cdl_distribution", "easypost_cdl_distribution"), + ("easypost_cdl_same_day", "easypost_cdl_same_day"), + ( + "easypost_courier_express_basic_parcel", + "easypost_courier_express_basic_parcel", + ), + ( + "easypost_couriersplease_domestic_priority_signature", + "easypost_couriersplease_domestic_priority_signature", + ), + ( + "easypost_couriersplease_domestic_priority", + "easypost_couriersplease_domestic_priority", + ), + ( + "easypost_couriersplease_domestic_off_peak_signature", + "easypost_couriersplease_domestic_off_peak_signature", + ), + ( + "easypost_couriersplease_domestic_off_peak", + "easypost_couriersplease_domestic_off_peak", + ), + ( + "easypost_couriersplease_gold_domestic_signature", + "easypost_couriersplease_gold_domestic_signature", + ), + ( + "easypost_couriersplease_gold_domestic", + "easypost_couriersplease_gold_domestic", + ), + ( + "easypost_couriersplease_australian_city_express_signature", + "easypost_couriersplease_australian_city_express_signature", + ), + ( + "easypost_couriersplease_australian_city_express", + "easypost_couriersplease_australian_city_express", + ), + ( + "easypost_couriersplease_domestic_saver_signature", + "easypost_couriersplease_domestic_saver_signature", + ), + ( + "easypost_couriersplease_domestic_saver", + "easypost_couriersplease_domestic_saver", + ), + ( + "easypost_couriersplease_road_express", + "easypost_couriersplease_road_express", + ), + ( + "easypost_couriersplease_5_kg_satchel", + "easypost_couriersplease_5_kg_satchel", + ), + ( + "easypost_couriersplease_3_kg_satchel", + "easypost_couriersplease_3_kg_satchel", + ), + ( + "easypost_couriersplease_1_kg_satchel", + "easypost_couriersplease_1_kg_satchel", + ), + ( + "easypost_couriersplease_5_kg_satchel_atl", + "easypost_couriersplease_5_kg_satchel_atl", + ), + ( + "easypost_couriersplease_3_kg_satchel_atl", + "easypost_couriersplease_3_kg_satchel_atl", + ), + ( + "easypost_couriersplease_1_kg_satchel_atl", + "easypost_couriersplease_1_kg_satchel_atl", + ), + ( + "easypost_couriersplease_500_gram_satchel", + "easypost_couriersplease_500_gram_satchel", + ), + ( + "easypost_couriersplease_500_gram_satchel_atl", + "easypost_couriersplease_500_gram_satchel_atl", + ), + ( + "easypost_couriersplease_25_kg_parcel", + "easypost_couriersplease_25_kg_parcel", + ), + ( + "easypost_couriersplease_10_kg_parcel", + "easypost_couriersplease_10_kg_parcel", + ), + ( + "easypost_couriersplease_5_kg_parcel", + "easypost_couriersplease_5_kg_parcel", + ), + ( + "easypost_couriersplease_3_kg_parcel", + "easypost_couriersplease_3_kg_parcel", + ), + ( + "easypost_couriersplease_1_kg_parcel", + "easypost_couriersplease_1_kg_parcel", + ), + ( + "easypost_couriersplease_500_gram_parcel", + "easypost_couriersplease_500_gram_parcel", + ), + ( + "easypost_couriersplease_500_gram_parcel_atl", + "easypost_couriersplease_500_gram_parcel_atl", + ), + ( + "easypost_couriersplease_express_international_priority", + "easypost_couriersplease_express_international_priority", + ), + ( + "easypost_couriersplease_international_saver", + "easypost_couriersplease_international_saver", + ), + ( + "easypost_couriersplease_international_express_import", + "easypost_couriersplease_international_express_import", + ), + ( + "easypost_couriersplease_domestic_tracked", + "easypost_couriersplease_domestic_tracked", + ), + ( + "easypost_couriersplease_international_economy", + "easypost_couriersplease_international_economy", + ), + ( + "easypost_couriersplease_international_standard", + "easypost_couriersplease_international_standard", + ), + ( + "easypost_couriersplease_international_express", + "easypost_couriersplease_international_express", + ), + ( + "easypost_deutschepost_packet_plus", + "easypost_deutschepost_packet_plus", + ), + ( + "easypost_deutschepost_uk_priority_packet_plus", + "easypost_deutschepost_uk_priority_packet_plus", + ), + ( + "easypost_deutschepost_uk_priority_packet", + "easypost_deutschepost_uk_priority_packet", + ), + ( + "easypost_deutschepost_uk_priority_packet_tracked", + "easypost_deutschepost_uk_priority_packet_tracked", + ), + ( + "easypost_deutschepost_uk_business_mail_registered", + "easypost_deutschepost_uk_business_mail_registered", + ), + ( + "easypost_deutschepost_uk_standard_packet", + "easypost_deutschepost_uk_standard_packet", + ), + ( + "easypost_deutschepost_uk_business_mail_standard", + "easypost_deutschepost_uk_business_mail_standard", + ), + ("easypost_dhl_ecom_asia_packet", "easypost_dhl_ecom_asia_packet"), + ( + "easypost_dhl_ecom_asia_parcel_direct", + "easypost_dhl_ecom_asia_parcel_direct", + ), + ( + "easypost_dhl_ecom_asia_parcel_direct_expedited", + "easypost_dhl_ecom_asia_parcel_direct_expedited", + ), + ( + "easypost_dhl_ecom_parcel_expedited", + "easypost_dhl_ecom_parcel_expedited", + ), + ( + "easypost_dhl_ecom_parcel_expedited_max", + "easypost_dhl_ecom_parcel_expedited_max", + ), + ( + "easypost_dhl_ecom_parcel_ground", + "easypost_dhl_ecom_parcel_ground", + ), + ( + "easypost_dhl_ecom_bpm_expedited", + "easypost_dhl_ecom_bpm_expedited", + ), + ("easypost_dhl_ecom_bpm_ground", "easypost_dhl_ecom_bpm_ground"), + ( + "easypost_dhl_ecom_parcel_international_direct", + "easypost_dhl_ecom_parcel_international_direct", + ), + ( + "easypost_dhl_ecom_parcel_international_standard", + "easypost_dhl_ecom_parcel_international_standard", + ), + ( + "easypost_dhl_ecom_packet_international", + "easypost_dhl_ecom_packet_international", + ), + ( + "easypost_dhl_ecom_parcel_international_direct_priority", + "easypost_dhl_ecom_parcel_international_direct_priority", + ), + ( + "easypost_dhl_ecom_parcel_international_direct_standard", + "easypost_dhl_ecom_parcel_international_direct_standard", + ), + ( + "easypost_dhl_express_break_bulk_economy", + "easypost_dhl_express_break_bulk_economy", + ), + ( + "easypost_dhl_express_break_bulk_express", + "easypost_dhl_express_break_bulk_express", + ), + ( + "easypost_dhl_express_domestic_economy_select", + "easypost_dhl_express_domestic_economy_select", + ), + ( + "easypost_dhl_express_domestic_express", + "easypost_dhl_express_domestic_express", + ), + ( + "easypost_dhl_express_domestic_express1030", + "easypost_dhl_express_domestic_express1030", + ), + ( + "easypost_dhl_express_domestic_express1200", + "easypost_dhl_express_domestic_express1200", + ), + ( + "easypost_dhl_express_economy_select", + "easypost_dhl_express_economy_select", + ), + ( + "easypost_dhl_express_economy_select_non_doc", + "easypost_dhl_express_economy_select_non_doc", + ), + ( + "easypost_dhl_express_euro_pack", + "easypost_dhl_express_euro_pack", + ), + ( + "easypost_dhl_express_europack_non_doc", + "easypost_dhl_express_europack_non_doc", + ), + ( + "easypost_dhl_express_express1030", + "easypost_dhl_express_express1030", + ), + ( + "easypost_dhl_express_express1030_non_doc", + "easypost_dhl_express_express1030_non_doc", + ), + ( + "easypost_dhl_express_express1200_non_doc", + "easypost_dhl_express_express1200_non_doc", + ), + ( + "easypost_dhl_express_express1200", + "easypost_dhl_express_express1200", + ), + ( + "easypost_dhl_express_express900", + "easypost_dhl_express_express900", + ), + ( + "easypost_dhl_express_express900_non_doc", + "easypost_dhl_express_express900_non_doc", + ), + ( + "easypost_dhl_express_express_easy", + "easypost_dhl_express_express_easy", + ), + ( + "easypost_dhl_express_express_easy_non_doc", + "easypost_dhl_express_express_easy_non_doc", + ), + ( + "easypost_dhl_express_express_envelope", + "easypost_dhl_express_express_envelope", + ), + ( + "easypost_dhl_express_express_worldwide", + "easypost_dhl_express_express_worldwide", + ), + ( + "easypost_dhl_express_express_worldwide_b2_c", + "easypost_dhl_express_express_worldwide_b2_c", + ), + ( + "easypost_dhl_express_express_worldwide_b2_c_non_doc", + "easypost_dhl_express_express_worldwide_b2_c_non_doc", + ), + ( + "easypost_dhl_express_express_worldwide_ecx", + "easypost_dhl_express_express_worldwide_ecx", + ), + ( + "easypost_dhl_express_express_worldwide_non_doc", + "easypost_dhl_express_express_worldwide_non_doc", + ), + ( + "easypost_dhl_express_freight_worldwide", + "easypost_dhl_express_freight_worldwide", + ), + ( + "easypost_dhl_express_globalmail_business", + "easypost_dhl_express_globalmail_business", + ), + ("easypost_dhl_express_jet_line", "easypost_dhl_express_jet_line"), + ( + "easypost_dhl_express_jumbo_box", + "easypost_dhl_express_jumbo_box", + ), + ( + "easypost_dhl_express_logistics_services", + "easypost_dhl_express_logistics_services", + ), + ("easypost_dhl_express_same_day", "easypost_dhl_express_same_day"), + ( + "easypost_dhl_express_secure_line", + "easypost_dhl_express_secure_line", + ), + ( + "easypost_dhl_express_sprint_line", + "easypost_dhl_express_sprint_line", + ), + ("easypost_dpd_classic", "easypost_dpd_classic"), + ("easypost_dpd_8_30", "easypost_dpd_8_30"), + ("easypost_dpd_10_00", "easypost_dpd_10_00"), + ("easypost_dpd_12_00", "easypost_dpd_12_00"), + ("easypost_dpd_18_00", "easypost_dpd_18_00"), + ("easypost_dpd_express", "easypost_dpd_express"), + ("easypost_dpd_parcelletter", "easypost_dpd_parcelletter"), + ("easypost_dpd_parcelletterplus", "easypost_dpd_parcelletterplus"), + ( + "easypost_dpd_internationalmail", + "easypost_dpd_internationalmail", + ), + ( + "easypost_dpd_uk_air_express_international_air", + "easypost_dpd_uk_air_express_international_air", + ), + ( + "easypost_dpd_uk_air_classic_international_air", + "easypost_dpd_uk_air_classic_international_air", + ), + ("easypost_dpd_uk_parcel_sunday", "easypost_dpd_uk_parcel_sunday"), + ( + "easypost_dpd_uk_freight_parcel_sunday", + "easypost_dpd_uk_freight_parcel_sunday", + ), + ("easypost_dpd_uk_pallet_sunday", "easypost_dpd_uk_pallet_sunday"), + ( + "easypost_dpd_uk_pallet_dpd_classic", + "easypost_dpd_uk_pallet_dpd_classic", + ), + ( + "easypost_dpd_uk_expresspak_dpd_classic", + "easypost_dpd_uk_expresspak_dpd_classic", + ), + ( + "easypost_dpd_uk_expresspak_sunday", + "easypost_dpd_uk_expresspak_sunday", + ), + ( + "easypost_dpd_uk_parcel_dpd_classic", + "easypost_dpd_uk_parcel_dpd_classic", + ), + ( + "easypost_dpd_uk_parcel_dpd_two_day", + "easypost_dpd_uk_parcel_dpd_two_day", + ), + ( + "easypost_dpd_uk_parcel_dpd_next_day", + "easypost_dpd_uk_parcel_dpd_next_day", + ), + ("easypost_dpd_uk_parcel_dpd12", "easypost_dpd_uk_parcel_dpd12"), + ("easypost_dpd_uk_parcel_dpd10", "easypost_dpd_uk_parcel_dpd10"), + ( + "easypost_dpd_uk_parcel_return_to_shop", + "easypost_dpd_uk_parcel_return_to_shop", + ), + ( + "easypost_dpd_uk_parcel_saturday", + "easypost_dpd_uk_parcel_saturday", + ), + ( + "easypost_dpd_uk_parcel_saturday12", + "easypost_dpd_uk_parcel_saturday12", + ), + ( + "easypost_dpd_uk_parcel_saturday10", + "easypost_dpd_uk_parcel_saturday10", + ), + ( + "easypost_dpd_uk_parcel_sunday12", + "easypost_dpd_uk_parcel_sunday12", + ), + ( + "easypost_dpd_uk_freight_parcel_dpd_classic", + "easypost_dpd_uk_freight_parcel_dpd_classic", + ), + ( + "easypost_dpd_uk_freight_parcel_sunday12", + "easypost_dpd_uk_freight_parcel_sunday12", + ), + ( + "easypost_dpd_uk_expresspak_dpd_next_day", + "easypost_dpd_uk_expresspak_dpd_next_day", + ), + ( + "easypost_dpd_uk_expresspak_dpd12", + "easypost_dpd_uk_expresspak_dpd12", + ), + ( + "easypost_dpd_uk_expresspak_dpd10", + "easypost_dpd_uk_expresspak_dpd10", + ), + ( + "easypost_dpd_uk_expresspak_saturday", + "easypost_dpd_uk_expresspak_saturday", + ), + ( + "easypost_dpd_uk_expresspak_saturday12", + "easypost_dpd_uk_expresspak_saturday12", + ), + ( + "easypost_dpd_uk_expresspak_saturday10", + "easypost_dpd_uk_expresspak_saturday10", + ), + ( + "easypost_dpd_uk_expresspak_sunday12", + "easypost_dpd_uk_expresspak_sunday12", + ), + ( + "easypost_dpd_uk_pallet_sunday12", + "easypost_dpd_uk_pallet_sunday12", + ), + ( + "easypost_dpd_uk_pallet_dpd_two_day", + "easypost_dpd_uk_pallet_dpd_two_day", + ), + ( + "easypost_dpd_uk_pallet_dpd_next_day", + "easypost_dpd_uk_pallet_dpd_next_day", + ), + ("easypost_dpd_uk_pallet_dpd12", "easypost_dpd_uk_pallet_dpd12"), + ("easypost_dpd_uk_pallet_dpd10", "easypost_dpd_uk_pallet_dpd10"), + ( + "easypost_dpd_uk_pallet_saturday", + "easypost_dpd_uk_pallet_saturday", + ), + ( + "easypost_dpd_uk_pallet_saturday12", + "easypost_dpd_uk_pallet_saturday12", + ), + ( + "easypost_dpd_uk_pallet_saturday10", + "easypost_dpd_uk_pallet_saturday10", + ), + ( + "easypost_dpd_uk_freight_parcel_dpd_two_day", + "easypost_dpd_uk_freight_parcel_dpd_two_day", + ), + ( + "easypost_dpd_uk_freight_parcel_dpd_next_day", + "easypost_dpd_uk_freight_parcel_dpd_next_day", + ), + ( + "easypost_dpd_uk_freight_parcel_dpd12", + "easypost_dpd_uk_freight_parcel_dpd12", + ), + ( + "easypost_dpd_uk_freight_parcel_dpd10", + "easypost_dpd_uk_freight_parcel_dpd10", + ), + ( + "easypost_dpd_uk_freight_parcel_saturday", + "easypost_dpd_uk_freight_parcel_saturday", + ), + ( + "easypost_dpd_uk_freight_parcel_saturday12", + "easypost_dpd_uk_freight_parcel_saturday12", + ), + ( + "easypost_dpd_uk_freight_parcel_saturday10", + "easypost_dpd_uk_freight_parcel_saturday10", + ), + ( + "easypost_epost_courier_service_ddp", + "easypost_epost_courier_service_ddp", + ), + ( + "easypost_epost_courier_service_ddu", + "easypost_epost_courier_service_ddu", + ), + ( + "easypost_epost_domestic_economy_parcel", + "easypost_epost_domestic_economy_parcel", + ), + ( + "easypost_epost_domestic_parcel_bpm", + "easypost_epost_domestic_parcel_bpm", + ), + ( + "easypost_epost_domestic_priority_parcel", + "easypost_epost_domestic_priority_parcel", + ), + ( + "easypost_epost_domestic_priority_parcel_bpm", + "easypost_epost_domestic_priority_parcel_bpm", + ), + ("easypost_epost_emi_service", "easypost_epost_emi_service"), + ( + "easypost_epost_economy_parcel_service", + "easypost_epost_economy_parcel_service", + ), + ("easypost_epost_ipa_service", "easypost_epost_ipa_service"), + ("easypost_epost_isal_service", "easypost_epost_isal_service"), + ("easypost_epost_pmi_service", "easypost_epost_pmi_service"), + ( + "easypost_epost_priority_parcel_ddp", + "easypost_epost_priority_parcel_ddp", + ), + ( + "easypost_epost_priority_parcel_ddu", + "easypost_epost_priority_parcel_ddu", + ), + ( + "easypost_epost_priority_parcel_delivery_confirmation_ddp", + "easypost_epost_priority_parcel_delivery_confirmation_ddp", + ), + ( + "easypost_epost_priority_parcel_delivery_confirmation_ddu", + "easypost_epost_priority_parcel_delivery_confirmation_ddu", + ), + ( + "easypost_epost_epacket_service", + "easypost_epost_epacket_service", + ), + ( + "easypost_estafeta_next_day_by930", + "easypost_estafeta_next_day_by930", + ), + ( + "easypost_estafeta_next_day_by1130", + "easypost_estafeta_next_day_by1130", + ), + ("easypost_estafeta_next_day", "easypost_estafeta_next_day"), + ("easypost_estafeta_two_day", "easypost_estafeta_two_day"), + ("easypost_estafeta_ltl", "easypost_estafeta_ltl"), + ("easypost_fastway_parcel", "easypost_fastway_parcel"), + ("easypost_fastway_satchel", "easypost_fastway_satchel"), + ("easypost_fedex_ground", "easypost_fedex_ground"), + ("easypost_fedex_2_day", "easypost_fedex_2_day"), + ("easypost_fedex_2_day_am", "easypost_fedex_2_day_am"), + ("easypost_fedex_express_saver", "easypost_fedex_express_saver"), + ( + "easypost_fedex_standard_overnight", + "easypost_fedex_standard_overnight", + ), + ( + "easypost_fedex_first_overnight", + "easypost_fedex_first_overnight", + ), + ( + "easypost_fedex_priority_overnight", + "easypost_fedex_priority_overnight", + ), + ( + "easypost_fedex_international_economy", + "easypost_fedex_international_economy", + ), + ( + "easypost_fedex_international_first", + "easypost_fedex_international_first", + ), + ( + "easypost_fedex_international_priority", + "easypost_fedex_international_priority", + ), + ( + "easypost_fedex_ground_home_delivery", + "easypost_fedex_ground_home_delivery", + ), + ( + "easypost_fedex_crossborder_cbec", + "easypost_fedex_crossborder_cbec", + ), + ( + "easypost_fedex_crossborder_cbecl", + "easypost_fedex_crossborder_cbecl", + ), + ( + "easypost_fedex_crossborder_cbecp", + "easypost_fedex_crossborder_cbecp", + ), + ( + "easypost_fedex_sameday_city_economy_service", + "easypost_fedex_sameday_city_economy_service", + ), + ( + "easypost_fedex_sameday_city_standard_service", + "easypost_fedex_sameday_city_standard_service", + ), + ( + "easypost_fedex_sameday_city_priority_service", + "easypost_fedex_sameday_city_priority_service", + ), + ( + "easypost_fedex_sameday_city_last_mile", + "easypost_fedex_sameday_city_last_mile", + ), + ("easypost_fedex_smart_post", "easypost_fedex_smart_post"), + ("easypost_globegistics_pmei", "easypost_globegistics_pmei"), + ( + "easypost_globegistics_ecom_domestic", + "easypost_globegistics_ecom_domestic", + ), + ( + "easypost_globegistics_ecom_europe", + "easypost_globegistics_ecom_europe", + ), + ( + "easypost_globegistics_ecom_express", + "easypost_globegistics_ecom_express", + ), + ( + "easypost_globegistics_ecom_extra", + "easypost_globegistics_ecom_extra", + ), + ( + "easypost_globegistics_ecom_ipa", + "easypost_globegistics_ecom_ipa", + ), + ( + "easypost_globegistics_ecom_isal", + "easypost_globegistics_ecom_isal", + ), + ( + "easypost_globegistics_ecom_pmei_duty_paid", + "easypost_globegistics_ecom_pmei_duty_paid", + ), + ( + "easypost_globegistics_ecom_pmi_duty_paid", + "easypost_globegistics_ecom_pmi_duty_paid", + ), + ( + "easypost_globegistics_ecom_packet", + "easypost_globegistics_ecom_packet", + ), + ( + "easypost_globegistics_ecom_packet_ddp", + "easypost_globegistics_ecom_packet_ddp", + ), + ( + "easypost_globegistics_ecom_priority", + "easypost_globegistics_ecom_priority", + ), + ( + "easypost_globegistics_ecom_standard", + "easypost_globegistics_ecom_standard", + ), + ( + "easypost_globegistics_ecom_tracked_ddp", + "easypost_globegistics_ecom_tracked_ddp", + ), + ( + "easypost_globegistics_ecom_tracked_ddu", + "easypost_globegistics_ecom_tracked_ddu", + ), + ( + "easypost_gso_early_priority_overnight", + "easypost_gso_early_priority_overnight", + ), + ( + "easypost_gso_priority_overnight", + "easypost_gso_priority_overnight", + ), + ( + "easypost_gso_california_parcel_service", + "easypost_gso_california_parcel_service", + ), + ( + "easypost_gso_saturday_delivery_service", + "easypost_gso_saturday_delivery_service", + ), + ( + "easypost_gso_early_saturday_service", + "easypost_gso_early_saturday_service", + ), + ( + "easypost_hermes_domestic_delivery", + "easypost_hermes_domestic_delivery", + ), + ( + "easypost_hermes_domestic_delivery_signed", + "easypost_hermes_domestic_delivery_signed", + ), + ( + "easypost_hermes_international_delivery", + "easypost_hermes_international_delivery", + ), + ( + "easypost_hermes_international_delivery_signed", + "easypost_hermes_international_delivery_signed", + ), + ( + "easypost_interlink_air_classic_international_air", + "easypost_interlink_air_classic_international_air", + ), + ( + "easypost_interlink_air_express_international_air", + "easypost_interlink_air_express_international_air", + ), + ( + "easypost_interlink_expresspak1_by10_30", + "easypost_interlink_expresspak1_by10_30", + ), + ( + "easypost_interlink_expresspak1_by12", + "easypost_interlink_expresspak1_by12", + ), + ( + "easypost_interlink_expresspak1_next_day", + "easypost_interlink_expresspak1_next_day", + ), + ( + "easypost_interlink_expresspak1_saturday", + "easypost_interlink_expresspak1_saturday", + ), + ( + "easypost_interlink_expresspak1_saturday_by10_30", + "easypost_interlink_expresspak1_saturday_by10_30", + ), + ( + "easypost_interlink_expresspak1_saturday_by12", + "easypost_interlink_expresspak1_saturday_by12", + ), + ( + "easypost_interlink_expresspak1_sunday", + "easypost_interlink_expresspak1_sunday", + ), + ( + "easypost_interlink_expresspak1_sunday_by12", + "easypost_interlink_expresspak1_sunday_by12", + ), + ( + "easypost_interlink_expresspak5_by10", + "easypost_interlink_expresspak5_by10", + ), + ( + "easypost_interlink_expresspak5_by10_30", + "easypost_interlink_expresspak5_by10_30", + ), + ( + "easypost_interlink_expresspak5_by12", + "easypost_interlink_expresspak5_by12", + ), + ( + "easypost_interlink_expresspak5_next_day", + "easypost_interlink_expresspak5_next_day", + ), + ( + "easypost_interlink_expresspak5_saturday", + "easypost_interlink_expresspak5_saturday", + ), + ( + "easypost_interlink_expresspak5_saturday_by10", + "easypost_interlink_expresspak5_saturday_by10", + ), + ( + "easypost_interlink_expresspak5_saturday_by10_30", + "easypost_interlink_expresspak5_saturday_by10_30", + ), + ( + "easypost_interlink_expresspak5_saturday_by12", + "easypost_interlink_expresspak5_saturday_by12", + ), + ( + "easypost_interlink_expresspak5_sunday", + "easypost_interlink_expresspak5_sunday", + ), + ( + "easypost_interlink_expresspak5_sunday_by12", + "easypost_interlink_expresspak5_sunday_by12", + ), + ( + "easypost_interlink_freight_by10", + "easypost_interlink_freight_by10", + ), + ( + "easypost_interlink_freight_by12", + "easypost_interlink_freight_by12", + ), + ( + "easypost_interlink_freight_next_day", + "easypost_interlink_freight_next_day", + ), + ( + "easypost_interlink_freight_saturday", + "easypost_interlink_freight_saturday", + ), + ( + "easypost_interlink_freight_saturday_by10", + "easypost_interlink_freight_saturday_by10", + ), + ( + "easypost_interlink_freight_saturday_by12", + "easypost_interlink_freight_saturday_by12", + ), + ( + "easypost_interlink_freight_sunday", + "easypost_interlink_freight_sunday", + ), + ( + "easypost_interlink_freight_sunday_by12", + "easypost_interlink_freight_sunday_by12", + ), + ( + "easypost_interlink_parcel_by10", + "easypost_interlink_parcel_by10", + ), + ( + "easypost_interlink_parcel_by10_30", + "easypost_interlink_parcel_by10_30", + ), + ( + "easypost_interlink_parcel_by12", + "easypost_interlink_parcel_by12", + ), + ( + "easypost_interlink_parcel_dpd_europe_by_road", + "easypost_interlink_parcel_dpd_europe_by_road", + ), + ( + "easypost_interlink_parcel_next_day", + "easypost_interlink_parcel_next_day", + ), + ( + "easypost_interlink_parcel_return", + "easypost_interlink_parcel_return", + ), + ( + "easypost_interlink_parcel_return_to_shop", + "easypost_interlink_parcel_return_to_shop", + ), + ( + "easypost_interlink_parcel_saturday", + "easypost_interlink_parcel_saturday", + ), + ( + "easypost_interlink_parcel_saturday_by10", + "easypost_interlink_parcel_saturday_by10", + ), + ( + "easypost_interlink_parcel_saturday_by10_30", + "easypost_interlink_parcel_saturday_by10_30", + ), + ( + "easypost_interlink_parcel_saturday_by12", + "easypost_interlink_parcel_saturday_by12", + ), + ( + "easypost_interlink_parcel_ship_to_shop", + "easypost_interlink_parcel_ship_to_shop", + ), + ( + "easypost_interlink_parcel_sunday", + "easypost_interlink_parcel_sunday", + ), + ( + "easypost_interlink_parcel_sunday_by12", + "easypost_interlink_parcel_sunday_by12", + ), + ( + "easypost_interlink_parcel_two_day", + "easypost_interlink_parcel_two_day", + ), + ( + "easypost_interlink_pickup_parcel_dpd_europe_by_road", + "easypost_interlink_pickup_parcel_dpd_europe_by_road", + ), + ("easypost_lasership_weekend", "easypost_lasership_weekend"), + ("easypost_loomis_ground", "easypost_loomis_ground"), + ("easypost_loomis_express1800", "easypost_loomis_express1800"), + ("easypost_loomis_express1200", "easypost_loomis_express1200"), + ("easypost_loomis_express900", "easypost_loomis_express900"), + ("easypost_lso_ground_early", "easypost_lso_ground_early"), + ("easypost_lso_ground_basic", "easypost_lso_ground_basic"), + ("easypost_lso_priority_basic", "easypost_lso_priority_basic"), + ("easypost_lso_priority_early", "easypost_lso_priority_early"), + ( + "easypost_lso_priority_saturday", + "easypost_lso_priority_saturday", + ), + ("easypost_lso_priority2nd_day", "easypost_lso_priority2nd_day"), + ( + "easypost_newgistics_parcel_select", + "easypost_newgistics_parcel_select", + ), + ( + "easypost_newgistics_parcel_select_lightweight", + "easypost_newgistics_parcel_select_lightweight", + ), + ("easypost_newgistics_express", "easypost_newgistics_express"), + ( + "easypost_newgistics_first_class_mail", + "easypost_newgistics_first_class_mail", + ), + ( + "easypost_newgistics_priority_mail", + "easypost_newgistics_priority_mail", + ), + ( + "easypost_newgistics_bound_printed_matter", + "easypost_newgistics_bound_printed_matter", + ), + ("easypost_ontrac_sunrise", "easypost_ontrac_sunrise"), + ("easypost_ontrac_gold", "easypost_ontrac_gold"), + ( + "easypost_ontrac_on_trac_ground", + "easypost_ontrac_on_trac_ground", + ), + ( + "easypost_ontrac_palletized_freight", + "easypost_ontrac_palletized_freight", + ), + ("easypost_osm_first", "easypost_osm_first"), + ("easypost_osm_expedited", "easypost_osm_expedited"), + ("easypost_osm_bpm", "easypost_osm_bpm"), + ("easypost_osm_media_mail", "easypost_osm_media_mail"), + ("easypost_osm_marketing_parcel", "easypost_osm_marketing_parcel"), + ( + "easypost_osm_marketing_parcel_tracked", + "easypost_osm_marketing_parcel_tracked", + ), + ("easypost_parcll_economy_west", "easypost_parcll_economy_west"), + ("easypost_parcll_economy_east", "easypost_parcll_economy_east"), + ( + "easypost_parcll_economy_central", + "easypost_parcll_economy_central", + ), + ( + "easypost_parcll_economy_northeast", + "easypost_parcll_economy_northeast", + ), + ("easypost_parcll_economy_south", "easypost_parcll_economy_south"), + ( + "easypost_parcll_expedited_west", + "easypost_parcll_expedited_west", + ), + ( + "easypost_parcll_expedited_northeast", + "easypost_parcll_expedited_northeast", + ), + ("easypost_parcll_regional_west", "easypost_parcll_regional_west"), + ("easypost_parcll_regional_east", "easypost_parcll_regional_east"), + ( + "easypost_parcll_regional_central", + "easypost_parcll_regional_central", + ), + ( + "easypost_parcll_regional_northeast", + "easypost_parcll_regional_northeast", + ), + ( + "easypost_parcll_regional_south", + "easypost_parcll_regional_south", + ), + ( + "easypost_parcll_us_to_canada_economy_west", + "easypost_parcll_us_to_canada_economy_west", + ), + ( + "easypost_parcll_us_to_canada_economy_central", + "easypost_parcll_us_to_canada_economy_central", + ), + ( + "easypost_parcll_us_to_canada_economy_northeast", + "easypost_parcll_us_to_canada_economy_northeast", + ), + ( + "easypost_parcll_us_to_europe_economy_west", + "easypost_parcll_us_to_europe_economy_west", + ), + ( + "easypost_parcll_us_to_europe_economy_northeast", + "easypost_parcll_us_to_europe_economy_northeast", + ), + ("easypost_purolator_express", "easypost_purolator_express"), + ( + "easypost_purolator_express12_pm", + "easypost_purolator_express12_pm", + ), + ( + "easypost_purolator_express_pack12_pm", + "easypost_purolator_express_pack12_pm", + ), + ( + "easypost_purolator_express_box12_pm", + "easypost_purolator_express_box12_pm", + ), + ( + "easypost_purolator_express_envelope12_pm", + "easypost_purolator_express_envelope12_pm", + ), + ( + "easypost_purolator_express1030_am", + "easypost_purolator_express1030_am", + ), + ( + "easypost_purolator_express9_am", + "easypost_purolator_express9_am", + ), + ( + "easypost_purolator_express_box", + "easypost_purolator_express_box", + ), + ( + "easypost_purolator_express_box1030_am", + "easypost_purolator_express_box1030_am", + ), + ( + "easypost_purolator_express_box9_am", + "easypost_purolator_express_box9_am", + ), + ( + "easypost_purolator_express_box_evening", + "easypost_purolator_express_box_evening", + ), + ( + "easypost_purolator_express_box_international", + "easypost_purolator_express_box_international", + ), + ( + "easypost_purolator_express_box_international1030_am", + "easypost_purolator_express_box_international1030_am", + ), + ( + "easypost_purolator_express_box_international1200", + "easypost_purolator_express_box_international1200", + ), + ( + "easypost_purolator_express_box_international9_am", + "easypost_purolator_express_box_international9_am", + ), + ( + "easypost_purolator_express_box_us", + "easypost_purolator_express_box_us", + ), + ( + "easypost_purolator_express_box_us1030_am", + "easypost_purolator_express_box_us1030_am", + ), + ( + "easypost_purolator_express_box_us1200", + "easypost_purolator_express_box_us1200", + ), + ( + "easypost_purolator_express_box_us9_am", + "easypost_purolator_express_box_us9_am", + ), + ( + "easypost_purolator_express_envelope", + "easypost_purolator_express_envelope", + ), + ( + "easypost_purolator_express_envelope1030_am", + "easypost_purolator_express_envelope1030_am", + ), + ( + "easypost_purolator_express_envelope9_am", + "easypost_purolator_express_envelope9_am", + ), + ( + "easypost_purolator_express_envelope_evening", + "easypost_purolator_express_envelope_evening", + ), + ( + "easypost_purolator_express_envelope_international", + "easypost_purolator_express_envelope_international", + ), + ( + "easypost_purolator_express_envelope_international1030_am", + "easypost_purolator_express_envelope_international1030_am", + ), + ( + "easypost_purolator_express_envelope_international1200", + "easypost_purolator_express_envelope_international1200", + ), + ( + "easypost_purolator_express_envelope_international9_am", + "easypost_purolator_express_envelope_international9_am", + ), + ( + "easypost_purolator_express_envelope_us", + "easypost_purolator_express_envelope_us", + ), + ( + "easypost_purolator_express_envelope_us1030_am", + "easypost_purolator_express_envelope_us1030_am", + ), + ( + "easypost_purolator_express_envelope_us1200", + "easypost_purolator_express_envelope_us1200", + ), + ( + "easypost_purolator_express_envelope_us9_am", + "easypost_purolator_express_envelope_us9_am", + ), + ( + "easypost_purolator_express_evening", + "easypost_purolator_express_evening", + ), + ( + "easypost_purolator_express_international", + "easypost_purolator_express_international", + ), + ( + "easypost_purolator_express_international1030_am", + "easypost_purolator_express_international1030_am", + ), + ( + "easypost_purolator_express_international1200", + "easypost_purolator_express_international1200", + ), + ( + "easypost_purolator_express_international9_am", + "easypost_purolator_express_international9_am", + ), + ( + "easypost_purolator_express_pack", + "easypost_purolator_express_pack", + ), + ( + "easypost_purolator_express_pack1030_am", + "easypost_purolator_express_pack1030_am", + ), + ( + "easypost_purolator_express_pack9_am", + "easypost_purolator_express_pack9_am", + ), + ( + "easypost_purolator_express_pack_evening", + "easypost_purolator_express_pack_evening", + ), + ( + "easypost_purolator_express_pack_international", + "easypost_purolator_express_pack_international", + ), + ( + "easypost_purolator_express_pack_international1030_am", + "easypost_purolator_express_pack_international1030_am", + ), + ( + "easypost_purolator_express_pack_international1200", + "easypost_purolator_express_pack_international1200", + ), + ( + "easypost_purolator_express_pack_international9_am", + "easypost_purolator_express_pack_international9_am", + ), + ( + "easypost_purolator_express_pack_us", + "easypost_purolator_express_pack_us", + ), + ( + "easypost_purolator_express_pack_us1030_am", + "easypost_purolator_express_pack_us1030_am", + ), + ( + "easypost_purolator_express_pack_us1200", + "easypost_purolator_express_pack_us1200", + ), + ( + "easypost_purolator_express_pack_us9_am", + "easypost_purolator_express_pack_us9_am", + ), + ("easypost_purolator_express_us", "easypost_purolator_express_us"), + ( + "easypost_purolator_express_us1030_am", + "easypost_purolator_express_us1030_am", + ), + ( + "easypost_purolator_express_us1200", + "easypost_purolator_express_us1200", + ), + ( + "easypost_purolator_express_us9_am", + "easypost_purolator_express_us9_am", + ), + ("easypost_purolator_ground", "easypost_purolator_ground"), + ( + "easypost_purolator_ground1030_am", + "easypost_purolator_ground1030_am", + ), + ("easypost_purolator_ground9_am", "easypost_purolator_ground9_am"), + ( + "easypost_purolator_ground_distribution", + "easypost_purolator_ground_distribution", + ), + ( + "easypost_purolator_ground_evening", + "easypost_purolator_ground_evening", + ), + ( + "easypost_purolator_ground_regional", + "easypost_purolator_ground_regional", + ), + ("easypost_purolator_ground_us", "easypost_purolator_ground_us"), + ( + "easypost_royalmail_international_signed", + "easypost_royalmail_international_signed", + ), + ( + "easypost_royalmail_international_tracked", + "easypost_royalmail_international_tracked", + ), + ( + "easypost_royalmail_international_tracked_and_signed", + "easypost_royalmail_international_tracked_and_signed", + ), + ("easypost_royalmail_1st_class", "easypost_royalmail_1st_class"), + ( + "easypost_royalmail_1st_class_signed_for", + "easypost_royalmail_1st_class_signed_for", + ), + ("easypost_royalmail_2nd_class", "easypost_royalmail_2nd_class"), + ( + "easypost_royalmail_2nd_class_signed_for", + "easypost_royalmail_2nd_class_signed_for", + ), + ( + "easypost_royalmail_royal_mail24", + "easypost_royalmail_royal_mail24", + ), + ( + "easypost_royalmail_royal_mail24_signed_for", + "easypost_royalmail_royal_mail24_signed_for", + ), + ( + "easypost_royalmail_royal_mail48", + "easypost_royalmail_royal_mail48", + ), + ( + "easypost_royalmail_royal_mail48_signed_for", + "easypost_royalmail_royal_mail48_signed_for", + ), + ( + "easypost_royalmail_special_delivery_guaranteed1pm", + "easypost_royalmail_special_delivery_guaranteed1pm", + ), + ( + "easypost_royalmail_special_delivery_guaranteed9am", + "easypost_royalmail_special_delivery_guaranteed9am", + ), + ( + "easypost_royalmail_standard_letter1st_class", + "easypost_royalmail_standard_letter1st_class", + ), + ( + "easypost_royalmail_standard_letter1st_class_signed_for", + "easypost_royalmail_standard_letter1st_class_signed_for", + ), + ( + "easypost_royalmail_standard_letter2nd_class", + "easypost_royalmail_standard_letter2nd_class", + ), + ( + "easypost_royalmail_standard_letter2nd_class_signed_for", + "easypost_royalmail_standard_letter2nd_class_signed_for", + ), + ("easypost_royalmail_tracked24", "easypost_royalmail_tracked24"), + ( + "easypost_royalmail_tracked24_high_volume", + "easypost_royalmail_tracked24_high_volume", + ), + ( + "easypost_royalmail_tracked24_high_volume_signature", + "easypost_royalmail_tracked24_high_volume_signature", + ), + ( + "easypost_royalmail_tracked24_signature", + "easypost_royalmail_tracked24_signature", + ), + ("easypost_royalmail_tracked48", "easypost_royalmail_tracked48"), + ( + "easypost_royalmail_tracked48_high_volume", + "easypost_royalmail_tracked48_high_volume", + ), + ( + "easypost_royalmail_tracked48_high_volume_signature", + "easypost_royalmail_tracked48_high_volume_signature", + ), + ( + "easypost_royalmail_tracked48_signature", + "easypost_royalmail_tracked48_signature", + ), + ( + "easypost_seko_ecommerce_standard_tracked", + "easypost_seko_ecommerce_standard_tracked", + ), + ( + "easypost_seko_ecommerce_express_tracked", + "easypost_seko_ecommerce_express_tracked", + ), + ( + "easypost_seko_domestic_express", + "easypost_seko_domestic_express", + ), + ( + "easypost_seko_domestic_standard", + "easypost_seko_domestic_standard", + ), + ("easypost_sendle_easy", "easypost_sendle_easy"), + ("easypost_sendle_pro", "easypost_sendle_pro"), + ("easypost_sendle_plus", "easypost_sendle_plus"), + ( + "easypost_sfexpress_international_standard_express_doc", + "easypost_sfexpress_international_standard_express_doc", + ), + ( + "easypost_sfexpress_international_standard_express_parcel", + "easypost_sfexpress_international_standard_express_parcel", + ), + ( + "easypost_sfexpress_international_economy_express_pilot", + "easypost_sfexpress_international_economy_express_pilot", + ), + ( + "easypost_sfexpress_international_economy_express_doc", + "easypost_sfexpress_international_economy_express_doc", + ), + ("easypost_speedee_delivery", "easypost_speedee_delivery"), + ("easypost_startrack_express", "easypost_startrack_express"), + ("easypost_startrack_premium", "easypost_startrack_premium"), + ( + "easypost_startrack_fixed_price_premium", + "easypost_startrack_fixed_price_premium", + ), + ( + "easypost_tforce_same_day_white_glove", + "easypost_tforce_same_day_white_glove", + ), + ( + "easypost_tforce_next_day_white_glove", + "easypost_tforce_next_day_white_glove", + ), + ("easypost_uds_delivery_service", "easypost_uds_delivery_service"), + ("easypost_ups_standard", "easypost_ups_standard"), + ("easypost_ups_saver", "easypost_ups_saver"), + ("easypost_ups_express_plus", "easypost_ups_express_plus"), + ("easypost_ups_next_day_air", "easypost_ups_next_day_air"), + ( + "easypost_ups_next_day_air_saver", + "easypost_ups_next_day_air_saver", + ), + ( + "easypost_ups_next_day_air_early_am", + "easypost_ups_next_day_air_early_am", + ), + ("easypost_ups_2nd_day_air", "easypost_ups_2nd_day_air"), + ("easypost_ups_2nd_day_air_am", "easypost_ups_2nd_day_air_am"), + ("easypost_ups_3_day_select", "easypost_ups_3_day_select"), + ( + "easypost_ups_mail_expedited_mail_innovations", + "easypost_ups_mail_expedited_mail_innovations", + ), + ( + "easypost_ups_mail_priority_mail_innovations", + "easypost_ups_mail_priority_mail_innovations", + ), + ( + "easypost_ups_mail_economy_mail_innovations", + "easypost_ups_mail_economy_mail_innovations", + ), + ("easypost_usps_library_mail", "easypost_usps_library_mail"), + ( + "easypost_usps_first_class_mail_international", + "easypost_usps_first_class_mail_international", + ), + ( + "easypost_usps_first_class_package_international_service", + "easypost_usps_first_class_package_international_service", + ), + ( + "easypost_usps_priority_mail_international", + "easypost_usps_priority_mail_international", + ), + ( + "easypost_usps_express_mail_international", + "easypost_usps_express_mail_international", + ), + ("easypost_veho_next_day", "easypost_veho_next_day"), + ("easypost_veho_same_day", "easypost_veho_same_day"), + ("eshipper_all", "eshipper_all"), + ("eshipper_fedex_priority", "eshipper_fedex_priority"), + ( + "eshipper_fedex_first_overnight", + "eshipper_fedex_first_overnight", + ), + ("eshipper_fedex_ground", "eshipper_fedex_ground"), + ( + "eshipper_fedex_standard_overnight", + "eshipper_fedex_standard_overnight", + ), + ("eshipper_fedex_2nd_day", "eshipper_fedex_2nd_day"), + ("eshipper_fedex_express_saver", "eshipper_fedex_express_saver"), + ( + "eshipper_fedex_international_economy", + "eshipper_fedex_international_economy", + ), + ("eshipper_purolator_air", "eshipper_purolator_air"), + ("eshipper_purolator_air_9_am", "eshipper_purolator_air_9_am"), + ("eshipper_purolator_air_10_30", "eshipper_purolator_air_10_30"), + ("eshipper_purolator_letter", "eshipper_purolator_letter"), + ( + "eshipper_purolator_letter_9_am", + "eshipper_purolator_letter_9_am", + ), + ( + "eshipper_purolator_letter_10_30", + "eshipper_purolator_letter_10_30", + ), + ("eshipper_purolator_pak", "eshipper_purolator_pak"), + ("eshipper_purolator_pak_9_am", "eshipper_purolator_pak_9_am"), + ("eshipper_purolator_pak_10_30", "eshipper_purolator_pak_10_30"), + ("eshipper_purolator_ground", "eshipper_purolator_ground"), + ( + "eshipper_purolator_ground_9_am", + "eshipper_purolator_ground_9_am", + ), + ( + "eshipper_purolator_ground_10_30", + "eshipper_purolator_ground_10_30", + ), + ( + "eshipper_canada_worldwide_same_day", + "eshipper_canada_worldwide_same_day", + ), + ( + "eshipper_canada_worldwide_next_flight_out", + "eshipper_canada_worldwide_next_flight_out", + ), + ( + "eshipper_canada_worldwide_air_freight", + "eshipper_canada_worldwide_air_freight", + ), + ("eshipper_canada_worldwide_ltl", "eshipper_canada_worldwide_ltl"), + ( + "eshipper_dhl_express_worldwide", + "eshipper_dhl_express_worldwide", + ), + ("eshipper_dhl_express_12_pm", "eshipper_dhl_express_12_pm"), + ("eshipper_dhl_express_10_30_am", "eshipper_dhl_express_10_30_am"), + ("eshipper_dhl_esi_export", "eshipper_dhl_esi_export"), + ( + "eshipper_dhl_international_express", + "eshipper_dhl_international_express", + ), + ( + "eshipper_ups_express_next_day_air", + "eshipper_ups_express_next_day_air", + ), + ( + "eshipper_ups_expedited_second_day_air", + "eshipper_ups_expedited_second_day_air", + ), + ( + "eshipper_ups_worldwide_express", + "eshipper_ups_worldwide_express", + ), + ( + "eshipper_ups_worldwide_expedited", + "eshipper_ups_worldwide_expedited", + ), + ("eshipper_ups_standard_ground", "eshipper_ups_standard_ground"), + ( + "eshipper_ups_express_early_am_next_day_air_early_am", + "eshipper_ups_express_early_am_next_day_air_early_am", + ), + ("eshipper_ups_three_day_select", "eshipper_ups_three_day_select"), + ("eshipper_ups_saver", "eshipper_ups_saver"), + ("eshipper_ups_ground", "eshipper_ups_ground"), + ("eshipper_ups_next_day_saver", "eshipper_ups_next_day_saver"), + ( + "eshipper_ups_worldwide_express_plus", + "eshipper_ups_worldwide_express_plus", + ), + ( + "eshipper_ups_second_day_air_am", + "eshipper_ups_second_day_air_am", + ), + ("eshipper_canada_post_priority", "eshipper_canada_post_priority"), + ( + "eshipper_canada_post_xpresspost", + "eshipper_canada_post_xpresspost", + ), + ( + "eshipper_canada_post_expedited", + "eshipper_canada_post_expedited", + ), + ("eshipper_canada_post_regular", "eshipper_canada_post_regular"), + ( + "eshipper_canada_post_xpresspost_usa", + "eshipper_canada_post_xpresspost_usa", + ), + ( + "eshipper_canada_post_xpresspost_intl", + "eshipper_canada_post_xpresspost_intl", + ), + ( + "eshipper_canada_post_air_parcel_intl", + "eshipper_canada_post_air_parcel_intl", + ), + ( + "eshipper_canada_post_surface_parcel_intl", + "eshipper_canada_post_surface_parcel_intl", + ), + ( + "eshipper_canada_post_expedited_parcel_usa", + "eshipper_canada_post_expedited_parcel_usa", + ), + ("eshipper_tst_ltl", "eshipper_tst_ltl"), + ( + "eshipper_ltl_chicago_suburban_express", + "eshipper_ltl_chicago_suburban_express", + ), + ( + "eshipper_ltl_fedex_freight_east", + "eshipper_ltl_fedex_freight_east", + ), + ( + "eshipper_ltl_fedex_freight_west", + "eshipper_ltl_fedex_freight_west", + ), + ( + "eshipper_ltl_mid_states_express", + "eshipper_ltl_mid_states_express", + ), + ( + "eshipper_ltl_new_england_motor_freight", + "eshipper_ltl_new_england_motor_freight", + ), + ("eshipper_ltl_new_penn", "eshipper_ltl_new_penn"), + ("eshipper_ltl_oak_harbor", "eshipper_ltl_oak_harbor"), + ("eshipper_ltl_pitt_ohio", "eshipper_ltl_pitt_ohio"), + ("eshipper_ltl_r_l_carriers", "eshipper_ltl_r_l_carriers"), + ("eshipper_ltl_saia", "eshipper_ltl_saia"), + ("eshipper_ltl_usf_reddaway", "eshipper_ltl_usf_reddaway"), + ("eshipper_ltl_vitran_express", "eshipper_ltl_vitran_express"), + ("eshipper_ltl_wilson_trucking", "eshipper_ltl_wilson_trucking"), + ( + "eshipper_ltl_yellow_transportation", + "eshipper_ltl_yellow_transportation", + ), + ("eshipper_ltl_roadway", "eshipper_ltl_roadway"), + ("eshipper_ltl_fedex_national", "eshipper_ltl_fedex_national"), + ("eshipper_wilson_trucking_tfc", "eshipper_wilson_trucking_tfc"), + ( + "eshipper_aaa_cooper_transportation", + "eshipper_aaa_cooper_transportation", + ), + ("eshipper_roadrunner_dawes", "eshipper_roadrunner_dawes"), + ( + "eshipper_new_england_motor_freight", + "eshipper_new_england_motor_freight", + ), + ( + "eshipper_new_penn_motor_express", + "eshipper_new_penn_motor_express", + ), + ("eshipper_dayton_freight", "eshipper_dayton_freight"), + ( + "eshipper_southeastern_freightway", + "eshipper_southeastern_freightway", + ), + ("eshipper_saia_inc", "eshipper_saia_inc"), + ("eshipper_conway", "eshipper_conway"), + ("eshipper_roadway", "eshipper_roadway"), + ("eshipper_usf_reddaway", "eshipper_usf_reddaway"), + ("eshipper_usf_holland", "eshipper_usf_holland"), + ( + "eshipper_dependable_highway_express", + "eshipper_dependable_highway_express", + ), + ("eshipper_day_and_ross", "eshipper_day_and_ross"), + ("eshipper_day_and_ross_r_and_l", "eshipper_day_and_ross_r_and_l"), + ("eshipper_ups", "eshipper_ups"), + ("eshipper_aaa_cooper", "eshipper_aaa_cooper"), + ("eshipper_ama_transportation", "eshipper_ama_transportation"), + ("eshipper_averitt_express", "eshipper_averitt_express"), + ("eshipper_central_freight", "eshipper_central_freight"), + ("eshipper_conway_us", "eshipper_conway_us"), + ("eshipper_dayton", "eshipper_dayton"), + ("eshipper_drug_transport", "eshipper_drug_transport"), + ("eshipper_estes", "eshipper_estes"), + ("eshipper_land_air_express", "eshipper_land_air_express"), + ("eshipper_fedex_west", "eshipper_fedex_west"), + ("eshipper_fedex_national", "eshipper_fedex_national"), + ("eshipper_usf_holland_us", "eshipper_usf_holland_us"), + ("eshipper_lakeville_m_express", "eshipper_lakeville_m_express"), + ("eshipper_milan_express", "eshipper_milan_express"), + ("eshipper_nebraska_transport", "eshipper_nebraska_transport"), + ("eshipper_new_england", "eshipper_new_england"), + ("eshipper_new_penn", "eshipper_new_penn"), + ("eshipper_a_duie_pyle", "eshipper_a_duie_pyle"), + ("eshipper_roadway_us", "eshipper_roadway_us"), + ("eshipper_usf_reddaway_us", "eshipper_usf_reddaway_us"), + ("eshipper_rhody_transportation", "eshipper_rhody_transportation"), + ("eshipper_saia_motor_freight", "eshipper_saia_motor_freight"), + ("eshipper_southeastern_frgt", "eshipper_southeastern_frgt"), + ("eshipper_pitt_ohio", "eshipper_pitt_ohio"), + ("eshipper_ward", "eshipper_ward"), + ("eshipper_wilson", "eshipper_wilson"), + ("eshipper_chi_cargo", "eshipper_chi_cargo"), + ("eshipper_tax_air", "eshipper_tax_air"), + ("eshipper_fedex_east", "eshipper_fedex_east"), + ("eshipper_central_transport", "eshipper_central_transport"), + ("eshipper_roadrunner", "eshipper_roadrunner"), + ("eshipper_r_and_l_carriers", "eshipper_r_and_l_carriers"), + ("eshipper_estes_us", "eshipper_estes_us"), + ("eshipper_yrc_roadway", "eshipper_yrc_roadway"), + ("eshipper_central_transport_us", "eshipper_central_transport_us"), + ( + "eshipper_absolute_transportation_services", + "eshipper_absolute_transportation_services", + ), + ("eshipper_blue_sky_express", "eshipper_blue_sky_express"), + ("eshipper_galasso_trucking", "eshipper_galasso_trucking"), + ("eshipper_griley_air_freight", "eshipper_griley_air_freight"), + ("eshipper_jet_transportation", "eshipper_jet_transportation"), + ( + "eshipper_metro_transportation_logistics", + "eshipper_metro_transportation_logistics", + ), + ("eshipper_oak_harbor", "eshipper_oak_harbor"), + ("eshipper_stream_links_express", "eshipper_stream_links_express"), + ("eshipper_tiffany_trucking", "eshipper_tiffany_trucking"), + ("eshipper_ups_freight", "eshipper_ups_freight"), + ("eshipper_roadrunner_us", "eshipper_roadrunner_us"), + ( + "eshipper_global_mail_parcel_priority", + "eshipper_global_mail_parcel_priority", + ), + ( + "eshipper_global_mail_parcel_standard", + "eshipper_global_mail_parcel_standard", + ), + ( + "eshipper_global_mail_packet_plus_priority", + "eshipper_global_mail_packet_plus_priority", + ), + ( + "eshipper_global_mail_packet_priority", + "eshipper_global_mail_packet_priority", + ), + ( + "eshipper_global_mail_packet_standard", + "eshipper_global_mail_packet_standard", + ), + ( + "eshipper_global_mail_business_priority", + "eshipper_global_mail_business_priority", + ), + ( + "eshipper_global_mail_business_standard", + "eshipper_global_mail_business_standard", + ), + ( + "eshipper_global_mail_parcel_direct_priority", + "eshipper_global_mail_parcel_direct_priority", + ), + ( + "eshipper_global_mail_parcel_direct_standard", + "eshipper_global_mail_parcel_direct_standard", + ), + ("eshipper_canpar_ground", "eshipper_canpar_ground"), + ("eshipper_canpar_select_parcel", "eshipper_canpar_select_parcel"), + ( + "eshipper_canpar_express_parcel", + "eshipper_canpar_express_parcel", + ), + ("eshipper_fleet_optics_ground", "eshipper_fleet_optics_ground"), + ( + "fedex_international_priority_express", + "fedex_international_priority_express", + ), + ("fedex_international_first", "fedex_international_first"), + ("fedex_international_priority", "fedex_international_priority"), + ("fedex_international_economy", "fedex_international_economy"), + ("fedex_ground", "fedex_ground"), + ("fedex_cargo_mail", "fedex_cargo_mail"), + ( + "fedex_cargo_international_premium", + "fedex_cargo_international_premium", + ), + ("fedex_first_overnight", "fedex_first_overnight"), + ("fedex_first_overnight_freight", "fedex_first_overnight_freight"), + ("fedex_1_day_freight", "fedex_1_day_freight"), + ("fedex_2_day_freight", "fedex_2_day_freight"), + ("fedex_3_day_freight", "fedex_3_day_freight"), + ( + "fedex_international_priority_freight", + "fedex_international_priority_freight", + ), + ( + "fedex_international_economy_freight", + "fedex_international_economy_freight", + ), + ( + "fedex_cargo_airport_to_airport", + "fedex_cargo_airport_to_airport", + ), + ( + "fedex_international_priority_distribution", + "fedex_international_priority_distribution", + ), + ( + "fedex_ip_direct_distribution_freight", + "fedex_ip_direct_distribution_freight", + ), + ( + "fedex_intl_ground_distribution", + "fedex_intl_ground_distribution", + ), + ("fedex_ground_home_delivery", "fedex_ground_home_delivery"), + ("fedex_smart_post", "fedex_smart_post"), + ("fedex_priority_overnight", "fedex_priority_overnight"), + ("fedex_standard_overnight", "fedex_standard_overnight"), + ("fedex_2_day", "fedex_2_day"), + ("fedex_2_day_am", "fedex_2_day_am"), + ("fedex_express_saver", "fedex_express_saver"), + ("fedex_same_day", "fedex_same_day"), + ("fedex_same_day_city", "fedex_same_day_city"), + ("fedex_one_day_freight", "fedex_one_day_freight"), + ( + "fedex_international_economy_distribution", + "fedex_international_economy_distribution", + ), + ( + "fedex_international_connect_plus", + "fedex_international_connect_plus", + ), + ( + "fedex_international_distribution_freight", + "fedex_international_distribution_freight", + ), + ("fedex_regional_economy", "fedex_regional_economy"), + ("fedex_next_day_freight", "fedex_next_day_freight"), + ("fedex_next_day", "fedex_next_day"), + ("fedex_next_day_10am", "fedex_next_day_10am"), + ("fedex_next_day_12pm", "fedex_next_day_12pm"), + ("fedex_next_day_end_of_day", "fedex_next_day_end_of_day"), + ("fedex_distance_deferred", "fedex_distance_deferred"), + ( + "fedex_europe_first_international_priority", + "fedex_europe_first_international_priority", + ), + ("fedex_1_day_freight", "fedex_1_day_freight"), + ("fedex_2_day", "fedex_2_day"), + ("fedex_2_day_am", "fedex_2_day_am"), + ("fedex_2_day_freight", "fedex_2_day_freight"), + ("fedex_3_day_freight", "fedex_3_day_freight"), + ( + "fedex_cargo_airport_to_airport", + "fedex_cargo_airport_to_airport", + ), + ( + "fedex_cargo_freight_forwarding", + "fedex_cargo_freight_forwarding", + ), + ( + "fedex_cargo_international_express_freight", + "fedex_cargo_international_express_freight", + ), + ( + "fedex_cargo_international_premium", + "fedex_cargo_international_premium", + ), + ("fedex_cargo_mail", "fedex_cargo_mail"), + ("fedex_cargo_registered_mail", "fedex_cargo_registered_mail"), + ("fedex_cargo_surface_mail", "fedex_cargo_surface_mail"), + ( + "fedex_custom_critical_air_expedite", + "fedex_custom_critical_air_expedite", + ), + ( + "fedex_custom_critical_air_expedite_exclusive_use", + "fedex_custom_critical_air_expedite_exclusive_use", + ), + ( + "fedex_custom_critical_air_expedite_network", + "fedex_custom_critical_air_expedite_network", + ), + ( + "fedex_custom_critical_charter_air", + "fedex_custom_critical_charter_air", + ), + ( + "fedex_custom_critical_point_to_point", + "fedex_custom_critical_point_to_point", + ), + ( + "fedex_custom_critical_surface_expedite", + "fedex_custom_critical_surface_expedite", + ), + ( + "fedex_custom_critical_surface_expedite_exclusive_use", + "fedex_custom_critical_surface_expedite_exclusive_use", + ), + ( + "fedex_custom_critical_temp_assure_air", + "fedex_custom_critical_temp_assure_air", + ), + ( + "fedex_custom_critical_temp_assure_validated_air", + "fedex_custom_critical_temp_assure_validated_air", + ), + ( + "fedex_custom_critical_white_glove_services", + "fedex_custom_critical_white_glove_services", + ), + ("fedex_distance_deferred", "fedex_distance_deferred"), + ("fedex_express_saver", "fedex_express_saver"), + ("fedex_first_freight", "fedex_first_freight"), + ("fedex_freight_economy", "fedex_freight_economy"), + ("fedex_freight_priority", "fedex_freight_priority"), + ("fedex_ground", "fedex_ground"), + ( + "fedex_international_priority_plus", + "fedex_international_priority_plus", + ), + ("fedex_next_day_afternoon", "fedex_next_day_afternoon"), + ("fedex_next_day_early_morning", "fedex_next_day_early_morning"), + ("fedex_next_day_end_of_day", "fedex_next_day_end_of_day"), + ("fedex_next_day_freight", "fedex_next_day_freight"), + ("fedex_next_day_mid_morning", "fedex_next_day_mid_morning"), + ("fedex_first_overnight", "fedex_first_overnight"), + ("fedex_ground_home_delivery", "fedex_ground_home_delivery"), + ( + "fedex_international_distribution_freight", + "fedex_international_distribution_freight", + ), + ("fedex_international_economy", "fedex_international_economy"), + ( + "fedex_international_economy_distribution", + "fedex_international_economy_distribution", + ), + ( + "fedex_international_economy_freight", + "fedex_international_economy_freight", + ), + ("fedex_international_first", "fedex_international_first"), + ("fedex_international_ground", "fedex_international_ground"), + ("fedex_international_priority", "fedex_international_priority"), + ( + "fedex_international_priority_distribution", + "fedex_international_priority_distribution", + ), + ( + "fedex_international_priority_express", + "fedex_international_priority_express", + ), + ( + "fedex_international_priority_freight", + "fedex_international_priority_freight", + ), + ("fedex_priority_overnight", "fedex_priority_overnight"), + ("fedex_same_day", "fedex_same_day"), + ("fedex_same_day_city", "fedex_same_day_city"), + ( + "fedex_same_day_metro_afternoon", + "fedex_same_day_metro_afternoon", + ), + ("fedex_same_day_metro_morning", "fedex_same_day_metro_morning"), + ("fedex_same_day_metro_rush", "fedex_same_day_metro_rush"), + ("fedex_smart_post", "fedex_smart_post"), + ("fedex_standard_overnight", "fedex_standard_overnight"), + ( + "fedex_transborder_distribution_consolidation", + "fedex_transborder_distribution_consolidation", + ), + ("freightcom_all", "freightcom_all"), + ("freightcom_usf_holland", "freightcom_usf_holland"), + ("freightcom_central_transport", "freightcom_central_transport"), + ("freightcom_estes", "freightcom_estes"), + ("freightcom_canpar_ground", "freightcom_canpar_ground"), + ("freightcom_canpar_select", "freightcom_canpar_select"), + ("freightcom_canpar_overnight", "freightcom_canpar_overnight"), + ("freightcom_dicom_ground", "freightcom_dicom_ground"), + ("freightcom_purolator_ground", "freightcom_purolator_ground"), + ("freightcom_purolator_express", "freightcom_purolator_express"), + ( + "freightcom_purolator_express_9_am", + "freightcom_purolator_express_9_am", + ), + ( + "freightcom_purolator_express_10_30_am", + "freightcom_purolator_express_10_30_am", + ), + ( + "freightcom_purolator_ground_us", + "freightcom_purolator_ground_us", + ), + ( + "freightcom_purolator_express_us", + "freightcom_purolator_express_us", + ), + ( + "freightcom_purolator_express_us_9_am", + "freightcom_purolator_express_us_9_am", + ), + ( + "freightcom_purolator_express_us_10_30_am", + "freightcom_purolator_express_us_10_30_am", + ), + ( + "freightcom_fedex_express_saver", + "freightcom_fedex_express_saver", + ), + ("freightcom_fedex_ground", "freightcom_fedex_ground"), + ("freightcom_fedex_2day", "freightcom_fedex_2day"), + ( + "freightcom_fedex_priority_overnight", + "freightcom_fedex_priority_overnight", + ), + ( + "freightcom_fedex_standard_overnight", + "freightcom_fedex_standard_overnight", + ), + ( + "freightcom_fedex_first_overnight", + "freightcom_fedex_first_overnight", + ), + ( + "freightcom_fedex_international_priority", + "freightcom_fedex_international_priority", + ), + ( + "freightcom_fedex_international_economy", + "freightcom_fedex_international_economy", + ), + ("freightcom_ups_standard", "freightcom_ups_standard"), + ("freightcom_ups_expedited", "freightcom_ups_expedited"), + ("freightcom_ups_express_saver", "freightcom_ups_express_saver"), + ("freightcom_ups_express", "freightcom_ups_express"), + ("freightcom_ups_express_early", "freightcom_ups_express_early"), + ("freightcom_ups_3day_select", "freightcom_ups_3day_select"), + ( + "freightcom_ups_worldwide_expedited", + "freightcom_ups_worldwide_expedited", + ), + ( + "freightcom_ups_worldwide_express", + "freightcom_ups_worldwide_express", + ), + ( + "freightcom_ups_worldwide_express_plus", + "freightcom_ups_worldwide_express_plus", + ), + ( + "freightcom_ups_worldwide_express_saver", + "freightcom_ups_worldwide_express_saver", + ), + ("freightcom_dhl_express_easy", "freightcom_dhl_express_easy"), + ("freightcom_dhl_express_10_30", "freightcom_dhl_express_10_30"), + ( + "freightcom_dhl_express_worldwide", + "freightcom_dhl_express_worldwide", + ), + ("freightcom_dhl_express_12_00", "freightcom_dhl_express_12_00"), + ("freightcom_dhl_economy_select", "freightcom_dhl_economy_select"), + ( + "freightcom_dhl_ecommerce_am_service", + "freightcom_dhl_ecommerce_am_service", + ), + ( + "freightcom_dhl_ecommerce_ground_service", + "freightcom_dhl_ecommerce_ground_service", + ), + ( + "freightcom_canadapost_regular_parcel", + "freightcom_canadapost_regular_parcel", + ), + ( + "freightcom_canadapost_expedited_parcel", + "freightcom_canadapost_expedited_parcel", + ), + ( + "freightcom_canadapost_xpresspost", + "freightcom_canadapost_xpresspost", + ), + ( + "freightcom_canadapost_priority", + "freightcom_canadapost_priority", + ), + ("standard_service", "standard_service"), + ("geodis_EXP", "geodis_EXP"), + ("geodis_MES", "geodis_MES"), + ("geodis_express_france", "geodis_express_france"), + ( + "geodis_retour_trans_fr_messagerie_plus", + "geodis_retour_trans_fr_messagerie_plus", + ), + ("locate2u_local_delivery", "locate2u_local_delivery"), + ("purolator_express_9_am", "purolator_express_9_am"), + ("purolator_express_us", "purolator_express_us"), + ("purolator_express_10_30_am", "purolator_express_10_30_am"), + ("purolator_express_us_9_am", "purolator_express_us_9_am"), + ("purolator_express_12_pm", "purolator_express_12_pm"), + ("purolator_express_us_10_30_am", "purolator_express_us_10_30_am"), + ("purolator_express", "purolator_express"), + ("purolator_express_us_12_00", "purolator_express_us_12_00"), + ("purolator_express_evening", "purolator_express_evening"), + ("purolator_express_envelope_us", "purolator_express_envelope_us"), + ( + "purolator_express_envelope_9_am", + "purolator_express_envelope_9_am", + ), + ( + "purolator_express_us_envelope_9_am", + "purolator_express_us_envelope_9_am", + ), + ( + "purolator_express_envelope_10_30_am", + "purolator_express_envelope_10_30_am", + ), + ( + "purolator_express_us_envelope_10_30_am", + "purolator_express_us_envelope_10_30_am", + ), + ( + "purolator_express_envelope_12_pm", + "purolator_express_envelope_12_pm", + ), + ( + "purolator_express_us_envelope_12_00", + "purolator_express_us_envelope_12_00", + ), + ("purolator_express_envelope", "purolator_express_envelope"), + ("purolator_express_pack_us", "purolator_express_pack_us"), + ( + "purolator_express_envelope_evening", + "purolator_express_envelope_evening", + ), + ( + "purolator_express_us_pack_9_am", + "purolator_express_us_pack_9_am", + ), + ("purolator_express_pack_9_am", "purolator_express_pack_9_am"), + ( + "purolator_express_us_pack_10_30_am", + "purolator_express_us_pack_10_30_am", + ), + ( + "purolator_express_pack10_30_am", + "purolator_express_pack10_30_am", + ), + ( + "purolator_express_us_pack_12_00", + "purolator_express_us_pack_12_00", + ), + ("purolator_express_pack_12_pm", "purolator_express_pack_12_pm"), + ("purolator_express_box_us", "purolator_express_box_us"), + ("purolator_express_pack", "purolator_express_pack"), + ("purolator_express_us_box_9_am", "purolator_express_us_box_9_am"), + ( + "purolator_express_pack_evening", + "purolator_express_pack_evening", + ), + ( + "purolator_express_us_box_10_30_am", + "purolator_express_us_box_10_30_am", + ), + ("purolator_express_box_9_am", "purolator_express_box_9_am"), + ( + "purolator_express_us_box_12_00", + "purolator_express_us_box_12_00", + ), + ( + "purolator_express_box_10_30_am", + "purolator_express_box_10_30_am", + ), + ("purolator_ground_us", "purolator_ground_us"), + ("purolator_express_box_12_pm", "purolator_express_box_12_pm"), + ( + "purolator_express_international", + "purolator_express_international", + ), + ("purolator_express_box", "purolator_express_box"), + ( + "purolator_express_international_9_am", + "purolator_express_international_9_am", + ), + ("purolator_express_box_evening", "purolator_express_box_evening"), + ( + "purolator_express_international_10_30_am", + "purolator_express_international_10_30_am", + ), + ("purolator_ground", "purolator_ground"), + ( + "purolator_express_international_12_00", + "purolator_express_international_12_00", + ), + ("purolator_ground_9_am", "purolator_ground_9_am"), + ( + "purolator_express_envelope_international", + "purolator_express_envelope_international", + ), + ("purolator_ground_10_30_am", "purolator_ground_10_30_am"), + ( + "purolator_express_international_envelope_9_am", + "purolator_express_international_envelope_9_am", + ), + ("purolator_ground_evening", "purolator_ground_evening"), + ( + "purolator_express_international_envelope_10_30_am", + "purolator_express_international_envelope_10_30_am", + ), + ("purolator_quick_ship", "purolator_quick_ship"), + ( + "purolator_express_international_envelope_12_00", + "purolator_express_international_envelope_12_00", + ), + ("purolator_quick_ship_envelope", "purolator_quick_ship_envelope"), + ( + "purolator_express_pack_international", + "purolator_express_pack_international", + ), + ("purolator_quick_ship_pack", "purolator_quick_ship_pack"), + ( + "purolator_express_international_pack_9_am", + "purolator_express_international_pack_9_am", + ), + ("purolator_quick_ship_box", "purolator_quick_ship_box"), + ( + "purolator_express_international_pack_10_30_am", + "purolator_express_international_pack_10_30_am", + ), + ( + "purolator_express_international_pack_12_00", + "purolator_express_international_pack_12_00", + ), + ( + "purolator_express_box_international", + "purolator_express_box_international", + ), + ( + "purolator_express_international_box_9_am", + "purolator_express_international_box_9_am", + ), + ( + "purolator_express_international_box_10_30_am", + "purolator_express_international_box_10_30_am", + ), + ( + "purolator_express_international_box_12_00", + "purolator_express_international_box_12_00", + ), + ("roadie_local_delivery", "roadie_local_delivery"), + ("sendle_standard_pickup", "sendle_standard_pickup"), + ("sendle_standard_dropoff", "sendle_standard_dropoff"), + ("sendle_express_pickup", "sendle_express_pickup"), + ("tnt_special_express", "tnt_special_express"), + ("tnt_9_00_express", "tnt_9_00_express"), + ("tnt_10_00_express", "tnt_10_00_express"), + ("tnt_12_00_express", "tnt_12_00_express"), + ("tnt_express", "tnt_express"), + ("tnt_economy_express", "tnt_economy_express"), + ("tnt_global_express", "tnt_global_express"), + ("ups_standard", "ups_standard"), + ("ups_worldwide_express", "ups_worldwide_express"), + ("ups_worldwide_expedited", "ups_worldwide_expedited"), + ("ups_worldwide_express_plus", "ups_worldwide_express_plus"), + ("ups_worldwide_saver", "ups_worldwide_saver"), + ("ups_2nd_day_air", "ups_2nd_day_air"), + ("ups_2nd_day_air_am", "ups_2nd_day_air_am"), + ("ups_3_day_select", "ups_3_day_select"), + ("ups_ground", "ups_ground"), + ("ups_next_day_air", "ups_next_day_air"), + ("ups_next_day_air_early", "ups_next_day_air_early"), + ("ups_next_day_air_saver", "ups_next_day_air_saver"), + ("ups_expedited_ca", "ups_expedited_ca"), + ("ups_express_saver_ca", "ups_express_saver_ca"), + ("ups_3_day_select_ca_us", "ups_3_day_select_ca_us"), + ("ups_access_point_economy_ca", "ups_access_point_economy_ca"), + ("ups_express_ca", "ups_express_ca"), + ("ups_express_early_ca", "ups_express_early_ca"), + ("ups_express_saver_intl_ca", "ups_express_saver_intl_ca"), + ("ups_standard_ca", "ups_standard_ca"), + ("ups_worldwide_expedited_ca", "ups_worldwide_expedited_ca"), + ("ups_worldwide_express_ca", "ups_worldwide_express_ca"), + ("ups_worldwide_express_plus_ca", "ups_worldwide_express_plus_ca"), + ("ups_express_early_ca_us", "ups_express_early_ca_us"), + ("ups_access_point_economy_eu", "ups_access_point_economy_eu"), + ("ups_expedited_eu", "ups_expedited_eu"), + ("ups_express_eu", "ups_express_eu"), + ("ups_standard_eu", "ups_standard_eu"), + ("ups_worldwide_express_plus_eu", "ups_worldwide_express_plus_eu"), + ("ups_worldwide_saver_eu", "ups_worldwide_saver_eu"), + ("ups_access_point_economy_mx", "ups_access_point_economy_mx"), + ("ups_expedited_mx", "ups_expedited_mx"), + ("ups_express_mx", "ups_express_mx"), + ("ups_standard_mx", "ups_standard_mx"), + ("ups_worldwide_express_plus_mx", "ups_worldwide_express_plus_mx"), + ("ups_worldwide_saver_mx", "ups_worldwide_saver_mx"), + ("ups_access_point_economy_pl", "ups_access_point_economy_pl"), + ( + "ups_today_dedicated_courrier_pl", + "ups_today_dedicated_courrier_pl", + ), + ("ups_today_express_pl", "ups_today_express_pl"), + ("ups_today_express_saver_pl", "ups_today_express_saver_pl"), + ("ups_today_standard_pl", "ups_today_standard_pl"), + ("ups_expedited_pl", "ups_expedited_pl"), + ("ups_express_pl", "ups_express_pl"), + ("ups_express_plus_pl", "ups_express_plus_pl"), + ("ups_express_saver_pl", "ups_express_saver_pl"), + ("ups_standard_pl", "ups_standard_pl"), + ("ups_2nd_day_air_pr", "ups_2nd_day_air_pr"), + ("ups_ground_pr", "ups_ground_pr"), + ("ups_next_day_air_pr", "ups_next_day_air_pr"), + ("ups_next_day_air_early_pr", "ups_next_day_air_early_pr"), + ("ups_worldwide_expedited_pr", "ups_worldwide_expedited_pr"), + ("ups_worldwide_express_pr", "ups_worldwide_express_pr"), + ("ups_worldwide_express_plus_pr", "ups_worldwide_express_plus_pr"), + ("ups_worldwide_saver_pr", "ups_worldwide_saver_pr"), + ("ups_express_12_00_de", "ups_express_12_00_de"), + ("ups_worldwide_express_freight", "ups_worldwide_express_freight"), + ( + "ups_worldwide_express_freight_midday", + "ups_worldwide_express_freight_midday", + ), + ("ups_worldwide_economy_ddu", "ups_worldwide_economy_ddu"), + ("ups_worldwide_economy_ddp", "ups_worldwide_economy_ddp"), + ("usps_first_class", "usps_first_class"), + ("usps_first_class_commercial", "usps_first_class_commercial"), + ( + "usps_first_class_hfp_commercial", + "usps_first_class_hfp_commercial", + ), + ("usps_priority", "usps_priority"), + ("usps_priority_commercial", "usps_priority_commercial"), + ("usps_priority_cpp", "usps_priority_cpp"), + ("usps_priority_hfp_commercial", "usps_priority_hfp_commercial"), + ("usps_priority_hfp_cpp", "usps_priority_hfp_cpp"), + ("usps_priority_mail_express", "usps_priority_mail_express"), + ( + "usps_priority_mail_express_commercial", + "usps_priority_mail_express_commercial", + ), + ( + "usps_priority_mail_express_cpp", + "usps_priority_mail_express_cpp", + ), + ("usps_priority_mail_express_sh", "usps_priority_mail_express_sh"), + ( + "usps_priority_mail_express_sh_commercial", + "usps_priority_mail_express_sh_commercial", + ), + ( + "usps_priority_mail_express_hfp", + "usps_priority_mail_express_hfp", + ), + ( + "usps_priority_mail_express_hfp_commercial", + "usps_priority_mail_express_hfp_commercial", + ), + ( + "usps_priority_mail_express_hfp_cpp", + "usps_priority_mail_express_hfp_cpp", + ), + ("usps_priority_mail_cubic", "usps_priority_mail_cubic"), + ("usps_retail_ground", "usps_retail_ground"), + ("usps_media", "usps_media"), + ("usps_library", "usps_library"), + ("usps_all", "usps_all"), + ("usps_online", "usps_online"), + ("usps_plus", "usps_plus"), + ("usps_bpm", "usps_bpm"), + ("usps_ground_advantage", "usps_ground_advantage"), + ( + "usps_ground_advantage_commercial", + "usps_ground_advantage_commercial", + ), + ("usps_ground_advantage_hfp", "usps_ground_advantage_hfp"), + ( + "usps_ground_advantage_hfp_commercial", + "usps_ground_advantage_hfp_commercial", + ), + ("usps_ground_advantage_cubic", "usps_ground_advantage_cubic"), + ("usps_first_class", "usps_first_class"), + ("usps_first_class_commercial", "usps_first_class_commercial"), + ( + "usps_first_class_hfp_commercial", + "usps_first_class_hfp_commercial", + ), + ("usps_priority", "usps_priority"), + ("usps_priority_commercial", "usps_priority_commercial"), + ("usps_priority_cpp", "usps_priority_cpp"), + ("usps_priority_hfp_commercial", "usps_priority_hfp_commercial"), + ("usps_priority_hfp_cpp", "usps_priority_hfp_cpp"), + ("usps_priority_mail_express", "usps_priority_mail_express"), + ( + "usps_priority_mail_express_commercial", + "usps_priority_mail_express_commercial", + ), + ( + "usps_priority_mail_express_cpp", + "usps_priority_mail_express_cpp", + ), + ("usps_priority_mail_express_sh", "usps_priority_mail_express_sh"), + ( + "usps_priority_mail_express_sh_commercial", + "usps_priority_mail_express_sh_commercial", + ), + ( + "usps_priority_mail_express_hfp", + "usps_priority_mail_express_hfp", + ), + ( + "usps_priority_mail_express_hfp_commercial", + "usps_priority_mail_express_hfp_commercial", + ), + ( + "usps_priority_mail_express_hfp_cpp", + "usps_priority_mail_express_hfp_cpp", + ), + ("usps_priority_mail_cubic", "usps_priority_mail_cubic"), + ("usps_retail_ground", "usps_retail_ground"), + ("usps_media", "usps_media"), + ("usps_library", "usps_library"), + ("usps_all", "usps_all"), + ("usps_online", "usps_online"), + ("usps_plus", "usps_plus"), + ("usps_bpm", "usps_bpm"), + ("zoom2u_VIP", "zoom2u_VIP"), + ("zoom2u_3_hour", "zoom2u_3_hour"), + ("zoom2u_same_day", "zoom2u_same_day"), + ], + help_text="\n The list of services you want to apply the surcharge to.\n
\n Note that by default, the surcharge is applied to all services\n ", + null=True, + ), + ), + ] diff --git a/modules/sdk/karrio/core/utils/helpers.py b/modules/sdk/karrio/core/utils/helpers.py index 40fa91c4de..da5e051cc9 100644 --- a/modules/sdk/karrio/core/utils/helpers.py +++ b/modules/sdk/karrio/core/utils/helpers.py @@ -188,16 +188,17 @@ def process_request( def process_response( request_id: str, - http_response: Any, - response, + response: Any, decoder: Callable, + on_ok: Callable[[HTTPError], str] = None, trace: Callable[[Any, str], Any] = None, ) -> str: - try: - _response = decoder(response) - except Exception as e: - logger.error(e) - _response = response + + if on_ok is not None: + _response = on_ok(response) + else: + _data = response.read() + _response = failsafe(lambda: decoder(_data)) or _data if trace: _content = _response if isinstance(_response, str) else "undecoded bytes..." @@ -231,6 +232,7 @@ def process_error( def request( decoder: Callable = decode_bytes, + on_ok: Callable[[Any], str] = None, on_error: Callable[[HTTPError], str] = None, trace: Callable[[Any, str], Any] = None, **kwargs, @@ -247,7 +249,9 @@ def request( _request = process_request(_request_id, trace, **kwargs) with urlopen(_request) as f: - _response = process_response(_request_id, f, f.read(), decoder, trace=trace) + _response = process_response( + _request_id, f, decoder, on_ok=on_ok, trace=trace + ) except HTTPError as e: _response = process_error(_request_id, e, on_error=on_error, trace=trace) diff --git a/packages/types/graphql/admin/queries.ts b/packages/types/graphql/admin/queries.ts index c1cafaeaf8..f435aeb80c 100644 --- a/packages/types/graphql/admin/queries.ts +++ b/packages/types/graphql/admin/queries.ts @@ -732,6 +732,8 @@ export const GET_SYSTEM_CONNECTIONS = gql`query GetSystemConnections { account_number api_key secret_key + track_api_key + track_secret_key account_country_code config } @@ -1440,6 +1442,8 @@ export const GET_SYSTEM_CONNECTION = gql`query GetSystemConnection($id: String!) account_number api_key secret_key + track_api_key + track_secret_key account_country_code config } diff --git a/packages/types/graphql/admin/types.ts b/packages/types/graphql/admin/types.ts index 4fb10be580..aacf79f9ef 100644 --- a/packages/types/graphql/admin/types.ts +++ b/packages/types/graphql/admin/types.ts @@ -916,6 +916,8 @@ export interface GetSystemConnections_system_connections_FedexSettingsType { account_number: string | null; api_key: string | null; secret_key: string | null; + track_api_key: string | null; + track_secret_key: string | null; account_country_code: string | null; config: any | null; } @@ -1734,6 +1736,8 @@ export interface GetSystemConnection_system_connection_FedexSettingsType { account_number: string | null; api_key: string | null; secret_key: string | null; + track_api_key: string | null; + track_secret_key: string | null; account_country_code: string | null; config: any | null; } @@ -3478,9 +3482,11 @@ export interface FedexSettingsInput { active?: boolean | null; config?: any | null; metadata?: any | null; - api_key: string; - secret_key: string; - account_number: string; + api_key?: string | null; + secret_key?: string | null; + account_number?: string | null; + track_api_key?: string | null; + track_secret_key?: string | null; carrier_id: string; } @@ -4039,6 +4045,8 @@ export interface UpdateFedexSettingsInput { api_key?: string | null; secret_key?: string | null; account_number?: string | null; + track_api_key?: string | null; + track_secret_key?: string | null; carrier_id?: string | null; } diff --git a/packages/types/graphql/queries.ts b/packages/types/graphql/queries.ts index a44b65a987..432cab465f 100644 --- a/packages/types/graphql/queries.ts +++ b/packages/types/graphql/queries.ts @@ -2059,6 +2059,8 @@ export const GET_USER_CONNECTIONS = gql`query get_user_connections { account_number api_key secret_key + track_api_key + track_secret_key account_country_code config } diff --git a/packages/types/graphql/types.ts b/packages/types/graphql/types.ts index da309e720b..3c2ac9b890 100644 --- a/packages/types/graphql/types.ts +++ b/packages/types/graphql/types.ts @@ -2822,6 +2822,8 @@ export interface get_user_connections_user_connections_FedexSettingsType { account_number: string | null; api_key: string | null; secret_key: string | null; + track_api_key: string | null; + track_secret_key: string | null; account_country_code: string | null; config: any | null; } @@ -5918,9 +5920,11 @@ export interface FedexSettingsInput { active?: boolean | null; config?: any | null; metadata?: any | null; - api_key: string; - secret_key: string; - account_number: string; + api_key?: string | null; + secret_key?: string | null; + account_number?: string | null; + track_api_key?: string | null; + track_secret_key?: string | null; carrier_id: string; } @@ -6479,6 +6483,8 @@ export interface UpdateFedexSettingsInput { api_key?: string | null; secret_key?: string | null; account_number?: string | null; + track_api_key?: string | null; + track_secret_key?: string | null; carrier_id?: string | null; } diff --git a/packages/ui/components/dropdown-input.tsx b/packages/ui/components/dropdown-input.tsx index 7677d36b2a..462e9823ce 100644 --- a/packages/ui/components/dropdown-input.tsx +++ b/packages/ui/components/dropdown-input.tsx @@ -120,6 +120,14 @@ export const DropdownInput: React.FC = ({ label, name, i
}
    +
  • + {`---`} +
  • + {(items || []) .filter(([_, val]) => search === "" || val.toLowerCase().includes(search.toLowerCase())) .map(([key, val], index) => ( diff --git a/packages/ui/modals/connect-provider-modal.tsx b/packages/ui/modals/connect-provider-modal.tsx index 0f50c3f36c..aec5fd8251 100644 --- a/packages/ui/modals/connect-provider-modal.tsx +++ b/packages/ui/modals/connect-provider-modal.tsx @@ -88,7 +88,7 @@ export const ConnectProviderModal: React.FC = ({ return fieldState(carrier_name as CarrierNameType, property); }; const directChange = (property: string) => (value: any) => { - dispatch({ name: property, value }); + dispatch({ name: property, value: value === 'none' || isNoneOrEmpty(value) ? null : value }); }; const handleChange = (event: React.ChangeEvent) => { @@ -96,7 +96,7 @@ export const ConnectProviderModal: React.FC = ({ const value = target.type === 'checkbox' ? target.checked : target.value; const name: string = target.name; - dispatch({ name, value: value === 'none' ? null : value }); + dispatch({ name, value: value === 'none' || isNoneOrEmpty(value) ? null : value }); }; const handleCarrierChange = (event: React.ChangeEvent) => { const target = event.target; @@ -358,6 +358,21 @@ export const ConnectProviderModal: React.FC = ({ required={field("secret_key").required} />} + {field("track_api_key").exists && } + + {field("track_secret_key").exists && } + {field("customer_number").exists && = ({ {LABEL_TYPES.map(_ => )} } + {"smart_post_hub_id" in connection_configs[carrier_name.toString()] && + } + {"enforce_zpl" in connection_configs[carrier_name.toString()] &&
    @@ -792,7 +816,7 @@ function fieldState(carrier_name: CarrierNameType, property: string) { [CarrierSettingsCarrierNameEnum.AsendiaUs]: [["carrier_id", true], ["username", true], ["password", true], ["api_key", true], ["account_number", true]], [CarrierSettingsCarrierNameEnum.Boxknight]: [["carrier_id", true], ["username", true], ["password", true]], [CarrierSettingsCarrierNameEnum.Bpost]: [["carrier_id", true], ["account_id", true], ["passphrase", true]], - [CarrierSettingsCarrierNameEnum.Canadapost]: [["carrier_id", true], ["username", true], ["password", true], ["customer_number", true], ["contract_id", true]], + [CarrierSettingsCarrierNameEnum.Canadapost]: [["carrier_id", true], ["username", true], ["password", true], ["customer_number"], ["contract_id"]], [CarrierSettingsCarrierNameEnum.Canpar]: [["carrier_id", true], ["username", true], ["password", true]], [CarrierSettingsCarrierNameEnum.Chronopost]: [["carrier_id", true], ["account_number", true], ["password", true], ["account_country_code"]], [CarrierSettingsCarrierNameEnum.Colissimo]: [["carrier_id", true], ["contract_number", true], ["password", true], ["laposte_api_key"]], @@ -812,7 +836,7 @@ function fieldState(carrier_name: CarrierNameType, property: string) { [CarrierSettingsCarrierNameEnum.Locate2u]: [["carrier_id", true], ["client_id", true], ["client_secret", true], ["account_country_code"]], [CarrierSettingsCarrierNameEnum.Nationex]: [["carrier_id", true], ["api_key", true], ["customer_id", true], ["billing_account"], ["language", false, "en"]], [CarrierSettingsCarrierNameEnum.Roadie]: [["carrier_id", true], ["api_key", true]], - [CarrierSettingsCarrierNameEnum.Fedex]: [["carrier_id", true], ["api_key", true], ["secret_key", true], ["account_number", true], ["account_country_code"]], + [CarrierSettingsCarrierNameEnum.Fedex]: [["carrier_id", true], ["api_key"], ["secret_key"], ["track_api_key"], ["track_secret_key"], ["account_number"], ["account_country_code"]], [CarrierSettingsCarrierNameEnum.FedexWs]: [["carrier_id", true], ["user_key"], ["password", true], ["meter_number", true], ["account_number", true], ["account_country_code"]], [CarrierSettingsCarrierNameEnum.Purolator]: [["carrier_id", true], ["username", true], ["password", true], ["account_number", true], ["user_token"]], [CarrierSettingsCarrierNameEnum.Royalmail]: [["carrier_id", true], ["client_id", true], ["client_secret", true]], diff --git a/schemas/graphql-admin.json b/schemas/graphql-admin.json index e91a0c9009..3b497cc83f 100644 --- a/schemas/graphql-admin.json +++ b/schemas/graphql-admin.json @@ -10762,6 +10762,30 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "track_api_key", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "track_secret_key", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "object_type", "description": null, @@ -19565,13 +19589,9 @@ "name": "api_key", "description": null, "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null }, "defaultValue": null }, @@ -19579,13 +19599,9 @@ "name": "secret_key", "description": null, "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null }, "defaultValue": null }, @@ -19593,13 +19609,29 @@ "name": "account_number", "description": null, "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "track_api_key", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "track_secret_key", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, "defaultValue": null }, @@ -24400,6 +24432,26 @@ }, "defaultValue": null }, + { + "name": "track_api_key", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "track_secret_key", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, { "name": "carrier_id", "description": null, diff --git a/schemas/graphql.json b/schemas/graphql.json index b1ad5fc13e..84d5b13e08 100644 --- a/schemas/graphql.json +++ b/schemas/graphql.json @@ -10369,6 +10369,30 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "track_api_key", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "track_secret_key", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -35989,13 +36013,9 @@ "name": "api_key", "description": null, "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null }, "defaultValue": null }, @@ -36003,13 +36023,9 @@ "name": "secret_key", "description": null, "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null }, "defaultValue": null }, @@ -36017,13 +36033,29 @@ "name": "account_number", "description": null, "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "track_api_key", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "track_secret_key", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, "defaultValue": null }, @@ -40828,6 +40860,26 @@ }, "defaultValue": null }, + { + "name": "track_api_key", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "track_secret_key", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, { "name": "carrier_id", "description": null, From 9069bf9ffab6cd46302a83cf81105643f8f6b289 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Sun, 25 Feb 2024 03:53:32 -0800 Subject: [PATCH 14/20] feat(Auspos): Consolidate australia post integration with live tests --- .../karrio/mappers/australiapost/proxy.py | 9 +-- .../karrio/providers/australiapost/rate.py | 71 ++++++++----------- .../australiapost/shipment/create.py | 43 ++++++----- .../karrio/providers/australiapost/units.py | 42 +++++++---- .../schemas/australiapost/rate_request.py | 12 +--- .../australiapost/schemas/rate_request.json | 54 +++++++------- .../tests/australiapost/test_rate.py | 44 ++++-------- .../tests/australiapost/test_tracking.py | 2 +- 8 files changed, 126 insertions(+), 151 deletions(-) diff --git a/modules/connectors/australiapost/karrio/mappers/australiapost/proxy.py b/modules/connectors/australiapost/karrio/mappers/australiapost/proxy.py index 58c3baf146..8ca62d0d7d 100644 --- a/modules/connectors/australiapost/karrio/mappers/australiapost/proxy.py +++ b/modules/connectors/australiapost/karrio/mappers/australiapost/proxy.py @@ -73,10 +73,6 @@ def create_shipment(self, request: lib.Serializable) -> lib.Deserializable[str]: decoder=lib.encode_base64, url=label_url, method="GET", - headers={ - "Account-Number": self.settings.account_number, - "Authorization": f"Basic {self.settings.authorization}", - }, ) ) @@ -111,9 +107,10 @@ def cancel_shipment(self, request: lib.Serializable) -> lib.Deserializable[str]: return lib.Deserializable(response, lib.to_dict) def get_tracking(self, request: lib.Serializable) -> lib.Deserializable[str]: - query = urllib.parse.urlencode(request.serialize()) + query = request.serialize() + tracking_ids = ",".join(query["tracking_ids"]) response = lib.request( - url=f"{self.settings.server_url}/shipping/v1/track?{query}", + url=f"{self.settings.server_url}/shipping/v1/track?tracking_ids={tracking_ids}", trace=self.trace_as("json"), method="GET", headers={ diff --git a/modules/connectors/australiapost/karrio/providers/australiapost/rate.py b/modules/connectors/australiapost/karrio/providers/australiapost/rate.py index 1431378dc6..fc9a1df2e0 100644 --- a/modules/connectors/australiapost/karrio/providers/australiapost/rate.py +++ b/modules/connectors/australiapost/karrio/providers/australiapost/rate.py @@ -98,53 +98,44 @@ def rate_request( services = lib.to_services(payload.services, provider_units.ShippingService) request = australiapost.RateRequestType( - shipments=[ - australiapost.ShipmentType( - shipment_from=australiapost.FromType( - suburb=payload.shipper.city, - state=payload.shipper.state_code, - postcode=payload.shipper.postal_code, - ), - to=australiapost.FromType( - suburb=payload.recipient.city, - state=payload.recipient.state_code, - postcode=payload.recipient.postal_code, - ), - items=[ - australiapost.ItemType( - item_reference=( - getattr(package.parcel, "id", None) or str(idx) - ), - length=package.length.CM, - width=package.width.CM, - height=package.height.CM, - weight=package.weight.KG, - packaging_type=provider_units.PackagingType.map( - package.packaging_type - ).value, - product_ids=[_.value for _ in services], - features=( - australiapost.FeaturesType( - TRANSIT_COVER=australiapost.TransitCoverType( - attributes=australiapost.AttributesType( - cover_amount=package.options.australiapost_transit_cover.state, - ), - ) - ) - if package.options.australiapost_transit_cover.state - is not None - else None - ), + rate_request_from=australiapost.FromType( + postcode=payload.shipper.postal_code, + country=payload.shipper.country_code, + ), + to=australiapost.FromType( + postcode=payload.recipient.postal_code, + country=payload.recipient.country_code, + ), + items=[ + australiapost.ItemType( + item_reference=(getattr(package.parcel, "id", None) or str(idx)), + length=package.length.CM, + width=package.width.CM, + height=package.height.CM, + weight=package.weight.KG, + packaging_type=provider_units.PackagingType.map( + package.packaging_type + ).value, + product_ids=[_.value for _ in services], + features=( + australiapost.FeaturesType( + TRANSIT_COVER=australiapost.TransitCoverType( + attributes=australiapost.AttributesType( + cover_amount=package.options.australiapost_transit_cover.state, + ), + ) ) - for idx, package in enumerate(packages, start=1) - ], + if (package.options.australiapost_transit_cover.state is not None) + else None + ), ) + for idx, package in enumerate(packages, start=1) ], ) return lib.Serializable( request, lambda _: lib.to_dict( - lib.to_json(_).replace("shipment_from", "from"), + lib.to_json(_).replace("rate_request_from", "from"), ), ) diff --git a/modules/connectors/australiapost/karrio/providers/australiapost/shipment/create.py b/modules/connectors/australiapost/karrio/providers/australiapost/shipment/create.py index ba909a14c7..58dde34cf2 100644 --- a/modules/connectors/australiapost/karrio/providers/australiapost/shipment/create.py +++ b/modules/connectors/australiapost/karrio/providers/australiapost/shipment/create.py @@ -68,6 +68,7 @@ def shipment_request( shipper = lib.to_address(payload.shipper) recipient = lib.to_address(payload.recipient) service = provider_units.ShippingService.map(payload.service) + is_intl = shipper.country_code != recipient.country_code options = lib.to_shipping_options( payload.options, initializer=provider_units.shipping_options_initializer, @@ -83,8 +84,8 @@ def shipment_request( payload.label_type or "PDF" ).value label_group = ( - provider_units.ServiceName.map(service.name).value - or provider_units.ServiceName.australiapost_parcel_post.value + provider_units.ServiceLabelGroup.map(service.name).value + or provider_units.ServiceLabelGroup.australiapost_parcel_post.value ) request = dict( @@ -231,23 +232,27 @@ def shipment_request( description_of_other=customs.content_description, export_declaration_number=customs.options.export_declaration_number.state, import_reference_number=customs.options.import_reference_number.state, - item_contents=[ - australiapost.ItemContentType( - country_of_origin=content.country, - description=content.description, - sku=content.sku, - quantity=content.quantity, - tariff_code=content.hs_code, - value=content.value_amount, - weight=content.weight.KG, - item_contents_reference=None, - ) - for content in ( - package.items - if any(package.items) - else customs.commodities - ) - ], + item_contents=( + [ + australiapost.ItemContentType( + country_of_origin=content.country, + description=content.description, + sku=content.sku, + quantity=content.quantity, + tariff_code=content.hs_code, + value=content.value_amount, + weight=content.weight, + item_contents_reference=None, + ) + for content in ( + package.items + if any(package.items) + else customs.commodities + ) + ] + if is_intl + else [] + ), ) for idx, package in enumerate(packages, start=1) ], diff --git a/modules/connectors/australiapost/karrio/providers/australiapost/units.py b/modules/connectors/australiapost/karrio/providers/australiapost/units.py index 0b55b61ec5..926811930f 100644 --- a/modules/connectors/australiapost/karrio/providers/australiapost/units.py +++ b/modules/connectors/australiapost/karrio/providers/australiapost/units.py @@ -61,21 +61,7 @@ class CustomsContentType(lib.StrEnum): return_merchandise = return_of_goods -class ShippingService(lib.StrEnum): - """Carrier specific services""" - - australiapost_parcel_post = "T28" - australiapost_express_post = "E34" - australiapost_parcel_post_signature = "T28S" - australiapost_express_post_signature = "E34S" - # australiapost_on_demand = "PTI8" - # australiapost_international = "IC10" - # australiapost_commercial = "Commercial" - # australiapost_startrack = "Startrack" - # australiapost_startrack_courier = "Startrack Courier" - - -class ServiceName(lib.StrEnum): +class ServiceLabelGroup(lib.StrEnum): """Carrier specific services""" australiapost_parcel_post = "Parcel Post" @@ -87,6 +73,32 @@ class ServiceName(lib.StrEnum): australiapost_commercial = "Commercial" +class ShippingService(lib.StrEnum): + """Carrier specific services""" + + australiapost_parcel_post = "T28" + australiapost_express_post = "E34" + australiapost_parcel_post_signature = "3D55" + australiapost_express_post_signature = "3J55" + australiapost_intl_standard_pack_track = "PTI8" + australiapost_intl_standard_with_signature = "PTI7" + australiapost_intl_express_merch = "ECM8" + australiapost_intl_express_docs = "ECD8" + australiapost_eparcel_post_returns = "PR" + australiapost_express_eparcel_post_returns = "XPR" + + # australiapost_parcel_post = "PARCEL POST" + # australiapost_express_post = "EXPRESS POST" + # australiapost_parcel_post_signature = "PARCEL POST + SIGNATURE" + # australiapost_express_post_signature = "EXPRESS POST + SIGNATURE" + # australiapost_intl_standard_pack_track = "INTL STANDARD/PACK & TRACK" + # australiapost_intl_standard_with_signature = "INT'L STANDARD WITH SIGNATURE" + # australiapost_intl_express_merch = "INTL EXPRESS MERCH" + # australiapost_intl_express_docs = "INTL EXPRESS DOCS" + # australiapost_eparcel_post_returns = "EPARCEL POST RETURNS" + # australiapost_express_eparcel_post_returns = "EXPRESS EPARCEL POST RETURNS" + + class ShippingOption(lib.Enum): """Carrier specific options""" diff --git a/modules/connectors/australiapost/karrio/schemas/australiapost/rate_request.py b/modules/connectors/australiapost/karrio/schemas/australiapost/rate_request.py index a701dfd65f..8fa4e0d577 100644 --- a/modules/connectors/australiapost/karrio/schemas/australiapost/rate_request.py +++ b/modules/connectors/australiapost/karrio/schemas/australiapost/rate_request.py @@ -33,18 +33,12 @@ class ItemType: @s(auto_attribs=True) class FromType: - suburb: Optional[str] = None - state: Optional[str] = None postcode: Optional[int] = None + country: Optional[str] = None @s(auto_attribs=True) -class ShipmentType: - shipment_from: Optional[FromType] = JStruct[FromType] +class RateRequestType: + rate_request_from: Optional[FromType] = JStruct[FromType] to: Optional[FromType] = JStruct[FromType] items: List[ItemType] = JList[ItemType] - - -@s(auto_attribs=True) -class RateRequestType: - shipments: List[ShipmentType] = JList[ShipmentType] diff --git a/modules/connectors/australiapost/schemas/rate_request.json b/modules/connectors/australiapost/schemas/rate_request.json index 0206d6f65c..73d76f4a22 100644 --- a/modules/connectors/australiapost/schemas/rate_request.json +++ b/modules/connectors/australiapost/schemas/rate_request.json @@ -1,37 +1,31 @@ { - "shipments": [ + "from": { + "postcode": "3207", + "country": "AU" + }, + "to": { + "postcode": "2001", + "country": "AU" + }, + "items": [ { - "from": { - "suburb": "MELBOURNE", - "state": "VIC", - "postcode": "3000" - }, - "to": { - "suburb": "SYDNEY", - "state": "NSW", - "postcode": "2000" - }, - "items": [ - { - "item_reference": "string", - "product_id": "7D55", - "length": 5.0, - "height": 1.0, - "width": 10.0, - "weight": 2.0, - "packaging_type": "BOX", - "product_ids": [ - "7D55" - ], - "features": { - "TRANSIT_COVER": { - "attributes": { - "cover_amount": 1000.0 - } - } + "item_reference": "string", + "product_id": "7D55", + "length": 5.0, + "height": 1.0, + "width": 10.0, + "weight": 2.0, + "packaging_type": "BOX", + "product_ids": [ + "7D55" + ], + "features": { + "TRANSIT_COVER": { + "attributes": { + "cover_amount": 1000.0 } } - ] + } } ] } \ No newline at end of file diff --git a/modules/connectors/australiapost/tests/australiapost/test_rate.py b/modules/connectors/australiapost/tests/australiapost/test_rate.py index b0d26527ba..834063ce2a 100644 --- a/modules/connectors/australiapost/tests/australiapost/test_rate.py +++ b/modules/connectors/australiapost/tests/australiapost/test_rate.py @@ -93,7 +93,7 @@ def test_parse_rate_response(self): {"amount": 0.82, "currency": "AUD", "name": "GST"}, ], "meta": {"service_name": "PARCEL POST + SIGNATURE"}, - "service": "australiapost_parcel_post_signature", + "service": "T28S", "total_charge": 9.0, }, { @@ -102,7 +102,7 @@ def test_parse_rate_response(self): "currency": "AUD", "extra_charges": [{"amount": 3.18, "currency": "AUD", "name": "GST"}], "meta": {"service_name": "EXPRESS POST + SIGNATURE"}, - "service": "australiapost_express_post_signature", + "service": "E34S", "total_charge": 34.94, }, ], @@ -128,37 +128,19 @@ def test_parse_rate_response(self): RateRequest = { - "shipments": [ + "items": [ { - "from": { - "postcode": "3000", - "state": "VIC", - "suburb": "MELBOURNE", - }, - "to": { - "postcode": "2000", - "state": "NSW", - "suburb": "SYDNEY", - }, - "items": [ - { - "features": { - "TRANSIT_COVER": { - "attributes": { - "cover_amount": 1000.0, - }, - } - }, - "height": 1.0, - "item_reference": "1", - "length": 5.0, - "packaging_type": "BOX", - "weight": 2.0, - "width": 10.0, - } - ], + "features": {"TRANSIT_COVER": {"attributes": {"cover_amount": 1000.0}}}, + "height": 1.0, + "item_reference": "1", + "length": 5.0, + "packaging_type": "BOX", + "weight": 2.0, + "width": 10.0, } - ] + ], + "from": {"country": "AU", "postcode": "3000"}, + "to": {"country": "AU", "postcode": "2000"}, } RateResponse = """{ diff --git a/modules/connectors/australiapost/tests/australiapost/test_tracking.py b/modules/connectors/australiapost/tests/australiapost/test_tracking.py index c9ea657548..dca529114d 100644 --- a/modules/connectors/australiapost/tests/australiapost/test_tracking.py +++ b/modules/connectors/australiapost/tests/australiapost/test_tracking.py @@ -24,7 +24,7 @@ def test_get_tracking(self): self.assertEqual( mock.call_args[1]["url"], - f"{gateway.settings.server_url}/shipping/v1/track?tracking_ids=%5B%277XX1000634011427%27%5D", + f"{gateway.settings.server_url}/shipping/v1/track?tracking_ids=7XX1000634011427", ) def test_parse_tracking_response(self): From e1e6e1453936a24ed36918c4f3702cfb0f6c1e7d Mon Sep 17 00:00:00 2001 From: Daniel K Date: Sun, 25 Feb 2024 06:34:09 -0800 Subject: [PATCH 15/20] feat(DHLParcelDE): Consolidate DHL Parcel DE integration with live tests --- .../karrio/mappers/dhl_parcel_de/proxy.py | 21 +++--- .../karrio/providers/dhl_parcel_de/error.py | 2 +- .../dhl_parcel_de/shipment/create.py | 6 +- .../karrio/providers/dhl_parcel_de/units.py | 60 ++++++++-------- .../dhl_parcel_de/tests/__init__.py | 1 + .../tests/dhl_parcel_de/test_rate.py | 69 +++++++++++++++++++ .../tests/dhl_parcel_de/test_shipment.py | 7 +- .../karrio/universal/mappers/rating_proxy.py | 14 +++- packages/types/base.ts | 2 + packages/ui/components/carrier-badge.tsx | 9 ++- packages/ui/components/carrier-image.tsx | 7 +- packages/ui/modals/connect-provider-modal.tsx | 24 ++++++- 12 files changed, 167 insertions(+), 55 deletions(-) create mode 100644 modules/connectors/dhl_parcel_de/tests/dhl_parcel_de/test_rate.py diff --git a/modules/connectors/dhl_parcel_de/karrio/mappers/dhl_parcel_de/proxy.py b/modules/connectors/dhl_parcel_de/karrio/mappers/dhl_parcel_de/proxy.py index db3a28b625..5290caafe5 100644 --- a/modules/connectors/dhl_parcel_de/karrio/mappers/dhl_parcel_de/proxy.py +++ b/modules/connectors/dhl_parcel_de/karrio/mappers/dhl_parcel_de/proxy.py @@ -23,6 +23,7 @@ def create_shipment(self, request: lib.Serializable) -> lib.Deserializable[str]: method="POST", headers={ "content-type": "application/json", + "dhl-api-key": self.settings.dhl_api_key, "Accept-Language": self.settings.language, "Authorization": f"Basic {self.settings.authorization}", }, @@ -38,6 +39,7 @@ def cancel_shipment(self, request: lib.Serializable) -> lib.Deserializable[str]: method="DELETE", headers={ "content-type": "application/json", + "DHL-API-Key": self.settings.dhl_api_key, "Accept-Language": self.settings.language, "Authorization": f"Basic {self.settings.authorization}", }, @@ -46,20 +48,23 @@ def cancel_shipment(self, request: lib.Serializable) -> lib.Deserializable[str]: return lib.Deserializable(response, lib.to_dict) def get_tracking(self, request: lib.Serializable) -> lib.Deserializable[str]: - def _get_tracking(tracking_request: dict): - query = urllib.parse.urlencode(tracking_request) - return lib.request( - url=f"{self.settings.tracking_server_url}/track/shipments?{query}", + + if not all([self.tracking_consumer_key]): + raise Exception( + "The tracking_consumer_key is required for Track API requests." + ) + + responses: typing.List[dict] = lib.run_asynchronously( + lambda request: lib.request( + url=f"{self.settings.tracking_server_url}/track/shipments?{urllib.parse.urlencode(request)}", trace=self.trace_as("json"), method="GET", headers={ "Accept": "application/json", "DHL-API-Key": self.settings.tracking_consumer_key, }, - ) - - responses: typing.List[dict] = lib.run_asynchronously( - _get_tracking, request.serialize() + ), + request.serialize(), ) return lib.Deserializable(responses, lambda res: [lib.to_dict(r) for r in res]) diff --git a/modules/connectors/dhl_parcel_de/karrio/providers/dhl_parcel_de/error.py b/modules/connectors/dhl_parcel_de/karrio/providers/dhl_parcel_de/error.py index 455939c2ac..15b0ffe57f 100644 --- a/modules/connectors/dhl_parcel_de/karrio/providers/dhl_parcel_de/error.py +++ b/modules/connectors/dhl_parcel_de/karrio/providers/dhl_parcel_de/error.py @@ -18,7 +18,7 @@ def parse_error_response( or ( isinstance(response.get("status"), dict) and "title" in response.get("status", {}) - and (response.get("status", {}).get("title") or "") != "ok" + and (response.get("status", {}).get("title") or "").lower() != "ok" ) ) ] diff --git a/modules/connectors/dhl_parcel_de/karrio/providers/dhl_parcel_de/shipment/create.py b/modules/connectors/dhl_parcel_de/karrio/providers/dhl_parcel_de/shipment/create.py index 8363f1252a..2df044332b 100644 --- a/modules/connectors/dhl_parcel_de/karrio/providers/dhl_parcel_de/shipment/create.py +++ b/modules/connectors/dhl_parcel_de/karrio/providers/dhl_parcel_de/shipment/create.py @@ -25,7 +25,7 @@ def parse_shipment_response( for _, item in enumerate(items, start=1) ] ) - if any(items) + if any([lib.failsafe(lambda: _["sstatus"]["statusCode"]) == 200 for _ in items]) else None ) @@ -42,6 +42,8 @@ def _extract_details( invoice = getattr(shipment.customsDoc, "b64", None) tracking_number = str(shipment.shipmentNo) + print("Touch........") + return models.ShipmentDetails( carrier_id=settings.carrier_id, carrier_name=settings.carrier_name, @@ -258,7 +260,7 @@ def shipment_request( request, lib.to_dict, dict( - validate="true", + # validate="true", docFormat=doc_format, printFormat=print_format, combine="true", diff --git a/modules/connectors/dhl_parcel_de/karrio/providers/dhl_parcel_de/units.py b/modules/connectors/dhl_parcel_de/karrio/providers/dhl_parcel_de/units.py index 24eec4eeb5..873b83e0d4 100644 --- a/modules/connectors/dhl_parcel_de/karrio/providers/dhl_parcel_de/units.py +++ b/modules/connectors/dhl_parcel_de/karrio/providers/dhl_parcel_de/units.py @@ -86,39 +86,39 @@ class ConnectionConfig(lib.Enum): class ShippingService(lib.Enum): """Carrier specific services""" - deutschepost_paket = "V01PAK" - deutschepost_warenpost = "V62WP" - deutschepost_europaket = "V54EPAK" - deutschepost_paket_international = "V53WPAK" - deutschepost_warenpost_international = "V66WPI" + dhl_parcel_de_paket = "V01PAK" + dhl_parcel_de_warenpost = "V62WP" + dhl_parcel_de_europaket = "V54EPAK" + dhl_parcel_de_paket_international = "V53WPAK" + dhl_parcel_de_warenpost_international = "V66WPI" class ShippingOption(lib.Enum): """Carrier specific options""" # fmt: off - deutshepost_preferred_neighbour = lib.OptionEnum("preferredNeighbour") - deutshepost_preferred_location = lib.OptionEnum("preferredLocation") - deutshepost_visual_check_of_age = lib.OptionEnum("visualCheckOfAge") - deutshepost_named_person_only = lib.OptionEnum("namedPersonOnly", bool) - # deutshepost_ident_check = lib.OptionEnum("identCheck") - deutshepost_signed_for_by_recipient = lib.OptionEnum("signedForByRecipient", bool) - deutshepost_endorsement = lib.OptionEnum("endorsement") - deutshepost_preferred_day = lib.OptionEnum("preferredDay") - deutshepost_no_neighbour_delivery = lib.OptionEnum("noNeighbourDelivery", bool) - deutshepost_additional_insurance = lib.OptionEnum("additionalInsurance", float) - deutschepost_bulky_goods = lib.OptionEnum("bulkyGoods", bool) - deutschepost_cash_on_delivery = lib.OptionEnum("cashOnDelivery", float) - deutschepost_individual_sender_requirement = lib.OptionEnum("individualSenderRequirement") - deutschepost_premium = lib.OptionEnum("premium", bool) - deutschepost_closest_drop_point = lib.OptionEnum("closestDropPoint", bool) - deutschepost_parcel_outlet_routing = lib.OptionEnum("parcelOutletRouting") - # deutschepost_dhl_retoure = lib.OptionEnum("dhlRetoure") - deutschepost_postal_delivery_duty_paid = lib.OptionEnum("postalDeliveryDutyPaid", bool) + dhl_parcel_de_preferred_neighbour = lib.OptionEnum("preferredNeighbour") + dhl_parcel_de_preferred_location = lib.OptionEnum("preferredLocation") + dhl_parcel_de_visual_check_of_age = lib.OptionEnum("visualCheckOfAge") + dhl_parcel_de_named_person_only = lib.OptionEnum("namedPersonOnly", bool) + # dhl_parcel_de_ident_check = lib.OptionEnum("identCheck") + dhl_parcel_de_signed_for_by_recipient = lib.OptionEnum("signedForByRecipient", bool) + dhl_parcel_de_endorsement = lib.OptionEnum("endorsement") + dhl_parcel_de_preferred_day = lib.OptionEnum("preferredDay") + dhl_parcel_de_no_neighbour_delivery = lib.OptionEnum("noNeighbourDelivery", bool) + dhl_parcel_de_additional_insurance = lib.OptionEnum("additionalInsurance", float) + dhl_parcel_de_bulky_goods = lib.OptionEnum("bulkyGoods", bool) + dhl_parcel_de_cash_on_delivery = lib.OptionEnum("cashOnDelivery", float) + dhl_parcel_de_individual_sender_requirement = lib.OptionEnum("individualSenderRequirement") + dhl_parcel_de_premium = lib.OptionEnum("premium", bool) + dhl_parcel_de_closest_drop_point = lib.OptionEnum("closestDropPoint", bool) + dhl_parcel_de_parcel_outlet_routing = lib.OptionEnum("parcelOutletRouting") + # dhl_parcel_de_dhl_retoure = lib.OptionEnum("dhlRetoure") + dhl_parcel_de_postal_delivery_duty_paid = lib.OptionEnum("postalDeliveryDutyPaid", bool) """ Unified Option type mapping """ - insurance = deutshepost_additional_insurance - cash_on_delivery = deutschepost_cash_on_delivery + insurance = dhl_parcel_de_additional_insurance + cash_on_delivery = dhl_parcel_de_cash_on_delivery # fmt: on @@ -158,7 +158,7 @@ class TrackingStatus(lib.Enum): DEFAULT_SERVICES = [ models.ServiceLevel( service_name="DHL Paket", - service_code="dpdhl_paket", + service_code="dhl_parcel_de_paket", currency="EUR", domicile=True, min_weight=0.01, @@ -172,7 +172,7 @@ class TrackingStatus(lib.Enum): ), models.ServiceLevel( service_name="DHL Paket International", - service_code="dpdhl_paket_international", + service_code="dhl_parcel_de_paket_international", currency="EUR", domicile=False, international=True, @@ -187,7 +187,7 @@ class TrackingStatus(lib.Enum): ), models.ServiceLevel( service_name="DHL EuroPaket", - service_code="dpdhl_europaket", + service_code="dhl_parcel_de_europaket", currency="EUR", domicile=False, international=True, @@ -202,7 +202,7 @@ class TrackingStatus(lib.Enum): ), models.ServiceLevel( service_name="DHL Warenpost", - service_code="dpdhl_warenpost", + service_code="dhl_parcel_de_warenpost", currency="EUR", domicile=True, international=False, @@ -217,7 +217,7 @@ class TrackingStatus(lib.Enum): ), models.ServiceLevel( service_name="DHL Warenpost International", - service_code="dpdhl_warenpost_international", + service_code="dhl_parcel_de_warenpost_international", currency="EUR", domicile=False, international=True, diff --git a/modules/connectors/dhl_parcel_de/tests/__init__.py b/modules/connectors/dhl_parcel_de/tests/__init__.py index 4f5653e6a7..3330e1adb2 100644 --- a/modules/connectors/dhl_parcel_de/tests/__init__.py +++ b/modules/connectors/dhl_parcel_de/tests/__init__.py @@ -1,2 +1,3 @@ from tests.dhl_parcel_de.test_shipment import * from tests.dhl_parcel_de.test_tracking import * +from tests.dhl_parcel_de.test_rate import * diff --git a/modules/connectors/dhl_parcel_de/tests/dhl_parcel_de/test_rate.py b/modules/connectors/dhl_parcel_de/tests/dhl_parcel_de/test_rate.py new file mode 100644 index 0000000000..e9333f0441 --- /dev/null +++ b/modules/connectors/dhl_parcel_de/tests/dhl_parcel_de/test_rate.py @@ -0,0 +1,69 @@ +import unittest +import karrio +from karrio.core.utils import DP +from karrio.core.models import RateRequest +from .fixture import gateway + + +class TestDHLParcelDERating(unittest.TestCase): + def setUp(self): + self.maxDiff = None + self.RateRequest = RateRequest(**rate_request_data) + + def test_parse_rate_response(self): + parsed_response = karrio.Rating.fetch(self.RateRequest).from_(gateway).parse() + + self.assertListEqual(DP.to_dict(parsed_response), ParsedRateResponse) + + +if __name__ == "__main__": + unittest.main() + + +rate_request_data = { + "recipient": { + "address_line1": "Kurt-Schumacher-Str. 20", + "street_number": "Apartment 107", + "city": "Bonn", + "country_code": "DE", + "email": "maria@musterfrau.de", + "person_name": "Maria Musterfrau", + "postal_code": "53113", + "phone_number": "+49 987654321", + }, + "shipper": { + "address_line1": "Sträßchensweg 10", + "street_number": "2. Etage", + "city": "Bonn", + "country_code": "DE", + "email": "max@mustermann.de", + "person_name": "My Online Shop GmbH", + "phone_number": "+49 123456789", + "postal_code": "53113", + }, + "parcels": [ + { + "dimension_unit": "CM", + "height": 10.0, + "length": 20.0, + "weight": 5, + "weight_unit": "KG", + "width": 15.0, + } + ], +} + + +ParsedRateResponse = [ + [ + { + "carrier_id": "dhl_parcel_de", + "carrier_name": "dhl_parcel_de", + "currency": "EUR", + "meta": {"service_name": "DHL Paket"}, + "service": "dhl_parcel_de_paket", + "total_charge": 0.0, + } + ], + [], +] diff --git a/modules/connectors/dhl_parcel_de/tests/dhl_parcel_de/test_shipment.py b/modules/connectors/dhl_parcel_de/tests/dhl_parcel_de/test_shipment.py index 7a52c88a47..94087949b0 100644 --- a/modules/connectors/dhl_parcel_de/tests/dhl_parcel_de/test_shipment.py +++ b/modules/connectors/dhl_parcel_de/tests/dhl_parcel_de/test_shipment.py @@ -40,7 +40,7 @@ def test_create_shipment(self): self.assertEqual( mock.call_args[1]["url"], - f"{gateway.settings.server_url}/v2/orders?validate=true&docFormat=PDF&printFormat=A4&combine=true", + f"{gateway.settings.server_url}/v2/orders?docFormat=PDF&printFormat=A4&combine=true", ) def test_cancel_shipment(self): @@ -90,7 +90,7 @@ def test_parse_error_response(self): ShipmentPayload = { - "service": "deutschepost_paket", + "service": "dhl_parcel_de_paket", "reference": "Order No. 1234", "shipper": { "company_name": "My Online Shop GmbH", @@ -123,7 +123,7 @@ def test_parse_error_response(self): } IntlShipmentPayload = { - "service": "deutschepost_europaket", + "service": "dhl_parcel_de_europaket", "reference": "Order No. 1234", "shipper": { "company_name": "My Online Shop GmbH", @@ -299,7 +299,6 @@ def test_parse_error_response(self): }, "product": "V54EPAK", "refNo": "Order No. 1234", - "services": {}, "shipDate": ANY, "shipper": { "addressHouse": "10", diff --git a/modules/sdk/karrio/universal/mappers/rating_proxy.py b/modules/sdk/karrio/universal/mappers/rating_proxy.py index bcd2aa0430..2a038feaab 100644 --- a/modules/sdk/karrio/universal/mappers/rating_proxy.py +++ b/modules/sdk/karrio/universal/mappers/rating_proxy.py @@ -130,7 +130,7 @@ def get_available_rates( match_min_weight_requirements = ( service.min_weight is not None and package.weight[service.weight_unit] - <= units.Weight(service.min_weight, service.weight_unit).value + >= units.Weight(service.min_weight, service.weight_unit).value ) or (service.min_weight is None) match_max_weight_requirements = ( service.max_weight is not None @@ -267,6 +267,18 @@ def get_available_rates( ) ) + print( + ">>>>>>", + destination_covered, + match_length_requirements, + match_height_requirements, + match_width_requirements, + match_min_weight_requirements, + match_max_weight_requirements, + selected_zone, + selected_zone is not None, + ) + if ( destination_covered and match_length_requirements diff --git a/packages/types/base.ts b/packages/types/base.ts index 29716ff649..64c25dc3da 100644 --- a/packages/types/base.ts +++ b/packages/types/base.ts @@ -352,6 +352,7 @@ export const CARRIER_THEMES: Collection = { 'dhl_universal': 'is-dhl', 'dpd': 'is-dpd', 'dpdhl': 'is-dhl', + 'dhl_parcel_de': 'is-dhl', 'eshipper': 'is-eshipper', 'easypost': 'is-easypost', 'geodis': 'is-geodis', @@ -400,6 +401,7 @@ export const CARRIER_IMAGES: Collection = { 'dhl_express': 'dhl_express', 'dhl_poland': 'dhl_express', 'dpdhl': 'dhl_express', + 'dhl_parcel_de': 'dhl_express', 'dhl_universal': 'dhl_universal', 'dpd': 'dpd', 'dpd_uk': 'dpd', diff --git a/packages/ui/components/carrier-badge.tsx b/packages/ui/components/carrier-badge.tsx index 7dd4a73bd3..ad4958d697 100644 --- a/packages/ui/components/carrier-badge.tsx +++ b/packages/ui/components/carrier-badge.tsx @@ -1,4 +1,4 @@ -import { CarrierSettingsCarrierNameEnum } from '@karrio/types'; +import { CARRIER_IMAGES, CarrierSettingsCarrierNameEnum } from '@karrio/types'; import { isNoneOrEmpty, p } from '@karrio/lib'; import Image from "next/image"; import React from 'react'; @@ -13,24 +13,23 @@ interface CarrierBadgeComponent extends React.AllHTMLAttributes } export const CarrierBadge: React.FC = ({ carrier_name, text_color, background, className, width, height, ...props }) => { + const carrier_img = CARRIER_IMAGES[carrier_name as any] || carrier_name; const query = new URLSearchParams(JSON.parse(JSON.stringify({ text_color: !!text_color ? encodeURIComponent(text_color) : undefined, background: !!background ? encodeURIComponent(background) : undefined, }))).toString(); - console.log('query', query); - return (
    {isNoneOrEmpty(query) ? {carrier_name : {carrier_name = ({ carrier_name, text_color, background, containerClassName, className, width, height, ...props }) => { + const carrier_img = CARRIER_IMAGES[carrier_name as any] || carrier_name; const query = new URLSearchParams(JSON.parse(JSON.stringify({ text_color: !!text_color ? encodeURIComponent(text_color) : undefined, background: !!background ? encodeURIComponent(background) : undefined, @@ -21,13 +22,13 @@ export const CarrierImage: React.FC = ({ carrier_name, te
    {isNoneOrEmpty(query) ? {carrier_name} : {carrier_name} = ({ required={field("api_key").required} />} + {field("dhl_api_key").exists && } + {field("laposte_api_key").exists && = ({ required={field("consumer_key").required} />} + {field("tracking_consumer_key").exists && } + {field("consumer_secret").exists && = ({ required={field("consumer_secret").required} />} + {field("tracking_consumer_secret").exists && } + {field("contract_id").exists && Date: Sun, 25 Feb 2024 06:45:17 -0800 Subject: [PATCH 16/20] docs: Add FAQ for issue --- apps/www/docs/product/resources/faq.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/www/docs/product/resources/faq.mdx b/apps/www/docs/product/resources/faq.mdx index a46319e889..ded225797d 100644 --- a/apps/www/docs/product/resources/faq.mdx +++ b/apps/www/docs/product/resources/faq.mdx @@ -21,3 +21,9 @@ See [Local Developement](/product/local-development) guide for a simple docker c ## How to set up the environment variables? See [Configuration](/product/self-hosting/environment) guide for full details on Karrio's deployment environment setup. + +## No active carrier connection found to process the request + +This error occurs when the karrio server is unable to find an active carrier connection to process the request. +If you have carrier accounts configured, make sure that the carrier accounts are active and that you requests are being sent +to the right environment. From 1f975a98a3cbd7b20a02c2cab02c88e7b949faf5 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Sun, 25 Feb 2024 10:14:15 -0800 Subject: [PATCH 17/20] fix: dhl_parcel_de invalide settings access --- .../dhl_parcel_de/karrio/mappers/dhl_parcel_de/proxy.py | 2 +- .../karrio/providers/dhl_parcel_de/shipment/create.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/connectors/dhl_parcel_de/karrio/mappers/dhl_parcel_de/proxy.py b/modules/connectors/dhl_parcel_de/karrio/mappers/dhl_parcel_de/proxy.py index 5290caafe5..eb85a9fb36 100644 --- a/modules/connectors/dhl_parcel_de/karrio/mappers/dhl_parcel_de/proxy.py +++ b/modules/connectors/dhl_parcel_de/karrio/mappers/dhl_parcel_de/proxy.py @@ -49,7 +49,7 @@ def cancel_shipment(self, request: lib.Serializable) -> lib.Deserializable[str]: def get_tracking(self, request: lib.Serializable) -> lib.Deserializable[str]: - if not all([self.tracking_consumer_key]): + if not all([self.settings.tracking_consumer_key]): raise Exception( "The tracking_consumer_key is required for Track API requests." ) diff --git a/modules/connectors/dhl_parcel_de/karrio/providers/dhl_parcel_de/shipment/create.py b/modules/connectors/dhl_parcel_de/karrio/providers/dhl_parcel_de/shipment/create.py index 2df044332b..059e1a61f3 100644 --- a/modules/connectors/dhl_parcel_de/karrio/providers/dhl_parcel_de/shipment/create.py +++ b/modules/connectors/dhl_parcel_de/karrio/providers/dhl_parcel_de/shipment/create.py @@ -42,8 +42,6 @@ def _extract_details( invoice = getattr(shipment.customsDoc, "b64", None) tracking_number = str(shipment.shipmentNo) - print("Touch........") - return models.ShipmentDetails( carrier_id=settings.carrier_id, carrier_name=settings.carrier_name, From 70d911c29354e6ce9a5c310a978cceaddb18964b Mon Sep 17 00:00:00 2001 From: Daniel K Date: Mon, 26 Feb 2024 00:33:22 -0800 Subject: [PATCH 18/20] feat(dashboard): Add support for dynamic carrier specific options fields --- .../src/modules/Orders/create_label.tsx | 66 +++++++++------ .../src/modules/Shipments/create_label.tsx | 83 ++++++++++--------- packages/hooks/carrier-connections.ts | 20 +++-- packages/types/base.ts | 2 +- packages/ui/modals/connect-provider-modal.tsx | 2 +- 5 files changed, 103 insertions(+), 70 deletions(-) diff --git a/apps/dashboard/src/modules/Orders/create_label.tsx b/apps/dashboard/src/modules/Orders/create_label.tsx index 9a18d827dc..d6b2a3fecc 100644 --- a/apps/dashboard/src/modules/Orders/create_label.tsx +++ b/apps/dashboard/src/modules/Orders/create_label.tsx @@ -27,6 +27,7 @@ import { useLabelDataMutation } from '@karrio/hooks/label-data'; import { InputField } from '@karrio/ui/components/input-field'; import { useNotifier } from '@karrio/ui/components/notifier'; import { DashboardLayout } from '@/layouts/dashboard-layout'; +import { useAPIMetadata } from '@karrio/hooks/api-metadata'; import { useLoader } from '@karrio/ui/components/loader'; import { ModalProvider } from '@karrio/ui/modals/modal'; import { Spinner } from '@karrio/ui/components/spinner'; @@ -52,6 +53,7 @@ export default function CreateShipmentPage(pageProps: any) { const loader = useLoader(); const notifier = useNotifier(); const { basePath } = useAppMode(); + const { references } = useAPIMetadata(); const { carrierOptions } = useConnections(); const { addUrlParam, ...router } = useLocation(); const { query: templates } = useDefaultTemplates(); @@ -545,8 +547,9 @@ export default function CreateShipmentPage(pageProps: any) {
    + {/* CARRIER OPTIONS SECTION */} - {carrierOptions.length > 0 &&
    + {Object.keys(carrierOptions).length > 0 &&
    {({ open }) => ( @@ -558,32 +561,45 @@ export default function CreateShipmentPage(pageProps: any) { {open ? : } - - - {(carrierOptions.includes("dpdhl_packstation")) && <> - {/* dpdhl packstation */} - onChange({ options: { ...shipment.options, dpdhl_packstation: e.target.checked === true ? "" : null } })} - > - Packstation - - -
    + + + {Object.entries(carrierOptions).map(([carrier, options]) => + + +
    + +
    + + {options.map((option, index) => + + {references!.options[carrier][option]?.type === 'boolean' && <> + onChange({ options: { ...shipment.options, [option]: e.target.checked || null } })} + > + {formatRef(option)} + + } + + {references!.options[carrier][option]?.type === 'string' && <> + onChange({ options: { ...shipment.options, [option]: e.target.value } })} + /> + } + + )} - onChange({ options: { ...shipment.options, dpdhl_packstation: e.target.value } })} - />
    - } + +
    + +
    )}
    diff --git a/apps/dashboard/src/modules/Shipments/create_label.tsx b/apps/dashboard/src/modules/Shipments/create_label.tsx index 5b6c142953..1a2f4f255a 100644 --- a/apps/dashboard/src/modules/Shipments/create_label.tsx +++ b/apps/dashboard/src/modules/Shipments/create_label.tsx @@ -26,6 +26,7 @@ import { useLabelDataMutation } from '@karrio/hooks/label-data'; import { InputField } from '@karrio/ui/components/input-field'; import { DashboardLayout } from '@/layouts/dashboard-layout'; import { useNotifier } from '@karrio/ui/components/notifier'; +import { useAPIMetadata } from '@karrio/hooks/api-metadata'; import { ModalProvider } from '@karrio/ui/modals/modal'; import { Spinner } from '@karrio/ui/components/spinner'; import { bundleContexts } from '@karrio/hooks/utils'; @@ -48,6 +49,7 @@ export default function CreateLabelPage(pageProps: any) { const Component: React.FC = () => { const notifier = useNotifier(); const { basePath } = useAppMode(); + const { references } = useAPIMetadata(); const { carrierOptions } = useConnections(); const { addUrlParam, ...router } = useLocation(); const { query: templates } = useDefaultTemplates(); @@ -477,12 +479,9 @@ export default function CreateLabelPage(pageProps: any) { defaultValue={shipment.options?.insurance} required={!isNone(shipment.options?.insurance)} onChange={e => onChange({ options: { ...shipment.options, insurance: parseFloat(e.target.value) } })} - > - - - - {shipment.options?.currency} - + addonLeft={} + addonRight={{shipment.options?.currency}} + />
    @@ -510,12 +509,9 @@ export default function CreateLabelPage(pageProps: any) { defaultValue={shipment.options?.cash_on_delivery} required={!isNone(shipment.options?.cash_on_delivery)} onChange={e => onChange({ options: { ...shipment.options, cash_on_delivery: parseFloat(e.target.value) } })} - > - - - - {shipment.options?.currency} - + addonLeft={} + addonRight={{shipment.options?.currency}} + />
    @@ -580,7 +576,7 @@ export default function CreateLabelPage(pageProps: any) {
    {/* CARRIER OPTIONS SECTION */} - {carrierOptions.length > 0 &&
    + {Object.keys(carrierOptions).length > 0 &&
    {({ open }) => ( @@ -592,32 +588,45 @@ export default function CreateLabelPage(pageProps: any) { {open ? : } - - - {(carrierOptions.includes("dpdhl_packstation")) && <> - {/* dpdhl packstation */} - onChange({ options: { ...shipment.options, dpdhl_packstation: e.target.checked === true ? "" : null } })} - > - Packstation - - -
    + + + {Object.entries(carrierOptions).map(([carrier, options]) => + + +
    + +
    + + {options.map((option, index) => + + {references!.options[carrier][option]?.type === 'boolean' && <> + onChange({ options: { ...shipment.options, [option]: e.target.checked || null } })} + > + {formatRef(option)} + + } + + {references!.options[carrier][option]?.type === 'string' && <> + onChange({ options: { ...shipment.options, [option]: e.target.value } })} + /> + } + + )} - onChange({ options: { ...shipment.options, dpdhl_packstation: e.target.value } })} - />
    - } + +
    + +
    )}
    diff --git a/packages/hooks/carrier-connections.ts b/packages/hooks/carrier-connections.ts index 9e6f9b6b3f..5b265d56d5 100644 --- a/packages/hooks/carrier-connections.ts +++ b/packages/hooks/carrier-connections.ts @@ -2,18 +2,26 @@ import { useCarrierConnections } from "./user-connection"; import React from 'react'; export function useConnections() { - const [carrierOptions, setCarrierOptions] = React.useState([]); + const [carrierOptions, setCarrierOptions] = React.useState>({}); const { query: { data: { user_connections = [] } = {}, ...query } } = useCarrierConnections(); React.useEffect(() => { if (!query.isFetched) { return; } - const _options: string[][] = (user_connections || []).map( - (_: any) => (_.active ? _.config?.shipping_options || [] : []) as string[], - [], + setCarrierOptions( + (user_connections || []) + .filter(_ => _.active && (_.config?.shipping_options || []).length > 0) + .reduce( + (acc, _) => ({ + ...acc, + [_.carrier_name]: [...new Set([ + ...(acc[_.carrier_name] as string[] || []), + ...(_.config?.shipping_options || []) + ])] + }), + {} as Record, + ) ); - - setCarrierOptions(([] as string[]).concat(..._options)); }, [user_connections, query.isFetched]); return { diff --git a/packages/types/base.ts b/packages/types/base.ts index 64c25dc3da..d1100f0e9f 100644 --- a/packages/types/base.ts +++ b/packages/types/base.ts @@ -322,7 +322,7 @@ export interface References { carriers: Collection; custom_carriers: Collection; states: Collection; - options: Collection; + options: Collection>; services: Collection; option_names: Collection; service_names: Collection; diff --git a/packages/ui/modals/connect-provider-modal.tsx b/packages/ui/modals/connect-provider-modal.tsx index bfab64bf3e..ebeb06eb6b 100644 --- a/packages/ui/modals/connect-provider-modal.tsx +++ b/packages/ui/modals/connect-provider-modal.tsx @@ -585,7 +585,7 @@ export const ConnectProviderModal: React.FC = ({ {/* Carrier config section */} - {carrier_name.toString() in connection_configs &&
    + {carrier_name.toString() in (connection_configs || {}) &&
    {({ open }) => ( From 0ba337cc40b984fddf70a5717accd7704fd9b610 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Mon, 26 Feb 2024 00:35:15 -0800 Subject: [PATCH 19/20] fix(FedEx): smartpost options data types --- modules/connectors/fedex/karrio/providers/fedex/units.py | 4 ++-- .../connectors/fedex_ws/karrio/providers/fedex_ws/units.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/connectors/fedex/karrio/providers/fedex/units.py b/modules/connectors/fedex/karrio/providers/fedex/units.py index 0a56c8e6e0..99d02463ec 100644 --- a/modules/connectors/fedex/karrio/providers/fedex/units.py +++ b/modules/connectors/fedex/karrio/providers/fedex/units.py @@ -276,8 +276,8 @@ class ShippingOption(lib.Enum): fedex_one_rate = lib.OptionEnum("FEDEX_ONE_RATE", bool) fedex_freight_guarantee = lib.OptionEnum("FREIGHT_GUARANTEE", bool) fedex_saturday_delivery = lib.OptionEnum("SATURDAY_DELIVERY", bool) - fedex_smart_post_hub_id = lib.OptionEnum("SMART_POST_HUB_ID", bool) - fedex_smart_post_allowed_indicia = lib.OptionEnum("SMART_POST_ALLOWED_INDICIA", bool) + fedex_smart_post_hub_id = lib.OptionEnum("SMART_POST_HUB_ID") + fedex_smart_post_allowed_indicia = lib.OptionEnum("SMART_POST_ALLOWED_INDICIA") """ Package Options """ diff --git a/modules/connectors/fedex_ws/karrio/providers/fedex_ws/units.py b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/units.py index 820ecd7163..f5fe71b2c6 100644 --- a/modules/connectors/fedex_ws/karrio/providers/fedex_ws/units.py +++ b/modules/connectors/fedex_ws/karrio/providers/fedex_ws/units.py @@ -400,8 +400,8 @@ class ShippingOption(utils.Enum): fedex_one_rate = utils.OptionEnum("FEDEX_ONE_RATE", bool) fedex_freight_guarantee = utils.OptionEnum("FREIGHT_GUARANTEE", bool) fedex_saturday_delivery = utils.OptionEnum("SATURDAY_DELIVERY", bool) - fedex_smart_post_hub_id = utils.OptionEnum("SMART_POST_HUB_ID", bool) - fedex_smart_post_allowed_indicia = utils.OptionEnum("SMART_POST_ALLOWED_INDICIA", bool) + fedex_smart_post_hub_id = utils.OptionEnum("SMART_POST_HUB_ID") + fedex_smart_post_allowed_indicia = utils.OptionEnum("SMART_POST_ALLOWED_INDICIA") """ Package Options """ From c65d4207f1197f3821b179c57948421e825de1a4 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Mon, 26 Feb 2024 00:55:07 -0800 Subject: [PATCH 20/20] release: 2024.2.rc7 --- apps/api/karrio/server/VERSION | 2 +- bin/deploy-hobby | 4 +- bin/upgrade-hobby | 2 +- docker/docker-compose.yml | 6 +- packages/hooks/carrier-connections.ts | 4 +- packages/types/rest/api.ts | 4 +- packages/types/rest/base.ts | 4 +- packages/types/rest/common.ts | 4 +- packages/types/rest/configuration.ts | 4 +- packages/types/rest/index.ts | 4 +- requirements.build.txt | 2 + requirements.txt | 131 +++++++------- schemas/graphql-admin.json | 20 +-- schemas/graphql.json | 20 +-- schemas/openapi.yml | 238 ++++++++++++++++---------- source.requirements.txt | 57 +++--- 16 files changed, 273 insertions(+), 233 deletions(-) diff --git a/apps/api/karrio/server/VERSION b/apps/api/karrio/server/VERSION index 500e109833..912e609f0a 100644 --- a/apps/api/karrio/server/VERSION +++ b/apps/api/karrio/server/VERSION @@ -1 +1 @@ -2024.2.rc6 +2024.2.rc7 diff --git a/bin/deploy-hobby b/bin/deploy-hobby index be618b7ac9..f49e6bbc8b 100755 --- a/bin/deploy-hobby +++ b/bin/deploy-hobby @@ -2,7 +2,7 @@ set -e -export KARRIO_TAG="${KARRIO_TAG:-2024.2.rc4}" +export KARRIO_TAG="${KARRIO_TAG:-2024.2.rc7}" export SENTRY_DSN="${SENTRY_DSN:-'https://public@sentry.example.com/1'}" SECRET_KEY=$(head -c 28 /dev/urandom | sha224sum -b | head -c 56) @@ -23,7 +23,7 @@ if ! [ -z "$1" ] then export KARRIO_TAG=$1 else -echo "What version of Karrio would you like to install? (We default to '2024.2.rc4')" +echo "What version of Karrio would you like to install? (We default to '2024.2.rc7')" echo "You can check out available versions here: https://hub.docker.com/r/karrio/server/tags" read -r KARRIO_TAG_READ if [ -z "$KARRIO_TAG_READ" ] diff --git a/bin/upgrade-hobby b/bin/upgrade-hobby index d2cc6a301f..672b662b90 100755 --- a/bin/upgrade-hobby +++ b/bin/upgrade-hobby @@ -44,7 +44,7 @@ else fi [[ -f ".env" ]] && export $(cat .env | xargs) || ( echo "No .env file found. Please create it with SECRET_KEY and DOMAIN set." && exit 1) -export KARRIO_TAG="${KARRIO_TAG:-2024.2.rc4}" +export KARRIO_TAG="${KARRIO_TAG:-2024.2.rc7}" # get karrio scripts mkdir -p ./karrio diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 6f3498d1c8..5c838a7dfb 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -3,7 +3,7 @@ version: "3" services: api: container_name: karrio.api - image: karrio.docker.scarf.sh/karrio/server:2024.2.rc4 + image: karrio.docker.scarf.sh/karrio/server:2024.2.rc7 restart: unless-stopped ports: - ${KARRIO_HTTP_PORT}:${KARRIO_HTTP_PORT} @@ -25,7 +25,7 @@ services: worker: container_name: karrio.worker - image: karrio.docker.scarf.sh/karrio/server:2024.2.rc4 + image: karrio.docker.scarf.sh/karrio/server:2024.2.rc7 restart: unless-stopped depends_on: - db @@ -46,7 +46,7 @@ services: dashboard: container_name: karrio.dashboard - image: karrio.docker.scarf.sh/karrio/dashboard:2024.2.rc4 + image: karrio.docker.scarf.sh/karrio/dashboard:2024.2.rc7 restart: unless-stopped ports: - ${DASHBOARD_PORT}:3000/tcp diff --git a/packages/hooks/carrier-connections.ts b/packages/hooks/carrier-connections.ts index 5b265d56d5..c5202f7a5e 100644 --- a/packages/hooks/carrier-connections.ts +++ b/packages/hooks/carrier-connections.ts @@ -14,10 +14,10 @@ export function useConnections() { .reduce( (acc, _) => ({ ...acc, - [_.carrier_name]: [...new Set([ + [_.carrier_name]: [...(new Set([ ...(acc[_.carrier_name] as string[] || []), ...(_.config?.shipping_options || []) - ])] + ])) as any] }), {} as Record, ) diff --git a/packages/types/rest/api.ts b/packages/types/rest/api.ts index 7f13b4768c..d2b7b6847d 100644 --- a/packages/types/rest/api.ts +++ b/packages/types/rest/api.ts @@ -2,9 +2,9 @@ /* eslint-disable */ /** * Karrio API - * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistics carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2024.2.rc6`. Read our API changelog to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. + * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistics carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2024.2.rc7`. Read our API changelog to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. * - * The version of the OpenAPI document: 2024.2.rc6 + * The version of the OpenAPI document: 2024.2.rc7 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/types/rest/base.ts b/packages/types/rest/base.ts index 613ac8e74e..d19f68f5ae 100644 --- a/packages/types/rest/base.ts +++ b/packages/types/rest/base.ts @@ -2,9 +2,9 @@ /* eslint-disable */ /** * Karrio API - * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistics carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2024.2.rc6`. Read our API changelog to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. + * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistics carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2024.2.rc7`. Read our API changelog to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. * - * The version of the OpenAPI document: 2024.2.rc6 + * The version of the OpenAPI document: 2024.2.rc7 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/types/rest/common.ts b/packages/types/rest/common.ts index a915e033e2..d588b04196 100644 --- a/packages/types/rest/common.ts +++ b/packages/types/rest/common.ts @@ -2,9 +2,9 @@ /* eslint-disable */ /** * Karrio API - * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistics carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2024.2.rc6`. Read our API changelog to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. + * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistics carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2024.2.rc7`. Read our API changelog to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. * - * The version of the OpenAPI document: 2024.2.rc6 + * The version of the OpenAPI document: 2024.2.rc7 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/types/rest/configuration.ts b/packages/types/rest/configuration.ts index 0d7082c66d..5a20b0b711 100644 --- a/packages/types/rest/configuration.ts +++ b/packages/types/rest/configuration.ts @@ -2,9 +2,9 @@ /* eslint-disable */ /** * Karrio API - * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistics carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2024.2.rc6`. Read our API changelog to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. + * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistics carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2024.2.rc7`. Read our API changelog to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. * - * The version of the OpenAPI document: 2024.2.rc6 + * The version of the OpenAPI document: 2024.2.rc7 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/types/rest/index.ts b/packages/types/rest/index.ts index 0e05fa541c..f544cfcb09 100644 --- a/packages/types/rest/index.ts +++ b/packages/types/rest/index.ts @@ -2,9 +2,9 @@ /* eslint-disable */ /** * Karrio API - * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistics carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2024.2.rc6`. Read our API changelog to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. + * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistics carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2024.2.rc7`. Read our API changelog to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. * - * The version of the OpenAPI document: 2024.2.rc6 + * The version of the OpenAPI document: 2024.2.rc7 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/requirements.build.txt b/requirements.build.txt index 6b7329705a..982a4e592e 100644 --- a/requirements.build.txt +++ b/requirements.build.txt @@ -16,12 +16,14 @@ Django==4.2.10 -e ./modules/connectors/chronopost -e ./modules/connectors/colissimo -e ./modules/connectors/dhl_express +-e ./modules/connectors/dhl_parcel_de -e ./modules/connectors/dhl_poland -e ./modules/connectors/dhl_universal -e ./modules/connectors/dicom -e ./modules/connectors/dpd -e ./modules/connectors/dpdhl -e ./modules/connectors/fedex +-e ./modules/connectors/fedex_ws -e ./modules/connectors/generic -e ./modules/connectors/geodis -e ./modules/connectors/laposte diff --git a/requirements.txt b/requirements.txt index 5f91317575..40607c87b5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,10 +7,9 @@ certifi==2024.2.2 cffi==1.16.0 charset-normalizer==3.3.2 click==8.1.7 -cryptography==42.0.4 +cryptography==42.0.5 cssselect2==0.7.0 defusedxml==0.7.1 -Deprecated==1.2.14 deprecation==2.1.0 diff-match-patch==20230430 dj-database-url==2.1.0 @@ -22,19 +21,19 @@ django-email-verification==0.3.3 django-filter==23.5 django-formtools==2.5.1 django-health-check==3.18.1 -django-import-export==3.3.6 +django-import-export==3.3.7 django-oauth-toolkit==2.3.0 django-otp==1.3.0 django-phonenumber-field==7.3.0 django-picklefield==3.1 django-redis==5.4.0 -django-two-factor-auth==1.15.5 +django-two-factor-auth==1.16.0 djangorestframework==3.14.0 djangorestframework-simplejwt==5.3.1 drf-api-tracking==1.8.4 drf-spectacular==0.27.1 et-xmlfile==1.1.0 -fonttools==4.47.2 +fonttools==4.49.0 graphql-core==3.2.3 gunicorn==21.2.0 h11==0.14.0 @@ -48,55 +47,58 @@ jsonfield==3.1.0 jsonschema==4.21.1 jsonschema-specifications==2023.12.1 jstruct==2021.11 -jwcrypto==1.5.1 --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio&subdirectory=modules/sdk --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.allied_express&subdirectory=modules/connectors/allied_express --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.amazon_shipping&subdirectory=modules/connectors/amazon_shipping --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.aramex&subdirectory=modules/connectors/aramex --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.asendia_us&subdirectory=modules/connectors/asendia_us --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.australiapost&subdirectory=modules/connectors/australiapost --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.boxknight&subdirectory=modules/connectors/boxknight --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.bpost&subdirectory=modules/connectors/bpost --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.canadapost&subdirectory=modules/connectors/canadapost --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.canpar&subdirectory=modules/connectors/canpar --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.chronopost&subdirectory=modules/connectors/chronopost --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.colissimo&subdirectory=modules/connectors/colissimo --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.dhl_express&subdirectory=modules/connectors/dhl_express --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.dhl_poland&subdirectory=modules/connectors/dhl_poland --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.dhl_universal&subdirectory=modules/connectors/dhl_universal --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.dicom&subdirectory=modules/connectors/dicom --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.dpd&subdirectory=modules/connectors/dpd --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.dpdhl&subdirectory=modules/connectors/dpdhl --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.easypost&subdirectory=modules/connectors/easypost --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.eshipper&subdirectory=modules/connectors/eshipper --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.fedex&subdirectory=modules/connectors/fedex --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.freightcom&subdirectory=modules/connectors/freightcom --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.generic&subdirectory=modules/connectors/generic --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.geodis&subdirectory=modules/connectors/geodis --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.laposte&subdirectory=modules/connectors/laposte --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.locate2u&subdirectory=modules/connectors/locate2u --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.nationex&subdirectory=modules/connectors/nationex --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.purolator&subdirectory=modules/connectors/purolator --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.roadie&subdirectory=modules/connectors/roadie --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.royalmail&subdirectory=modules/connectors/royalmail --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.sendle&subdirectory=modules/connectors/sendle --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.server&subdirectory=apps/api --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.server.admin&subdirectory=modules/admin --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.server.apps&subdirectory=modules/apps --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.server.core&subdirectory=modules/core --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.server.data&subdirectory=modules/data --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.server.documents&subdirectory=modules/documents --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.server.events&subdirectory=modules/events --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.server.graph&subdirectory=modules/graph --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.server.manager&subdirectory=modules/manager --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.server.orders&subdirectory=modules/orders --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.server.pricing&subdirectory=modules/pricing --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.server.proxy&subdirectory=modules/proxy --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.tnt&subdirectory=modules/connectors/tnt --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.ups&subdirectory=modules/connectors/ups --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.usps&subdirectory=modules/connectors/usps --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.usps_international&subdirectory=modules/connectors/usps_international --e git+ssh://git@github.com/karrioapi/karrio.git@5e9f9a780e415b75a7a0e62831e943b5383137e9#egg=karrio.zoom2u&subdirectory=modules/connectors/zoom2u +jwcrypto==1.5.4 +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio&subdirectory=modules/sdk +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.allied_express&subdirectory=modules/connectors/allied_express +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.allied_express_local&subdirectory=modules/connectors/allied_express_local +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.amazon_shipping&subdirectory=modules/connectors/amazon_shipping +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.aramex&subdirectory=modules/connectors/aramex +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.asendia_us&subdirectory=modules/connectors/asendia_us +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.australiapost&subdirectory=modules/connectors/australiapost +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.boxknight&subdirectory=modules/connectors/boxknight +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.bpost&subdirectory=modules/connectors/bpost +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.canadapost&subdirectory=modules/connectors/canadapost +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.canpar&subdirectory=modules/connectors/canpar +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.chronopost&subdirectory=modules/connectors/chronopost +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.colissimo&subdirectory=modules/connectors/colissimo +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.dhl_express&subdirectory=modules/connectors/dhl_express +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.dhl_parcel_de&subdirectory=modules/connectors/dhl_parcel_de +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.dhl_poland&subdirectory=modules/connectors/dhl_poland +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.dhl_universal&subdirectory=modules/connectors/dhl_universal +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.dicom&subdirectory=modules/connectors/dicom +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.dpd&subdirectory=modules/connectors/dpd +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.dpdhl&subdirectory=modules/connectors/dpdhl +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.easypost&subdirectory=modules/connectors/easypost +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.eshipper&subdirectory=modules/connectors/eshipper +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.fedex&subdirectory=modules/connectors/fedex +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.fedex_ws&subdirectory=modules/connectors/fedex_ws +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.freightcom&subdirectory=modules/connectors/freightcom +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.generic&subdirectory=modules/connectors/generic +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.geodis&subdirectory=modules/connectors/geodis +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.laposte&subdirectory=modules/connectors/laposte +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.locate2u&subdirectory=modules/connectors/locate2u +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.nationex&subdirectory=modules/connectors/nationex +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.purolator&subdirectory=modules/connectors/purolator +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.roadie&subdirectory=modules/connectors/roadie +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.royalmail&subdirectory=modules/connectors/royalmail +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.sendle&subdirectory=modules/connectors/sendle +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.server&subdirectory=apps/api +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.server.admin&subdirectory=modules/admin +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.server.apps&subdirectory=modules/apps +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.server.core&subdirectory=modules/core +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.server.data&subdirectory=modules/data +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.server.documents&subdirectory=modules/documents +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.server.events&subdirectory=modules/events +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.server.graph&subdirectory=modules/graph +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.server.manager&subdirectory=modules/manager +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.server.orders&subdirectory=modules/orders +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.server.pricing&subdirectory=modules/pricing +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.server.proxy&subdirectory=modules/proxy +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.tnt&subdirectory=modules/connectors/tnt +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.ups&subdirectory=modules/connectors/ups +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.usps&subdirectory=modules/connectors/usps +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.usps_international&subdirectory=modules/connectors/usps_international +-e git+ssh://git@github.com/karrioapi/karrio.git@0ba337cc40b984fddf70a5717accd7704fd9b610#egg=karrio.zoom2u&subdirectory=modules/connectors/zoom2u lxml==4.9.4 lxml-stubs==0.5.1 MarkupPy==1.14 @@ -107,9 +109,9 @@ oauthlib==3.2.2 odfpy==1.4.1 openpyxl==3.1.2 packaging==23.2 -phonenumbers==8.13.29 +phonenumbers==8.13.31 pillow==10.2.0 -posthog==3.3.4 +posthog==3.4.2 psutil==5.9.8 psycopg2-binary==2.9.9 py-soap==2020.3.2 @@ -128,24 +130,23 @@ qrcode==7.4.2 redis==5.0.1 referencing==0.33.0 requests==2.31.0 -rpds-py==0.17.1 -sentry-sdk==1.40.0 +rpds-py==0.18.0 +sentry-sdk==1.40.5 six==1.16.0 sqlparse==0.4.4 -strawberry-graphql==0.219.1 -strawberry-graphql-django==0.30.0 +strawberry-graphql==0.219.2 +strawberry-graphql-django==0.32.1 tablib==3.5.0 tinycss2==1.2.1 treepoem==3.23.0 -typing_extensions==4.9.0 +typing_extensions==4.10.0 uritemplate==4.1.1 -urllib3==2.2.0 -uvicorn==0.27.0.post1 +urllib3==2.2.1 +uvicorn==0.27.1 validators==0.22.0 -weasyprint==60.2 +weasyprint==61.0 webencodings==0.5.1 whitenoise==6.6.0 -wrapt==1.16.0 xlrd==2.0.1 xlwt==1.3.0 xmltodict==0.13.0 diff --git a/schemas/graphql-admin.json b/schemas/graphql-admin.json index 3b497cc83f..fa751229c2 100644 --- a/schemas/graphql-admin.json +++ b/schemas/graphql-admin.json @@ -18234,13 +18234,9 @@ "name": "customer_number", "description": null, "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null }, "defaultValue": null }, @@ -18248,13 +18244,9 @@ "name": "contract_id", "description": null, "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null }, "defaultValue": null }, diff --git a/schemas/graphql.json b/schemas/graphql.json index 84d5b13e08..6fe66d4ca6 100644 --- a/schemas/graphql.json +++ b/schemas/graphql.json @@ -34658,13 +34658,9 @@ "name": "customer_number", "description": null, "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null }, "defaultValue": null }, @@ -34672,13 +34668,9 @@ "name": "contract_id", "description": null, "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null }, "defaultValue": null }, diff --git a/schemas/openapi.yml b/schemas/openapi.yml index 4be4adc1d4..d74a9c8f2f 100644 --- a/schemas/openapi.yml +++ b/schemas/openapi.yml @@ -16,7 +16,7 @@ info: ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. - The current version is `2024.2.rc6`. + The current version is `2024.2.rc7`. Read our API changelog to learn more about backwards compatibility. @@ -86,7 +86,7 @@ info: All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. title: Karrio API - version: 2024.2.rc6 + version: 2024.2.rc7 paths: /: get: @@ -11940,6 +11940,9 @@ tags: ## Carriers | Carrier Name | Display Name | | ------------ | ------------ | + | australiapost | Australia Post | + | fedex | FedEx | + | fedex_ws | FedEx Web Service | | zoom2u | Zoom2u | | usps_international | USPS International | | usps | USPS | @@ -11969,14 +11972,11 @@ tags: | canadapost | Canada Post | | bpost | Belgian Post | | boxknight | BoxKnight | - | australiapost | Australia Post | | asendia_us | Asendia US | | aramex | Aramex | | amazon_shipping | AmazonShipping | | allied_express_local | Allied Express Local | | allied_express | Allied Express | - | fedex | FedEx | - | fedex_ws | FedEx Web Service | --- ## Services @@ -11984,6 +11984,122 @@ tags: when purchasing shipping labels using single call label creation. You can also find all of the possible service levels for each of your carrier accounts by using [this endpoint](#operation/&&get_services). + ### Australia Post + | Code | Service Name | + | ------------ | ------------ | + | australiapost_parcel_post | T28 | + | australiapost_express_post | E34 | + | australiapost_parcel_post_signature | 3D55 | + | australiapost_express_post_signature | 3J55 | + | australiapost_intl_standard_pack_track | PTI8 | + | australiapost_intl_standard_with_signature | PTI7 | + | australiapost_intl_express_merch | ECM8 | + | australiapost_intl_express_docs | ECD8 | + | australiapost_eparcel_post_returns | PR | + | australiapost_express_eparcel_post_returns | XPR | + + ### FedEx + | Code | Service Name | + | ------------ | ------------ | + | fedex_international_priority_express | FEDEX_INTERNATIONAL_PRIORITY_EXPRESS | + | fedex_international_first | INTERNATIONAL_FIRST | + | fedex_international_priority | FEDEX_INTERNATIONAL_PRIORITY | + | fedex_international_economy | INTERNATIONAL_ECONOMY | + | fedex_ground | FEDEX_GROUND | + | fedex_cargo_mail | FEDEX_CARGO_MAIL | + | fedex_cargo_international_premium | FEDEX_CARGO_INTERNATIONAL_PREMIUM | + | fedex_first_overnight | FIRST_OVERNIGHT | + | fedex_first_overnight_freight | FIRST_OVERNIGHT_FREIGHT | + | fedex_1_day_freight | FEDEX_1_DAY_FREIGHT | + | fedex_2_day_freight | FEDEX_2_DAY_FREIGHT | + | fedex_3_day_freight | FEDEX_3_DAY_FREIGHT | + | fedex_international_priority_freight | INTERNATIONAL_PRIORITY_FREIGHT | + | fedex_international_economy_freight | INTERNATIONAL_ECONOMY_FREIGHT | + | fedex_cargo_airport_to_airport | FEDEX_CARGO_AIRPORT_TO_AIRPORT | + | fedex_international_priority_distribution | INTERNATIONAL_PRIORITY_DISTRIBUTION | + | fedex_ip_direct_distribution_freight | FEDEX_IP_DIRECT_DISTRIBUTION_FREIGHT | + | fedex_intl_ground_distribution | INTL_GROUND_DISTRIBUTION | + | fedex_ground_home_delivery | GROUND_HOME_DELIVERY | + | fedex_smart_post | SMART_POST | + | fedex_priority_overnight | PRIORITY_OVERNIGHT | + | fedex_standard_overnight | STANDARD_OVERNIGHT | + | fedex_2_day | FEDEX_2_DAY | + | fedex_2_day_am | FEDEX_2_DAY_AM | + | fedex_express_saver | FEDEX_EXPRESS_SAVER | + | fedex_same_day | SAME_DAY | + | fedex_same_day_city | SAME_DAY_CITY | + | fedex_one_day_freight | FEDEX_ONE_DAY_FREIGHT | + | fedex_international_economy_distribution | INTERNATIONAL_ECONOMY_DISTRIBUTION | + | fedex_international_connect_plus | FEDEX_INTERNATIONAL_CONNECT_PLUS | + | fedex_international_distribution_freight | INTERNATIONAL_DISTRIBUTION_FREIGHT | + | fedex_regional_economy | FEDEX_REGIONAL_ECONOMY | + | fedex_next_day_freight | FEDEX_NEXT_DAY_FREIGHT | + | fedex_next_day | FEDEX_NEXT_DAY | + | fedex_next_day_10am | FEDEX_NEXT_DAY_10AM | + | fedex_next_day_12pm | FEDEX_NEXT_DAY_12PM | + | fedex_next_day_end_of_day | FEDEX_NEXT_DAY_END_OF_DAY | + | fedex_distance_deferred | FEDEX_DISTANCE_DEFERRED | + + ### FedEx Web Service + | Code | Service Name | + | ------------ | ------------ | + | fedex_europe_first_international_priority | EUROPE_FIRST_INTERNATIONAL_PRIORITY | + | fedex_1_day_freight | FEDEX_1_DAY_FREIGHT | + | fedex_2_day | FEDEX_2_DAY | + | fedex_2_day_am | FEDEX_2_DAY_AM | + | fedex_2_day_freight | FEDEX_2_DAY_FREIGHT | + | fedex_3_day_freight | FEDEX_3_DAY_FREIGHT | + | fedex_cargo_airport_to_airport | FEDEX_CARGO_AIRPORT_TO_AIRPORT | + | fedex_cargo_freight_forwarding | FEDEX_CARGO_FREIGHT_FORWARDING | + | fedex_cargo_international_express_freight | FEDEX_CARGO_INTERNATIONAL_EXPRESS_FREIGHT | + | fedex_cargo_international_premium | FEDEX_CARGO_INTERNATIONAL_PREMIUM | + | fedex_cargo_mail | FEDEX_CARGO_MAIL | + | fedex_cargo_registered_mail | FEDEX_CARGO_REGISTERED_MAIL | + | fedex_cargo_surface_mail | FEDEX_CARGO_SURFACE_MAIL | + | fedex_custom_critical_air_expedite | FEDEX_CUSTOM_CRITICAL_AIR_EXPEDITE | + | fedex_custom_critical_air_expedite_exclusive_use | FEDEX_CUSTOM_CRITICAL_AIR_EXPEDITE_EXCLUSIVE_USE | + | fedex_custom_critical_air_expedite_network | FEDEX_CUSTOM_CRITICAL_AIR_EXPEDITE_NETWORK | + | fedex_custom_critical_charter_air | FEDEX_CUSTOM_CRITICAL_CHARTER_AIR | + | fedex_custom_critical_point_to_point | FEDEX_CUSTOM_CRITICAL_POINT_TO_POINT | + | fedex_custom_critical_surface_expedite | FEDEX_CUSTOM_CRITICAL_SURFACE_EXPEDITE | + | fedex_custom_critical_surface_expedite_exclusive_use | FEDEX_CUSTOM_CRITICAL_SURFACE_EXPEDITE_EXCLUSIVE_USE | + | fedex_custom_critical_temp_assure_air | FEDEX_CUSTOM_CRITICAL_TEMP_ASSURE_AIR | + | fedex_custom_critical_temp_assure_validated_air | FEDEX_CUSTOM_CRITICAL_TEMP_ASSURE_VALIDATED_AIR | + | fedex_custom_critical_white_glove_services | FEDEX_CUSTOM_CRITICAL_WHITE_GLOVE_SERVICES | + | fedex_distance_deferred | FEDEX_DISTANCE_DEFERRED | + | fedex_express_saver | FEDEX_EXPRESS_SAVER | + | fedex_first_freight | FEDEX_FIRST_FREIGHT | + | fedex_freight_economy | FEDEX_FREIGHT_ECONOMY | + | fedex_freight_priority | FEDEX_FREIGHT_PRIORITY | + | fedex_ground | FEDEX_GROUND | + | fedex_international_priority_plus | FEDEX_INTERNATIONAL_PRIORITY_PLUS | + | fedex_next_day_afternoon | FEDEX_NEXT_DAY_AFTERNOON | + | fedex_next_day_early_morning | FEDEX_NEXT_DAY_EARLY_MORNING | + | fedex_next_day_end_of_day | FEDEX_NEXT_DAY_END_OF_DAY | + | fedex_next_day_freight | FEDEX_NEXT_DAY_FREIGHT | + | fedex_next_day_mid_morning | FEDEX_NEXT_DAY_MID_MORNING | + | fedex_first_overnight | FIRST_OVERNIGHT | + | fedex_ground_home_delivery | GROUND_HOME_DELIVERY | + | fedex_international_distribution_freight | INTERNATIONAL_DISTRIBUTION_FREIGHT | + | fedex_international_economy | INTERNATIONAL_ECONOMY | + | fedex_international_economy_distribution | INTERNATIONAL_ECONOMY_DISTRIBUTION | + | fedex_international_economy_freight | INTERNATIONAL_ECONOMY_FREIGHT | + | fedex_international_first | INTERNATIONAL_FIRST | + | fedex_international_ground | INTERNATIONAL_GROUND | + | fedex_international_priority | INTERNATIONAL_PRIORITY | + | fedex_international_priority_distribution | INTERNATIONAL_PRIORITY_DISTRIBUTION | + | fedex_international_priority_express | INTERNATIONAL_PRIORITY_EXPRESS | + | fedex_international_priority_freight | INTERNATIONAL_PRIORITY_FREIGHT | + | fedex_priority_overnight | PRIORITY_OVERNIGHT | + | fedex_same_day | SAME_DAY | + | fedex_same_day_city | SAME_DAY_CITY | + | fedex_same_day_metro_afternoon | SAME_DAY_METRO_AFTERNOON | + | fedex_same_day_metro_morning | SAME_DAY_METRO_MORNING | + | fedex_same_day_metro_rush | SAME_DAY_METRO_RUSH | + | fedex_smart_post | SMART_POST | + | fedex_standard_overnight | STANDARD_OVERNIGHT | + | fedex_transborder_distribution_consolidation | TRANSBORDER_DISTRIBUTION_CONSOLIDATION | + ### Zoom2u | Code | Service Name | | ------------ | ------------ | @@ -13014,11 +13130,11 @@ tags: ### DHL Parcel DE | Code | Service Name | | ------------ | ------------ | - | deutschepost_paket | V01PAK | - | deutschepost_warenpost | V62WP | - | deutschepost_europaket | V54EPAK | - | deutschepost_paket_international | V53WPAK | - | deutschepost_warenpost_international | V66WPI | + | dhl_parcel_de_paket | V01PAK | + | dhl_parcel_de_warenpost | V62WP | + | dhl_parcel_de_europaket | V54EPAK | + | dhl_parcel_de_paket_international | V53WPAK | + | dhl_parcel_de_warenpost_international | V66WPI | ### DHL Express | Code | Service Name | @@ -13143,14 +13259,6 @@ tags: | boxknight_nextday | NEXTDAY | | boxknight_scheduled | SCHEDULED | - ### Australia Post - | Code | Service Name | - | ------------ | ------------ | - | australiapost_parcel_post | T28 | - | australiapost_express_post | E34 | - | australiapost_parcel_post_signature | T28S | - | australiapost_express_post_signature | E34S | - ### Asendia US | Code | Service Name | | ------------ | ------------ | @@ -13168,6 +13276,10 @@ tags: ### Allied Express Local | Code | Service Name | | ------------ | ------------ | + | allied_road_service | R | + | allied_parcel_service | P | + | allied_standard_pallet_service | PT | + | allied_oversized_pallet_service | PT2 | | allied_local_normal_service | N | | allied_local_vip_service | V | | allied_local_executive_service | E | @@ -13181,70 +13293,25 @@ tags: | allied_standard_pallet_service | PT | | allied_oversized_pallet_service | PT2 | - ### FedEx Web Service - | Code | Service Name | - | ------------ | ------------ | - | fedex_europe_first_international_priority | EUROPE_FIRST_INTERNATIONAL_PRIORITY | - | fedex_1_day_freight | FEDEX_1_DAY_FREIGHT | - | fedex_2_day | FEDEX_2_DAY | - | fedex_2_day_am | FEDEX_2_DAY_AM | - | fedex_2_day_freight | FEDEX_2_DAY_FREIGHT | - | fedex_3_day_freight | FEDEX_3_DAY_FREIGHT | - | fedex_cargo_airport_to_airport | FEDEX_CARGO_AIRPORT_TO_AIRPORT | - | fedex_cargo_freight_forwarding | FEDEX_CARGO_FREIGHT_FORWARDING | - | fedex_cargo_international_express_freight | FEDEX_CARGO_INTERNATIONAL_EXPRESS_FREIGHT | - | fedex_cargo_international_premium | FEDEX_CARGO_INTERNATIONAL_PREMIUM | - | fedex_cargo_mail | FEDEX_CARGO_MAIL | - | fedex_cargo_registered_mail | FEDEX_CARGO_REGISTERED_MAIL | - | fedex_cargo_surface_mail | FEDEX_CARGO_SURFACE_MAIL | - | fedex_custom_critical_air_expedite | FEDEX_CUSTOM_CRITICAL_AIR_EXPEDITE | - | fedex_custom_critical_air_expedite_exclusive_use | FEDEX_CUSTOM_CRITICAL_AIR_EXPEDITE_EXCLUSIVE_USE | - | fedex_custom_critical_air_expedite_network | FEDEX_CUSTOM_CRITICAL_AIR_EXPEDITE_NETWORK | - | fedex_custom_critical_charter_air | FEDEX_CUSTOM_CRITICAL_CHARTER_AIR | - | fedex_custom_critical_point_to_point | FEDEX_CUSTOM_CRITICAL_POINT_TO_POINT | - | fedex_custom_critical_surface_expedite | FEDEX_CUSTOM_CRITICAL_SURFACE_EXPEDITE | - | fedex_custom_critical_surface_expedite_exclusive_use | FEDEX_CUSTOM_CRITICAL_SURFACE_EXPEDITE_EXCLUSIVE_USE | - | fedex_custom_critical_temp_assure_air | FEDEX_CUSTOM_CRITICAL_TEMP_ASSURE_AIR | - | fedex_custom_critical_temp_assure_validated_air | FEDEX_CUSTOM_CRITICAL_TEMP_ASSURE_VALIDATED_AIR | - | fedex_custom_critical_white_glove_services | FEDEX_CUSTOM_CRITICAL_WHITE_GLOVE_SERVICES | - | fedex_distance_deferred | FEDEX_DISTANCE_DEFERRED | - | fedex_express_saver | FEDEX_EXPRESS_SAVER | - | fedex_first_freight | FEDEX_FIRST_FREIGHT | - | fedex_freight_economy | FEDEX_FREIGHT_ECONOMY | - | fedex_freight_priority | FEDEX_FREIGHT_PRIORITY | - | fedex_ground | FEDEX_GROUND | - | fedex_international_priority_plus | FEDEX_INTERNATIONAL_PRIORITY_PLUS | - | fedex_next_day_afternoon | FEDEX_NEXT_DAY_AFTERNOON | - | fedex_next_day_early_morning | FEDEX_NEXT_DAY_EARLY_MORNING | - | fedex_next_day_end_of_day | FEDEX_NEXT_DAY_END_OF_DAY | - | fedex_next_day_freight | FEDEX_NEXT_DAY_FREIGHT | - | fedex_next_day_mid_morning | FEDEX_NEXT_DAY_MID_MORNING | - | fedex_first_overnight | FIRST_OVERNIGHT | - | fedex_ground_home_delivery | GROUND_HOME_DELIVERY | - | fedex_international_distribution_freight | INTERNATIONAL_DISTRIBUTION_FREIGHT | - | fedex_international_economy | INTERNATIONAL_ECONOMY | - | fedex_international_economy_distribution | INTERNATIONAL_ECONOMY_DISTRIBUTION | - | fedex_international_economy_freight | INTERNATIONAL_ECONOMY_FREIGHT | - | fedex_international_first | INTERNATIONAL_FIRST | - | fedex_international_ground | INTERNATIONAL_GROUND | - | fedex_international_priority | INTERNATIONAL_PRIORITY | - | fedex_international_priority_distribution | INTERNATIONAL_PRIORITY_DISTRIBUTION | - | fedex_international_priority_express | INTERNATIONAL_PRIORITY_EXPRESS | - | fedex_international_priority_freight | INTERNATIONAL_PRIORITY_FREIGHT | - | fedex_priority_overnight | PRIORITY_OVERNIGHT | - | fedex_same_day | SAME_DAY | - | fedex_same_day_city | SAME_DAY_CITY | - | fedex_same_day_metro_afternoon | SAME_DAY_METRO_AFTERNOON | - | fedex_same_day_metro_morning | SAME_DAY_METRO_MORNING | - | fedex_same_day_metro_rush | SAME_DAY_METRO_RUSH | - | fedex_smart_post | SMART_POST | - | fedex_standard_overnight | STANDARD_OVERNIGHT | - | fedex_transborder_distribution_consolidation | TRANSBORDER_DISTRIBUTION_CONSOLIDATION | - --- ## Parcel Templates Use any of the following templates when you ship with special carrier packaging. + ### FedEx Web Service + | Code | Dimensions | + | ------------ | ------------ | + | fedex_envelope_legal_size | 9.5 x 15.5 x 1 in | + | fedex_padded_pak | 11.75 x 14.75 x 1 in | + | fedex_polyethylene_pak | 12.0 x 15.5 x 1 in | + | fedex_clinical_pak | 13.5 x 18.0 x 1 in | + | fedex_small_box | 12.25 x 10.9 x 1.5 in | + | fedex_medium_box | 13.25 x 11.5 x 2.38 in | + | fedex_large_box | 17.88 x 12.38 x 3.0 in | + | fedex_extra_large_box | 11.88 x 11.0 x 10.75 in | + | fedex_10_kg_box | 15.81 x 12.94 x 10.19 in | + | fedex_25_kg_box | 21.56 x 16.56 x 13.19 in | + | fedex_tube | 38.0 x 6.0 x 6.0 in | + ### UPS | Code | Dimensions | | ------------ | ------------ | @@ -13308,19 +13375,4 @@ tags: | canadapost_xexpresspost_certified_envelope | 26.0 x 15.9 x 1.5 cm | | canadapost_xexpresspost_national_large_envelope | 40.0 x 29.2 x 1.5 cm | - ### FedEx Web Service - | Code | Dimensions | - | ------------ | ------------ | - | fedex_envelope_legal_size | 9.5 x 15.5 x 1 in | - | fedex_padded_pak | 11.75 x 14.75 x 1 in | - | fedex_polyethylene_pak | 12.0 x 15.5 x 1 in | - | fedex_clinical_pak | 13.5 x 18.0 x 1 in | - | fedex_small_box | 12.25 x 10.9 x 1.5 in | - | fedex_medium_box | 13.25 x 11.5 x 2.38 in | - | fedex_large_box | 17.88 x 12.38 x 3.0 in | - | fedex_extra_large_box | 11.88 x 11.0 x 10.75 in | - | fedex_10_kg_box | 15.81 x 12.94 x 10.19 in | - | fedex_25_kg_box | 21.56 x 16.56 x 13.19 in | - | fedex_tube | 38.0 x 6.0 x 6.0 in | - ... diff --git a/source.requirements.txt b/source.requirements.txt index ba4c2c5474..69c17d1bb7 100644 --- a/source.requirements.txt +++ b/source.requirements.txt @@ -3,14 +3,13 @@ asgiref==3.7.2 attrs==23.2.0 backoff==2.2.1 Brotli==1.1.0 -certifi==2023.11.17 +certifi==2024.2.2 cffi==1.16.0 charset-normalizer==3.3.2 click==8.1.7 -cryptography==42.0.4 +cryptography==42.0.5 cssselect2==0.7.0 defusedxml==0.7.1 -Deprecated==1.2.14 deprecation==2.1.0 diff-match-patch==20230430 dj-database-url==2.1.0 @@ -21,20 +20,20 @@ django-downloadview==2.3.0 django-email-verification==0.3.3 django-filter==23.5 django-formtools==2.5.1 -django-health-check==3.17.0 -django-import-export==3.3.6 +django-health-check==3.18.1 +django-import-export==3.3.7 django-oauth-toolkit==2.3.0 django-otp==1.3.0 django-phonenumber-field==7.3.0 django-picklefield==3.1 django-redis==5.4.0 -django-two-factor-auth==1.15.5 +django-two-factor-auth==1.16.0 djangorestframework==3.14.0 djangorestframework-simplejwt==5.3.1 drf-api-tracking==1.8.4 drf-spectacular==0.27.1 et-xmlfile==1.1.0 -fonttools==4.47.2 +fonttools==4.49.0 graphql-core==3.2.3 gunicorn==21.2.0 h11==0.14.0 @@ -48,12 +47,13 @@ jsonfield==3.1.0 jsonschema==4.21.1 jsonschema-specifications==2023.12.1 jstruct==2021.11 -jwcrypto==1.5.1 +jwcrypto==1.5.4 karrio @ file://${PWD}/modules/sdk -karrio.allied-express @ file://${PWD}/modules/connectors/allied_express -karrio.amazon-shipping @ file://${PWD}/modules/connectors/amazon_shipping +karrio.allied_express @ file://${PWD}/modules/connectors/allied_express +karrio.allied_express_local @ file://${PWD}/modules/connectors/allied_express_local +karrio.amazon_shipping @ file://${PWD}/modules/connectors/amazon_shipping karrio.aramex @ file://${PWD}/modules/connectors/aramex -karrio.asendia-us @ file://${PWD}/modules/connectors/asendia_us +karrio.asendia_us @ file://${PWD}/modules/connectors/asendia_us karrio.australiapost @ file://${PWD}/modules/connectors/australiapost karrio.boxknight @ file://${PWD}/modules/connectors/boxknight karrio.bpost @ file://${PWD}/modules/connectors/bpost @@ -61,15 +61,17 @@ karrio.canadapost @ file://${PWD}/modules/connectors/canadapost karrio.canpar @ file://${PWD}/modules/connectors/canpar karrio.chronopost @ file://${PWD}/modules/connectors/chronopost karrio.colissimo @ file://${PWD}/modules/connectors/colissimo -karrio.dhl-express @ file://${PWD}/modules/connectors/dhl_express -karrio.dhl-poland @ file://${PWD}/modules/connectors/dhl_poland -karrio.dhl-universal @ file://${PWD}/modules/connectors/dhl_universal +karrio.dhl_parcel_de @ file://${PWD}/modules/connectors/dhl_parcel_de +karrio.dhl_express @ file://${PWD}/modules/connectors/dhl_express +karrio.dhl_poland @ file://${PWD}/modules/connectors/dhl_poland +karrio.dhl_universal @ file://${PWD}/modules/connectors/dhl_universal karrio.dicom @ file://${PWD}/modules/connectors/dicom karrio.dpd @ file://${PWD}/modules/connectors/dpd karrio.dpdhl @ file://${PWD}/modules/connectors/dpdhl karrio.easypost @ file://${PWD}/modules/connectors/easypost karrio.eshipper @ file://${PWD}/modules/connectors/eshipper karrio.fedex @ file://${PWD}/modules/connectors/fedex +karrio.fedex_ws @ file://${PWD}/modules/connectors/fedex_ws karrio.freightcom @ file://${PWD}/modules/connectors/freightcom karrio.generic @ file://${PWD}/modules/connectors/generic karrio.geodis @ file://${PWD}/modules/connectors/geodis @@ -100,16 +102,16 @@ karrio.zoom2u @ file://${PWD}/modules/connectors/zoom2u lxml==4.9.4 lxml-stubs==0.5.1 MarkupPy==1.14 -MarkupSafe==2.1.4 +MarkupSafe==2.1.5 monotonic==1.6 more-itertools==10.2.0 oauthlib==3.2.2 odfpy==1.4.1 openpyxl==3.1.2 packaging==23.2 -phonenumbers==8.13.28 +phonenumbers==8.13.31 pillow==10.2.0 -posthog==3.3.2 +posthog==3.4.2 psutil==5.9.8 psycopg2-binary==2.9.9 py-soap==2020.3.2 @@ -122,30 +124,29 @@ pypng==0.20220715.0 python-barcode==0.15.1 python-dateutil==2.8.2 python-decouple==3.8 -pytz==2023.3.post1 +pytz==2024.1 PyYAML==6.0.1 qrcode==7.4.2 redis==5.0.1 -referencing==0.32.1 +referencing==0.33.0 requests==2.31.0 -rpds-py==0.17.1 -sentry-sdk==1.39.2 +rpds-py==0.18.0 +sentry-sdk==1.40.5 six==1.16.0 sqlparse==0.4.4 -strawberry-graphql==0.218.0 -strawberry-graphql-django==0.28.3 +strawberry-graphql==0.219.2 +strawberry-graphql-django==0.32.1 tablib==3.5.0 tinycss2==1.2.1 treepoem==3.23.0 -typing_extensions==4.9.0 +typing_extensions==4.10.0 uritemplate==4.1.1 -urllib3==2.1.0 -uvicorn==0.27.0 +urllib3==2.2.1 +uvicorn==0.27.1 validators==0.22.0 -weasyprint==60.2 +weasyprint==61.0 webencodings==0.5.1 whitenoise==6.6.0 -wrapt==1.16.0 xlrd==2.0.1 xlwt==1.3.0 xmltodict==0.13.0