import { APIResource } from "../core/resource.mjs"; import * as ShipmentsAPI from "./shipments.mjs"; import { APIPromise } from "../core/api-promise.mjs"; import { CursorPagination, type CursorPaginationParams, PagePromise } from "../core/pagination.mjs"; import { RequestOptions } from "../internal/request-options.mjs"; export declare class Shipments extends APIResource { /** * Retrieve a shipment by id * * Returns shipment information if the lookup succeeds. */ retrieve(id: string, options?: RequestOptions): APIPromise; /** * Retrieve a paginated list of shipments * * Enables developers to query shipments associated with their account, with * filters and cursor-based pagination. */ list(query?: ShipmentListParams | null | undefined, options?: RequestOptions): PagePromise; } export type ShipmentsCursorPagination = CursorPagination; export type Shipment = Shipment.WithStatusBaseShipmentWithTrackingShipped | Shipment.DeliveredShipment | Shipment.WithStatusBaseShipmentWithTrackingDelayed | Shipment.WithStatusBaseShipmentWithTrackingOutForDelivery | Shipment.WithStatusBaseShipmentOrdered | Shipment.WithStatusBaseShipmentCanceled; export declare namespace Shipment { interface WithStatusBaseShipmentWithTrackingShipped { id: string; checkoutIntentId: string; createdAt: string; /** * The external ID is provided by the marketplace and matches the shipment to their * system. */ externalId: string; marketplaceOrderId: string; shippedAt: string; status: 'shipped'; tracking: ShipmentsAPI.ShipmentTracking; trackingEvents: Array; updatedAt: string; } namespace WithStatusBaseShipmentWithTrackingShipped { interface TrackingEvent { description: string | null; location: TrackingEvent.Location; status: ShipmentsAPI.ShipmentStatus; timestamp: TrackingEvent.Timestamp | null; } namespace TrackingEvent { interface Location { city?: string | null; country?: string | null; province?: string | null; } interface Timestamp { /** * ISO 8601 string with timezone offset, e.g. "2025-02-05T17:02:00.000-05:00" */ local: string; /** * UTC timestamp */ utc: string; } } } interface DeliveredShipment { id: string; checkoutIntentId: string; createdAt: string; deliveredAt: string; /** * The external ID is provided by the marketplace and matches the shipment to their * system. */ externalId: string; marketplaceOrderId: string; shippedAt: string; status: 'delivered'; tracking: ShipmentsAPI.ShipmentTracking; trackingEvents: Array; updatedAt: string; } namespace DeliveredShipment { interface TrackingEvent { description: string | null; location: TrackingEvent.Location; status: ShipmentsAPI.ShipmentStatus; timestamp: TrackingEvent.Timestamp | null; } namespace TrackingEvent { interface Location { city?: string | null; country?: string | null; province?: string | null; } interface Timestamp { /** * ISO 8601 string with timezone offset, e.g. "2025-02-05T17:02:00.000-05:00" */ local: string; /** * UTC timestamp */ utc: string; } } } interface WithStatusBaseShipmentWithTrackingDelayed { id: string; checkoutIntentId: string; createdAt: string; /** * The external ID is provided by the marketplace and matches the shipment to their * system. */ externalId: string; marketplaceOrderId: string; shippedAt: string; status: 'delayed'; tracking: ShipmentsAPI.ShipmentTracking; trackingEvents: Array; updatedAt: string; } namespace WithStatusBaseShipmentWithTrackingDelayed { interface TrackingEvent { description: string | null; location: TrackingEvent.Location; status: ShipmentsAPI.ShipmentStatus; timestamp: TrackingEvent.Timestamp | null; } namespace TrackingEvent { interface Location { city?: string | null; country?: string | null; province?: string | null; } interface Timestamp { /** * ISO 8601 string with timezone offset, e.g. "2025-02-05T17:02:00.000-05:00" */ local: string; /** * UTC timestamp */ utc: string; } } } interface WithStatusBaseShipmentWithTrackingOutForDelivery { id: string; checkoutIntentId: string; createdAt: string; /** * The external ID is provided by the marketplace and matches the shipment to their * system. */ externalId: string; marketplaceOrderId: string; shippedAt: string; status: 'out_for_delivery'; tracking: ShipmentsAPI.ShipmentTracking; trackingEvents: Array; updatedAt: string; } namespace WithStatusBaseShipmentWithTrackingOutForDelivery { interface TrackingEvent { description: string | null; location: TrackingEvent.Location; status: ShipmentsAPI.ShipmentStatus; timestamp: TrackingEvent.Timestamp | null; } namespace TrackingEvent { interface Location { city?: string | null; country?: string | null; province?: string | null; } interface Timestamp { /** * ISO 8601 string with timezone offset, e.g. "2025-02-05T17:02:00.000-05:00" */ local: string; /** * UTC timestamp */ utc: string; } } } interface WithStatusBaseShipmentOrdered { id: string; checkoutIntentId: string; createdAt: string; marketplaceOrderId: string; status: 'ordered'; updatedAt: string; } interface WithStatusBaseShipmentCanceled { id: string; checkoutIntentId: string; createdAt: string; marketplaceOrderId: string; status: 'canceled'; updatedAt: string; } } export type ShipmentStatus = 'out_for_delivery' | 'delivered' | 'shipped' | 'canceled' | 'delayed' | 'ordered'; export interface ShipmentTracking { number: string | null; carrierName?: string | null; deliveryDate?: ShipmentTracking.DeliveryDate | null; url?: string | null; } export declare namespace ShipmentTracking { interface DeliveryDate { estimated: string; } } export interface ShipmentListParams extends CursorPaginationParams { ids?: Array; status?: Array; } export declare namespace Shipments { export { type Shipment as Shipment, type ShipmentStatus as ShipmentStatus, type ShipmentTracking as ShipmentTracking, type ShipmentsCursorPagination as ShipmentsCursorPagination, type ShipmentListParams as ShipmentListParams, }; } //# sourceMappingURL=shipments.d.mts.map