Skip to content

Trouble using tax_identifiers on individual shipment objects within an order. Python 7.4.1 #52

@LoganSimonsen

Description

@LoganSimonsen

We are having trouble trying to figure out how to pass in tax_identifiers within an order. We verified we are using python client versions after 6.0.0, which is when tax_identifier support was implemented. If tax_identifiers do work in Python with Orders, can we get a code example? The goal is to have tax identifiers nested within each shipment object (in the shipments array) of an order.

Code snippet from client:

[a.keys() for a in data["order"]["shipments"]]
> [dict_keys(['parcel', 'carrier_accounts', 'options', 'customs_info', 'tax_identifiers'])]

this is getting covered into JSON and sent to the EasyPost API in this format:

{"order":{"to_address":{"name":"redacted redacted","company":null,"phone":"redacted","email":"[redacted@redacted.co.uk](mailto:redacted@redacted.co.uk)","street1":"redacted","street2":"redacted","city":"redacted","state":null,"zip":"redacted redacted","country":"redacted","residential":false},"from_address":{"name":"redacted redacted","company":null,"phone":"redacted","email":null,"street1":"redacted redacted Ave","street2":null,"city":"Tallmadge","state":"redacted","zip":"redacted-1431","country":"US","residential":false},"shipments":[{"parcel":{"weight":6.1},"carrier_accounts":["redacted"],"options":{"print_custom_1":"redacted","print_custom_2":"redacted","machinable":null,"label_size":"4x6","label_format":"PNG","incoterm":"CPT"},"customs_info":{"eel_pfc":null,"contents_type":"merchandise","contents_explanation":"redacted redacted redacted redacted","customs_certify":true,"non_delivery_option":"return","customs_items":[{"description":"3 redacted redacted","quantity":1,"value":20,"weight":6.0,"hs_tariff_number":"redacted","origin_country":"US","code":"redacted"}]},"tax_identifiers":[{"entity":"SENDER","tax_id":"redacted","tax_id_type":"VAT","issuing_country":"GB"}]}],"is_return":false,"carrier_accounts":
[{"id":"redacted"}]},"format":"json","controller":"orders","action":"create","version_prefix":"v2"}

as we can see in the JSON, tax_identifiers is being nested under the order object and not within the first shipment object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions