> ## 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.

# Advance simulated shipment

> Advance the simulated shipment for a checkout intent. To trigger delayed or
canceled shipping scenarios, create the checkout intent with a matching
shipping and delivery test product:
https://rye.com/docs/api-v2/testing/test-products#shipping-&-delivery



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/checkout-intents/openapi.documented.yml post /api/v1/test-helpers/checkout-intents/{checkoutIntentId}/shipments/advance
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/test-helpers/checkout-intents/{checkoutIntentId}/shipments/advance:
    post:
      tags:
        - Test Helpers
      summary: Advance simulated shipment
      description: >-
        Advance the simulated shipment for a checkout intent. To trigger delayed
        or

        canceled shipping scenarios, create the checkout intent with a matching

        shipping and delivery test product:

        https://rye.com/docs/api-v2/testing/test-products#shipping-&-delivery
      operationId: AdvanceShipment
      parameters:
        - in: path
          name: checkoutIntentId
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The advanced simulated shipment state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdvanceShipmentResponse'
      security:
        - bearerAuth:
            - test_helpers:write
      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 response = await
            client.testHelpers.shipments.advance('checkoutIntentId');


            console.log(response.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
            )
            response = client.test_helpers.shipments.advance(
                "checkoutIntentId",
            )
            print(response.shipment)
        - lang: Java
          source: |-
            package com.rye.example;

            import com.rye.client.CheckoutIntentsClient;
            import com.rye.client.okhttp.CheckoutIntentsOkHttpClient;
            import com.rye.models.testhelpers.shipments.ShipmentAdvanceParams;
            import com.rye.models.testhelpers.shipments.ShipmentAdvanceResponse;

            public final class Main {
                private Main() {}

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

                    ShipmentAdvanceResponse response = client.testHelpers().shipments().advance("checkoutIntentId");
                }
            }
        - lang: cURL
          source: >-
            curl
            https://staging.api.rye.com/api/v1/test-helpers/checkout-intents/$CHECKOUT_INTENT_ID/shipments/advance
            \
                -X POST \
                -H "Authorization: Bearer $CHECKOUT_INTENTS_API_KEY"
components:
  schemas:
    AdvanceShipmentResponse:
      properties:
        shipment:
          $ref: '#/components/schemas/Shipment'
      required:
        - shipment
      type: object
    Shipment:
      $ref: '#/components/schemas/ShipmentUnion'
    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

````