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

# Retrieve shipment by id

> Retrieve a shipment by id

Returns shipment information if the lookup succeeds.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/checkout-intents/openapi.documented.yml get /api/v1/shipments/{id}
openapi: 3.0.0
info:
  title: Universal Checkout API
  version: 1.0.5
  description: >-
    Turn any product URL into a completed checkout. Instantly retrieve price,
    tax, and shipping for any product, and let users buy without ever leaving
    your native AI experience.


    View the [Rye API docs](https://docs.rye.com).
  termsOfService: https://rye.com/terms-of-service
  license:
    name: UNLICENSED
  contact:
    name: Rye
    email: dev@rye.com
    url: https://docs.rye.com
servers:
  - url: https://staging.api.rye.com
security: []
paths:
  /api/v1/shipments/{id}:
    get:
      tags:
        - Shipments
      summary: Retrieve shipment by id
      description: |-
        Retrieve a shipment by id

        Returns shipment information if the lookup succeeds.
      operationId: GetShipment
      parameters:
        - description: The id of the shipment to look up
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Shipment information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Shipment'
        '401':
          description: Authentication Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
      security:
        - bearerAuth:
            - checkout_intents:read
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import CheckoutIntents from 'checkout-intents';

            const client = new CheckoutIntents({
              apiKey: process.env['CHECKOUT_INTENTS_API_KEY'], // This is the default and can be omitted
            });

            const shipment = await client.shipments.retrieve('id');

            console.log(shipment);
        - lang: Python
          source: |-
            import os
            from checkout_intents import CheckoutIntents

            client = CheckoutIntents(
                api_key=os.environ.get("CHECKOUT_INTENTS_API_KEY"),  # This is the default and can be omitted
            )
            shipment = client.shipments.retrieve(
                "id",
            )
            print(shipment)
        - lang: Java
          source: |-
            package com.rye.example;

            import com.rye.client.CheckoutIntentsClient;
            import com.rye.client.okhttp.CheckoutIntentsOkHttpClient;
            import com.rye.models.shipments.Shipment;
            import com.rye.models.shipments.ShipmentRetrieveParams;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    CheckoutIntentsClient client = CheckoutIntentsOkHttpClient.fromEnv();

                    Shipment shipment = client.shipments().retrieve("id");
                }
            }
        - lang: cURL
          source: |-
            curl https://staging.api.rye.com/api/v1/shipments/$ID \
                -H "Authorization: Bearer $CHECKOUT_INTENTS_API_KEY"
