USPS官方指引:https://developers.usps.com/getting-started
注意:USPS开发者中心已经迁移到了2.0版本,2.0版本的授权信息与1.0版本的授权信息不一样。目前USPS仅可申请2.0版本的授权信息。 2.0版本接口地址:https://apis.usps.com/(需要用2.0版本的授权信息)
1.0版本接口地址:https://api.usps.com/(需要用1.0版本的授权信息)
第一步:获取USPS帐号信息(CUID,Master MID,MID,EPA)
1、如果没有帐号可注册账号:https://reg.usps.com/entreg/RegistrationBusinessAction_input
2、登录帐号获取帐号信息(CUID,Master MID,MID,EPA)
登录地址:https://gateway.usps.com/eAdmin/view/signin 注意:如果找不到这些帐号信息,可联系USPS官方人员提供
第二步:进入开发者中心,申请开发者授权信息
1、使用第一步注册的USPS帐号登录开发者中心:https://developers.usps.com/
2、进入APP管理页面创建APP
2.1 添加APP
2.2 查看开发者Key和Secret,请求接口时需要用到这些信息
2.3 申请API访问权限
**Note: If you want to use the Labels APIs, it requires additional approval and configuration. The Labels APIs require you to be enrolled in USPS Ship for both outbound and return labels and have an Enterprise Payment Account. **
注意:创建APP时APIs只有公共接口(Public Access I)权限,如果要使用发货标签或退货标签接口,要求您注册 USPS Ship 的出境标签(outbound labels)和回邮标签(return labels),并拥有企业付款账户。还需要发送邮件申请Shipping API接口权限,不然无法创建发货和退件标签。USPS申请邮箱:APISupport@usps.gov。
邮件内容中需要中包括以下信息:
Using the Label API Reason --您要申请接口的原因,简单的描述一下
Your Name --联系人姓名
Contact Phone Number --联系人电话
Developer Portal Username --USPS开发者中心用户名
URL being called --接口地址,apis.usps.com
Customer Registration Id (CRID) --帐号CRID代码,需从USPS获取
Mailer Id (MID) --帐号MID代码,需从USPS获取
Developer Portal App Name --您在开发者中心创建的应用名称