> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goshippo.com/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.goshippo.com/feedback

```json
{
  "path": "/api-reference/batches/add-shipments-to-a-batch",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Add shipments to a batch

> Adds batch shipments to an existing batch.



## OpenAPI

````yaml /spec/shippoapi/public-api.yaml post /batches/{BatchId}/add_shipments
openapi: 3.1.0
info:
  title: Shippo external API.
  version: '2018-02-08'
  x-logo:
    url: https://docs.goshippo.com/images/shippo-logo.svg
  contact:
    name: Shippo Developer Platform
    url: https://goshippo.com/contact/
  description: Use this API to integrate with the Shippo service
servers:
  - url: https://api.goshippo.com
security:
  - APIKeyHeader: []
tags:
  - name: Overview
    description: >-
      <p style="text-align: center; background-color: #F2F3F4; padding: 16px
      24px; border-radius: 4px;">
        First-time users and those looking for specific integration tutorials,
        <a href="/shippoapi/public-api/overview">see our full API documentation and guides.</a><br>
        Download the <a href="/spec/shippoapi/public-api.yaml">API Specification yaml file</a>
      </p>


      <h3>API Resources</h3>

      All API URLs listed in this documentation are relative to
      <b>https://api.goshippo.com/</b>.


      For example, the `/addresses/` resource is reachable at
      `https://api.goshippo.com/addresses/`.



      <h3>Authentication</h3>

      The API requires Shippo's token HTTP Authentication with your Shippo token
      (live or test). 


      In order to authenticate properly, please put `Authorization: ShippoToken
      <token>` in your header. You can find your token on the 

      <a href="https://goshippo.com/user/apikeys/">Shippo API settings page</a>.




      For more information about authentication and test mode, 

      <a
      href="https://docs.goshippo.com/docs/guides_general/authentication/">please
      visit our Authentication guide</a>.


      The API is available via Secure Socket Layer (SSL) only. All requests to
      the Shippo API must use TLS version 1.2 or higher.


      <h3>Request & Response Data</h3>

      Request data is passed to the API by <b>POSTing JSON objects</b> with the
      appropriate key/value-pairs to the respective 

      resource. The documentation for each API resource contains more details on
      the values accepted by a given resource.


      Response data also formatted as JSON object. You can specify how many
      results per page are to be returned. For instance, 

      `/rates/?results=25` will return up to 25 results.


      <h3>REST & Disposable Objects</h3>

      The Shippo API is built around <a
      href="http://en.wikipedia.org/wiki/Representational_State_Transfer">REST
      principles</a>. 

      Use POST requests to create objects, GET requests to retrieve objects, and
      PUT requests to update objects.


      Only the Carrier Accounts object can be updated via PUT requests. All
      other objects such as Addresses, Parcels, 

      Shipments, Rates, Transactions, Refunds, Customs Items, and Customs
      Declarations are disposable. This means that 

      once you have created an object, you cannot change it. Instead, create a
      new one with the desired values.


      <h3>API Version</h3>


      This reference guide supports the Shippo API version: `2018-02-08` . 


      To see reference guides for older API versions, see our <a
      href="https://docs.goshippo.com/docs/guides_general/legacy_reference/">legacy
      reference guide</a>. 

      For more information about Shippo API versions, see our <a
      href="https://docs.goshippo.com/docs/api_concepts/apiversioning/">API
      versions guide</a>.
  - name: Addresses
    description: >-
      Addresses are the locations a parcel is being shipped **from** and **to**.
      They represent company and residential places. Among other things, you can
      use address objects to create shipments, calculate shipping rates, and
      purchase shipping labels.
  - name: Parcels
    description: >-
      A parcel is an item you are shipping. The parcel object includes details
      about its physical make-up of the parcel. It includes dimensions and
      weight that Shippo uses to calculate rates.
  - name: Shipments
    description: >-
      A shipment is the act of transporting goods. A shipment object contains
      **to** and **from** addresses, and the parcel details that you are
      shipping. You can use the shipment object to retrieve shipping rates and
      purchase a shipping label.
  - name: Rates
    description: >-
      A rate is the cost to ship a parcel from a carrier. The rate object
      details the service level including the cost and transit time. 
  - name: Transactions
    x-displayName: Transactions (shipping labels)
    description: >-
      A transaction is the purchase of a shipping label from a shipping provider
      for a specific service. You can print purchased labels and used them to
      ship a parcel with a carrier, such as USPS or FedEx.
  - name: Customs Items
    description: >-
      Customs declarations are relevant information, including one or multiple
      customs items, you need to provide for customs clearance for your
      international shipments.
  - name: Customs Declarations
    description: >-
      Customs declarations are relevant information, including one or multiple
      customs items, you need to provide for 

      customs clearance for your international shipments.
  - name: Refunds
    description: >-
      Refunds are reimbursements for successfully created but unused shipping
      labels or other charges.
  - name: Manifests
    description: >-
      A manifest is a single-page document with a barcode that carriers can scan
      to accept all packages into transit without the need to scan each item
      individually.

      They are close-outs of shipping labels of a certain day. Some carriers
      require manifests to  process the shipments.
  - name: Carrier Accounts
    description: >-
      Carriers are the companies who deliver your package. Shippo uses Carrier
      account objects as credentials to retrieve shipping rates and purchase
      labels from shipping Carriers.
  - name: Webhooks
    description: >-
      Webhooks are a way for Shippo to notify your application when a specific
      event occurs. For example, when a label is purchased or when a shipment
      tracking status has changed. You can use webhooks to trigger actions in
      your application, such as sending an email or updating a database.
  - name: Tracking Status
    description: >-
      <p style="text-align: center; background-color: #F2F3F4;"></br>

      If you purchased your shipping label through Shippo, you can also get all
      the tracking details of your Shipment 

      from the <a href="/shippoapi/public-api/transactions">Transaction</a>
      object.

      </br></br></p>

      A tracking status of a package is an indication of current location of a
      package in the supply chain. For example,  sorting, warehousing, or out
      for delivery. Use the tracking status object to track the location of your
      shipments.


      When using your <a
      href="https://docs.goshippo.com/docs/guides_general/authentication/">Test</a>
      token for tracking, you need to use Shippo's 

      predefined tokens for testing different tracking statuses. You can find
      more information in our 

      <a href="https://docs.goshippo.com/docs/tracking/tracking/">Tracking
      tutorial</a> on how to do this, and what the 

      payloads look like.      
  - name: Batches
    description: >-
      A batch is a technique for creating multiple labels at once. Use the 
      batch object to create and purchase many shipments in two API calls. After
      creating the batch, retrieve the batch to verify that all shipments are
      valid. You can add and remove shipments after you have created the batch.
      When all shipments are valid you can purchase the batch and retrieve all
      the shipping labels.
  - name: Orders
    x-displayName: Orders (beta)
    description: >-
      An order is a request from a customer to purchase goods from a merchant.

      Use the orders object to load orders from your system to the Shippo
      dashboard.

      You can use the orders object to create, retrieve, list, and manage orders
      programmatically.

      You can also retrieve shipping rates, purchase labels, and track shipments
      for each order.
  - name: Pickups
    description: >-
      A pickup is when you schedule a carrier to collect a package for delivery.

      Use Shippo’s pickups endpoint to schedule pickups with USPS and DHL
      Express for eligible shipments that you have already created.
  - name: Service Groups
    description: >-
      A service group is a set of service levels grouped together. 

      Rates at checkout uses services groups to present available shipping
      options to customers in their shopping basket.
  - name: Carrier Parcel Templates
    description: >-
      A carrier parcel template represents a package used for shipping that has
      preset dimensions defined by a carrier. Some examples of a carrier parcel
      template include USPS Flat Rate Box and Fedex Small Pak. When using a
      carrier parcel template, the rates returned may be limited to the carrier
      that provides the box. You can create user parcel templates using a
      carrier parcel template. Shippo takes the dimensions of the carrier parcel
      template but you must configure the weight.
  - name: User Parcel Templates
    description: >-
      A user parcel template represents a package used for shipping that has
      preset dimensions and attributes defined 

      by you. They are useful for capturing attributes of parcel-types you
      frequently use for shipping, allowing 

      them to be defined once and then used for many shipments. These parcel
      templates can also be used for live rates.


      User parcel templates can also be created using a carrier parcel template,
      where the dimensions will be copied from 

      the carrier presets, but the weight can be configured by you.
  - name: Rates at Checkout
    description: >-
      Rates at checkout is a tool for merchants to display up-to-date shipping
      estimates based on what's in their customers cart and where they’re
      shipping to.

      Merchants set up curated shipping options for customers in the checkout
      flow based on data in the shopping cart. The request must include the
      **to** address and item information. Optional fields are the **from**
      address and package information. If the optional fields are not included,
      the service will use the default address and/or package configured for
      rates at checkout. The response is a list of shipping options based on the
      Service Group configuration.

      (see <a href="/shippoapi/public-api/service-groups">Service Group
      configuration</a> for details).




      # Default Parcel Template

      Assign one of your user parcel templates to be the default used when
      generating Live Rates. This template will be used by default when
      generating Live Rates, unless you explicitly provide a parcel in the Live
      Rates request.
  - name: Carriers
    description: >
      |Token | Carrier name|

      |:---|:---|

      | airterra | Airterra |

      | apc_postal | APC Postal|

      | apg | APG|

      | aramex | Aramex|

      | asendia_us | Asendia US|

      | australia_post | Australia Post (also used for Startrack)|

      | axlehire | Jitsu|

      | better_trucks | BetterTrucks|

      | borderguru | BorderGuru|

      | boxberry | Boxberry|

      | bring | Bring (also used for Posten Norge)|

      | canada_post | Canada Post|

      | chronopost | Chronopost|

      | collect_plus | CollectPlus|

      | correios_br | CorreiosBR|

      | correos_espana | Correos España |

      | colissimo | Colissimo|

      | deutsche_post | Deutsche Post|

      | dhl_benelux | DHL Benelux|

      | dhl_ecommerce | DHL eCommerce|

      | dhl_express | DHL Express|

      | dhl_germany_c2c | DHL Germany C2C|

      | dhl_germany | DHL Germany|

      | dpd_de | DPD GERMANY|

      | dpd_uk | DPD UK|

      | estafeta | Estafeta|

      | fastway_australia | Aramex|

      | fedex | FedEx|

      | globegistics | Globegistics (now Asendia)|

      | gls_us | GLS US|

      | gophr | Gophr|

      | gso | GSO|

      | hermes_germany_b2c | Hermes Germany B2C|

      | hermes_uk | Evri UK |

      | hongkong_post | Hongkong Post|

      | lasership | LaserShip|

      | lso | LSO|

      | mondial_relay | Mondial Relay|

      | new_zealand_post | New Zealand Post (also used for Pace and
      CourierPost)|

      | nippon_express | Nippon Express|

      | ontrac | OnTrac|

      | parcelforce | Parcelforce|

      | passport | Passport|

      | pcf | PCF|

      | poste_italiane | Poste Italiane |

      | posti | Posti|

      | purolator | Purolator|

      | royal_mail | Royal Mail|

      | royal_mail_sf | Royal Mail Storefeeder|

      | rr_donnelley | ePost Global|

      | russian_post | Russian Post|

      | skypostal | SkyPostal|

      | stuart | Stuart|

      | swyft | Swyft|

      | uds | UDS (United Delivery Service)|

      | ups | UPS|

      | usps | USPS|

      | veho | Veho |
  - name: Service Levels
    description: >
      Service levels represent the shipping service type for each carrier. Use
      the tokens below when creating shipments.


      ## USPS Service Levels

      |Token | Service name|

      |:---|:---|

      | usps_priority | Priority Mail|

      | usps_priority_express | Priority Mail Express|

      | usps_media_mail | Media Mail (grandfathered customers only)|

      | usps_priority_mail_international | Priority Mail International|

      | usps_priority_mail_express_international | Priority Mail Express
      International|

      | usps_first_class_package_international_service | First Class Package
      International|

      | usps_ground_advantage | Ground Advantage |


      ## FedEx Service Levels

      |Token | Service name|

      |:---|:---|

      | fedex_ground | FedEx Ground®|

      | fedex_home_delivery | FedEx Home Delivery®|

      | fedex_ground_economy | FedEx Ground® Economy|

      | fedex_2_day | FedEx 2Day®|

      | fedex_2_day_am | FedEx 2Day® A.M.|

      | fedex_express_saver | FedEx Express Saver®|

      | fedex_standard_overnight | FedEx Standard Overnight®|

      | fedex_priority_overnight | FedEx Priority Overnight®|

      | fedex_first_overnight | FedEx First Overnight®|

      | fedex_international_economy | FedEx International Economy®|

      | fedex_international_priority | FedEx International Priority®|

      | fedex_international_first | FedEx International First®|

      | fedex_international_connect_plus | FedEx International Connect Plus|


      ## UPS Service Levels

      |Token | Service name|

      |:---|:---|

      | ups_standard | UPS Standard|

      | ups_ground | UPS Ground|

      | ups_saver | UPS Saver|

      | ups_3_day_select | UPS 3 Day Select|

      | ups_second_day_air | UPS 2nd Day Air|

      | ups_second_day_air_am | UPS 2nd Day Air A.M.|

      | ups_next_day_air | UPS Next Day Air|

      | ups_next_day_air_saver | UPS Next Day Air Saver|

      | ups_next_day_air_early_am | UPS Next Day Air Early A.M.|

      | ups_express | UPS Express|

      | ups_express_plus | UPS Express Plus|

      | ups_expedited | UPS Expedited|


      ## Other Supported Carriers

      Additional service levels are available for: Airterra, APC Postal, APG,
      Asendia, Australia Post, 

      Better Trucks, Canada Post, Chronopost, Colissimo, Correos España, DHL
      Express, DHL eCommerce, 

      DHL Germany, DPD DE, DPD UK, Deutsche Post, Aramex Australia,
      Globegistics, GLS US, Jitsu, LaserShip, 

      LSO, Mondial Relay, OnTrac, Parcelforce, Poste Italiane, ePost Global,
      Purolator, Royal Mail, 

      Royal Mail Storefeeder, Swyft, UDS, Veho, and Evri UK.


      See the Schemas section for complete service level lists for each carrier.
  - name: Parcel Templates
    description: >
      A predefined package used by one or multiple carriers. When a template is
      given, the parcel dimensions 

      do not have to be sent - the dimensions below will instead be used. The
      parcel weight is not affected 

      by the use of a template.


      ## FedEx Parcel Templates

      |Token | Name | Dimensions|

      |:---|:---|:---|

      | FedEx_Box_10kg | FedEx® 10kg Box | 15.81 x 12.94 x 10.19 in|

      | FedEx_Box_25kg | FedEx® 25kg Box | 54.80 x 42.10 x 33.50 in|

      | FedEx_Box_Extra_Large_1 | FedEx® Extra Large Box (X1) | 11.88 x 11.00 x
      10.75 in|

      | FedEx_Box_Extra_Large_2 | FedEx® Extra Large Box (X2) | 15.75 x 14.13 x
      6.00 in|

      | FedEx_Box_Large_1 | FedEx® Large Box (L1) | 17.50 x 12.38 x 3.00 in|

      | FedEx_Box_Large_2 | FedEx® Large Box (L2) | 11.25 x 8.75 x 7.75 in|

      | FedEx_Box_Medium_1 | FedEx® Medium Box (M1) | 13.25 x 11.50 x 2.38 in|

      | FedEx_Box_Medium_2 | FedEx® Medium Box (M2) | 11.25 x 8.75 x 4.38 in|

      | FedEx_Box_Small_1 | FedEx® Small Box (S1) | 12.38 x 10.88 x 1.50 in|

      | FedEx_Box_Small_2 | FedEx® Small Box (S2) | 11.25 x 8.75 x 2.38 in|

      | FedEx_Envelope | FedEx® Envelope | 12.50 x 9.50 x 0.80 in|

      | FedEx_Padded_Pak | FedEx® Padded Pak | 11.75 x 14.75 x 2.00 in|

      | FedEx_Pak_1 | FedEx® Large Pak | 15.50 x 12.00 x 0.80 in|

      | FedEx_Pak_2 | FedEx® Small Pak | 12.75 x 10.25 x 0.80 in|

      | FedEx_Tube | FedEx® Tube | 38.00 x 6.00 x 6.00 in|

      | FedEx_XL_Pak | FedEx® Extra Large Pak | 17.50 x 20.75 x 2.00 in|


      ## UPS Parcel Templates

      |Token | Name | Dimensions|

      |:---|:---|:---|

      | UPS_Box_10kg | Box 10kg | 410.00 x 335.00 x 265.00 mm|

      | UPS_Box_25kg | Box 25kg | 484.00 x 433.00 x 350.00 mm|

      | UPS_Express_Box | Express Box | 460.00 x 315.00 x 95.00 mm|

      | UPS_Express_Box_Large | Express Box Large | 18.00 x 13.00 x 3.00 in|

      | UPS_Express_Box_Medium | Express Box Medium | 15.00 x 11.00 x 3.00 in|

      | UPS_Express_Box_Small | Express Box Small | 13.00 x 11.00 x 2.00 in|

      | UPS_Express_Envelope | Express Envelope | 12.50 x 9.50 x 2.00 in|

      | UPS_Express_Hard_Pak | Express Hard Pak | 14.75 x 11.50 x 2.00 in|

      | UPS_Express_Legal_Envelope | Express Legal Envelope | 15.00 x 9.50 x
      2.00 in|

      | UPS_Express_Pak | Express Pak | 16.00 x 12.75 x 2.00 in|

      | UPS_Express_Tube | Express Tube | 970.00 x 190.00 x 165.00 mm|

      | UPS_Laboratory_Pak | Laboratory Pak | 17.25 x 12.75 x 2.00 in|

      | UPS_Pad_Pak | Pad Pak | 14.75 x 11.00 x 2.00 in|


      ## USPS Parcel Templates

      |Token | Name | Dimensions|

      |:---|:---|:---|

      | USPS_FlatRateCardboardEnvelope | Flat Rate Cardboard Envelope | 12.50 x
      9.50 x 0.75 in|

      | USPS_FlatRateEnvelope | Flat Rate Envelope | 12.50 x 9.50 x 0.75 in|

      | USPS_FlatRateGiftCardEnvelope | Flat Rate Gift Card Envelope | 10.00 x
      7.00 x 0.75 in|

      | USPS_FlatRateLegalEnvelope | Flat Rate Legal Envelope | 15.00 x 9.50 x
      0.75 in|

      | USPS_FlatRatePaddedEnvelope | Flat Rate Padded Envelope | 12.50 x 9.50 x
      1.00 in|

      | USPS_FlatRateWindowEnvelope | Flat Rate Window Envelope | 10.00 x 5.00 x
      0.75 in|

      | USPS_LargeFlatRateBoardGameBox | Large Flat Rate Board Game Box | 24.06
      x 11.88 x 3.13 in|

      | USPS_LargeFlatRateBox | Large Flat Rate Box | 12.25 x 12.25 x 6.00 in|

      | USPS_APOFlatRateBox | APO/FPO/DPO Large Flat Rate Box | 12.25 x 12.25 x
      6.00 in|

      | USPS_MediumFlatRateBox1 | Medium Flat Rate Box 1 | 11.25 x 8.75 x 6.00
      in|

      | USPS_MediumFlatRateBox2 | Medium Flat Rate Box 2 | 14.00 x 12.00 x 3.50
      in|

      | USPS_RegionalRateBoxA1 | Regional Rate Box A1 | 10.13 x 7.13 x 5.00 in|

      | USPS_RegionalRateBoxA2 | Regional Rate Box A2 | 13.06 x 11.06 x 2.50 in|

      | USPS_RegionalRateBoxB1 | Regional Rate Box B1 | 12.25 x 10.50 x 5.50 in|

      | USPS_RegionalRateBoxB2 | Regional Rate Box B2 | 16.25 x 14.50 x 3.00 in|

      | USPS_SmallFlatRateBox | Small Flat Rate Box | 8.69 x 5.44 x 1.75 in|

      | USPS_SmallFlatRateEnvelope | Small Flat Rate Envelope | 10.00 x 6.00 x
      4.00 in|


      ## Other Carriers

      Additional parcel templates are available for DHL eCommerce, DPD UK, and
      Aramex Australia.

      See the Schemas section for complete template lists.
  - name: Shippo Accounts
    description: >-
      Shippo Accounts are used by Shippo Platform Accounts to create and manage
      Managed Shippo Accounts. 

      Managed Shippo Accounts are headless accounts that represent your
      customers. They are opaque to your end customers, meaning customers do not
      need to create their own Shippo login or have a billing relationship with
      Shippo. 

      They can be used by marketplaces, e-commerce platforms, and third-party
      logistics providers who want to offer, seamless, built-in shipping
      functionality to their customers. See our <a
      href="https://docs.goshippo.com/docs/platformaccounts/platform_accounts/">guide</a>
      for more details.
  - name: Customs Declaration B13A Filing Option
    description: >
      B13A Option details are obtained by filing a B13A Canada Export
      Declaration via the Canadian Export Reporting System (CERS). 

      More information on <a
      href="https://www.cbsa-asfc.gc.ca/export/guide-eng.html">reporting
      commercial exports from Canada</a>.


      **Allowed values:**

      - `FILED_ELECTRONICALLY`

      - `SUMMARY_REPORTING`

      - `NOT_REQUIRED`
  - name: Customs Declaration Contents Type
    description: |
      Type of goods of the shipment.

      **Allowed values:**
      - `DOCUMENTS`
      - `GIFT`
      - `SAMPLE`
      - `MERCHANDISE`
      - `HUMANITARIAN_DONATION`
      - `RETURN_MERCHANDISE`
      - `OTHER`
  - name: Customs Declaration EEL/PFC
    description: >
      EEL / PFC type of the shipment. For most shipments from the US to CA,
      `NOEEI_30_36` is applicable; 

      for most other shipments from the US, `NOEEI_30_37_a` is applicable.


      **Allowed values:**

      - `NOEEI_30_37_a`

      - `NOEEI_30_37_h`

      - `NOEEI_30_37_f`

      - `NOEEI_30_36`

      - `AES_ITN`
  - name: Customs Declaration Incoterm
    description: >
      The incoterm reference of the shipment. FCA is available for DHL Express
      and FedEx only. 

      eDAP is available for DPD UK only. DAP is available for DHL Express and
      DPD UK.

      If expecting DAP for other carriers, please use DDU.


      **Allowed values:**

      - `DDP`

      - `DDU`

      - `FCA`

      - `DAP`

      - `eDAP`
  - name: Customs Declaration Non Delivery Option
    description: >
      Indicates how the carrier should proceed in case the shipment can't be
      delivered.


      **Allowed values:**

      - `ABANDON`

      - `RETURN`
  - name: Address Validation Source
    description: |
      Source of the address validation message.

      **Allowed values:**
      - `Shippo Address Validator`
      - `UPS`
  - name: Address Validation Codes
    description: |
      Validation result codes returned by the address validation service.

      **Allowed values:**
      - `verification_error`
      - `unknown_street`
      - `component_mismatch_error`
      - `multiple_match`
      - `sub_premise_number_invalid`
      - `sub_premise_number_missing`
      - `premise_number_invalid`
      - `premise_number_missing`
      - `box_number_invalid`
      - `box_number_missing`
      - `pmb_number_missing`
      - `postal_code_change`
      - `administrative_area_change`
      - `locality_change`
      - `dependent_locality_change`
      - `street_name_change`
      - `street_type_change`
      - `street_directional_change`
      - `sub_premise_type_change`
      - `sub_premise_number_change`
      - `double_dependent_locality_change`
      - `subadministrative_area_change`
      - `subnational_area_change`
      - `po_box_change`
      - `premise_type_change`
      - `house_number_change`
      - `organization_change`
      - `extraneous_information`
      - `usps_door_inaccessible`
      - `administrative_area_partial`
      - `city_partial`
      - `street_partial`
      - `building_partial`
      - `subpremise_partial`
      - `administrative_area_full`
      - `city_full`
      - `thoroughfare_full`
      - `premises_full`
      - `subpremise_full`
      - `geocoded_street`
      - `geocoded_neighborhood`
      - `geocoded_community`
      - `geocoded_state`
      - `geocoded_rooftop`
      - `geocoded_interpolated_rooftop`
      - `invalid_postal_code`
      - `postal_code_not_found`
      - `empty_request`
      - `service_error`
      - `street_detail_missing`
      - `Invalid City/State/Zip`
      - `Default Match`
      - `Unknown Street`
      - `Address Not Found`
      - `Non-Deliverable ZIP4`
      - `Multiple Responses`
      - `Invalid Dual Address`
      - `Invalid State`
      - `Invalid City`
      - `Ambiguous Address`
