Gateways
Create
The Gateway encapsulate the access to the carrier's API. A carrier gateway instance
can created by using the karrio.gateway
Gateway's initializer.
import karrio
carrier_gateway = karrio.gateway["carrier_name"].create(...)
Code sample
- Plain
- Typed
import karrio
# canadapost_gateway = karrio.gateway["carrier_name"].create(
canadapost_gateway = karrio.gateway["canadapost"].create(
{
"username": "username",
"password": "password",
"customer_number": "123456789",
"test": True
}
)
import karrio
# from karrio.mappers.[carrier].settings import Settings
from karrio.mappers.canadapost.settings import Settings
# canadapost_gateway = karrio.gateway["carrier_name"].create(
canadapost_gateway = karrio.gateway["canadapost"].create(
Settings(
username="username",
password="password",
customer_number="123456789",
test=True
)
)
Carrier Gateway Settings
Aramex Settings [carrier_name = aramex]
Name | Type | Description |
---|---|---|
username | str | required |
password | str | required |
account_pin | str | required |
account_entity | str | required |
account_number | str | required |
account_country_code | str | required |
id | str | |
test | bool | |
carrier_id | str |
Australia Post Settings [carrier_name = australiapost]
Name | Type | Description |
---|---|---|
api_key | str | required |
password | str | required |
account_number | str | required |
id | str | |
test | bool | |
carrier_id | str | |
account_country_code | str |
BoxKnight Settings [carrier_name = boxknight]
Name | Type | Description |
---|---|---|
username | str | required |
password | str | required |
id | str | |
test | bool | |
carrier_id | str | |
account_country_code | str |
Canada Post Settings [carrier_name = canadapost]
Name | Type | Description |
---|---|---|
username | str | required |
password | str | required |
customer_number | str | |
contract_id | str | |
language | str | |
id | str | |
test | bool | |
carrier_id | str | |
account_country_code | str |
Canpar Settings [carrier_name = canpar]
Name | Type | Description |
---|---|---|
username | str | required |
password | str | required |
language | str | |
id | str | |
test | bool | |
carrier_id | str | |
account_country_code | str |
DHL Express Settings [carrier_name = dhl_express]
Name | Type | Description |
---|---|---|
site_id | str | required |
password | str | required |
account_number | str | |
account_country_code | str | |
id | str | |
test | bool | |
carrier_id | str |
DHL Universal Settings [carrier_name = dhl_universal]
Name | Type | Description |
---|---|---|
consumer_key | str | required |
consumer_secret | str | required |
id | str | |
test | bool | |
carrier_id | str | |
account_country_code | str |
Dicom Settings [carrier_name = dicom]
Name | Type | Description |
---|---|---|
username | str | required |
password | str | required |
billing_account | str | |
id | str | |
test | bool | |
carrier_id | str | |
account_country_code | str |
FedEx Settings [carrier_name = fedex]
Name | Type | Description |
---|---|---|
user_key | str | required |
password | str | required |
meter_number | str | required |
account_number | str | required |
account_country_code | str | |
id | str | |
test | bool | |
carrier_id | str |
Purolator Settings [carrier_name = purolator]
Name | Type | Description |
---|---|---|
username | str | required |
password | str | required |
account_number | str | required |
language | str | |
user_token | str | |
id | str | |
test | bool | |
carrier_id | str | |
account_country_code | str |
Royal Mail Settings [carrier_name = royalmail]
Name | Type | Description |
---|---|---|
client_id | str | required |
client_secret | str | required |
id | str | |
test | bool | |
carrier_id | str | |
account_country_code | str |
Sendle Settings [carrier_name = sendle]
Name | Type | Description |
---|---|---|
sendle_id | str | required |
api_key | str | required |
id | str | |
test | bool | |
carrier_id | str | |
account_country_code | str |
SF-Express Settings [carrier_name = sf_express]
Name | Type | Description |
---|---|---|
partner_id | str | required |
check_word | str | required |
id | str | |
test | bool | |
carrier_id | str | |
account_country_code | str |
TNT Settings [carrier_name = tnt]
Name | Type | Description |
---|---|---|
username | str | required |
password | str | required |
account_number | str | |
account_country_code | str | |
id | str | |
test | bool | |
carrier_id | str |
UPS Settings [carrier_name = ups]
Name | Type | Description |
---|---|---|
username | str | required |
password | str | required |
access_license_number | str | required |
account_number | str | |
account_country_code | str | |
id | str | |
test | bool | |
carrier_id | str |
USPS Settings [carrier_name = usps]
Name | Type | Description |
---|---|---|
username | str | required |
password | str | required |
mailer_id | str | |
customer_registration_id | str | |
logistics_manager_mailer_id | str | |
id | str | |
test | bool | |
carrier_id | str | |
account_country_code | str |
USPS International Settings [carrier_name = usps_international]
Name | Type | Description |
---|---|---|
username | str | required |
password | str | required |
mailer_id | str | |
customer_registration_id | str | |
logistics_manager_mailer_id | str | |
id | str | |
test | bool | |
carrier_id | str | |
account_country_code | str |
Yanwen Settings [carrier_name = yanwen]
Name | Type | Description |
---|---|---|
customer_number | str | required |
license_key | str | required |
id | str | |
test | bool | |
carrier_id | str | |
account_country_code | str |
Yunexpress Settings [carrier_name = yunexpress]
Name | Type | Description |
---|---|---|
customer_number | str | required |
api_secret | str | required |
id | str | |
test | bool | |
carrier_id | str | |
account_country_code | str |
Shared Properties
Note that all carrier gateway defined bellow have these additional parameters
Name | Type | Description |
---|---|---|
carrier_name | str | default: carrier name (eg: canadapost, purolator...) |
id | str | |
test | boolean | |
account_country_code | str |