You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

未提供公司信息时运单标签重复打印寄件人姓名问题咨询

EasyPost运单标签寄件人姓名重复问题解决方案

问题背景

使用EasyPost API的one-call buy接口创建运单时,from_address仅传入name字段(未提供company),生成的运单标签会重复打印寄件人姓名。尝试显式传入"company": ""或"company": null后,重复问题仍未解决。

是否为预期行为?

这并非EasyPost API的默认行为,而是所使用承运商的标签模板规则导致的:当地址对象中无有效company值时,部分承运商的模板会自动将name字段内容填充到company的显示位置,最终造成姓名重复。

无需添加真实公司名的解决方法

  • 拆分姓名字段:将from_address中的name拆分为first_name和last_name字段传入,承运商模板通常会正确解析这两个字段,避免重复填充。示例修改后的from_address:
    "from_address": {
      "city": "New York",
      "country": "US",
      "email": "sender@example.com",
      "first_name": "John",
      "last_name": "Doe",
      "phone": "1234567890",
      "state": "NY",
      "street1": "123 Main St",
      "street2": "",
      "zip": "10001"
    }
    
  • 使用空白占位符:尝试传入"company": " "(单个空格)代替空字符串或null,部分承运商会忽略空白的company值,不再重复显示姓名。
  • 联系EasyPost支持:确认当前使用的承运商标签模板是否支持自定义地址显示逻辑,通过EasyPost团队调整模板配置。

原始请求载荷

{
  "shipment": {
    "to_address": {
      "city": "Kabul",
      "company": "Test Company Afghanistan",
      "country": "AF",
      "email": "test.afg@example.com",
      "name": "Test Recipient",
      "phone": "93700000000",
      "state": "",
      "street1": "House #123, Street 4",
      "street2": "Shahr-e-Naw",
      "zip": "1001"
    },
    "from_address": {
      "city": "New York",
      "country": "US",
      "email": "sender@example.com",
      "name": "John Doe",
      "phone": "1234567890",
      "state": "NY",
      "street1": "123 Main St",
      "street2": "",
      "zip": "10001"
    },
    "parcel": {
      "height": 0.1,
      "length": 12,
      "weight": 10,
      "width": 9
    },
    "service": "Expedited",
    "carrier_accounts": [
      "ca_841001764fc24493a23025a8f1b1f416"
    ],
    "customs_info": {
      "contents_explanation": "Book",
      "customs_items": [
        {
          "description": "Book",
          "quantity": 1,
          "value": "10.0",
          "weight": 10.0
        }
      ]
    }
  }
}

内容的提问来源于stack exchange,提问作者Sagar Patil

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 23:38:24