CarrierType
The CarrierType
object provides an interface for determining the valid fields of a CarrierAccount
.
The list of CarrierType
objects only changes when a new carrier is added to EasyPost.
The CarrierType
objects consist of their top level attributes as well as a Fields
object that contains credentials
and sometimes test_credentials
sub-objects, which themselves are collections of attributes for CarrierAccounts
creation, as well as metadata about presentation and the naming of said attributes.
There are a couple special case CarrierAccounts
, with structures differing somewhat from the norm.
For instance, instead of credentials for a "UspsAccount", it has only auto_link: true
, which indicates that it is an account that can be added or removed without any carrier-specific fields.
CarrierAccount
typeCarrierType
Fields
objectContains at least one of the following keys:
auto_link
credentials
test_credentials
custom_workflow
{
"object": "CarrierType",
"type": "AmazonMwsAccount",
"readable": "Amazon MWS",
"logo": null,
"fields": {
"credentials": {
"access_key_id": {
"visibility": "visible",
"label": "AWS Access Key ID"
},
"secret_key": {
"visibility": "password",
"label": "Secret Key"
},
"merchant_id": {
"visibility": "visible",
"label": "Seller ID"
}
}
}
}
true
, no other attributes are needed for CarrierAccount
creation.true
, CarrierAccount
creation of this type requires extra work not handled by the CarrierAccount
standard API.Credentials
objectCredentials
objectCarrierAccount
creation if you do not plan on using the CarrierAccount
for test mode.{
"credentials": {
"access_key_id": {
"visibility": "visible",
"label": "AWS Access Key ID"
},
"secret_key": {
"visibility": "password",
"label": "Secret Key"
},
"merchant_id": {
"visibility": "visible",
"label": "Seller ID"
}
}
}
CarrierAccounts
There are five possible values, which encode the security need and storage type for each attribute:
visible
checkbox
fake
password
masked
{
"access_key_id": {
"visibility": "visible",
"label": "AWS Access Key ID"
},
"secret_key": {
"visibility": "password",
"label": "Secret Key"
},
"merchant_id": {
"visibility": "visible",
"label": "Seller ID"
}
}
Production OnlyThis call will only work with your Production API Key.
The CarrierType
list is an unpaginated list of all carrier types available to the account of the given API key.
1curl -X GET https://api.easypost.com/v2/carrier_types \
2 -u "EASYPOST_API_KEY":
1[
2 {
3 "object": "CarrierType",
4 "type": "AmazonMwsAccount",
5 "readable": "Amazon MWS",
6 "logo": null,
7 "fields": {
8 "credentials": {
9 "access_key_id": {
10 "visibility": "visible",
11 "label": "AWS Access Key ID"
12 },
13 "secret_key": {
14 "visibility": "password",
15 "label": "Secret Key"
16 },
17 "merchant_id": {
18 "visibility": "visible",
19 "label": "Seller ID"
20 }
21 }
22 }
23 },
24 {
25 "object": "CarrierType",
26 "type": "ApcAccount",
27 "readable": "APC",
28 "logo": null,
29 "fields": {
30 "credentials": {
31 "shipper_id": {
32 "visibility": "visible",
33 "label": "APC Shipper ID"
34 },
35 "password": {
36 "visibility": "password",
37 "label": "APC Password"
38 },
39 "facility": {
40 "visibility": "visible",
41 "label": "APC Facility (e.g., NJ, LA)"
42 }
43 }
44 }
45 },
46 {
47 "object": "CarrierType",
48 "type": "AsendiaUsaAccount",
49 "readable": "Asendia USA",
50 "logo": null,
51 "fields": {
52 "credentials": {
53 "account_number": {
54 "visibility": "visible",
55 "label": "AsendiaUsa Account Number"
56 },
57 "sub_account_number": {
58 "visibility": "visible",
59 "label": "AsendiaUsa Sub Account Number"
60 },
61 "username": {
62 "visibility": "visible",
63 "label": "AsendiaUsa Username"
64 },
65 "password": {
66 "visibility": "password",
67 "label": "AsendiaUsa Password"
68 },
69 "api_key": {
70 "visibility": "masked",
71 "label": "AsendiaUsa API key"
72 },
73 "carrier_facility": {
74 "visibility": "select",
75 "label": "AsendiaUsa Carrier Facility / Processing Location (Optional)"
76 }
77 },
78 "test_credentials": {
79 "account_number": {
80 "visibility": "visible",
81 "label": "Test AsendiaUsa Account Number"
82 },
83 "sub_account_number": {
84 "visibility": "visible",
85 "label": "Test AsendiaUsa Sub Account Number"
86 },
87 "username": {
88 "visibility": "visible",
89 "label": "Test AsendiaUsa Username"
90 },
91 "password": {
92 "visibility": "password",
93 "label": "Test AsendiaUsa Password"
94 },
95 "api_key": {
96 "visibility": "masked",
97 "label": "Test AsendiaUsa API key"
98 },
99 "carrier_facility": {
100 "visibility": "select",
101 "label": "Test AsendiaUsa Carrier Facility / Processing Location (Optional)"
102 }
103 }
104 }
105 }
106]