> ## 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/transactions/retrieve-a-shipping-label",
  "feedback": "Description of the issue"
}
```

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

</AgentInstructions>

# Retrieve a shipping label

> Returns an existing transaction using an object ID.



## OpenAPI

````yaml /spec/shippoapi/public-api.yaml get /transactions/{TransactionId}
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:
  /transactions/{TransactionId}:
    get:
      tags:
        - Transactions
      summary: Retrieve a shipping label
      description: Returns an existing transaction using an object ID.
      operationId: GetTransaction
      parameters:
        - description: Object ID of the transaction to update
          in: path
          name: TransactionId
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/ShippoApiVersionHeader'
      responses:
        '200':
          $ref: '#/components/responses/transactionResponse'
        '400':
          $ref: '#/components/responses/badRequestResponse'
      x-codeSamples:
        - label: cURL
          lang: cURL
          source: >-
            curl
            https://api.goshippo.com/transactions/70ae8117ee1749e393f249d5b77c45e0
            \
             -H "Authorization: ShippoToken <API_TOKEN>"
        - lang: python
          label: Python
          source: |-
            import shippo

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


            res = s.transactions.get(transaction_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.transactions.get("<id>");

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

            run();
        - lang: php
          label: PHP
          source: |-
            declare(strict_types=1);

            require 'vendor/autoload.php';

            use Shippo\API;

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



            $response = $sdk->transactions->get(
                transactionId: '<id>',
                shippoApiVersion: '2018-02-08'

            );

            if ($response->transaction !== null) {
                // handle response
            }
        - lang: csharp
          label: C#
          source: |-
            using Shippo;
            using Shippo.Models.Components;

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

            var res = await sdk.Transactions.GetAsync(
                transactionId: "<id>",
                shippoApiVersion: "2018-02-08"
            );

            // handle response
        - lang: java
          label: Java
          source: >-
            package hello.world;


            import com.goshippo.shippo_sdk.Shippo;

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

            import java.lang.Exception;


            public class Application {

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

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

                    GetTransactionResponse res = sdk.transactions().get()
                            .transactionId("<id>")
                            .shippoApiVersion("2018-02-08")
                            .call();

                    if (res.transaction().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
  responses:
    transactionResponse:
      description: Transaction
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Transaction'
    badRequestResponse:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BadRequest'
  schemas:
    Transaction:
      x-tags:
        - Transactions
      properties:
        commercial_invoice_url:
          type: string
          description: >-
            A URL pointing to the commercial invoice as a 8.5x11 inch PDF file. 

            A value will only be returned if the Transactions has been processed
            successfully and if the shipment is international.
        created_by:
          anyOf:
            - type: object
              description: >-
                An object with details about the user who created the
                Transaction (purchased the label).

                A value will be returned only for Transactions that can be
                associated with a specific user, e.g. when a logged-in

                user purchases a label via the Shippo Web application; but not
                for Transactions purchased e.g. via the API using a ShippoToken,

                which is associated with the account but not any specific user.
              properties:
                first_name:
                  type: string
                  example: Shwan
                last_name:
                  type: string
                  example: Ippotle
                username:
                  type: string
                  example: shippotle@shippo.com
            - type: 'null'
        eta:
          type: string
          description: The estimated time of arrival according to the carrier.
        label_file_type:
          $ref: '#/components/schemas/LabelFileTypeEnum'
        label_url:
          example: >-
            https://shippo-delivery.s3.amazonaws.com/70ae8117ee1749e393f249d5b77c45e0.pdf?Signature=vDw1ltcyGveVR1OQoUDdzC43BY8%3D&Expires=1437093830&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA
          type: string
          description: >-
            A URL pointing directly to the label in the format you've set in
            your settings. 

            A value will only be returned if the Transactions has been processed
            successfully.
        messages:
          $ref: '#/components/schemas/ResponseMessageList'
        metadata:
          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.
        object_created:
          format: date-time
          type: string
          description: Date and time of Transaction creation.
        object_id:
          example: 915d94940ea54c3a80cbfa328722f5a1
          type: string
          description: Unique identifier of the given Transaction object.
        object_owner:
          example: shippotle@shippo.com
          type: string
          description: Username of the user who created the Transaction object.
        object_state:
          $ref: '#/components/schemas/ObjectStateEnum'
        object_updated:
          format: date-time
          type: string
          description: Date and time of last Transaction update.
        parcel:
          example: e94c7fdfdc7b495dbb390a28d929d90a
          type: string
          description: Object ID of the Parcel object that is being shipped.
        qr_code_url:
          example: >-
            https://shippo-delivery.s3.amazonaws.com/96_qr_code.pdf?Signature=PEdWrp0mFWAGwJp7FW3b%2FeA2eyY%3D&Expires=1385930652&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA
          type: string
          description: >-
            A URL pointing directly to the QR code in PNG format. 

            A value will only be returned if requested using qr_code_requested
            flag and the carrier provides such an option.
        rate:
          oneOf:
            - $ref: '#/components/schemas/CoreRate'
            - example: ec9f0d3adc9441449c85d315f0997fd5
              type: string
          description: >-
            ID of the Rate object for which a Label has to be obtained.  

            If you purchase a label by calling the transaction endpoint without
            a rate (instalabel), 

            this field will be a simplified Rate object in the Transaction model
            returned from the POST request.

            </br>Note, only rates less than 7 days old can be purchased to
            ensure up-to-date pricing.
        status:
          $ref: '#/components/schemas/TransactionStatusEnum'
        test:
          type: boolean
          description: Indicates whether the object has been created in test mode.
        tracking_number:
          example: '9499907123456123456781'
          type: string
          description: >-
            The carrier-specific tracking number that can be used to track the
            Shipment. 

            A value will only be returned if the Rate is for a trackable
            Shipment and if the Transactions has been processed successfully.
        tracking_status:
          $ref: '#/components/schemas/TrackingStatusEnum'
        tracking_url_provider:
          example: >-
            https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=9499907123456123456781
          type: string
          description: >-
            A link to track this item on the carrier-provided tracking website. 

            A value will only be returned if tracking is available and the
            carrier provides such a service.
      type: object
    BadRequest:
      additionalProperties: true
      type: object
    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
    ResponseMessageList:
      items:
        $ref: '#/components/schemas/ResponseMessage'
      type: array
    ObjectStateEnum:
      type: string
      enum:
        - VALID
        - INVALID
      description: Indicates the validity of the enclosing object
    CoreRate:
      allOf:
        - $ref: '#/components/schemas/RateAmountAndCurrency'
        - properties:
            object_id:
              example: adcfdddf8ec64b84ad22772bce3ea37a
              type: string
              description: Unique identifier of the Rate object.
            provider:
              example: USPS
              type: string
              description: Carrier offering the rate, e.g., `FedEx` or `Deutsche Post DHL`.
            carrier_account:
              example: 078870331023437cb917f5187429b093
              type: string
              description: >-
                Object ID of the carrier account that has been used to retrieve
                the rate.
            servicelevel_name:
              description: >-
                Service level name, e.g. `Priority Mail` or `FedEx Ground®`. 

                A service level commonly defines the transit time of a Shipment
                (e.g., Express vs. Standard), 

                along with other properties.  These names vary depending on the
                provider.<br>

                See <a href="/shippoapi/public-api/service-levels">Service
                Levels</a>.
              example: Priority Mail
              type: string
            servicelevel_token:
              description: >-
                Token of the Rate's servicelevel, e.g. `usps_priority` or
                `fedex_ground`.

                See <a
                href="/shippoapi/public-api/service-levels">servicelevels</a>.
              example: fedex_ground
              type: string
      type: object
    TransactionStatusEnum:
      enum:
        - WAITING
        - QUEUED
        - SUCCESS
        - ERROR
        - REFUNDED
        - REFUNDPENDING
        - REFUNDREJECTED
      example: SUCCESS
      type: string
      description: Indicates the status of the Transaction.
    TrackingStatusEnum:
      example: DELIVERED
      type: string
      description: Indicates the high level status of the shipment.
      enum:
        - UNKNOWN
        - PRE_TRANSIT
        - TRANSIT
        - DELIVERED
        - RETURNED
        - FAILURE
    ResponseMessage:
      description: >-
        Message returned with supporting information from a request. In some
        cases this can be an error message, 

        for example a timeout from a carrier. If available, the origin of the
        message is displayed in `source`.
      properties:
        source:
          description: Origin of message
          example: UPS
          type: string
        code:
          description: Classification of message
          example: carrier_timeout
          type: string
        text:
          description: Message content
          example: UPS API did not respond. Please try again in a few minutes.
          type: string
      type: object
    RateAmountAndCurrency:
      properties:
        amount:
          example: '5.5'
          type: string
          description: >-
            Final Rate price, expressed in the currency used in the sender's
            country.
        amount_local:
          example: '5.5'
          type: string
          description: >-
            Final Rate price, expressed in the currency used in the recipient's
            country.
        currency:
          example: USD
          type: string
          description: >-
            Currency used in the sender's country, refers to `amount`. 

            The <a href="http://www.xe.com/iso4217.php">official ISO 4217</a>
            currency codes are used, e.g. `USD` or `EUR`.
        currency_local:
          example: USD
          type: string
          description: >-
            Currency used in the recipient's country, refers to `amount_local`. 

            The <a href="http://www.xe.com/iso4217.php">official ISO 4217</a>
            currency codes are used, e.g. `USD` or "EUR".
  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

````