EasyPost/easypost-ruby

[Bug]: Customs items do not save when using client.customs_info.create

Closed this issue · 1 comments

Software Version

5.0.0

Language Version

3.2.2

Operating System

MacOs

What happened?

  1. Wrote a Ruby script to create customs information. Passed in customs items as objects in an array:

client.customs_info.create({
contents_explanation: "Shipping label for returning company-owned equipment.",
contents_type: "documents",
customs_items: [
{
description: "Prepaid shipping label.",
hs_tariff_number: "4907.00.00",
origin_country: "US",
quantity: 1,
value: 1,
weight: 1
}
],
eel_pfc: "NOEEI 30.37(a)",
restriction_type: "none
})

  1. Ran the script from the command line.

  2. A customs_info object was returned and the customs items array is empty:

{
"id": "cstinfo_ad4983a1531b4ae190fc9db0022a6060",
"object": "CustomsInfo",
"created_at": "2023-06-15T20:44:14Z",
"updated_at": "2023-06-15T20:44:14Z",
"contents_explanation": "Shipping label for returning company-owned equipment.",
"contents_type": "documents",
"customs_certify": false,
"customs_signer": null,
"eel_pfc": "NOEEI 30.37(a)",
"non_delivery_option": "return",
"restriction_comments": null,
"restriction_type": "none",
"mode": "test",
"declaration": null,
"customs_items": [] <------
}

I tried these steps with other client libraries (Node, Python) and was able to create a custom_info object that included a filled-in customs_items

What was expected?

The expected behavior is for the customs_items to be populated when that data is included in a create request for customs_info

Sample Code

client.customs_info.create({
  contents_explanation: "Shipping label for returning company-owned equipment.",
  contents_type: "documents",
  customs_items: [
    {
      description: "Prepaid shipping label.",
      hs_tariff_number: "4907.00.00",
      origin_country: "US",
      quantity: 1,
      value: 1,
      weight: 1
    }
   ],
   eel_pfc: "NOEEI 30.37(a)",
   restriction_type: "none
 })

Relevant logs

Params sent to EasyPost: 
{"contents_explanation":"Shipping label for returning company-owned equipment.","contents_type":"documents","customs_items":[{"description":"Prepaid shipping label.","hs_tariff_number":"4907.00.00","origin_country":"US","quantity":1,"value":1,"weight":1}],"eel_pfc":"NOEEI 30.37(a)","restriction_type":"none","format":"json","controller":"customs_infos","action":"create","version_prefix":"v2","customs_info":{"contents_type":"documents","contents_explanation":"Shipping label for returning company-owned equipment.","restriction_type":"none","eel_pfc":"NOEEI 30.37(a)"}}

Response: 
{"id":"cstinfo_ad4983a1531b4ae190fc9db0022a6060","object":"CustomsInfo","created_at":"2023-06-15T20:44:14Z","updated_at":"2023-06-15T20:44:14Z","contents_explanation":"Shipping label for returning company-owned equipment.","contents_type":"documents","customs_certify":false,"customs_signer":null,"eel_pfc":"NOEEI 30.37(a)","non_delivery_option":"return","restriction_comments":null,"restriction_type":"none","mode":"test","declaration":null,"customs_items":[]}

Hey @mckayarchibald, thanks for reporting this! I can reproduce this. We'll work on getting a patch out soon.