components:
  schemas:
    Shipment:
      $ref: '#/components/schemas/ShipmentUnion'
    AuthenticationError:
      properties:
        name:
          type: string
        message:
          type: string
        stack:
          type: string
      required:
        - name
        - message
      type: object
      additionalProperties: false
    NotFoundError:
      properties:
        name:
          type: string
        message:
          type: string
        stack:
          type: string
      required:
        - name
        - message
      type: object
      additionalProperties: false
    ShipmentUnion:
      anyOf:
        - $ref: '#/components/schemas/ShipmentWithTrackingUnion'
        - $ref: '#/components/schemas/ShipmentWithoutTrackingUnion'
    ShipmentWithTrackingUnion:
      anyOf:
        - $ref: '#/components/schemas/ShippedShipment'
        - $ref: '#/components/schemas/DeliveredShipment'
        - $ref: '#/components/schemas/DelayedShipment'
        - $ref: '#/components/schemas/OutForDeliveryShipment'
      description: >-
        Shipments that have tracking information (shipped, delayed, or delivered
        states)
      title: With Tracking
    ShipmentWithoutTrackingUnion:
      anyOf:
        - $ref: '#/components/schemas/OrderedShipment'
        - $ref: '#/components/schemas/CanceledShipment'
      description: Shipments without tracking information
      title: Without Tracking
    ShippedShipment:
      $ref: '#/components/schemas/WithStatus_BaseShipmentWithTracking.shipped_'
      title: Shipped
    DeliveredShipment:
      allOf:
        - $ref: '#/components/schemas/WithStatus_BaseShipmentWithTracking.delivered_'
        - properties:
            deliveredAt:
              type: string
              format: date-time
          required:
            - deliveredAt
          type: object
      title: Delivered
    DelayedShipment:
      $ref: '#/components/schemas/WithStatus_BaseShipmentWithTracking.delayed_'
      title: Delayed
    OutForDeliveryShipment:
      $ref: >-
        #/components/schemas/WithStatus_BaseShipmentWithTracking.out_for_delivery_
      title: Out for Delivery
    OrderedShipment:
      $ref: '#/components/schemas/WithStatus_BaseShipment.ordered_'
      title: Ordered
    CanceledShipment:
      $ref: '#/components/schemas/WithStatus_BaseShipment.canceled_'
      title: Canceled
    WithStatus_BaseShipmentWithTracking.shipped_:
      allOf:
        - $ref: '#/components/schemas/BaseShipmentWithTracking'
        - properties:
            status:
              type: string
              enum:
                - shipped
              nullable: false
          required:
            - status
          type: object
    WithStatus_BaseShipmentWithTracking.delivered_:
      allOf:
        - $ref: '#/components/schemas/BaseShipmentWithTracking'
        - properties:
            status:
              type: string
              enum:
                - delivered
              nullable: false
          required:
            - status
          type: object
    WithStatus_BaseShipmentWithTracking.delayed_:
      allOf:
        - $ref: '#/components/schemas/BaseShipmentWithTracking'
        - properties:
            status:
              type: string
              enum:
                - delayed
              nullable: false
          required:
            - status
          type: object
    WithStatus_BaseShipmentWithTracking.out_for_delivery_:
      allOf:
        - $ref: '#/components/schemas/BaseShipmentWithTracking'
        - properties:
            status:
              type: string
              enum:
                - out_for_delivery
              nullable: false
          required:
            - status
          type: object
    WithStatus_BaseShipment.ordered_:
      allOf:
        - $ref: '#/components/schemas/BaseShipment'
        - properties:
            status:
              type: string
              enum:
                - ordered
              nullable: false
          required:
            - status
          type: object
    WithStatus_BaseShipment.canceled_:
      allOf:
        - $ref: '#/components/schemas/BaseShipment'
        - properties:
            status:
              type: string
              enum:
                - canceled
              nullable: false
          required:
            - status
          type: object
    BaseShipmentWithTracking:
      allOf:
        - $ref: '#/components/schemas/BaseShipment'
        - $ref: '#/components/schemas/ShippingDetails'
    BaseShipment:
      properties:
        updatedAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
        marketplaceOrderId:
          type: string
        checkoutIntentId:
          type: string
        id:
          type: string
      required:
        - updatedAt
        - createdAt
        - marketplaceOrderId
        - checkoutIntentId
        - id
      type: object
    ShippingDetails:
      properties:
        trackingEvents:
          items:
            $ref: '#/components/schemas/TrackingEvent'
          type: array
        shippedAt:
          type: string
          format: date-time
        tracking:
          $ref: '#/components/schemas/ShipmentTracking'
        externalId:
          type: string
          description: >-
            The external ID is provided by the marketplace and matches the
            shipment to their system.
      required:
        - trackingEvents
        - shippedAt
        - tracking
        - externalId
      type: object
    TrackingEvent:
      properties:
        status:
          $ref: '#/components/schemas/ShipmentStatus'
        location:
          $ref: '#/components/schemas/EventLocation'
        timestamp:
          allOf:
            - $ref: '#/components/schemas/TrackingEventTimestamp'
          nullable: true
        description:
          type: string
          nullable: true
      required:
        - status
        - location
        - timestamp
        - description
      type: object
    ShipmentTracking:
      properties:
        carrierName:
          type: string
          nullable: true
        number:
          type: string
          nullable: true
        deliveryDate:
          allOf:
            - $ref: '#/components/schemas/DeliveryDate'
          nullable: true
        url:
          type: string
          nullable: true
      required:
        - number
      type: object
    ShipmentStatus:
      type: string
      enum:
        - out_for_delivery
        - delivered
        - shipped
        - canceled
        - delayed
        - ordered
    EventLocation:
      properties:
        country:
          type: string
          nullable: true
        province:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
      type: object
    TrackingEventTimestamp:
      properties:
        local:
          type: string
          description: >-
            ISO 8601 string with timezone offset, e.g.
            "2025-02-05T17:02:00.000-05:00"
        utc:
          type: string
          format: date-time
          description: UTC timestamp
      required:
        - local
        - utc
      type: object
    DeliveryDate:
      properties:
        estimated:
          type: string
          format: date-time
      required:
        - estimated
      type: object
  securitySchemes:
    bearerAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Rye API key

````