paths:
  /batches/{BatchId}/add_shipments:
    post:
      tags:
        - Batches
      summary: Add shipments to a batch
      description: Adds batch shipments to an existing batch.
      operationId: AddShipmentsToBatch
      parameters:
        - description: Object ID of the batch
          in: path
          name: BatchId
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/ShippoApiVersionHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/BatchShipmentCreateRequest'
              type: array
        description: Array of shipments to add to the batch
      responses:
        '200':
          $ref: '#/components/responses/batchResponse'
        '400':
          $ref: '#/components/responses/badRequestResponse'
      x-codeSamples:
        - label: cURL
          lang: cURL
          source: >-
            curl -X POST https://api.goshippo.com/batches/<BATCH OBJECT
            ID>/add_shipments \

            -H "Authorization: ShippoToken <API_TOKEN>" \

            -H "Content-Type: application/json"  \

            -d '[
                    {
                      "shipment": {    
                        "address_from": {
                          "name": "Mr Hippo",
                          "street1": "965 Mission St",
                          "street2": "Ste 201",
                          "city": "San Francisco",
                          "state": "CA",
                          "zip": "94103",
                          "country": "US",
                          "phone": "4151234567",
                        },
                        "address_to": {
                          "name": "Hippo Jr",
                          "street1": "915 Broadway",
                          "street2": "19th Floor",
                          "city": "New York",
                          "state": "NY",
                          "zip": "10010",
                          "country": "US",
                          "phone": "2129947880",
                        },
                        "parcels": [{
                          "length": "12",
                          "width": "12",
                          "height": "12",
                          "distance_unit": "in",
                          "weight": "12",
                          "mass_unit": "oz"
                        }]
                      }
                    },
                    {
                      "shipment": {    
                        "address_from": {
                          "name": "Ms Hippo",
                          "street1": "1092 Indian Summer Ct",
                          "city": "San Jose",
                          "state": "CA",
                          "zip": "95122",
                          "country": "US",
                          "phone": "4151234567",
                        },
                        "address_to": {
                          "name": "Mr Hippo",
                          "street1": "965 Mission St",
                          "street2": "Ste 201",
                          "city": "San Francisco",
                          "state": "CA",
                          "zip": "94103",
                          "country": "US",
                          "phone": "4151234567",
                        },
                        "parcels": [{
                          "length": "5",
                          "width": "5",
                          "height": "5",
                          "distance_unit": "in",
                          "weight": "2",
                          "mass_unit": "lb"
                        }]
                      },
                      "carrier_account": "a4391cd4ab974f478f55dc08b5c8e3b3",
                      "servicelevel_token": "fedex_2_day"
                    }
                  ]'
        - lang: python
          label: Python
          source: |-
            import shippo
            from shippo.models import components

            s = shippo.Shippo(
                api_key_header='ShippoToken <API_TOKEN>',
                shippo_api_version='2018-02-08',
            )


            res = s.batches.add_shipments(request_body=[
                components.BatchShipmentCreateRequest(
                    carrier_account='a4391cd4ab974f478f55dc08b5c8e3b3',
                    metadata='SHIPMENT #1',
                    servicelevel_token='fedex_ground',
                    shipment=components.ShipmentCreateRequest(
                        extra=components.ShipmentExtra(
                            accounts_receivable_customer_account=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            appropriation_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            bill_of_lading_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            cod=components.Cod(
                                amount='5.5',
                                currency='USD',
                                payment_method=components.PaymentMethod.CASH,
                            ),
                            cod_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            customer_reference=components.CustomerReference(
                                ref_sort=1,
                            ),
                            dealer_order_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            dept_number=components.DepartmentNumber(
                                ref_sort=3,
                            ),
                            fda_product_code=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            insurance=components.Insurance(
                                amount='5.5',
                                currency='USD',
                            ),
                            invoice_number=components.InvoiceNumber(
                                ref_sort=2,
                            ),
                            manifest_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            model_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            part_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            po_number=components.PoNumber(
                                ref_sort=2,
                            ),
                            production_code=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            purchase_request_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            rma_number=components.RmaNumber(
                                ref_sort=1,
                            ),
                            salesperson_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            serial_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            store_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            transaction_reference_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                        ),
                        metadata='Customer ID 123456',
                        shipment_date='2021-03-22T12:00:00Z',
                        address_from=components.AddressCreateRequest(
                            name='Shwan Ippotle',
                            company='Shippo',
                            street1='215 Clayton St.',
                            street3='',
                            street_no='',
                            city='San Francisco',
                            state='CA',
                            zip='94117',
                            country='US',
                            phone='+1 555 341 9393',
                            email='shippotle@shippo.com',
                            is_residential=True,
                            metadata='Customer ID 123456',
                            validate=True,
                        ),
                        address_return=components.AddressCreateRequest(
                            name='Shwan Ippotle',
                            company='Shippo',
                            street1='215 Clayton St.',
                            street3='',
                            street_no='',
                            city='San Francisco',
                            state='CA',
                            zip='94117',
                            country='US',
                            phone='+1 555 341 9393',
                            email='shippotle@shippo.com',
                            is_residential=True,
                            metadata='Customer ID 123456',
                            validate=True,
                        ),
                        address_to='d799c2679e644279b59fe661ac8fa489',
                        customs_declaration='adcfdddf8ec64b84ad22772bce3ea37a',
                        carrier_accounts=[
                            '065a4a8c10d24a34ab932163a1b87f52',
                            '73f706f4bdb94b54a337563840ce52b0',
                        ],
                        parcels=[
                            '<value>',
                            '<value>',
                            components.ParcelCreateFromTemplateRequest(
                                extra=components.ParcelExtra(
                                    cod=components.Cod(
                                        amount='5.5',
                                        currency='USD',
                                        payment_method=components.PaymentMethod.CASH,
                                    ),
                                    insurance=components.ParcelInsurance(
                                        amount='5.5',
                                        content='Laptop',
                                        currency='USD',
                                        provider=components.ParcelInsuranceProvider.UPS,
                                    ),
                                ),
                                metadata='Customer ID 123456',
                                mass_unit=components.WeightUnitEnum.LB,
                                weight='1',
                                template=components.ParcelTemplateUSPSEnum.USPS_SMALL_FLAT_RATE_ENVELOPE,
                            ),
                        ],
                    ),
                ),
                components.BatchShipmentCreateRequest(
                    carrier_account='a4391cd4ab974f478f55dc08b5c8e3b3',
                    metadata='SHIPMENT #1',
                    servicelevel_token='fedex_ground',
                    shipment=components.ShipmentCreateRequest(
                        extra=components.ShipmentExtra(
                            accounts_receivable_customer_account=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            appropriation_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            bill_of_lading_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            cod=components.Cod(
                                amount='5.5',
                                currency='USD',
                                payment_method=components.PaymentMethod.CASH,
                            ),
                            cod_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            customer_reference=components.CustomerReference(
                                ref_sort=1,
                            ),
                            dealer_order_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            dept_number=components.DepartmentNumber(
                                ref_sort=3,
                            ),
                            fda_product_code=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            insurance=components.Insurance(
                                amount='5.5',
                                currency='USD',
                            ),
                            invoice_number=components.InvoiceNumber(
                                ref_sort=2,
                            ),
                            manifest_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            model_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            part_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            po_number=components.PoNumber(
                                ref_sort=2,
                            ),
                            production_code=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            purchase_request_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            rma_number=components.RmaNumber(
                                ref_sort=1,
                            ),
                            salesperson_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            serial_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            store_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            transaction_reference_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                        ),
                        metadata='Customer ID 123456',
                        shipment_date='2021-03-22T12:00:00Z',
                        address_from=components.AddressCreateRequest(
                            name='Shwan Ippotle',
                            company='Shippo',
                            street1='215 Clayton St.',
                            street3='',
                            street_no='',
                            city='San Francisco',
                            state='CA',
                            zip='94117',
                            country='US',
                            phone='+1 555 341 9393',
                            email='shippotle@shippo.com',
                            is_residential=True,
                            metadata='Customer ID 123456',
                            validate=True,
                        ),
                        address_return=components.AddressCreateRequest(
                            name='Shwan Ippotle',
                            company='Shippo',
                            street1='215 Clayton St.',
                            street3='',
                            street_no='',
                            city='San Francisco',
                            state='CA',
                            zip='94117',
                            country='US',
                            phone='+1 555 341 9393',
                            email='shippotle@shippo.com',
                            is_residential=True,
                            metadata='Customer ID 123456',
                            validate=True,
                        ),
                        address_to=components.AddressCreateRequest(
                            name='Shwan Ippotle',
                            company='Shippo',
                            street1='215 Clayton St.',
                            street3='',
                            street_no='',
                            city='San Francisco',
                            state='CA',
                            zip='94117',
                            country='US',
                            phone='+1 555 341 9393',
                            email='shippotle@shippo.com',
                            is_residential=True,
                            metadata='Customer ID 123456',
                            validate=True,
                        ),
                        customs_declaration=components.CustomsDeclarationCreateRequest(
                            b13a_filing_option=components.CustomsDeclarationB13AFilingOptionEnum.FILED_ELECTRONICALLY,
                            certify=True,
                            certify_signer='Shawn Ippotle',
                            contents_explanation='T-Shirt purchase',
                            duties_payor=components.DutiesPayor(
                                account='2323434543',
                                type=components.CustomsDeclarationCreateRequestType.THIRD_PARTY,
                                address=components.CustomsDeclarationCreateRequestAddress(
                                    name='Patrick Kavanagh',
                                    zip='80331',
                                    country='DE',
                                ),
                            ),
                            exporter_identification=components.CustomsExporterIdentification(
                                eori_number='PL123456790ABCDE',
                                tax_id=components.CustomsTaxIdentification(
                                    number='123456789',
                                    type=components.CustomsTaxIdentificationType.EIN,
                                ),
                            ),
                            invoice='#123123',
                            metadata='Order ID #123123',
                            address_importer=components.AddressImporter(
                                name='Shwan Ippotle',
                                company='Shippo',
                                street1='Blumenstraße',
                                street3='',
                                street_no='22',
                                city='München',
                                state='CA',
                                zip='80331',
                                country='DE',
                                phone='80331',
                                email='shippotle@shippo.com',
                                is_residential=True,
                            ),
                            contents_type=components.CustomsDeclarationContentsTypeEnum.MERCHANDISE,
                            eel_pfc=components.CustomsDeclarationEelPfcEnum.NOEEI_30_37_A,
                            incoterm=components.CustomsDeclarationIncotermEnum.DDP,
                            items=[
                                components.CustomsItemCreateRequest(
                                    description='T-Shirt',
                                    mass_unit=components.WeightUnitEnum.LB,
                                    metadata='Order ID "123454"',
                                    net_weight='5',
                                    origin_country='<value>',
                                    quantity=20,
                                    sku_code='HM-123',
                                    hs_code='0901.21',
                                    value_amount='200',
                                    value_currency='USD',
                                ),
                            ],
                            non_delivery_option=components.CustomsDeclarationNonDeliveryOptionEnum.RETURN,
                            test=True,
                        ),
                        carrier_accounts=[
                            '065a4a8c10d24a34ab932163a1b87f52',
                            '73f706f4bdb94b54a337563840ce52b0',
                        ],
                        parcels=[
                            components.ParcelCreateFromTemplateRequest(
                                extra=components.ParcelExtra(
                                    cod=components.Cod(
                                        amount='5.5',
                                        currency='USD',
                                        payment_method=components.PaymentMethod.CASH,
                                    ),
                                    insurance=components.ParcelInsurance(
                                        amount='5.5',
                                        content='Laptop',
                                        currency='USD',
                                        provider=components.ParcelInsuranceProvider.UPS,
                                    ),
                                ),
                                metadata='Customer ID 123456',
                                mass_unit=components.WeightUnitEnum.LB,
                                weight='1',
                                template=components.ParcelTemplateDPDUKEnum.DPD_UK_EXPRESS_PAK,
                            ),
                            components.ParcelCreateFromTemplateRequest(
                                extra=components.ParcelExtra(
                                    cod=components.Cod(
                                        amount='5.5',
                                        currency='USD',
                                        payment_method=components.PaymentMethod.CASH,
                                    ),
                                    insurance=components.ParcelInsurance(
                                        amount='5.5',
                                        content='Laptop',
                                        currency='USD',
                                        provider=components.ParcelInsuranceProvider.UPS,
                                    ),
                                ),
                                metadata='Customer ID 123456',
                                mass_unit=components.WeightUnitEnum.LB,
                                weight='1',
                                template=components.ParcelTemplateDHLeCommerceEnum.DH_LE_C_IRREGULAR,
                            ),
                        ],
                    ),
                ),
                components.BatchShipmentCreateRequest(
                    carrier_account='a4391cd4ab974f478f55dc08b5c8e3b3',
                    metadata='SHIPMENT #1',
                    servicelevel_token='fedex_ground',
                    shipment=components.ShipmentCreateRequest(
                        extra=components.ShipmentExtra(
                            accounts_receivable_customer_account=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            appropriation_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            bill_of_lading_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            cod=components.Cod(
                                amount='5.5',
                                currency='USD',
                                payment_method=components.PaymentMethod.CASH,
                            ),
                            cod_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            customer_reference=components.CustomerReference(
                                ref_sort=1,
                            ),
                            dealer_order_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            dept_number=components.DepartmentNumber(
                                ref_sort=3,
                            ),
                            fda_product_code=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            insurance=components.Insurance(
                                amount='5.5',
                                currency='USD',
                            ),
                            invoice_number=components.InvoiceNumber(
                                ref_sort=2,
                            ),
                            manifest_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            model_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            part_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            po_number=components.PoNumber(
                                ref_sort=2,
                            ),
                            production_code=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            purchase_request_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            rma_number=components.RmaNumber(
                                ref_sort=1,
                            ),
                            salesperson_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            serial_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            store_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                            transaction_reference_number=components.UPSReferenceFields(
                                prefix='ABC',
                                value='value',
                                ref_sort=1,
                            ),
                        ),
                        metadata='Customer ID 123456',
                        shipment_date='2021-03-22T12:00:00Z',
                        address_from='d799c2679e644279b59fe661ac8fa488',
                        address_return='d799c2679e644279b59fe661ac8fa488',
                        address_to=components.AddressCreateRequest(
                            name='Shwan Ippotle',
                            company='Shippo',
                            street1='215 Clayton St.',
                            street3='',
                            street_no='',
                            city='San Francisco',
                            state='CA',
                            zip='94117',
                            country='US',
                            phone='+1 555 341 9393',
                            email='shippotle@shippo.com',
                            is_residential=True,
                            metadata='Customer ID 123456',
                            validate=True,
                        ),
                        customs_declaration='adcfdddf8ec64b84ad22772bce3ea37a',
                        carrier_accounts=[
                            '065a4a8c10d24a34ab932163a1b87f52',
                            '73f706f4bdb94b54a337563840ce52b0',
                        ],
                        parcels=[
                            '<value>',
                        ],
                    ),
                ),
            ], batch_id='<id>')

            if res is not None:
                # handle response
                pass
        - lang: typescript
          label: Typescript
          source: |-
            import { Shippo } from "shippo";

            const shippo = new Shippo({
              apiKeyHeader: "ShippoToken <API_TOKEN>",
              shippoApiVersion: "2018-02-08",
            });

            async function run() {
              const result = await shippo.batches.addShipments([
                {
                  carrierAccount: "a4391cd4ab974f478f55dc08b5c8e3b3",
                  metadata: "SHIPMENT #1",
                  servicelevelToken: "fedex_ground",
                  shipment: {
                    extra: {
                      accountsReceivableCustomerAccount: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      appropriationNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      billOfLadingNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      cod: {
                        amount: "5.5",
                        currency: "USD",
                        paymentMethod: "CASH",
                      },
                      codNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      customerReference: {
                        refSort: 1,
                      },
                      dealerOrderNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      deptNumber: {
                        refSort: 3,
                      },
                      fdaProductCode: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      insurance: {
                        amount: "5.5",
                        currency: "USD",
                      },
                      invoiceNumber: {
                        refSort: 2,
                      },
                      manifestNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      modelNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      partNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      poNumber: {
                        refSort: 2,
                      },
                      productionCode: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      purchaseRequestNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      rmaNumber: {
                        refSort: 1,
                      },
                      salespersonNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      serialNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      storeNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      transactionReferenceNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                    },
                    metadata: "Customer ID 123456",
                    shipmentDate: "2021-03-22T12:00:00Z",
                    addressFrom: {
                      name: "Shwan Ippotle",
                      company: "Shippo",
                      street1: "215 Clayton St.",
                      street3: "",
                      streetNo: "",
                      city: "San Francisco",
                      state: "CA",
                      zip: "94117",
                      country: "US",
                      phone: "+1 555 341 9393",
                      email: "shippotle@shippo.com",
                      isResidential: true,
                      metadata: "Customer ID 123456",
                      validate: true,
                    },
                    addressReturn: {
                      name: "Shwan Ippotle",
                      company: "Shippo",
                      street1: "215 Clayton St.",
                      street3: "",
                      streetNo: "",
                      city: "San Francisco",
                      state: "CA",
                      zip: "94117",
                      country: "US",
                      phone: "+1 555 341 9393",
                      email: "shippotle@shippo.com",
                      isResidential: true,
                      metadata: "Customer ID 123456",
                      validate: true,
                    },
                    addressTo: "d799c2679e644279b59fe661ac8fa489",
                    customsDeclaration: "adcfdddf8ec64b84ad22772bce3ea37a",
                    carrierAccounts: [
                      "065a4a8c10d24a34ab932163a1b87f52",
                      "73f706f4bdb94b54a337563840ce52b0",
                    ],
                    parcels: [
                      "<value>",
                      "<value>",
                      {
                        extra: {
                          cod: {
                            amount: "5.5",
                            currency: "USD",
                            paymentMethod: "CASH",
                          },
                          insurance: {
                            amount: "5.5",
                            content: "Laptop",
                            currency: "USD",
                            provider: "UPS",
                          },
                        },
                        metadata: "Customer ID 123456",
                        massUnit: "lb",
                        weight: "1",
                        template: "USPS_SmallFlatRateEnvelope",
                      },
                    ],
                  },
                },
                {
                  carrierAccount: "a4391cd4ab974f478f55dc08b5c8e3b3",
                  metadata: "SHIPMENT #1",
                  servicelevelToken: "fedex_ground",
                  shipment: {
                    extra: {
                      accountsReceivableCustomerAccount: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      appropriationNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      billOfLadingNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      cod: {
                        amount: "5.5",
                        currency: "USD",
                        paymentMethod: "CASH",
                      },
                      codNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      customerReference: {
                        refSort: 1,
                      },
                      dealerOrderNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      deptNumber: {
                        refSort: 3,
                      },
                      fdaProductCode: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      insurance: {
                        amount: "5.5",
                        currency: "USD",
                      },
                      invoiceNumber: {
                        refSort: 2,
                      },
                      manifestNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      modelNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      partNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      poNumber: {
                        refSort: 2,
                      },
                      productionCode: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      purchaseRequestNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      rmaNumber: {
                        refSort: 1,
                      },
                      salespersonNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      serialNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      storeNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      transactionReferenceNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                    },
                    metadata: "Customer ID 123456",
                    shipmentDate: "2021-03-22T12:00:00Z",
                    addressFrom: {
                      name: "Shwan Ippotle",
                      company: "Shippo",
                      street1: "215 Clayton St.",
                      street3: "",
                      streetNo: "",
                      city: "San Francisco",
                      state: "CA",
                      zip: "94117",
                      country: "US",
                      phone: "+1 555 341 9393",
                      email: "shippotle@shippo.com",
                      isResidential: true,
                      metadata: "Customer ID 123456",
                      validate: true,
                    },
                    addressReturn: {
                      name: "Shwan Ippotle",
                      company: "Shippo",
                      street1: "215 Clayton St.",
                      street3: "",
                      streetNo: "",
                      city: "San Francisco",
                      state: "CA",
                      zip: "94117",
                      country: "US",
                      phone: "+1 555 341 9393",
                      email: "shippotle@shippo.com",
                      isResidential: true,
                      metadata: "Customer ID 123456",
                      validate: true,
                    },
                    addressTo: {
                      name: "Shwan Ippotle",
                      company: "Shippo",
                      street1: "215 Clayton St.",
                      street3: "",
                      streetNo: "",
                      city: "San Francisco",
                      state: "CA",
                      zip: "94117",
                      country: "US",
                      phone: "+1 555 341 9393",
                      email: "shippotle@shippo.com",
                      isResidential: true,
                      metadata: "Customer ID 123456",
                      validate: true,
                    },
                    customsDeclaration: {
                      b13aFilingOption: "FILED_ELECTRONICALLY",
                      certify: true,
                      certifySigner: "Shawn Ippotle",
                      contentsExplanation: "T-Shirt purchase",
                      dutiesPayor: {
                        account: "2323434543",
                        type: "THIRD_PARTY",
                        address: {
                          name: "Patrick Kavanagh",
                          zip: "80331",
                          country: "DE",
                        },
                      },
                      exporterIdentification: {
                        eoriNumber: "PL123456790ABCDE",
                        taxId: {
                          number: "123456789",
                          type: "EIN",
                        },
                      },
                      invoice: "#123123",
                      metadata: "Order ID #123123",
                      addressImporter: {
                        name: "Shwan Ippotle",
                        company: "Shippo",
                        street1: "Blumenstraße",
                        street3: "",
                        streetNo: "22",
                        city: "München",
                        state: "CA",
                        zip: "80331",
                        country: "DE",
                        phone: "80331",
                        email: "shippotle@shippo.com",
                        isResidential: true,
                      },
                      contentsType: "MERCHANDISE",
                      eelPfc: "NOEEI_30_37_a",
                      incoterm: "DDP",
                      items: [
                        {
                          description: "T-Shirt",
                          massUnit: "lb",
                          metadata: "Order ID \"123454\"",
                          netWeight: "5",
                          originCountry: "<value>",
                          quantity: 20,
                          skuCode: "HM-123",
                          hsCode: "0901.21",
                          valueAmount: "200",
                          valueCurrency: "USD",
                        },
                      ],
                      nonDeliveryOption: "RETURN",
                      test: true,
                    },
                    carrierAccounts: [
                      "065a4a8c10d24a34ab932163a1b87f52",
                      "73f706f4bdb94b54a337563840ce52b0",
                    ],
                    parcels: [
                      {
                        extra: {
                          cod: {
                            amount: "5.5",
                            currency: "USD",
                            paymentMethod: "CASH",
                          },
                          insurance: {
                            amount: "5.5",
                            content: "Laptop",
                            currency: "USD",
                            provider: "UPS",
                          },
                        },
                        metadata: "Customer ID 123456",
                        massUnit: "lb",
                        weight: "1",
                        template: "DPD_UK_Express_Pak",
                      },
                      {
                        extra: {
                          cod: {
                            amount: "5.5",
                            currency: "USD",
                            paymentMethod: "CASH",
                          },
                          insurance: {
                            amount: "5.5",
                            content: "Laptop",
                            currency: "USD",
                            provider: "UPS",
                          },
                        },
                        metadata: "Customer ID 123456",
                        massUnit: "lb",
                        weight: "1",
                        template: "DHLeC_Irregular",
                      },
                    ],
                  },
                },
                {
                  carrierAccount: "a4391cd4ab974f478f55dc08b5c8e3b3",
                  metadata: "SHIPMENT #1",
                  servicelevelToken: "fedex_ground",
                  shipment: {
                    extra: {
                      accountsReceivableCustomerAccount: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      appropriationNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      billOfLadingNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      cod: {
                        amount: "5.5",
                        currency: "USD",
                        paymentMethod: "CASH",
                      },
                      codNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      customerReference: {
                        refSort: 1,
                      },
                      dealerOrderNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      deptNumber: {
                        refSort: 3,
                      },
                      fdaProductCode: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      insurance: {
                        amount: "5.5",
                        currency: "USD",
                      },
                      invoiceNumber: {
                        refSort: 2,
                      },
                      manifestNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      modelNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      partNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      poNumber: {
                        refSort: 2,
                      },
                      productionCode: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      purchaseRequestNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      rmaNumber: {
                        refSort: 1,
                      },
                      salespersonNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      serialNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      storeNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                      transactionReferenceNumber: {
                        prefix: "ABC",
                        value: "value",
                        refSort: 1,
                      },
                    },
                    metadata: "Customer ID 123456",
                    shipmentDate: "2021-03-22T12:00:00Z",
                    addressFrom: "d799c2679e644279b59fe661ac8fa488",
                    addressReturn: "d799c2679e644279b59fe661ac8fa488",
                    addressTo: {
                      name: "Shwan Ippotle",
                      company: "Shippo",
                      street1: "215 Clayton St.",
                      street3: "",
                      streetNo: "",
                      city: "San Francisco",
                      state: "CA",
                      zip: "94117",
                      country: "US",
                      phone: "+1 555 341 9393",
                      email: "shippotle@shippo.com",
                      isResidential: true,
                      metadata: "Customer ID 123456",
                      validate: true,
                    },
                    customsDeclaration: "adcfdddf8ec64b84ad22772bce3ea37a",
                    carrierAccounts: [
                      "065a4a8c10d24a34ab932163a1b87f52",
                      "73f706f4bdb94b54a337563840ce52b0",
                    ],
                    parcels: [
                      "<value>",
                    ],
                  },
                },
              ], "<id>");

              // Handle the result
              console.log(result);
            }

            run();
        - lang: csharp
          label: C#
          source: |-
            using Shippo;
            using Shippo.Models.Components;
            using System.Collections.Generic;

            var sdk = new ShippoSDK(
                apiKeyHeader: "ShippoToken <API_TOKEN>",
                shippoApiVersion: "2018-02-08"
            );

            var res = await sdk.Batches.AddShipmentsAsync(
                batchId: "<id>",
                requestBody: new List<BatchShipmentCreateRequest>() {
                    new BatchShipmentCreateRequest() {
                        CarrierAccount = "a4391cd4ab974f478f55dc08b5c8e3b3",
                        Metadata = "SHIPMENT #1",
                        ServicelevelToken = "fedex_ground",
                        Shipment = new ShipmentCreateRequest() {
                            Extra = new ShipmentExtra() {
                                AccountsReceivableCustomerAccount = new UPSReferenceFields() {
                                    Prefix = "ABC",
                                    Value = "value",
                                    RefSort = 1,
                                },
                                AppropriationNumber = new UPSReferenceFields() {
                                    Prefix = "ABC",
                                    Value = "value",
                                    RefSort = 1,
                                },
                                BillOfLadingNumber = new UPSReferenceFields() {
                                    Prefix = "ABC",
                                    Value = "value",
                                    RefSort = 1,
                                },
                                Cod = new Cod() {
                                    Amount = "5.5",
                                    Currency = "USD",
                                    PaymentMethod = PaymentMethod.Cash,
                                },
                                CodNumber = new UPSReferenceFields() {
                                    Prefix = "ABC",
                                    Value = "value",
                                    RefSort = 1,
                                },
                                CustomerReference = new CustomerReference() {
                                    RefSort = 1,
                                },
                                DealerOrderNumber = new UPSReferenceFields() {
                                    Prefix = "ABC",
                                    Value = "value",
                                    RefSort = 1,
                                },
                                DeptNumber = new DepartmentNumber() {
                                    RefSort = 3,
                                },
                                FdaProductCode = new UPSReferenceFields() {
                                    Prefix = "ABC",
                                    Value = "value",
                                    RefSort = 1,
                                },
                                Insurance = new Insurance() {
                                    Amount = "5.5",
                                    Currency = "USD",
                                },
                                InvoiceNumber = new InvoiceNumber() {
                                    RefSort = 2,
                                },
                                ManifestNumber = new UPSReferenceFields() {
                                    Prefix = "ABC",
                                    Value = "value",
                                    RefSort = 1,
                                },
                                ModelNumber = new UPSReferenceFields() {
                                    Prefix = "ABC",
                                    Value = "value",
                                    RefSort = 1,
                                },
                                PartNumber = new UPSReferenceFields() {
                                    Prefix = "ABC",
                                    Value = "value",
                                    RefSort = 1,
                                },
                                PoNumber = new PoNumber() {
                                    RefSort = 2,
                                },
                                ProductionCode = new UPSReferenceFields() {
                                    Prefix = "ABC",
                                    Value = "value",
                                    RefSort = 1,
                                },
                                PurchaseRequestNumber = new UPSReferenceFields() {
                                    Prefix = "ABC",
                                    Value = "value",
                                    RefSort = 1,
                                },
                                RmaNumber = new RmaNumber() {
                                    RefSort = 1,
                                },
                                SalespersonNumber = new UPSReferenceFields() {
                                    Prefix = "ABC",
                                    Value = "value",
                                    RefSort = 1,
                                },
                                SerialNumber = new UPSReferenceFields() {
                                    Prefix = "ABC",
                                    Value = "value",
                                    RefSort = 1,
                                },
                                StoreNumber = new UPSReferenceFields() {
                                    Prefix = "ABC",
                                    Value = "value",
                                    RefSort = 1,
                                },
                                TransactionReferenceNumber = new UPSReferenceFields() {
                                    Prefix = "ABC",
                                    Value = "value",
                                    RefSort = 1,
                                },
                            },
                            Metadata = "Customer ID 123456",
                            ShipmentDate = "2021-03-22T12:00:00Z",
                            AddressFrom = AddressFrom.CreateStr(
                                "d799c2679e644279b59fe661ac8fa488"
                            ),
                            AddressReturn = AddressReturn.CreateAddressCreateRequest(
                                new AddressCreateRequest() {
                                    Name = "Shwan Ippotle",
                                    Company = "Shippo",
                                    Street1 = "215 Clayton St.",
                                    Street3 = "",
                                    StreetNo = "",
                                    City = "San Francisco",
                                    State = "CA",
                                    Zip = "94117",
                                    Country = "US",
                                    Phone = "+1 555 341 9393",
                                    Email = "shippotle@shippo.com",
                                    IsResidential = true,
                                    Metadata = "Customer ID 123456",
                                    Validate = true,
                                }
                            ),
                            AddressTo = AddressTo.CreateAddressCreateRequest(
                                new AddressCreateRequest() {
                                    Name = "Shwan Ippotle",
                                    Company = "Shippo",
                                    Street1 = "215 Clayton St.",
                                    Street3 = "",
                                    StreetNo = "",
                                    City = "San Francisco",
                                    State = "CA",
                                    Zip = "94117",
                                    Country = "US",
                                    Phone = "+1 555 341 9393",
                                    Email = "shippotle@shippo.com",
                                    IsResidential = true,
                                    Metadata = "Customer ID 123456",
                                    Validate = true,
                                }
                            ),
                            CustomsDeclaration = ShipmentCreateRequestCustomsDeclaration.CreateStr(
                                "adcfdddf8ec64b84ad22772bce3ea37a"
                            ),
                            CarrierAccounts = new List<string>() {
                                "065a4a8c10d24a34ab932163a1b87f52",
                                "73f706f4bdb94b54a337563840ce52b0",
                            },
                            Parcels = new List<Models.Components.Parcels>() {
                                Parcels.CreateStr(
                                    "<value>"
                                ),
                            },
                        },
                    },
                },
                shippoApiVersion: "2018-02-08"
            );

            // handle response
        - lang: php
          label: PHP
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Shippo\API;
            use Shippo\API\Models\Components;

            $sdk = API\Shippo::builder()
                ->setSecurity(
                    'ShippoToken <API_TOKEN>'
                )
                ->setShippoApiVersion('2018-02-08')
                ->build();



            $response = $sdk->batches->addShipments(
                batchId: '<id>',
                requestBody: [
                    new Components\BatchShipmentCreateRequest(
                        carrierAccount: 'a4391cd4ab974f478f55dc08b5c8e3b3',
                        metadata: 'SHIPMENT #1',
                        servicelevelToken: 'fedex_ground',
                        shipment: new Components\ShipmentCreateRequest(
                            extra: new Components\ShipmentExtra(
                                accountsReceivableCustomerAccount: new Components\UPSReferenceFields(
                                    prefix: 'ABC',
                                    value: 'value',
                                    refSort: 1,
                                ),
                                appropriationNumber: new Components\UPSReferenceFields(
                                    prefix: 'ABC',
                                    value: 'value',
                                    refSort: 1,
                                ),
                                billOfLadingNumber: new Components\UPSReferenceFields(
                                    prefix: 'ABC',
                                    value: 'value',
                                    refSort: 1,
                                ),
                                cod: new Components\Cod(
                                    amount: '5.5',
                                    currency: 'USD',
                                    paymentMethod: Components\PaymentMethod::Cash,
                                ),
                                codNumber: new Components\UPSReferenceFields(
                                    prefix: 'ABC',
                                    value: 'value',
                                    refSort: 1,
                                ),
                                customerReference: new Components\CustomerReference(
                                    refSort: 1,
                                ),
                                dealerOrderNumber: new Components\UPSReferenceFields(
                                    prefix: 'ABC',
                                    value: 'value',
                                    refSort: 1,
                                ),
                                deptNumber: new Components\DepartmentNumber(
                                    refSort: 3,
                                ),
                                fdaProductCode: new Components\UPSReferenceFields(
                                    prefix: 'ABC',
                                    value: 'value',
                                    refSort: 1,
                                ),
                                insurance: new Components\Insurance(
                                    amount: '5.5',
                                    currency: 'USD',
                                ),
                                invoiceNumber: new Components\InvoiceNumber(
                                    refSort: 2,
                                ),
                                manifestNumber: new Components\UPSReferenceFields(
                                    prefix: 'ABC',
                                    value: 'value',
                                    refSort: 1,
                                ),
                                modelNumber: new Components\UPSReferenceFields(
                                    prefix: 'ABC',
                                    value: 'value',
                                    refSort: 1,
                                ),
                                partNumber: new Components\UPSReferenceFields(
                                    prefix: 'ABC',
                                    value: 'value',
                                    refSort: 1,
                                ),
                                poNumber: new Components\PoNumber(
                                    refSort: 2,
                                ),
                                productionCode: new Components\UPSReferenceFields(
                                    prefix: 'ABC',
                                    value: 'value',
                                    refSort: 1,
                                ),
                                purchaseRequestNumber: new Components\UPSReferenceFields(
                                    prefix: 'ABC',
                                    value: 'value',
                                    refSort: 1,
                                ),
                                rmaNumber: new Components\RmaNumber(
                                    refSort: 1,
                                ),
                                salespersonNumber: new Components\UPSReferenceFields(
                                    prefix: 'ABC',
                                    value: 'value',
                                    refSort: 1,
                                ),
                                serialNumber: new Components\UPSReferenceFields(
                                    prefix: 'ABC',
                                    value: 'value',
                                    refSort: 1,
                                ),
                                storeNumber: new Components\UPSReferenceFields(
                                    prefix: 'ABC',
                                    value: 'value',
                                    refSort: 1,
                                ),
                                transactionReferenceNumber: new Components\UPSReferenceFields(
                                    prefix: 'ABC',
                                    value: 'value',
                                    refSort: 1,
                                ),
                            ),
                            metadata: 'Customer ID 123456',
                            shipmentDate: '2021-03-22T12:00:00Z',
                            addressFrom: 'd799c2679e644279b59fe661ac8fa488',
                            addressReturn: new Components\AddressCreateRequest(
                                name: 'Shwan Ippotle',
                                company: 'Shippo',
                                street1: '215 Clayton St.',
                                street3: '',
                                streetNo: '',
                                city: 'San Francisco',
                                state: 'CA',
                                zip: '94117',
                                country: 'US',
                                phone: '+1 555 341 9393',
                                email: 'shippotle@shippo.com',
                                isResidential: true,
                                metadata: 'Customer ID 123456',
                                validate: true,
                            ),
                            addressTo: new Components\AddressCreateRequest(
                                name: 'Shwan Ippotle',
                                company: 'Shippo',
                                street1: '215 Clayton St.',
                                street3: '',
                                streetNo: '',
                                city: 'San Francisco',
                                state: 'CA',
                                zip: '94117',
                                country: 'US',
                                phone: '+1 555 341 9393',
                                email: 'shippotle@shippo.com',
                                isResidential: true,
                                metadata: 'Customer ID 123456',
                                validate: true,
                            ),
                            customsDeclaration: 'adcfdddf8ec64b84ad22772bce3ea37a',
                            carrierAccounts: [
                                '065a4a8c10d24a34ab932163a1b87f52',
                                '73f706f4bdb94b54a337563840ce52b0',
                            ],
                            parcels: [
                                '<value>',
                            ],
                        ),
                    ),
                ],
                shippoApiVersion: '2018-02-08'

            );

            if ($response->batch !== null) {
                // handle response
            }
        - lang: java
          label: Java
          source: >-
            package hello.world;


            import com.goshippo.shippo_sdk.Shippo;

            import
            com.goshippo.shippo_sdk.models.components.AddressCreateRequest;

            import com.goshippo.shippo_sdk.models.components.AddressFrom;

            import com.goshippo.shippo_sdk.models.components.AddressImporter;

            import com.goshippo.shippo_sdk.models.components.AddressReturn;

            import com.goshippo.shippo_sdk.models.components.AddressTo;

            import
            com.goshippo.shippo_sdk.models.components.BatchShipmentCreateRequest;

            import com.goshippo.shippo_sdk.models.components.Cod;

            import com.goshippo.shippo_sdk.models.components.CustomerReference;

            import
            com.goshippo.shippo_sdk.models.components.CustomsDeclarationB13AFilingOptionEnum;

            import
            com.goshippo.shippo_sdk.models.components.CustomsDeclarationContentsTypeEnum;

            import
            com.goshippo.shippo_sdk.models.components.CustomsDeclarationCreateRequest;

            import
            com.goshippo.shippo_sdk.models.components.CustomsDeclarationCreateRequestAddress;

            import
            com.goshippo.shippo_sdk.models.components.CustomsDeclarationCreateRequestType;

            import
            com.goshippo.shippo_sdk.models.components.CustomsDeclarationEelPfcEnum;

            import
            com.goshippo.shippo_sdk.models.components.CustomsDeclarationIncotermEnum;

            import
            com.goshippo.shippo_sdk.models.components.CustomsDeclarationNonDeliveryOptionEnum;

            import
            com.goshippo.shippo_sdk.models.components.CustomsExporterIdentification;

            import
            com.goshippo.shippo_sdk.models.components.CustomsItemCreateRequest;

            import
            com.goshippo.shippo_sdk.models.components.CustomsTaxIdentification;

            import
            com.goshippo.shippo_sdk.models.components.CustomsTaxIdentificationType;

            import com.goshippo.shippo_sdk.models.components.DepartmentNumber;

            import com.goshippo.shippo_sdk.models.components.DutiesPayor;

            import com.goshippo.shippo_sdk.models.components.Insurance;

            import com.goshippo.shippo_sdk.models.components.InvoiceNumber;

            import
            com.goshippo.shippo_sdk.models.components.ParcelCreateFromTemplateRequest;

            import com.goshippo.shippo_sdk.models.components.ParcelExtra;

            import com.goshippo.shippo_sdk.models.components.ParcelInsurance;

            import
            com.goshippo.shippo_sdk.models.components.ParcelInsuranceProvider;

            import
            com.goshippo.shippo_sdk.models.components.ParcelTemplateDHLeCommerceEnum;

            import
            com.goshippo.shippo_sdk.models.components.ParcelTemplateDPDUKEnum;

            import
            com.goshippo.shippo_sdk.models.components.ParcelTemplateEnumSet;

            import
            com.goshippo.shippo_sdk.models.components.ParcelTemplateUSPSEnum;

            import com.goshippo.shippo_sdk.models.components.Parcels;

            import com.goshippo.shippo_sdk.models.components.PaymentMethod;

            import com.goshippo.shippo_sdk.models.components.PoNumber;

            import com.goshippo.shippo_sdk.models.components.RmaNumber;

            import
            com.goshippo.shippo_sdk.models.components.ShipmentCreateRequest;

            import
            com.goshippo.shippo_sdk.models.components.ShipmentCreateRequestCustomsDeclaration;

            import com.goshippo.shippo_sdk.models.components.ShipmentExtra;

            import com.goshippo.shippo_sdk.models.components.UPSReferenceFields;

            import com.goshippo.shippo_sdk.models.components.WeightUnitEnum;

            import
            com.goshippo.shippo_sdk.models.operations.AddShipmentsToBatchResponse;

            import java.lang.Exception;

            import java.util.List;


            public class Application {

                public static void main(String[] args) throws Exception {

                    Shippo sdk = Shippo.builder()
                            .apiKeyHeader("ShippoToken <API_TOKEN>")
                            .shippoApiVersion("2018-02-08")
                        .build();

                    AddShipmentsToBatchResponse res = sdk.batches().addShipments()
                            .batchId("<id>")
                            .shippoApiVersion("2018-02-08")
                            .requestBody(List.of(
                                BatchShipmentCreateRequest.builder()
                                    .shipment(ShipmentCreateRequest.builder()
                                        .addressFrom(AddressFrom.of(AddressCreateRequest.builder()
                                            .country("US")
                                            .name("Shwan Ippotle")
                                            .company("Shippo")
                                            .street1("215 Clayton St.")
                                            .street3("")
                                            .streetNo("")
                                            .city("San Francisco")
                                            .state("CA")
                                            .zip("94117")
                                            .phone("+1 555 341 9393")
                                            .email("shippotle@shippo.com")
                                            .isResidential(true)
                                            .metadata("Customer ID 123456")
                                            .validate(true)
                                            .build()))
                                        .addressTo(AddressTo.of("d799c2679e644279b59fe661ac8fa489"))
                                        .parcels(List.of(
                                            Parcels.of("<value>"),
                                            Parcels.of("<value>"),
                                            Parcels.of(ParcelCreateFromTemplateRequest.builder()
                                                .massUnit(WeightUnitEnum.LB)
                                                .weight("1")
                                                .template(ParcelTemplateEnumSet.of(ParcelTemplateUSPSEnum.USPS_SMALL_FLAT_RATE_ENVELOPE))
                                                .extra(ParcelExtra.builder()
                                                    .cod(Cod.builder()
                                                        .amount("5.5")
                                                        .currency("USD")
                                                        .paymentMethod(PaymentMethod.CASH)
                                                        .build())
                                                    .insurance(ParcelInsurance.builder()
                                                        .amount("5.5")
                                                        .content("Laptop")
                                                        .currency("USD")
                                                        .provider(ParcelInsuranceProvider.UPS)
                                                        .build())
                                                    .build())
                                                .metadata("Customer ID 123456")
                                                .build())))
                                        .extra(ShipmentExtra.builder()
                                            .accountsReceivableCustomerAccount(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .appropriationNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .billOfLadingNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .cod(Cod.builder()
                                                .amount("5.5")
                                                .currency("USD")
                                                .paymentMethod(PaymentMethod.CASH)
                                                .build())
                                            .codNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .customerReference(CustomerReference.builder()
                                                .refSort(1L)
                                                .build())
                                            .dealerOrderNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .deptNumber(DepartmentNumber.builder()
                                                .refSort(3L)
                                                .build())
                                            .fdaProductCode(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .insurance(Insurance.builder()
                                                .amount("5.5")
                                                .currency("USD")
                                                .build())
                                            .invoiceNumber(InvoiceNumber.builder()
                                                .refSort(2L)
                                                .build())
                                            .manifestNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .modelNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .partNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .poNumber(PoNumber.builder()
                                                .refSort(2L)
                                                .build())
                                            .productionCode(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .purchaseRequestNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .rmaNumber(RmaNumber.builder()
                                                .refSort(1L)
                                                .build())
                                            .salespersonNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .serialNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .storeNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .transactionReferenceNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .build())
                                        .metadata("Customer ID 123456")
                                        .shipmentDate("2021-03-22T12:00:00Z")
                                        .addressReturn(AddressReturn.of(AddressCreateRequest.builder()
                                            .country("US")
                                            .name("Shwan Ippotle")
                                            .company("Shippo")
                                            .street1("215 Clayton St.")
                                            .street3("")
                                            .streetNo("")
                                            .city("San Francisco")
                                            .state("CA")
                                            .zip("94117")
                                            .phone("+1 555 341 9393")
                                            .email("shippotle@shippo.com")
                                            .isResidential(true)
                                            .metadata("Customer ID 123456")
                                            .validate(true)
                                            .build()))
                                        .customsDeclaration(ShipmentCreateRequestCustomsDeclaration.of("adcfdddf8ec64b84ad22772bce3ea37a"))
                                        .carrierAccounts(List.of(
                                            "065a4a8c10d24a34ab932163a1b87f52",
                                            "73f706f4bdb94b54a337563840ce52b0"))
                                        .build())
                                    .carrierAccount("a4391cd4ab974f478f55dc08b5c8e3b3")
                                    .metadata("SHIPMENT #1")
                                    .servicelevelToken("fedex_ground")
                                    .build(),
                                BatchShipmentCreateRequest.builder()
                                    .shipment(ShipmentCreateRequest.builder()
                                        .addressFrom(AddressFrom.of(AddressCreateRequest.builder()
                                            .country("US")
                                            .name("Shwan Ippotle")
                                            .company("Shippo")
                                            .street1("215 Clayton St.")
                                            .street3("")
                                            .streetNo("")
                                            .city("San Francisco")
                                            .state("CA")
                                            .zip("94117")
                                            .phone("+1 555 341 9393")
                                            .email("shippotle@shippo.com")
                                            .isResidential(true)
                                            .metadata("Customer ID 123456")
                                            .validate(true)
                                            .build()))
                                        .addressTo(AddressTo.of(AddressCreateRequest.builder()
                                            .country("US")
                                            .name("Shwan Ippotle")
                                            .company("Shippo")
                                            .street1("215 Clayton St.")
                                            .street3("")
                                            .streetNo("")
                                            .city("San Francisco")
                                            .state("CA")
                                            .zip("94117")
                                            .phone("+1 555 341 9393")
                                            .email("shippotle@shippo.com")
                                            .isResidential(true)
                                            .metadata("Customer ID 123456")
                                            .validate(true)
                                            .build()))
                                        .parcels(List.of(
                                            Parcels.of(ParcelCreateFromTemplateRequest.builder()
                                                .massUnit(WeightUnitEnum.LB)
                                                .weight("1")
                                                .template(ParcelTemplateEnumSet.of(ParcelTemplateDPDUKEnum.DPDUK_EXPRESS_PAK))
                                                .extra(ParcelExtra.builder()
                                                    .cod(Cod.builder()
                                                        .amount("5.5")
                                                        .currency("USD")
                                                        .paymentMethod(PaymentMethod.CASH)
                                                        .build())
                                                    .insurance(ParcelInsurance.builder()
                                                        .amount("5.5")
                                                        .content("Laptop")
                                                        .currency("USD")
                                                        .provider(ParcelInsuranceProvider.UPS)
                                                        .build())
                                                    .build())
                                                .metadata("Customer ID 123456")
                                                .build()),
                                            Parcels.of(ParcelCreateFromTemplateRequest.builder()
                                                .massUnit(WeightUnitEnum.LB)
                                                .weight("1")
                                                .template(ParcelTemplateEnumSet.of(ParcelTemplateDHLeCommerceEnum.DH_LE_C_IRREGULAR))
                                                .extra(ParcelExtra.builder()
                                                    .cod(Cod.builder()
                                                        .amount("5.5")
                                                        .currency("USD")
                                                        .paymentMethod(PaymentMethod.CASH)
                                                        .build())
                                                    .insurance(ParcelInsurance.builder()
                                                        .amount("5.5")
                                                        .content("Laptop")
                                                        .currency("USD")
                                                        .provider(ParcelInsuranceProvider.UPS)
                                                        .build())
                                                    .build())
                                                .metadata("Customer ID 123456")
                                                .build())))
                                        .extra(ShipmentExtra.builder()
                                            .accountsReceivableCustomerAccount(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .appropriationNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .billOfLadingNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .cod(Cod.builder()
                                                .amount("5.5")
                                                .currency("USD")
                                                .paymentMethod(PaymentMethod.CASH)
                                                .build())
                                            .codNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .customerReference(CustomerReference.builder()
                                                .refSort(1L)
                                                .build())
                                            .dealerOrderNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .deptNumber(DepartmentNumber.builder()
                                                .refSort(3L)
                                                .build())
                                            .fdaProductCode(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .insurance(Insurance.builder()
                                                .amount("5.5")
                                                .currency("USD")
                                                .build())
                                            .invoiceNumber(InvoiceNumber.builder()
                                                .refSort(2L)
                                                .build())
                                            .manifestNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .modelNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .partNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .poNumber(PoNumber.builder()
                                                .refSort(2L)
                                                .build())
                                            .productionCode(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .purchaseRequestNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .rmaNumber(RmaNumber.builder()
                                                .refSort(1L)
                                                .build())
                                            .salespersonNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .serialNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .storeNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .transactionReferenceNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .build())
                                        .metadata("Customer ID 123456")
                                        .shipmentDate("2021-03-22T12:00:00Z")
                                        .addressReturn(AddressReturn.of(AddressCreateRequest.builder()
                                            .country("US")
                                            .name("Shwan Ippotle")
                                            .company("Shippo")
                                            .street1("215 Clayton St.")
                                            .street3("")
                                            .streetNo("")
                                            .city("San Francisco")
                                            .state("CA")
                                            .zip("94117")
                                            .phone("+1 555 341 9393")
                                            .email("shippotle@shippo.com")
                                            .isResidential(true)
                                            .metadata("Customer ID 123456")
                                            .validate(true)
                                            .build()))
                                        .customsDeclaration(ShipmentCreateRequestCustomsDeclaration.of(CustomsDeclarationCreateRequest.builder()
                                            .certify(true)
                                            .certifySigner("Shawn Ippotle")
                                            .contentsType(CustomsDeclarationContentsTypeEnum.MERCHANDISE)
                                            .items(List.of(
                                                CustomsItemCreateRequest.builder()
                                                    .description("T-Shirt")
                                                    .massUnit(WeightUnitEnum.LB)
                                                    .netWeight("5")
                                                    .originCountry("<value>")
                                                    .quantity(20L)
                                                    .valueAmount("200")
                                                    .valueCurrency("USD")
                                                    .metadata("Order ID \"123454\"")
                                                    .skuCode("HM-123")
                                                    .hsCode("0901.21")
                                                    .build()))
                                            .nonDeliveryOption(CustomsDeclarationNonDeliveryOptionEnum.RETURN)
                                            .b13aFilingOption(CustomsDeclarationB13AFilingOptionEnum.FILED_ELECTRONICALLY)
                                            .contentsExplanation("T-Shirt purchase")
                                            .dutiesPayor(DutiesPayor.builder()
                                                .account("2323434543")
                                                .type(CustomsDeclarationCreateRequestType.THIRD_PARTY)
                                                .address(CustomsDeclarationCreateRequestAddress.builder()
                                                    .name("Patrick Kavanagh")
                                                    .zip("80331")
                                                    .country("DE")
                                                    .build())
                                                .build())
                                            .exporterIdentification(CustomsExporterIdentification.builder()
                                                .eoriNumber("PL123456790ABCDE")
                                                .taxId(CustomsTaxIdentification.builder()
                                                    .number("123456789")
                                                    .type(CustomsTaxIdentificationType.EIN)
                                                    .build())
                                                .build())
                                            .invoice("#123123")
                                            .metadata("Order ID #123123")
                                            .addressImporter(AddressImporter.builder()
                                                .name("Shwan Ippotle")
                                                .company("Shippo")
                                                .street1("Blumenstraße")
                                                .street3("")
                                                .streetNo("22")
                                                .city("München")
                                                .state("CA")
                                                .zip("80331")
                                                .country("DE")
                                                .phone("80331")
                                                .email("shippotle@shippo.com")
                                                .isResidential(true)
                                                .build())
                                            .eelPfc(CustomsDeclarationEelPfcEnum.NOEEI3037_A)
                                            .incoterm(CustomsDeclarationIncotermEnum.DDP)
                                            .test(true)
                                            .build()))
                                        .carrierAccounts(List.of(
                                            "065a4a8c10d24a34ab932163a1b87f52",
                                            "73f706f4bdb94b54a337563840ce52b0"))
                                        .build())
                                    .carrierAccount("a4391cd4ab974f478f55dc08b5c8e3b3")
                                    .metadata("SHIPMENT #1")
                                    .servicelevelToken("fedex_ground")
                                    .build(),
                                BatchShipmentCreateRequest.builder()
                                    .shipment(ShipmentCreateRequest.builder()
                                        .addressFrom(AddressFrom.of("d799c2679e644279b59fe661ac8fa488"))
                                        .addressTo(AddressTo.of(AddressCreateRequest.builder()
                                            .country("US")
                                            .name("Shwan Ippotle")
                                            .company("Shippo")
                                            .street1("215 Clayton St.")
                                            .street3("")
                                            .streetNo("")
                                            .city("San Francisco")
                                            .state("CA")
                                            .zip("94117")
                                            .phone("+1 555 341 9393")
                                            .email("shippotle@shippo.com")
                                            .isResidential(true)
                                            .metadata("Customer ID 123456")
                                            .validate(true)
                                            .build()))
                                        .parcels(List.of(
                                            Parcels.of("<value>")))
                                        .extra(ShipmentExtra.builder()
                                            .accountsReceivableCustomerAccount(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .appropriationNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .billOfLadingNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .cod(Cod.builder()
                                                .amount("5.5")
                                                .currency("USD")
                                                .paymentMethod(PaymentMethod.CASH)
                                                .build())
                                            .codNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .customerReference(CustomerReference.builder()
                                                .refSort(1L)
                                                .build())
                                            .dealerOrderNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .deptNumber(DepartmentNumber.builder()
                                                .refSort(3L)
                                                .build())
                                            .fdaProductCode(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .insurance(Insurance.builder()
                                                .amount("5.5")
                                                .currency("USD")
                                                .build())
                                            .invoiceNumber(InvoiceNumber.builder()
                                                .refSort(2L)
                                                .build())
                                            .manifestNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .modelNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .partNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .poNumber(PoNumber.builder()
                                                .refSort(2L)
                                                .build())
                                            .productionCode(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .purchaseRequestNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .rmaNumber(RmaNumber.builder()
                                                .refSort(1L)
                                                .build())
                                            .salespersonNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .serialNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .storeNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .transactionReferenceNumber(UPSReferenceFields.builder()
                                                .prefix("ABC")
                                                .value("value")
                                                .refSort(1L)
                                                .build())
                                            .build())
                                        .metadata("Customer ID 123456")
                                        .shipmentDate("2021-03-22T12:00:00Z")
                                        .addressReturn(AddressReturn.of("d799c2679e644279b59fe661ac8fa488"))
                                        .customsDeclaration(ShipmentCreateRequestCustomsDeclaration.of("adcfdddf8ec64b84ad22772bce3ea37a"))
                                        .carrierAccounts(List.of(
                                            "065a4a8c10d24a34ab932163a1b87f52",
                                            "73f706f4bdb94b54a337563840ce52b0"))
                                        .build())
                                    .carrierAccount("a4391cd4ab974f478f55dc08b5c8e3b3")
                                    .metadata("SHIPMENT #1")
                                    .servicelevelToken("fedex_ground")
                                    .build()))
                            .call();

                    if (res.batch().isPresent()) {
                        // handle response
                    }
                }
            }
components:
  parameters:
    ShippoApiVersionHeader:
      description: >-
        Optional string used to pick a non-default API version to use. See our
        <a href="https://docs.goshippo.com/docs/api_concepts/apiversioning/">API
        version</a> guide.
      in: header
      name: SHIPPO-API-VERSION
      schema:
        type: string
        example: '2018-02-08'
        default: '2018-02-08'
        x-default: '2018-02-08'
      x-speakeasy-globals-hidden: true
  schemas:
    BatchShipmentCreateRequest:
      allOf:
        - $ref: '#/components/schemas/BatchShipmentBase'
        - properties:
            shipment:
              $ref: '#/components/schemas/ShipmentCreateRequest'
      required:
        - shipment
      type: object
    BatchShipmentBase:
      properties:
        carrier_account:
          description: >-
            Object ID of the carrier account to be used for this shipment (will
            override batch default)
          example: a4391cd4ab974f478f55dc08b5c8e3b3
          type: string
        metadata:
          description: >-
            A string of up to 100 characters that can be filled with any
            additional information you want 

            to attach to the object.
          example: 'SHIPMENT #1'
          maxLength: 100
          type: string
        servicelevel_token:
          description: >-
            A token that sets the shipping method for the batch, overriding the
            batch default. 

            Servicelevel tokens can be found <a
            href="/shippoapi/public-api/service-levels">in this list</a> 

            or <a
            href="/shippoapi/public-api/carrier-accounts/listcarrieraccounts">at
            this endpoint</a>.
          example: fedex_ground
          type: string
      type: object
    ShipmentCreateRequest:
      allOf:
        - $ref: '#/components/schemas/ShipmentBase'
        - properties:
            address_from:
              oneOf:
                - $ref: '#/components/schemas/AddressCreateRequest'
                - type: string
                  example: d799c2679e644279b59fe661ac8fa488
                  description: >-
                    <a href="/shippoapi/public-api/addresses">Address</a>
                    `object_id` of a previously created address.
            address_return:
              oneOf:
                - $ref: '#/components/schemas/AddressCreateRequest'
                - type: string
                  example: d799c2679e644279b59fe661ac8fa488
                  description: >-
                    <a href="/shippoapi/public-api/addresses">Address</a>
                    `object_id` of a previously created address.
            address_to:
              oneOf:
                - $ref: '#/components/schemas/AddressCreateRequest'
                - type: string
                  example: d799c2679e644279b59fe661ac8fa489
                  description: >-
                    <a href="/shippoapi/public-api/addresses">Address</a>
                    `object_id` of a previously created address.
            customs_declaration:
              oneOf:
                - $ref: '#/components/schemas/CustomsDeclarationCreateRequest'
                - type: string
                  example: adcfdddf8ec64b84ad22772bce3ea37a
                  description: >-
                    <a href="/shippoapi/public-api/customs-declarations">Customs
                    Declaration</a> `object_id` of a previously

                    created customs declaration.
            async:
              type: boolean
            carrier_accounts:
              items:
                type: string
              type: array
              description: >-
                List of <a href="/shippoapi/public-api/carrier-accounts">Carrier
                Accounts</a> `object_id`s used to filter 

                the returned rates.  If set, only rates from these carriers will
                be returned.
              example:
                - 065a4a8c10d24a34ab932163a1b87f52
                - 73f706f4bdb94b54a337563840ce52b0
            parcels:
              type: array
              description: |-
                List of parcels to be shipped.

                **Carrier-Specific Constraints:**
                | Carrier | Constraints |
                |:---|:---|
                | FedEx | Max 30 items |
              items:
                oneOf:
                  - $ref: '#/components/schemas/ParcelCreateRequest'
                  - $ref: '#/components/schemas/ParcelCreateFromTemplateRequest'
                  - type: string
                    description: >-
                      <a href="/shippoapi/public-api/parcels">Parcel</a>
                      `object_id` of a previously created parcel.
          required:
            - address_to
            - address_from
            - parcels
    Batch:
      x-tags:
        - Batches
      allOf:
        - $ref: '#/components/schemas/BatchBase'
        - properties:
            batch_shipments:
              $ref: '#/components/schemas/BatchShipmentPaginatedList'
            label_url:
              description: >-
                An array of URLs each pointing to a merged file of 100 labels
                each
              items:
                type: string
              type: array
            object_created:
              description: Date and time of Batch creation
              example: '2016-01-04T00:15:44.394Z'
              type: string
            object_id:
              description: Unique identifier of the given Batch object
              example: 5ef63c54f5bf45d3b1f8fb37dcb1c5f4
              type: string
            object_owner:
              description: Username of the user who created the Batch object.
              example: shippo@shippo.com
              type: string
            object_results:
              description: >-
                An object containing the following
                counts:<br>`creation_succeeded`<br>`creation_failed`<br>`purchase_succeeded`<br>`purchase_failed`
              properties:
                creation_failed:
                  example: 3
                  format: int64
                  type: integer
                creation_succeeded:
                  example: 5
                  format: int64
                  type: integer
                purchase_failed:
                  example: 0
                  format: int64
                  type: integer
                purchase_succeeded:
                  example: 0
                  format: int64
                  type: integer
              required:
                - purchase_failed
                - purchase_succeeded
                - creation_failed
                - creation_succeeded
              type: object
            object_updated:
              description: Date and time of last update to the Batch
              example: '2016-01-04T00:48:13.841Z'
              type: string
            status:
              description: >-
                Batches that are `VALIDATING` are being created and
                validated<br>

                `VALID` batches can be purchased<br>

                `INVALID` batches cannot be purchased, `INVALID` BatchShipments
                must be removed<br>

                Batches that are in the `PURCHASING` state are being
                purchased<br>

                `PURCHASED` batches are finished purchasing.
              enum:
                - VALIDATING
                - VALID
                - INVALID
                - PURCHASING
                - PURCHASED
              example: VALID
              type: string
            test:
              example: false
              type: boolean
          required:
            - object_id
            - object_owner
            - status
            - object_created
            - object_updated
            - batch_shipments
            - object_results
            - label_url
    BadRequest:
      additionalProperties: true
      type: object
    ShipmentBase:
      properties:
        extra:
          $ref: '#/components/schemas/ShipmentExtra'
        metadata:
          example: Customer ID 123456
          type: string
          maxLength: 100
          description: >-
            A string of up to 100 characters that can be filled with any
            additional information you want to attach to the object.
        shipment_date:
          example: '2021-03-22T12:00:00Z'
          type: string
          description: >-
            Date the shipment will be tendered to the carrier. Must be in the
            format `2014-01-18T00:35:03.463Z`. 

            Defaults to current date and time if no value is provided. Please
            note that some carriers require this value to

            be in the future, on a working day, or similar.
      type: object
    AddressCreateRequest:
      allOf:
        - $ref: '#/components/schemas/AddressBase'
        - properties:
            validate:
              description: Set to true to validate Address object.
              example: true
              type: boolean
          required:
            - country
    CustomsDeclarationCreateRequest:
      allOf:
        - $ref: '#/components/schemas/CustomsDeclarationBase'
        - properties:
            address_importer:
              $ref: '#/components/schemas/AddressImporter'
            b13a_filing_option:
              $ref: '#/components/schemas/CustomsDeclarationB13AFilingOptionEnum'
            contents_type:
              $ref: '#/components/schemas/CustomsDeclarationContentsTypeEnum'
            eel_pfc:
              $ref: '#/components/schemas/CustomsDeclarationEelPfcEnum'
            incoterm:
              $ref: '#/components/schemas/CustomsDeclarationIncotermEnum'
            items:
              items:
                $ref: '#/components/schemas/CustomsItemCreateRequest'
              type: array
            non_delivery_option:
              $ref: '#/components/schemas/CustomsDeclarationNonDeliveryOptionEnum'
            test:
              example: true
              type: boolean
          required:
            - items
    ParcelCreateRequest:
      allOf:
        - $ref: '#/components/schemas/ParcelBase'
        - $ref: '#/components/schemas/ParcelDimensions'
      required:
        - length
        - width
        - height
        - distance_unit
        - weight
        - mass_unit
      type: object
    ParcelCreateFromTemplateRequest:
      allOf:
        - $ref: '#/components/schemas/ParcelBase'
        - properties:
            template:
              $ref: '#/components/schemas/ParcelTemplateEnumSet'
      required:
        - template
        - weight
        - mass_unit
      type: object
    BatchBase:
      properties:
        default_carrier_account:
          description: >-
            ID of the Carrier Account object to use as the default for all
            shipments in this Batch. 

            The carrier account can be changed on a per-shipment basis by
            changing the carrier_account in the 

            corresponding BatchShipment object.
          example: 078870331023437cb917f5187429b093
          type: string
        default_servicelevel_token:
          description: >-
            Token of the service level to use as the default for all shipments
            in this Batch. 

            The servicelevel can be changed on a per-shipment basis by changing
            the servicelevel_token in the 

            corresponding BatchShipment object. <a
            href="/shippoapi/public-api/service-levels">Servicelevel tokens can
            be found here.</a>
          example: usps_priority
          type: string
        label_filetype:
          $ref: '#/components/schemas/LabelFileTypeEnum'
        metadata:
          description: >-
            A string of up to 100 characters that can be filled with any
            additional information you want to attach to the object.
          example: 'BATCH #1'
          maxLength: 100
          type: string
      required:
        - default_carrier_account
        - default_servicelevel_token
      type: object
    BatchShipmentPaginatedList:
      allOf:
        - $ref: '#/components/schemas/PaginatedList'
        - description: >-
            Array of <a
            href="/shippoapi/public-api/batches/batchshipment">BatchShipment</a>
            objects. 

            The response keeps the same order as in the request array.
          properties:
            results:
              items:
                $ref: '#/components/schemas/BatchShipment'
              type: array
    ShipmentExtra:
      title: Shipment Extra
      x-tags:
        - Shipments
      description: An object holding optional extra services to be requested.
      properties:
        accounts_receivable_customer_account:
          $ref: '#/components/schemas/UPSReferenceFields'
          description: >-
            UPS only. Adds custom accounts receivable customer account reference
            to UPS labels.
        alcohol:
          $ref: '#/components/schemas/Alcohol'
        ancillary_endorsement:
          enum:
            - FORWARDING_SERVICE_REQUESTED
            - RETURN_SERVICE_REQUESTED
          description: >-
            Specify an ancillary service endorsement to provide the USPS with
            instructions on how to handle undeliverable-as-addressed pieces (DHL
            eCommerce only).
        appropriation_number:
          $ref: '#/components/schemas/UPSReferenceFields'
          description: UPS only. Adds custom appropriation number reference to UPS labels.
        authority_to_leave:
          type: boolean
          description: >-
            Request `true` to give carrier permission to leave the parcel in a
            safe place if no one answers the 

            door (where supported). When set to `false`, if no one is available
            to receive the item, the parcel 

            will not be left (*surcharges may be applicable).
        bill_of_lading_number:
          $ref: '#/components/schemas/UPSReferenceFields'
          description: UPS only. Adds custom bill of lading number reference to UPS labels.
        billing:
          $ref: '#/components/schemas/Billing'
        bypass_address_validation:
          type: boolean
          description: Bypasses address validation (USPS, UPS, & LaserShip only).
        carbon_neutral:
          type: boolean
          description: Request carbon offsets by passing true (UPS only).
        carrier_hub_id:
          type: string
          description: Identifies the carrier injection site.
        carrier_hub_travel_time:
          type: integer
          description: >-
            Travel time in hours from fulfillment center to carrier injection
            site.
        COD:
          $ref: '#/components/schemas/COD'
        cod_number:
          $ref: '#/components/schemas/UPSReferenceFields'
          description: UPS only. Adds custom COD number reference to UPS labels.
        container_type:
          type: string
          description: Specify container type.
        critical_pull_time:
          type: string
          description: >-
            Carrier arrival time to pickup packages from the fulfillment
            center. 

            UTC format: `%Y-%m-%dT%H:%M:%SZ`
        customer_branch:
          type: string
          description: Specify customer branch (Lasership only).
        customer_reference:
          $ref: '#/components/schemas/CustomerReference'
        dangerous_goods:
          $ref: '#/components/schemas/DangerousGoodsObject'
        dangerous_goods_code:
          enum:
            - '01'
            - '02'
            - '03'
            - '04'
            - '05'
            - '06'
            - '07'
            - '08'
            - '09'
          description: >-
            Dangerous Goods Code (DHL eCommerce only). See <a
            href="https://api-legacy.dhlecs.com/docs/v2/appendix.html#dangerous-goods">Category
            Codes</a>
        dealer_order_number:
          $ref: '#/components/schemas/UPSReferenceFields'
          description: UPS only. Adds custom dealer order number reference to UPS labels.
        delivery_instructions:
          type: string
          description: >-
            Specify delivery instructions. Up to 500 characters. (FedEx and
            OnTrac only).
        dept_number:
          $ref: '#/components/schemas/DepartmentNumber'
        dry_ice:
          $ref: '#/components/schemas/DryIce'
        fda_product_code:
          $ref: '#/components/schemas/UPSReferenceFields'
          description: UPS only. Adds custom FDA product code reference to UPS labels.
        fulfillment_center:
          type: string
          description: The fulfilment center where the package originates from.
        insurance:
          $ref: '#/components/schemas/Insurance'
        invoice_number:
          $ref: '#/components/schemas/InvoiceNumber'
        is_return:
          type: boolean
          description: >-
            This field specifies if it is a scan-based return shipment. See the
            <a href="https://docs.goshippo.com/docs/shipments/returns/">Create a
            return shipment</a> section for more details.
        lasership_attrs:
          description: >-
            Specify Lasership Attributes (Lasership only). Multiple options
            accepted.
          items:
            $ref: '#/components/schemas/ShipmentExtraLasershipAttributesEnum'
          type: array
        lasership_declared_value:
          type: string
          description: Declared value (Lasership only). Defaults to `50.00`.
        manifest_number:
          $ref: '#/components/schemas/UPSReferenceFields'
          description: UPS only. Adds custom manifest number reference to UPS labels.
        model_number:
          $ref: '#/components/schemas/UPSReferenceFields'
          description: UPS only. Adds custom model number reference to UPS labels.
        part_number:
          $ref: '#/components/schemas/UPSReferenceFields'
          description: UPS only. Adds custom part number reference to UPS labels.
        po_number:
          $ref: '#/components/schemas/PoNumber'
        preferred_delivery_timeframe:
          enum:
            - '10001200'
            - '12001400'
            - '14001600'
            - '16001800'
            - '18002000'
            - '19002100'
          description: >-
            Required for DHL Germany Paket Sameday. Designates a desired
            timeframe for delivery. Format is `HHMMHHMM`
        premium:
          type: boolean
          description: >-
            Add premium service to a shipment (DHL Germany international
            shipments only).
        production_code:
          $ref: '#/components/schemas/UPSReferenceFields'
          description: UPS only. Adds custom product code reference to UPS labels.
        purchase_request_number:
          $ref: '#/components/schemas/UPSReferenceFields'
          description: >-
            UPS only. Adds custom purchase request number reference to UPS
            labels.
        qr_code_requested:
          type: boolean
          description: >-
            Request a QR code for a given transaction when creating a shipping
            label (USPS domestic and Evri UK only).
        reference_1:
          type: string
          maxLength: 50
          description: >-
            Optional text to be printed on the shipping label if supported by
            carrier. Up to 50 characters.


            **Carrier-Specific Constraints:**

            | Carrier | Constraints |

            |:---|:---|

            | FedEx | Max 40 characters (Express services); Max 30 characters
            (Ground services) |
        reference_2:
          type: string
          maxLength: 50
          description: >-
            Optional text to be printed on the shipping label if supported by
            carrier. Up to 50 characters. For DHL eCommerce, this field can be
            used for billing reference.


            **Carrier-Specific Constraints:**

            | Carrier | Constraints |

            |:---|:---|

            | FedEx | Max 30 characters |
        request_retail_rates:
          type: boolean
          description: >-
            Returns retail rates instead of account-based rates (UPS and FedEx
            only).
        return_service_type:
          type: string
          description: >-
            Request additional return option for return shipments (UPS and
            Lasership only).
          oneOf:
            - $ref: '#/components/schemas/ShipmentExtraReturnServiceTypeUPSEnum'
            - $ref: '#/components/schemas/ShipmentExtraReturnServiceTypeLasershipEnum'
        rma_number:
          $ref: '#/components/schemas/RmaNumber'
        saturday_delivery:
          type: boolean
          description: Marks shipment as to be delivered on a Saturday.
        salesperson_number:
          $ref: '#/components/schemas/UPSReferenceFields'
          description: UPS only. Adds custom salesperson number reference to UPS labels.
        serial_number:
          $ref: '#/components/schemas/UPSReferenceFields'
          description: UPS only. Adds custom serial number reference to UPS labels.
        signature_confirmation:
          enum:
            - STANDARD
            - ADULT
            - CERTIFIED
            - INDIRECT
            - CARRIER_CONFIRMATION
          description: >-
            Request standard or adult signature confirmation. You can
            alternatively request Certified Mail (USPS only) 

            or Indirect signature (FedEx only) or Carrier Confirmation (Deutsche
            Post only).
        store_number:
          $ref: '#/components/schemas/UPSReferenceFields'
          description: UPS only. Adds custom store number reference to UPS labels.
        transaction_reference_number:
          $ref: '#/components/schemas/UPSReferenceFields'
          description: UPS only. Adds custom transaction reference number to UPS labels.
        usmca_eligible:
          type: boolean
          description: >-
            UPS only. Request USMCA (United States-Mexico-Canada Agreement)
            preferential tariff treatment. 

            When enabled, it includes the USMCA eligibility declaration in
            customs documentation.


            Supported routes and value limits:

            - USA/Canada → Mexico: ≤ $1,000 USD

            - Canada/Mexico → USA: ≤ $2,500 USD  

            - USA/Mexico → Canada: ≤ $3,300 CAD


            Only for declaration-only shipments, full USMCA - FormType 04
            (Certificate of Origin) is not supported.
      type: object
    AddressBase:
      description: Address represents the address as retrieved from the database
      properties:
        name:
          description: >-
            **required for purchase**<br>

            First and Last Name of the addressee


            **Carrier-Specific Constraints:**

            | Carrier | Constraints |

            |:---|:---|

            | FedEx | Either company or name required; No length validation
            (first 35 chars printed on label) |
          example: Shwan Ippotle
          type: string
          maxLength: 100
        company:
          example: Shippo
          type: string
          maxLength: 100
          description: |-
            Company Name

            **Carrier-Specific Constraints:**
            | Carrier | Constraints |
            |:---|:---|
            | FedEx | Max 35 characters; Either company or name required |
        street1:
          description: >-
            **required for purchase**<br>

            First street line. Usually street number and street name (except for
            DHL Germany, see street_no).


            **Carrier-Specific Constraints:**

            | Carrier | Constraints |

            |:---|:---|

            | FedEx | At least one street line required; Max 35 characters per
            line |
          example: 215 Clayton St.
          type: string
          maxLength: 121
        street2:
          type: string
          maxLength: 100
          description: >-
            Second street line.


            **Carrier-Specific Constraints:**

            | Carrier | Constraints |

            |:---|:---|

            | FedEx | At least one street line required; Max 35 characters per
            line |
        street3:
          type: string
          maxLength: 100
          example: ''
          description: >-
            Third street line.

            Only accepted for USPS international shipments, UPS domestic and UPS
            international shipments.


            **Carrier-Specific Constraints:**

            | Carrier | Constraints |

            |:---|:---|

            | FedEx | At least one street line required; Max 35 characters per
            line |
        street_no:
          type: string
          example: ''
          description: >-
            Street number of the addressed building. 

            This field can be included in street1 for all carriers except for
            DHL Germany.
        city:
          description: >-
            **required for purchase**<br>

            Name of a city. When creating a Quote Address, sending a city is
            optional but will yield more accurate Rates.

            Please bear in mind that city names may be ambiguous (there are 34
            Springfields in the US). Pass in a state

            or a ZIP code (see below), if known, it will yield more accurate
            results.


            **Carrier-Specific Constraints:**

            | Carrier | Constraints |

            |:---|:---|

            | FedEx | Required; Max 35 characters |
          example: San Francisco
          type: string
          maxLength: 100
        state:
          description: >-
            **required for purchase for some countries**<br>

            State/Province values are required for shipments from/to the US, AU,
            and CA. UPS requires province for some

            countries (i.e Ireland). To receive more accurate quotes, passing
            this field is recommended. Most carriers

            only accept two or three character state abbreviations.


            **Carrier-Specific Constraints:**

            | Carrier | Constraints |

            |:---|:---|

            | FedEx | Required if country requires state; Max 2 characters for
            US, CA, PR |
          example: CA
          type: string
          maxLength: 100
        zip:
          description: >-
            **required for purchase**<br>

            Postal code of an Address. When creating a Quote Addresses, sending
            a ZIP is optional but will yield more

            accurate Rates.


            **Carrier-Specific Constraints:**

            | Carrier | Constraints |

            |:---|:---|

            | FedEx | Max 10 characters |
          example: '94117'
          type: string
          maxLength: 20
        country:
          example: US
          type: string
          description: >-
            ISO 3166-1 alpha-2 country codes and country names can be used. For
            most consistent results, we recommend using country codes like `US`
            or `DE`.

            If using country names, please ensure they are spelled correctly and
            in English. Country names are converted to country codes.

            Refer to this <a
            href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements"
            target="_blank">guide</a> for a list of country codes.

            Sending a country is always required.
        phone:
          example: +1 555 341 9393
          type: string
          maxLength: 50
          description: >-
            Addresses containing a phone number allow carriers to call the
            recipient when delivering the Parcel. This

            increases the probability of delivery and helps to avoid accessorial
            charges after a Parcel has been shipped.


            **Carrier-Specific Constraints:**

            | Carrier | Constraints |

            |:---|:---|

            | FedEx | Required; Min 1, max 15 characters |

            | USPS | Sender phone required for shipments during label purchase;
            Min 8, max 15 digits |
        email:
          example: shippotle@shippo.com
          type: string
          maxLength: 254
          description: |-
            E-mail address of the contact person, RFC3696/5321-compliant.

            **Carrier-Specific Constraints:**
            | Carrier | Constraints |
            |:---|:---|
            | FedEx | Max 80 characters |
            | USPS | Sender email required for shipments during label purchase |
        is_residential:
          example: true
          type: boolean
        metadata:
          example: Customer ID 123456
          type: string
          maxLength: 100
          description: >-
            A string of up to 100 characters that can be filled with any
            additional information you want 

            to attach to the object.
      type: object
    CustomsDeclarationBase:
      properties:
        aes_itn:
          description: |-
            **required if eel_pfc is `AES_ITN`**<br>
            AES / ITN reference of the shipment.
          type: string
        b13a_filing_option:
          type: string
        b13a_number:
          description: >-
            **must be provided if and only if b13a_filing_option is
            provided**<br>

            Represents:<br> the Proof of Report (POR) Number when
            b13a_filing_option is `FILED_ELECTRONICALLY`;<br> 

            the Summary ID Number when b13a_filing_option is
            `SUMMARY_REPORTING`;<br> 

            or the Exemption Number when b13a_filing_option is `NOT_REQUIRED`.
          type: string
        certificate:
          type: string
          description: Certificate reference of the shipment.
        certify:
          example: true
          type: boolean
          description: >-
            Expresses that the certify_signer has provided all information of
            this customs declaration truthfully.
        certify_signer:
          example: Shawn Ippotle
          type: string
          description: >-
            Name of the person who created the customs declaration and is
            responsible for the validity of all 

            information provided.
        commercial_invoice:
          type: boolean
        contents_explanation:
          description: |-
            **required if contents_type is `OTHER`**<br>
            Explanation of the type of goods of the shipment.
          example: T-Shirt purchase
          type: string
        disclaimer:
          type: string
          maxLength: 1000
          description: >-
            Disclaimer for the shipment and customs information that have been
            provided.


            **Carrier-Specific Constraints:**

            | Carrier | Constraints |

            |:---|:---|

            | FedEx | Max 554 characters |
        duties_payor:
          description: >-
            Specifies who will pay the duties for the shipment. Only accepted
            for FedEx shipments.
          type: object
          properties:
            account:
              type: string
              description: Account number to be billed for duties.
              example: '2323434543'
            type:
              enum:
                - SENDER
                - RECIPIENT
                - THIRD_PARTY
              description: Party to be billed for duties.
              example: THIRD_PARTY
            address:
              type: object
              properties:
                name:
                  type: string
                  description: Name of the party to be billed for duties.
                  example: Patrick Kavanagh
                zip:
                  type: string
                  description: Postal code of the party to be billed for duties.
                  example: '80331'
                country:
                  type: string
                  description: Country ISO code of account number to be billed.
                  example: DE
        exporter_identification:
          $ref: '#/components/schemas/CustomsExporterIdentification'
        exporter_reference:
          type: string
          description: Exporter reference of an export shipment.
        importer_reference:
          type: string
          description: Importer reference of an import shipment.
        is_vat_collected:
          type: boolean
          description: >-
            Indicates whether the shipment's destination VAT has been collected.
            May be required for some destinations.
        invoice:
          example: '#123123'
          type: string
          maxLength: 15
          description: Invoice reference of the shipment.
        license:
          type: string
          description: License reference of the shipment.
        metadata:
          example: 'Order ID #123123'
          type: string
          description: >-
            A string of up to 100 characters that can be filled with any
            additional information you 

            want to attach to the object.
        notes:
          type: string
          description: Additional notes to be included in the customs declaration.
      required:
        - certify_signer
        - certify
        - non_delivery_option
        - contents_type
      type: object
    AddressImporter:
      description: Object that represents the address of the importer
      type: object
      properties:
        name:
          description: First and Last Name of the addressee
          example: Shwan Ippotle
          type: string
        company:
          example: Shippo
          type: string
          description: Company Name
        street1:
          description: >-
            First street line, 35 character limit. Usually street number and
            street name (except for DHL Germany, see street_no).
          example: Blumenstraße
          type: string
        street2:
          type: string
          description: Second street line, 35 character limit.
        street3:
          type: string
          example: ''
          description: >-
            Third street line, 35 character limit. 

            Only accepted for USPS international shipments, UPS domestic and UPS
            international shipments.
        street_no:
          type: string
          example: '22'
          description: >-
            Street number of the addressed building. 

            This field can be included in street1 for all carriers except for
            DHL Germany.
        city:
          description: Name of a city
          example: München
          type: string
        state:
          description: >-
            **required for purchase for some countries**<br>

            State/Province values are required for shipments from/to the US, AU,
            and CA. UPS requires province for some 

            countries (i.e Ireland). To receive more accurate quotes, passing
            this field is recommended. Most carriers 

            only accept two or three character state abbreviations.
          example: CA
          type: string
        zip:
          description: Postal code of an Address.
          example: '80331'
          type: string
        country:
          example: DE
          type: string
          description: >-
            Example: `US` or `DE`. All accepted values can be found on the 

            <a href="http://www.iso.org/" target="blank">Official ISO
            Website</a>.

            Sending a country is always required.
        phone:
          example: '80331'
          type: string
          description: >-
            Addresses containing a phone number allow carriers to call the
            recipient when delivering the Parcel. This 

            increases the probability of delivery and helps to avoid accessorial
            charges after a Parcel has been shipped.    
        email:
          example: shippotle@shippo.com
          type: string
          description: E-mail address of the contact person, RFC3696/5321-compliant.
        is_residential:
          example: true
          type: boolean
          description: >-
            Indicates whether the address provided is a residential address or
            not.
    CustomsDeclarationB13AFilingOptionEnum:
      allOf:
        - $ref: '#/components/schemas/CustomsDeclarationB13AFilingOption'
        - enum:
            - FILED_ELECTRONICALLY
            - SUMMARY_REPORTING
            - NOT_REQUIRED
    CustomsDeclarationContentsTypeEnum:
      allOf:
        - $ref: '#/components/schemas/CustomsDeclarationContentsType'
        - enum:
            - DOCUMENTS
            - GIFT
            - SAMPLE
            - MERCHANDISE
            - HUMANITARIAN_DONATION
            - RETURN_MERCHANDISE
            - OTHER
    CustomsDeclarationEelPfcEnum:
      allOf:
        - $ref: '#/components/schemas/CustomsDeclarationEelPfc'
        - enum:
            - NOEEI_30_37_a
            - NOEEI_30_37_h
            - NOEEI_30_37_f
            - NOEEI_30_36
            - AES_ITN
    CustomsDeclarationIncotermEnum:
      allOf:
        - $ref: '#/components/schemas/CustomsDeclarationIncoterm'
        - enum:
            - DDP
            - DDU
            - FCA
            - DAP
            - eDAP
    CustomsItemCreateRequest:
      allOf:
        - $ref: '#/components/schemas/CustomsItemBase'
      x-speakeasy-name-override: CustomsItemCreateRequest
      x-speakeasy-include: true
    CustomsDeclarationNonDeliveryOptionEnum:
      allOf:
        - $ref: '#/components/schemas/CustomsDeclarationNonDeliveryOption'
        - enum:
            - ABANDON
            - RETURN
    ParcelBase:
      properties:
        extra:
          $ref: '#/components/schemas/ParcelExtra'
        metadata:
          type: string
          example: Customer ID 123456
        mass_unit:
          $ref: '#/components/schemas/WeightUnitEnum'
        weight:
          description: >-
            Weight of the parcel. Up to six digits in front and four digits
            after the decimal separator are accepted.
          example: '1'
          type: string
      type: object
    ParcelDimensions:
      properties:
        distance_unit:
          $ref: '#/components/schemas/DistanceUnitEnum'
          description: The measure unit used for length, width and height.
        height:
          description: >-
            Height of the parcel. Up to six digits in front and four digits
            after the decimal separator are accepted.
          example: '1'
          type: string
        length:
          description: >-
            Length of the Parcel. Up to six digits in front and four digits
            after the decimal separator are accepted.
          example: '1'
          type: string
        width:
          description: >-
            Width of the Parcel. Up to six digits in front and four digits after
            the decimal separator are accepted.
          example: '1'
          type: string
      type: object
    ParcelTemplateEnumSet:
      description: >-
        If template is passed, `length`, `width`, `height`, and `distance_unit`
        are not required
      oneOf:
        - $ref: '#/components/schemas/ParcelTemplateFedExEnum'
        - $ref: '#/components/schemas/ParcelTemplateUPSEnum'
        - $ref: '#/components/schemas/ParcelTemplateUSPSEnum'
        - $ref: '#/components/schemas/ParcelTemplateDHLeCommerceEnum'
        - $ref: '#/components/schemas/ParcelTemplateDPDUKEnum'
        - $ref: '#/components/schemas/ParcelTemplateAramexAustraliaEnum'
      x-speakeasy-include: true
    LabelFileTypeEnum:
      description: >-
        Print format of the <a
        href="https://docs.goshippo.com/docs/shipments/shippinglabelsizes/">label</a>.
        If empty, will use the default format set from 

        <a href="https://apps.goshippo.com/settings/labels">the Shippo
        dashboard.</a>
      enum:
        - PNG
        - PNG_2.3x7.5
        - PDF
        - PDF_2.3x7.5
        - PDF_4x6
        - PDF_4x8
        - PDF_A4
        - PDF_A5
        - PDF_A6
        - ZPLII
      example: PDF_4x6
      type: string
    PaginatedList:
      properties:
        next:
          example: baseurl?page=3&results=10
          type: string
        previous:
          example: baseurl?page=1&results=10
          type: string
      type: object
    BatchShipment:
      title: Batch Shipment
      x-tags:
        - Batches
      description: >-
        The batch shipment object is a wrapper around a shipment object, which
        include shipment-specific information

        for batch processing.


        Note: batch shipments can only be created on the batch endpoint, either
        when creating a batch object or by through

        the `/batches/{BATCH_OBJECT_ID}/add_shipments` endpoint
      allOf:
        - $ref: '#/components/schemas/BatchShipmentBase'
        - properties:
            messages:
              description: List of Shipment and Transaction error messages.
              type: array
              items: {}
            object_id:
              description: >-
                Object ID of this batch shipment. Can be used in the
                remove_shipments endpoint.
              example: e11c95a6788d4ddcaa22f03175838740
              type: string
            shipment:
              description: >-
                Object ID of the shipment object created for this batch
                shipment.
              example: adcfdddf8ec64b84ad22772bce3ea37a
              type: string
            status:
              description: >-
                `INVALID` batch shipments cannot be purchased and will have to
                be removed, fixed, and added to the batch again.<br>

                `VALID` batch shipments can be purchased. <br>

                Batch shipments with the status `TRANSACTION_FAILED` were not
                able to be purchased and the error will be displayed on the
                message field<br> 

                `INCOMPLETE` batch shipments have an issue with the Address and
                will need to be removed, fixed, and added to the batch again.
              enum:
                - INVALID
                - VALID
                - INCOMPLETE
                - TRANSACTION_FAILED
              example: INVALID
              type: string
            transaction:
              description: >-
                Object ID of the transaction object created for this batch
                shipment.
              example: 4c33736a67e2450da88b38c42deef6b7
              type: string
          required:
            - shipment
            - object_id
            - status
    UPSReferenceFields:
      properties:
        prefix:
          type: string
          description: Custom prefix text.
          example: ABC
        value:
          type: string
          description: Label reference text. 35 character limit.
          example: value
        ref_sort:
          type: integer
          description: >-
            Order UPS reference fields are printed on ZPL labels. For UPS
            shipments, if you choose to set `ref_sort` for one reference, you
            must set `ref_sort` for all other supported UPS references using
            unique integers.
          example: 1
    Alcohol:
      description: Indicates that a shipment contains Alcohol (Fedex and UPS only).
      properties:
        contains_alcohol:
          type: boolean
          description: >-
            Mandatory for Fedex and UPS. Specifies that the package contains
            Alcohol.
        recipient_type:
          enum:
            - licensee
            - consumer
          description: >-
            Mandatory for Fedex only. License type of the recipient of the
            Alcohol Package.
      type: object
    Billing:
      description: Specify billing details (UPS, FedEx, and DHL Germany only).
      properties:
        account:
          type: string
          description: >-
            Account number to be billed. (For DHL Germany, leave this field
            blank.)
        country:
          type: string
          format: iso-3166
          description: >-
            Country iso2 code of account number to be billed (required for UPS
            third party billing only).
        participation_code:
          type: string
          description: >-
            2 digit code used to override your default participation code
            associated with your DHL Germany account.
        type:
          enum:
            - SENDER
            - RECIPIENT
            - THIRD_PARTY
            - THIRD_PARTY_CONSIGNEE
            - COLLECT
          description: Party to be billed. (Leave blank for DHL Germany.)
        zip:
          type: string
          description: >-
            ZIP code of account number to be billed (required for UPS if there
            is a zip on the billing account).
      type: object
    COD:
      description: Specify collection on delivery details (UPS only).
      properties:
        amount:
          description: Amount to be collected.
          example: '5.5'
          type: string
        currency:
          description: >-
            Currency for the amount to be collected. Currently only USD is
            supported for UPS.
          example: USD
          type: string
        payment_method:
          description: >-
            Secured funds include money orders, certified cheques and others
            (see 

            <a
            href="https://www.ups.com/content/us/en/shipping/time/service/value_added/cod.html">UPS</a>
            for details). 

            If no payment_method inputted the value defaults to "ANY".)
          enum:
            - SECURED_FUNDS
            - CASH
            - ANY
          example: CASH
          type: string
      title: COD Specify collection on delivery details (UPS only).
      type: object
    CustomerReference:
      description: Specify the reference field on the label (FedEx and UPS only).
      properties:
        prefix:
          type: string
          description: >-
            Custom prefix for customer reference field (ZPL labels only). Up to
            11 characters, including trailing 

            spaces. Empty string indicates removal of default prefix. To use the
            default prefix, do not include

            this property.
        value:
          type: string
          maxLength: 40
          description: >-
            Optional text to be printed on the shipping label for customer
            reference. Up to 40 characters. If

            this is provided, reference_1 will be ignored.


            **Carrier-Specific Constraints:**

            | Carrier | Constraints |

            |:---|:---|

            | FedEx | Max 40 characters (Express services); Max 30 characters
            (Ground services) |
        ref_sort:
          type: integer
          description: >-
            Order UPS reference fields are printed on ZPL labels. For UPS
            shipments, if you choose to set `ref_sort` for one reference, you
            must set `ref_sort` for all other supported UPS references using
            unique integers.
          example: 1
      type: object
    DangerousGoodsObject:
      description: >-
        Container for specifying the presence of dangerous materials. This is
        specific to USPS, and if any contents

        are provided, only certain USPS service levels will be eligible. For
        more information, see our

        <a href="https://docs.goshippo.com/docs/shipments/hazmat/">guide on
        hazardous or dangerous materials shipping</a>.
      properties:
        contains:
          type: boolean
          description: Indicates if the shipment contains dangerous goods.
        biological_material:
          $ref: '#/components/schemas/DangerousGoodsBiologicalMaterial'
        lithium_batteries:
          $ref: '#/components/schemas/DangerousGoodsLithiumBatteries'
      type: object
    DepartmentNumber:
      description: Specify the department number field on the label (FedEx and UPS only).
      properties:
        prefix:
          type: string
          description: >-
            Custom prefix for department number field (ZPL labels only). Up to
            11 characters, including trailing 

            spaces. Empty string indicates removal of default prefix. To use the
            default prefix, do not include

            this property.
        value:
          type: string
          maxLength: 40
          description: >-
            Optional text to be printed on the shipping label for department
            number. Up to 40 characters.


            **Carrier-Specific Constraints:**

            | Carrier | Constraints |

            |:---|:---|

            | FedEx | Max 30 characters |
        ref_sort:
          type: integer
          description: >-
            Order UPS reference fields are printed on ZPL labels. For UPS
            shipments, if you choose to set `ref_sort` for one reference, you
            must set `ref_sort` for all other supported UPS references using
            unique integers.
          example: 3
      type: object
    DryIce:
      description: Specify that the package contains Dry Ice (FedEx, Veho, and UPS only).
      properties:
        contains_dry_ice:
          type: boolean
          description: Mandatory. Specifies that the package contains Dry Ice.
        weight:
          type: string
          description: >-
            Mandatory. Units must be in Kilograms. Cannot be greater than
            package weight.
      type: object
    Insurance:
      description: >-
        To add 3rd party insurance powered by <a
        href="https://docs.goshippo.com/docs/shipments/shippinginsurance/">XCover</a>, 

        specify <br> `amount`, `content`, and `currency`. <br> Alternatively,
        you can choose carrier provided insurance 

        by additionally specifying `provider` (UPS, FedEx and OnTrac only).
        <br><br> If you do not want to add insurance 

        to your shipment, do not set these parameters.
      properties:
        amount:
          description: Declared value of the goods you want to insure.
          example: '5.5'
          type: string
        content:
          type: string
          description: Description of package content.
        currency:
          example: USD
          type: string
          format: iso-4217
          description: |-
            Currency for the amount value.
            Currently only USD is supported for FedEx and UPS.
        provider:
          enum:
            - FEDEX
            - UPS
            - ONTRAC
          description: >-
            To have insurance cover provided by a carrier directly instead of
            Shippo's provider (XCover), set `provider` to `FEDEX`, `UPS`, or
            `ONTRAC`.
      type: object
    InvoiceNumber:
      description: Specify the invoice number field on the label (FedEx and UPS only).
      properties:
        prefix:
          type: string
          description: >-
            Custom prefix for invoice number field (ZPL labels only). Up to 11
            characters, including trailing 

            spaces. Empty string indicates removal of default prefix. To use the
            default prefix, do not include

            this property.
        value:
          type: string
          maxLength: 40
          description: >-
            Optional text to be printed on the shipping label for invoice
            number. Up to 40 characters. If

            provided, this will be used on the label instead of
            shipment.customs_declaration.invoice.


            **Carrier-Specific Constraints:**

            | Carrier | Constraints |

            |:---|:---|

            | FedEx | Max 30 characters |
        ref_sort:
          type: integer
          description: >-
            Order UPS reference fields are printed on ZPL labels. For UPS
            shipments, if you choose to set `ref_sort` for one reference, you
            must set `ref_sort` for all other supported UPS references using
            unique integers.
          example: 2
      type: object
    ShipmentExtraLasershipAttributesEnum:
      type: string
      enum:
        - TwoPersonDelivery
        - Explosive
        - Alcohol
        - Hazmat
        - ControlledSubstance
        - Refrigerated
        - DryIce
        - Perishable
        - NoRTS
    PoNumber:
      description: Specify the PO number field on the label (FedEx and UPS only).
      properties:
        prefix:
          type: string
          description: >-
            Custom prefix for PO number field (ZPL labels only). Up to 11
            characters, including trailing 

            spaces. Empty string indicates removal of default prefix. To use the
            default prefix, do not include

            this property.
        value:
          type: string
          maxLength: 40
          description: >-
            Optional text to be printed on the shipping label for PO number. Up
            to 40 characters. If

            this is provided, reference_2 will be ignored.


            **Carrier-Specific Constraints:**

            | Carrier | Constraints |

            |:---|:---|

            | FedEx | Max 30 characters |
        ref_sort:
          type: integer
          description: >-
            Order UPS reference fields are printed on ZPL labels. For UPS
            shipments, if you choose to set `ref_sort` for one reference, you
            must set `ref_sort` for all other supported UPS references using
            unique integers.
          example: 2
      type: object
    ShipmentExtraReturnServiceTypeUPSEnum:
      type: string
      enum:
        - PRINT_AND_MAIL
        - ATTEMPT_1
        - ATTEMPT_3
        - ELECTRONIC_LABEL
    ShipmentExtraReturnServiceTypeLasershipEnum:
      type: string
      enum:
        - NO_RETURN
    RmaNumber:
      description: Specify the RMA number field on the label (FedEx and UPS only).
      properties:
        prefix:
          type: string
          description: >-
            Custom prefix for RMA number field (ZPL labels only). Up to 11
            characters, including trailing 

            spaces. Empty string indicates removal of default prefix. To use the
            default prefix, do not include

            this property.
        value:
          type: string
          maxLength: 40
          description: >-
            Optional text to be printed on the shipping label for RMA number. Up
            to 40 characters.


            **Carrier-Specific Constraints:**

            | Carrier | Constraints |

            |:---|:---|

            | FedEx | Max 20 characters |
        ref_sort:
          type: integer
          description: >-
            Order UPS reference fields are printed on ZPL labels. For UPS
            shipments, if you choose to set `ref_sort` for one reference, you
            must set `ref_sort` for all other supported UPS references using
            unique integers.
          example: 1
      type: object
    CustomsExporterIdentification:
      description: >-
        Additional exporter identification that may be required to ship in
        certain countries
      properties:
        eori_number:
          example: PL123456790ABCDE
          type: string
          description: >-
            Economic Operators' Registration and Identification (EORI) number.
            Must start with a 2 character 

            country code followed by a 6-17 character alphanumeric identifier
            (e.g. PL1234567890ABCDE).

            <a
            href="https://ec.europa.eu/taxation_customs/business/customs-procedures/general-overview/economic-operators-registration-identification-number-eori_en">More
            information on EORI.</a>
        tax_id:
          $ref: '#/components/schemas/CustomsTaxIdentification'
      type: object
    CustomsDeclarationB13AFilingOption:
      type: string
      example: FILED_ELECTRONICALLY
      description: >-
        B13A Option details are obtained by filing a B13A Canada Export
        Declaration via the Canadian Export Reporting System (CERS). 

        <a href="https://www.cbsa-asfc.gc.ca/services/export/guide-eng.html"
        target="_blank" rel="noopener noreferrer"> More information on reporting
        commercial exports from Canada. </a>

        Allowed values available <a
        href="/shippoapi/public-api/customs-declaration-b13a-filing-option">here</a>
    CustomsDeclarationContentsType:
      type: string
      description: >-
        Type of goods of the shipment.  

        Allowed values available <a
        href="/shippoapi/public-api/customs-declaration-contents-type">here</a>
      example: MERCHANDISE
    CustomsDeclarationEelPfc:
      type: string
      description: >-
        EEL / PFC type of the shipment. For most shipments from the US to CA,
        `NOEEI_30_36` is applicable; for most 

        other shipments from the US, `NOEEI_30_37_a` is applicable.

        Allowed values available <a
        href="/shippoapi/public-api/customs-declaration-eelpfc">here</a>
      example: NOEEI_30_37_a
    CustomsDeclarationIncoterm:
      type: string
      description: >-
        The incoterm reference of the shipment. FCA is available for DHL Express
        and FedEx only.

        eDAP is available for DPD UK only. DAP is available for DHL Express,
        FedEx, and DPD UK.

        If expecting DAP for other carriers, please use DDU.

        Allowed values available <a
        href="/shippoapi/public-api/customs-declaration-incoterm">here</a>

        Carrier-specific restrictions are in the table below.


        **Carrier-Specific Constraints:**

        | Carrier | Constraints |

        |:---|:---|

        | FedEx | Must be one of DDP, DDU, FCA, DAP |
      example: DDP
    CustomsItemBase:
      properties:
        description:
          example: T-Shirt
          type: string
          description: Text description of your item.
        eccn_ear99:
          type: string
          description: >-
            Export Control Classification Number, required on some exports from
            the United States.
        mass_unit:
          $ref: '#/components/schemas/WeightUnitEnum'
        metadata:
          example: Order ID "123454"
          type: string
          description: >-
            A string of up to 100 characters that can be filled with any
            additional information you 

            want to attach to the object.
        net_weight:
          example: '5'
          type: string
          description: Total weight of this item, i.e. quantity * weight per item.
        origin_country:
          type: string
          description: >-
            Country of origin of the item. Example: `US` or `DE`. 

            All accepted values can be found on the <a
            href="http://www.iso.org/" target="_blank">Official ISO Website</a>.
        quantity:
          example: 20
          format: int64
          type: integer
          description: >-
            Quantity of this item in the shipment you send.  Must be greater
            than 0.
        sku_code:
          description: SKU code of the item, which is required by some carriers.
          example: HM-123
          type: string
        hs_code:
          description: >-
            HS code of the item, which is required by some carriers. If
            `tariff_number` is not provided, `hs_code` will be used.  If both
            `hs_code` and `tariff_number` are provided, `tariff_number` will be
            used. 50 character limit.
          example: '0901.21'
          type: string
        tariff_number:
          type: string
          description: >-
            The tariff number of the item. If `tariff_number` is not provided,
            `hs_code` will be used. If both `hs_code` and `tariff_number` are
            provided, `tariff_number` will be used. 12 character limit.
        value_amount:
          example: '200'
          type: string
          description: Total value of this item, i.e. quantity * value per item.
        value_currency:
          example: USD
          type: string
          description: >-
            Currency used for value_amount. The <a
            href="http://www.xe.com/iso4217.php">official ISO 4217</a> 

            currency codes are used, e.g.  `USD` or `EUR`.
      required:
        - description
        - quantity
        - net_weight
        - mass_unit
        - value_amount
        - value_currency
        - origin_country
      type: object
    CustomsDeclarationNonDeliveryOption:
      type: string
      description: >-
        Indicates how the carrier should proceed in case the shipment can't be
        delivered.

        Allowed values available <a
        href="/shippoapi/public-api/customs-declaration-non-delivery-option">here</a>
      example: RETURN
    ParcelExtra:
      title: Parcel Extra
      x-tags:
        - Parcels
      description: >-
        An object holding optional extra services to be requested for each
        parcel in a multi-piece shipment.

        The following values are supported for the `extra` field of the parcel
        object.
      properties:
        COD:
          $ref: '#/components/schemas/COD'
        insurance:
          $ref: '#/components/schemas/ParcelInsurance'
        reference_1:
          type: string
          maxLength: 50
          description: >-
            Optional text to be printed on the shipping label if supported by
            carrier. Up to 50 characters.


            **Carrier-Specific Constraints:**

            | Carrier | Constraints |

            |:---|:---|

            | FedEx | Max 40 characters (Express services); Max 30 characters
            (Ground services) |
        reference_2:
          type: string
          maxLength: 50
          description: >-
            Optional text to be printed on the shipping label if supported by
            carrier. Up to 50 characters.


            **Carrier-Specific Constraints:**

            | Carrier | Constraints |

            |:---|:---|

            | FedEx | Max 30 characters |
      type: object
    WeightUnitEnum:
      description: The unit used for weight.
      enum:
        - g
        - kg
        - lb
        - oz
      example: lb
      type: string
    DistanceUnitEnum:
      enum:
        - cm
        - in
        - ft
        - m
        - mm
        - yd
      example: in
      type: string
      description: The measure unit used for length, width and height.
    ParcelTemplateFedExEnum:
      type: string
      title: FedEx Parcel Template
      enum:
        - FedEx_Box_10kg
        - FedEx_Box_25kg
        - FedEx_Box_Extra_Large_1
        - FedEx_Box_Extra_Large_2
        - FedEx_Box_Large_1
        - FedEx_Box_Large_2
        - FedEx_Box_Medium_1
        - FedEx_Box_Medium_2
        - FedEx_Box_Small_1
        - FedEx_Box_Small_2
        - FedEx_Envelope
        - FedEx_Padded_Pak
        - FedEx_Pak_1
        - FedEx_Pak_2
        - FedEx_Tube
        - FedEx_XL_Pak
      description: >
        |Token | Name | Dimensions|

        |:---|:---|:---|

        | FedEx_Box_10kg | FedEx® 10kg Box | 15.81 x 12.94 x 10.19 in|

        | FedEx_Box_25kg | FedEx® 25kg Box | 54.80 x 42.10 x 33.50 in|

        | FedEx_Box_Extra_Large_1 | FedEx® Extra Large Box (X1) | 11.88 x 11.00
        x 10.75 in|

        | FedEx_Box_Extra_Large_2 | FedEx® Extra Large Box (X2) | 15.75 x 14.13
        x 6.00 in|

        | FedEx_Box_Large_1 | FedEx® Large Box (L1) | 17.50 x 12.38 x 3.00 in|

        | FedEx_Box_Large_2 | FedEx® Large Box (L2) | 11.25 x 8.75 x 7.75 in|

        | FedEx_Box_Medium_1 | FedEx® Medium Box (M1) | 13.25 x 11.50 x 2.38 in|

        | FedEx_Box_Medium_2 | FedEx® Medium Box (M2) | 11.25 x 8.75 x 4.38 in|

        | FedEx_Box_Small_1 | FedEx® Small Box (S1) | 12.38 x 10.88 x 1.50 in|

        | FedEx_Box_Small_2 | FedEx® Small Box (S2) | 11.25 x 8.75 x 2.38 in|

        | FedEx_Envelope | FedEx® Envelope | 12.50 x 9.50 x 0.80 in|

        | FedEx_Padded_Pak | FedEx® Padded Pak | 11.75 x 14.75 x 2.00 in|

        | FedEx_Pak_1 | FedEx® Large Pak | 15.50 x 12.00 x 0.80 in|

        | FedEx_Pak_2 | FedEx® Small Pak | 12.75 x 10.25 x 0.80 in|

        | FedEx_Tube | FedEx® Tube | 38.00 x 6.00 x 6.00 in|

        | FedEx_XL_Pak | FedEx® Extra Large Pak | 17.50 x 20.75 x 2.00 in|
    ParcelTemplateUPSEnum:
      type: string
      title: UPS Parcel Template
      enum:
        - UPS_Box_10kg
        - UPS_Box_25kg
        - UPS_Express_Box
        - UPS_Express_Box_Large
        - UPS_Express_Box_Medium
        - UPS_Express_Box_Small
        - UPS_Express_Envelope
        - UPS_Express_Hard_Pak
        - UPS_Express_Legal_Envelope
        - UPS_Express_Pak
        - UPS_Express_Tube
        - UPS_Laboratory_Pak
        - UPS_MI_BPM
        - UPS_MI_BPM_Flat
        - UPS_MI_BPM_Parcel
        - UPS_MI_First_Class
        - UPS_MI_Flat
        - UPS_MI_Irregular
        - UPS_MI_Machinable
        - UPS_MI_MEDIA_MAIL
        - UPS_MI_Parcel_Post
        - UPS_MI_Priority
        - UPS_MI_Standard_Flat
        - UPS_Pad_Pak
        - UPS_Pallet
      description: >
        |Token | Name | Dimensions|

        |:---|:---|:---|

        | UPS_Box_10kg | Box 10kg | 410.00 x 335.00 x 265.00 mm|

        | UPS_Box_25kg | Box 25kg | 484.00 x 433.00 x 350.00 mm|

        | UPS_Express_Box | Express Box | 460.00 x 315.00 x 95.00 mm|

        | UPS_Express_Box_Large | Express Box Large | 18.00 x 13.00 x 3.00 in|

        | UPS_Express_Box_Medium | Express Box Medium | 15.00 x 11.00 x 3.00 in|

        | UPS_Express_Box_Small | Express Box Small | 13.00 x 11.00 x 2.00 in|

        | UPS_Express_Envelope | Express Envelope | 12.50 x 9.50 x 2.00 in|

        | UPS_Express_Hard_Pak | Express Hard Pak | 14.75 x 11.50 x 2.00 in|

        | UPS_Express_Legal_Envelope | Express Legal Envelope | 15.00 x 9.50 x
        2.00 in|

        | UPS_Express_Pak | Express Pak | 16.00 x 12.75 x 2.00 in|

        | UPS_Express_Tube | Express Tube | 970.00 x 190.00 x 165.00 mm|

        | UPS_Laboratory_Pak | Laboratory Pak | 17.25 x 12.75 x 2.00 in|

        | UPS_MI_BPM | BPM (Mail Innovations - Domestic &amp; International) |
        0.00 x 0.00 x 0.00 in|

        | UPS_MI_BPM_Flat | BPM Flat (Mail Innovations - Domestic &amp;
        International) | 0.00 x 0.00 x 0.00 in|

        | UPS_MI_BPM_Parcel | BPM Parcel (Mail Innovations - Domestic &amp;
        International) | 0.00 x 0.00 x 0.00 in|

        | UPS_MI_First_Class | First Class (Mail Innovations - Domestic only) |
        0.00 x 0.00 x 0.00 in|

        | UPS_MI_Flat | Flat (Mail Innovations - Domestic only) | 0.00 x 0.00 x
        0.00 in|

        | UPS_MI_Irregular | Irregular (Mail Innovations - Domestic only) | 0.00
        x 0.00 x 0.00 in|

        | UPS_MI_Machinable | Machinable (Mail Innovations - Domestic only) |
        0.00 x 0.00 x 0.00 in|

        | UPS_MI_MEDIA_MAIL | Media Mail (Mail Innovations - Domestic only) |
        0.00 x 0.00 x 0.00 in|

        | UPS_MI_Parcel_Post | Parcel Post (Mail Innovations - Domestic only) |
        0.00 x 0.00 x 0.00 in|

        | UPS_MI_Priority | Priority (Mail Innovations - Domestic only) | 0.00 x
        0.00 x 0.00 in|

        | UPS_MI_Standard_Flat | Standard Flat (Mail Innovations - Domestic
        only) | 0.00 x 0.00 x 0.00 in|

        | UPS_Pad_Pak | Pad Pak | 14.75 x 11.00 x 2.00 in|

        | UPS_Pallet | Pallet | 120.00 x 80.00 x 200.00 cm|
    ParcelTemplateUSPSEnum:
      type: string
      title: USPS Parcel Template
      enum:
        - USPS_FlatRateCardboardEnvelope
        - USPS_FlatRateEnvelope
        - USPS_FlatRateGiftCardEnvelope
        - USPS_FlatRateLegalEnvelope
        - USPS_FlatRatePaddedEnvelope
        - USPS_FlatRateWindowEnvelope
        - USPS_IrregularParcel
        - USPS_LargeFlatRateBoardGameBox
        - USPS_LargeFlatRateBox
        - USPS_APOFlatRateBox
        - USPS_LargeVideoFlatRateBox
        - USPS_MediumFlatRateBox1
        - USPS_MediumFlatRateBox2
        - USPS_RegionalRateBoxA1
        - USPS_RegionalRateBoxA2
        - USPS_RegionalRateBoxB1
        - USPS_RegionalRateBoxB2
        - USPS_SmallFlatRateBox
        - USPS_SmallFlatRateEnvelope
        - USPS_SoftPack
      description: >
        |Token | Name | Dimensions|

        |:---|:---|:---|

        | USPS_FlatRateCardboardEnvelope | Flat Rate Cardboard Envelope |  12.50
        x 9.50 x 0.75 in |

        | USPS_FlatRateEnvelope | Flat Rate Envelope |  12.50 x 9.50 x 0.75 in |

        | USPS_FlatRateGiftCardEnvelope | Flat Rate Gift Card Envelope |  10.00
        x 7.00 x 0.75 in |

        | USPS_FlatRateLegalEnvelope | Flat Rate Legal Envelope |  15.00 x 9.50
        x 0.75 in |

        | USPS_FlatRatePaddedEnvelope | Flat Rate Padded Envelope |  12.50 x
        9.50 x 1.00 in |

        | USPS_FlatRateWindowEnvelope | Flat Rate Window Envelope |  10.00 x
        5.00 x 0.75 in |

        | USPS_IrregularParcel | Irregular Parcel |  0.00 x 0.00 x 0.00 in |

        | USPS_LargeFlatRateBoardGameBox | Large Flat Rate Board Game Box | 
        24.06 x 11.88 x 3.13 in |

        | USPS_LargeFlatRateBox | Large Flat Rate Box |  12.25 x 12.25 x 6.00 in
        |

        | USPS_APOFlatRateBox | APO/FPO/DPO Large Flat Rate Box |  12.25 x 12.25
        x 6.00 in |

        | USPS_LargeVideoFlatRateBox | Flat Rate Large Video Box (Int&#39;l
        only) |  9.60 x 6.40 x 2.20 in |

        | USPS_MediumFlatRateBox1 | Medium Flat Rate Box 1 |  11.25 x 8.75 x
        6.00 in |

        | USPS_MediumFlatRateBox2 | Medium Flat Rate Box 2 |  14.00 x 12.00 x
        3.50 in |

        | USPS_RegionalRateBoxA1 | Regional Rate Box A1 |  10.13 x 7.13 x 5.00
        in |

        | USPS_RegionalRateBoxA2 | Regional Rate Box A2 |  13.06 x 11.06 x 2.50
        in |

        | USPS_RegionalRateBoxB1 | Regional Rate Box B1 |  12.25 x 10.50 x 5.50
        in |

        | USPS_RegionalRateBoxB2 | Regional Rate Box B2 |  16.25 x 14.50 x 3.00
        in |

        | USPS_SmallFlatRateBox | Small Flat Rate Box |  8.69 x 5.44 x 1.75 in |

        | USPS_SmallFlatRateEnvelope | Small Flat Rate Envelope |  10.00 x 6.00
        x 4.00 in |

        | USPS_SoftPack | Soft Pack Padded Envelope |  Length and width defined
        in the Parcel|
    ParcelTemplateDHLeCommerceEnum:
      type: string
      title: DHL eCommerce Parcel Template
      enum:
        - DHLeC_Irregular
        - DHLeC_SM_Flats
      description: |
        |Token | Name | Dimensions|
        |:---|:---|:---|
        | DHLeC_Irregular | Irregular Shipment | 10.00 x 10.00 x 10.00 in|
        | DHLeC_SM_Flats | Flats | 27.00 x 17.00 x 17.00 in|
    ParcelTemplateDPDUKEnum:
      type: string
      title: DPD UK Parcel Template
      enum:
        - DPD_UK_Express_Pak
      description: |
        |Token | Name | Dimensions|
        |:---|:---|:---|
        | DPD_UK_Express_Pak| DPD UK Express Pak | 530.00 x 400.00 x 100.00 mm|
    ParcelTemplateAramexAustraliaEnum:
      type: string
      title: Aramex Australia Parcel Template
      enum:
        - Fastway_Australia_Satchel_A2
        - Fastway_Australia_Satchel_A3
        - Fastway_Australia_Satchel_A4
        - Fastway_Australia_Satchel_A5
      description: >
        |Token | Name | Dimensions|

        |:---|:---|:---|

        | Fastway_Australia_Satchel_A2 | Satchel A2 | 594.00 x 420.00 x 48.00
        mm|

        | Fastway_Australia_Satchel_A3 | Satchel A3 | 420.00 x 297.00 x 64.00
        mm|

        | Fastway_Australia_Satchel_A4 | Satchel A4 | 297.00 x 210.00 x 64.00
        mm|

        | Fastway_Australia_Satchel_A5 | Satchel A5 | 210.00 x 148.00 x 64.00
        mm|
    DangerousGoodsBiologicalMaterial:
      description: Container for specifying the presence of biological material.
      properties:
        contains:
          type: boolean
          description: Indicates if the shipment contains biological material.
      type: object
    DangerousGoodsLithiumBatteries:
      description: Container for specifying the presence of lithium batteries.
      properties:
        contains:
          type: boolean
          description: Indicates if the shipment contains lithium batteries.
      type: object
    CustomsTaxIdentification:
      description: >-
        Tax identification that may be required to ship in certain countries.
        Typically used to assess duties on 

        goods that are crossing a border.
      properties:
        number:
          example: '123456789'
          type: string
          maxLength: 15
          description: Tax identification number.
        type:
          example: EIN
          enum:
            - EIN
            - VAT
            - IOSS
            - ARN
          description: >-
            Type of tax identification.

            * `EIN` - Employer Identification Number, also known as a Federal
            Tax Identification Number.

            * `VAT` - Value Added Tax identification number.

            * `IOSS` - Import One-Stop Shop

            * `ARN` - Australian Taxation Office Reference Number
      type: object
    ParcelInsurance:
      description: >-
        To add insurance to your parcel, specify `amount`, `content` and
        `currency`. <br><br>If you do not want to add insurance to you parcel,
        do not set these parameters.
      properties:
        amount:
          description: Declared value of the goods you want to insure.
          example: '5.5'
          type: string
        content:
          description: Description of parcel content.
          example: Laptop
          type: string
        currency:
          description: >-
            Currency for the amount value. Currently only USD is supported for
            FedEx and UPS.
          example: USD
          type: string
        provider:
          description: >-
            To have insurance cover provided by a carrier directly instead of
            Shippo's provider (XCover), set provider to `FEDEX`, `UPS`, or
            `ONTRAC`.
          example: UPS
          type: string
          enum:
            - FEDEX
            - UPS
            - ONTRAC
      type: object
  responses:
    batchResponse:
      description: Batch
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Batch'
    badRequestResponse:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BadRequest'
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization
      x-token-prefix: ShippoToken
      x-token-format: ShippoToken {token}
      x-default: 'ShippoToken '
      description: |
        API key authentication using the ShippoToken scheme.
        Format: Authorization: ShippoToken <API_TOKEN>
        Example: Authorization: ShippoToken shippo_live_abc123

````