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 typeCarrierTypeFields objectContains at least one of the following keys:
auto_linkcredentialstest_credentialscustom_workflow
{
"object": "CarrierType",
"type": "UpsAccount",
"readable": "UPS",
"logo": null,
"fields": {
"credentials": {
"access_license_number": {
"visibility": "invisible",
"label": "UPS Access License Number"
},
"account_number": {
"visibility": "readonly",
"label": "UPS Account Number"
},
"user_id": {
"visibility": "invisible",
"label": "UPS.com User ID"
},
"password": {
"visibility": "invisible",
"label": "UPS.com Password"
},
"oauth_status": {
"visibility": "readonly",
"label": "OAuth Authorization Status"
},
"partner_oauth_url": {
"visibility": "readonly",
"label": "OAuth Portal URL"
}
}
}
}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_license_number": {
"visibility": "invisible",
"label": "UPS Access License Number"
},
"account_number": {
"visibility": "readonly",
"label": "UPS Account Number"
},
"user_id": {
"visibility": "invisible",
"label": "UPS.com User ID"
},
"password": {
"visibility": "invisible",
"label": "UPS.com Password"
},
"oauth_status": {
"visibility": "readonly",
"label": "OAuth Authorization Status"
},
"partner_oauth_url": {
"visibility": "readonly",
"label": "OAuth Portal URL"
}
}
}CarrierAccountsThere are five possible values, which encode the security need and storage type for each attribute:
visiblecheckboxfakepasswordmasked
{
"access_license_number": {
"visibility": "invisible",
"label": "UPS Access License Number"
},
"account_number": {
"visibility": "readonly",
"label": "UPS Account Number"
},
"user_id": {
"visibility": "invisible",
"label": "UPS.com User ID"
},
"password": {
"visibility": "invisible",
"label": "UPS.com Password"
},
"oauth_status": {
"visibility": "readonly",
"label": "OAuth Authorization Status"
},
"partner_oauth_url": {
"visibility": "readonly",
"label": "OAuth Portal URL"
}
}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": "UpsAccount",
5 "readable": "UPS",
6 "logo": null,
7 "fields": {
8 "credentials": {
9 "access_license_number": {
10 "visibility": "invisible",
11 "label": "UPS Access License Number"
12 },
13 "account_number": {
14 "visibility": "readonly",
15 "label": "UPS Account Number"
16 },
17 "user_id": {
18 "visibility": "invisible",
19 "label": "UPS.com User ID"
20 },
21 "password": {
22 "visibility": "invisible",
23 "label": "UPS.com Password"
24 },
25 "oauth_status": {
26 "visibility": "readonly",
27 "label": "OAuth Authorization Status"
28 },
29 "partner_oauth_url": {
30 "visibility": "readonly",
31 "label": "OAuth Portal URL"
32 }
33 }
34 }
35 },
36 {
37 "object": "CarrierType",
38 "type": "UpsMailInnovationsAccount",
39 "readable": "UPS Mail Innovations",
40 "logo": null,
41 "fields": {
42 "credentials": {
43 "account_number": {
44 "visibility": "visible",
45 "label": "UPS Shipper Number"
46 },
47 "user_id": {
48 "visibility": "visible",
49 "label": "UPS.com User ID"
50 },
51 "password": {
52 "visibility": "password",
53 "label": "UPS.com Password"
54 },
55 "customer_id": {
56 "visibility": "visible",
57 "label": "UPS customer id (optional)"
58 },
59 "customer_guid": {
60 "visibility": "visible",
61 "label": "UPS customer GUID (optional)"
62 },
63 "oauth_status": {
64 "visibility": "readonly",
65 "label": "OAuth Authorization Status"
66 },
67 "partner_oauth_url": {
68 "visibility": "readonly",
69 "label": "OAuth Portal URL"
70 }
71 }
72 }
73 },
74 {
75 "object": "CarrierType",
76 "type": "AccurateAccount",
77 "readable": "Accurate",
78 "logo": null,
79 "fields": {
80 "credentials": {
81 "username": {
82 "visibility": "visible",
83 "label": "Accurate username"
84 },
85 "password": {
86 "visibility": "password",
87 "label": "Accurate password"
88 }
89 },
90 "test_credentials": {
91 "username": {
92 "visibility": "visible",
93 "label": "Accurate test username"
94 },
95 "password": {
96 "visibility": "password",
97 "label": "Accurate test password"
98 }
99 }
100 }
101 }
102]