shipstation_sdk.models¶
ShipStation API v2 models.
Attributes¶
Classes¶
Model for a monetary amount and its currency. |
|
Model for a weight. |
|
Model for a shipment tag. |
|
Model for a shipment item option. |
|
Model for one geolocation item of an address, such as a what3words location. |
|
Model for a shipping address. |
|
Model for a shipment item (an order line). |
|
Model for the FedEx Freight options of a shipment. |
|
Model for a collect-on-delivery request: how and how much the recipient pays. |
|
Model for the contact to reach about a shipment's dangerous goods. |
|
Model for the Windsor Framework details of a shipment into Northern Ireland. |
|
Model for where on a Netstamps sheet a label prints. |
|
Model for the Amazon Transparency codes of one order item. |
|
Model for advanced shipment options. |
|
Model for a tax identifier on a customs declaration, such as a VAT or EORI number. |
|
Model for the import taxes and duties a commercial invoice estimates. |
|
Model for the charges a commercial invoice adds to the value of the goods. |
|
Model for one line of a customs declaration; |
|
Model for the customs declaration of an international shipment. |
|
Model for a package's dimensions: ShipStation needs all three sides and the unit. |
|
Model for the custom messages printed on one package's label. |
|
Model for the amount of a dangerous good in a package. |
|
Model for the dangerous goods details of one product in a package. |
|
Model for a US Consumer Product Safety Commission eFiling certificate of a product. |
|
Model for a product's disclaimer of the CPSC eFiling requirement, and why. |
|
Model for one product in a package, as a customs declaration describes it. |
|
Model for one package of a shipment, as a request sends it and a shipment returns it. |
|
Model for a shipment (the v2 equivalent of a v1 order). |
|
Model for a single pagination link. |
|
Model for the pagination links of a list response. |
|
Response model for the shipments list API. |
|
Model for one shipping service a carrier offers. |
|
Model for one package type a carrier offers, such as a flat-rate box. |
|
Model for one advanced option a carrier supports, and its default. |
|
Model for a connected carrier account. |
|
Response model for the carriers list API. |
|
Response model for the tags list API. |
|
Model for where a label's file can be downloaded, in each format ShipStation offers. |
|
Model for a paperless label: where to download it and how to hand the package off without it. |
|
Model for another identifier a carrier gives a label, such as a last-mile tracking number. |
|
Model for one package of a bought label: its own tracking number and where it falls in the shipment. |
|
Model for one item on a shipment request: what a packer sees on the pick list. |
|
Model for the body of one shipment to create or update. |
|
Model for one finding of address validation. |
|
Model for the outcome of validating a shipment's address: the address as sent, as matched, and why. |
|
Model for one shipment in a create response, with the errors ShipStation found in it. |
|
Response model for the create shipments API. |
|
Model for when ShipStation predicts a label's package will be delivered, and how sure it is. |
|
Model for the refund of a voided label: its status and the amounts paid, asked for, approved and credited. |
|
Model for one line of what a label cost, as the carrier billed it. |
|
Model for a shipping label: what was bought, for which shipment, and its tracking numbers (one per package). |
|
Response model for the labels list API. |
|
Model for one header ShipStation sends with every call of a webhook. |
|
Model for a webhook subscription. |
|
Model for one scan or status change a carrier reports for a package, and where it happened. |
|
Model for where a package is: its tracking status, delivery dates and every event the carrier reported. |
|
Model for the body of a tracking webhook call: the package's tracking info, and where to fetch it again. |
Functions¶
|
Accept full ISO timestamps for date fields, truncating to the calendar date. |
Module Contents¶
- shipstation_sdk.models._date_from_timestamp(value: object) object[source]¶
Accept full ISO timestamps for date fields, truncating to the calendar date.
ShipStation’s schema declares plain dates, but documented response examples carry full timestamps (e.g.
2024-07-25T05:00:00.000Z), which pydantic would reject for adatefield.
- class shipstation_sdk.models.MonetaryValue(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for a monetary amount and its currency.
- class shipstation_sdk.models.Weight(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for a weight.
- class shipstation_sdk.models.Tag(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for a shipment tag.
- class shipstation_sdk.models.ItemOption(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for a shipment item option.
- class shipstation_sdk.models.Geolocation(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for one geolocation item of an address, such as a what3words location.
- class shipstation_sdk.models.Address(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for a shipping address.
- geolocation: list[Geolocation] | None = None[source]¶
- class shipstation_sdk.models.ShipmentItem(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for a shipment item (an order line).
- options: list[ItemOption] = [][source]¶
- class shipstation_sdk.models.FedexFreight(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for the FedEx Freight options of a shipment.
- class shipstation_sdk.models.CollectOnDelivery(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for a collect-on-delivery request: how and how much the recipient pays.
- payment_amount: MonetaryValue | None = None[source]¶
- class shipstation_sdk.models.DangerousGoodsContact(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for the contact to reach about a shipment’s dangerous goods.
- class shipstation_sdk.models.WindsorFrameworkDetails(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for the Windsor Framework details of a shipment into Northern Ireland.
- class shipstation_sdk.models.NetstampsOptions(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for where on a Netstamps sheet a label prints.
- class shipstation_sdk.models.TransparencyCode(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for the Amazon Transparency codes of one order item.
- class shipstation_sdk.models.AdvancedShipmentOptions(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for advanced shipment options.
- fedex_freight: FedexFreight | None = None[source]¶
- collect_on_delivery: CollectOnDelivery | None = None[source]¶
- dangerous_goods_contact: DangerousGoodsContact | None = None[source]¶
- windsor_framework_details: WindsorFrameworkDetails | None = None[source]¶
- netstamps_options: NetstampsOptions | None = None[source]¶
- transparency_codes: list[TransparencyCode] | None = None[source]¶
- class shipstation_sdk.models.TaxIdentifier(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for a tax identifier on a customs declaration, such as a VAT or EORI number.
- class shipstation_sdk.models.EstimatedImportCharges(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for the import taxes and duties a commercial invoice estimates.
- taxes: MonetaryValue | None = None[source]¶
- duties: MonetaryValue | None = None[source]¶
- class shipstation_sdk.models.InvoiceAdditionalDetails(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for the charges a commercial invoice adds to the value of the goods.
- freight_charge: MonetaryValue | None = None[source]¶
- insurance_charge: MonetaryValue | None = None[source]¶
- discount: MonetaryValue | None = None[source]¶
- estimated_import_charges: EstimatedImportCharges | None = None[source]¶
- other_charge: MonetaryValue | None = None[source]¶
- class shipstation_sdk.models.CustomsItem(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for one line of a customs declaration;
customs_item_idis ShipStation’s own: read but never sent.
- class shipstation_sdk.models.CustomsOptions(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for the customs declaration of an international shipment.
- invoice_additional_details: InvoiceAdditionalDetails | None = None[source]¶
- customs_items: list[CustomsItem] | None = None[source]¶
- class shipstation_sdk.models.Dimensions(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for a package’s dimensions: ShipStation needs all three sides and the unit.
- class shipstation_sdk.models.LabelMessages(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for the custom messages printed on one package’s label.
How many lines print, and how long each may be, depends on the carrier: ShipStation documents three for USPS and FedEx and two for UPS and OnTrac.
- class shipstation_sdk.models.DangerousAmount(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for the amount of a dangerous good in a package.
- class shipstation_sdk.models.DangerousGoods(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for the dangerous goods details of one product in a package.
- dangerous_amount: DangerousAmount | None = None[source]¶
- class shipstation_sdk.models.CpscCertificate(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for a US Consumer Product Safety Commission eFiling certificate of a product.
- class shipstation_sdk.models.CpscDisclaim(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for a product’s disclaimer of the CPSC eFiling requirement, and why.
- class shipstation_sdk.models.PackageProduct(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for one product in a package, as a customs declaration describes it.
- value: MonetaryValue | None = None[source]¶
- dangerous_goods: list[DangerousGoods] | None = None[source]¶
- cpsc_certificates: list[CpscCertificate] | None = None[source]¶
- cpsc_disclaim: CpscDisclaim | None = None[source]¶
- class shipstation_sdk.models.Package(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for one package of a shipment, as a request sends it and a shipment returns it.
Every field ShipStation documents for a shipment’s package is here, so a shipment read back and sent again (an update replaces the whole shipment) keeps what was set on it.
shipment_package_idis ShipStation’s own and read-only: it is read but never sent.- dimensions: Dimensions | None = None[source]¶
- insured_value: MonetaryValue | None = None[source]¶
- label_messages: LabelMessages | None = None[source]¶
- products: list[PackageProduct] | None = None[source]¶
- class shipstation_sdk.models.Shipment(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for a shipment (the v2 equivalent of a v1 order).
- created_at: datetime.datetime | None = None[source]¶
- modified_at: datetime.datetime | None = None[source]¶
- ship_date: ShipStationDate | None = None[source]¶
- ship_by_date: datetime.datetime | None = None[source]¶
- hold_until_date: datetime.datetime | None = None[source]¶
- deliver_by_date: datetime.datetime | None = None[source]¶
- amount_paid: MonetaryValue | None = None[source]¶
- shipping_paid: MonetaryValue | None = None[source]¶
- tax_paid: MonetaryValue | None = None[source]¶
- retail_rate: MonetaryValue | None = None[source]¶
- items: list[ShipmentItem] = [][source]¶
- advanced_options: AdvancedShipmentOptions | None = None[source]¶
- customs: CustomsOptions | None = None[source]¶
- tax_identifiers: list[TaxIdentifier] | None = None[source]¶
- class shipstation_sdk.models.PaginationLink(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for a single pagination link.
- class shipstation_sdk.models.PaginationLinks(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for the pagination links of a list response.
- first: PaginationLink | None = None[source]¶
- last: PaginationLink | None = None[source]¶
- prev: PaginationLink | None = None[source]¶
- next: PaginationLink | None = None[source]¶
- class shipstation_sdk.models.ShipmentsList(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelResponse model for the shipments list API.
- links: PaginationLinks | None = None[source]¶
- class shipstation_sdk.models.CarrierService(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for one shipping service a carrier offers.
- class shipstation_sdk.models.PackageType(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for one package type a carrier offers, such as a flat-rate box.
- dimensions: Dimensions | None = None[source]¶
- class shipstation_sdk.models.CarrierOption(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for one advanced option a carrier supports, and its default.
- class shipstation_sdk.models.Carrier(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for a connected carrier account.
- services: list[CarrierService] = [][source]¶
- packages: list[PackageType] = [][source]¶
- options: list[CarrierOption] = [][source]¶
- class shipstation_sdk.models.CarriersList(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelResponse model for the carriers list API.
The endpoint documents a 207 partial-success response;
errorscarries the details of any carrier accounts that could not be returned.- links: PaginationLinks | None = None[source]¶
- class shipstation_sdk.models.TagsList(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelResponse model for the tags list API.
- class shipstation_sdk.models.LabelDownload(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for where a label’s file can be downloaded, in each format ShipStation offers.
- class shipstation_sdk.models.PaperlessDownload(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for a paperless label: where to download it and how to hand the package off without it.
- class shipstation_sdk.models.AlternativeIdentifier(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for another identifier a carrier gives a label, such as a last-mile tracking number.
- class shipstation_sdk.models.LabelPackage(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for one package of a bought label: its own tracking number and where it falls in the shipment.
- dimensions: Dimensions | None = None[source]¶
- insured_value: MonetaryValue | None = None[source]¶
- label_download: LabelDownload | None = None[source]¶
- form_download: PaginationLink | None = None[source]¶
- qr_code_download: PaginationLink | None = None[source]¶
- paperless_download: PaperlessDownload | None = None[source]¶
- label_messages: LabelMessages | None = None[source]¶
- alternative_identifiers: list[AlternativeIdentifier] | None = None[source]¶
- class shipstation_sdk.models.ShipmentRequestItem(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for one item on a shipment request: what a packer sees on the pick list.
- options: list[ItemOption] | None = None[source]¶
- class shipstation_sdk.models.ShipmentRequest(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for the body of one shipment to create or update.
ship_fromandwarehouse_idare alternatives: ShipStation refuses both. Fields leftNoneare left off the wire, so an update changes only what it names.create_sales_orderis read on create only: without it, ShipStation keeps the shipment out of its Orders tab. ShipStation documents a narrower body for create than for update; the fields here are the union, and ShipStation’s own read-only fields (ids, timestamps, total weight, batch ids) are not here at all.shipment_statusis settable on create only.- ship_by_date: datetime.datetime | None = None[source]¶
- items: list[ShipmentRequestItem] | None = None[source]¶
- advanced_options: AdvancedShipmentOptions | None = None[source]¶
- ship_date: ShipStationDate | None = None[source]¶
- hold_until_date: datetime.datetime | None = None[source]¶
- deliver_by_date: datetime.datetime | None = None[source]¶
- amount_paid: MonetaryValue | None = None[source]¶
- shipping_paid: MonetaryValue | None = None[source]¶
- tax_paid: MonetaryValue | None = None[source]¶
- retail_rate: MonetaryValue | None = None[source]¶
- customs: CustomsOptions | None = None[source]¶
- tax_identifiers: list[TaxIdentifier] | None = None[source]¶
- class shipstation_sdk.models.AddressValidationMessage(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for one finding of address validation.
- class shipstation_sdk.models.AddressValidationResult(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for the outcome of validating a shipment’s address: the address as sent, as matched, and why.
- messages: list[AddressValidationMessage] = [][source]¶
- class shipstation_sdk.models.CreatedShipment(/, **data: Any)[source]¶
Bases:
ShipmentModel for one shipment in a create response, with the errors ShipStation found in it.
- address_validation: AddressValidationResult | None = None[source]¶
- class shipstation_sdk.models.CreateShipmentsResponse(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelResponse model for the create shipments API.
- shipments: list[CreatedShipment][source]¶
- class shipstation_sdk.models.DeliveryPrediction(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for when ShipStation predicts a label’s package will be delivered, and how sure it is.
- delivery_date: ShipStationDate | None = None[source]¶
- class shipstation_sdk.models.RefundDetails(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for the refund of a voided label: its status and the amounts paid, asked for, approved and credited.
- request_date: datetime.datetime | None = None[source]¶
- amount_paid: MonetaryValue | None = None[source]¶
- amount_requested: MonetaryValue | None = None[source]¶
- amount_approved: MonetaryValue | None = None[source]¶
- amount_credited: MonetaryValue | None = None[source]¶
- class shipstation_sdk.models.RateDetail(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for one line of what a label cost, as the carrier billed it.
- amount: MonetaryValue | None = None[source]¶
- class shipstation_sdk.models.Label(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for a shipping label: what was bought, for which shipment, and its tracking numbers (one per package).
- ship_date: ShipStationDate | None = None[source]¶
- created_at: datetime.datetime | None = None[source]¶
- shipment_cost: MonetaryValue | None = None[source]¶
- voided_at: datetime.datetime | None = None[source]¶
- packages: list[LabelPackage] = [][source]¶
- delivery_prediction: DeliveryPrediction | None = None[source]¶
- insurance_cost: MonetaryValue | None = None[source]¶
- requested_comparison_amount: MonetaryValue | None = None[source]¶
- refund_details: RefundDetails | None = None[source]¶
- label_download: LabelDownload | None = None[source]¶
- form_download: PaginationLink | None = None[source]¶
- qr_code_download: PaginationLink | None = None[source]¶
- paperless_download: PaperlessDownload | None = None[source]¶
- insurance_claim: PaginationLink | None = None[source]¶
- alternative_identifiers: list[AlternativeIdentifier] | None = None[source]¶
- rate_details: list[RateDetail] = [][source]¶
- class shipstation_sdk.models.LabelsList(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelResponse model for the labels list API.
- links: PaginationLinks | None = None[source]¶
- class shipstation_sdk.models.WebhookHeader(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for one header ShipStation sends with every call of a webhook.
- class shipstation_sdk.models.Webhook(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for a webhook subscription.
- headers: list[WebhookHeader] = [][source]¶
- type shipstation_sdk.models.TrackingStatusCode = Literal['UN', 'AC', 'IT', 'DE', 'EX', 'AT', 'NY', 'SP'][source]¶
- class shipstation_sdk.models.TrackEvent(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for one scan or status change a carrier reports for a package, and where it happened.
- occurred_at: datetime.datetime | None = None[source]¶
- carrier_occurred_at: datetime.datetime | None = None[source]¶
- status_code: TrackingStatusCode | None = None[source]¶
- class shipstation_sdk.models.TrackingInfo(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for where a package is: its tracking status, delivery dates and every event the carrier reported.
- status_code: TrackingStatusCode | None = None[source]¶
- ship_date: datetime.datetime | None = None[source]¶
- estimated_delivery_date: datetime.datetime | None = None[source]¶
- actual_delivery_date: datetime.datetime | None = None[source]¶
- events: list[TrackEvent] = [][source]¶
- class shipstation_sdk.models.TrackWebhookEvent(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelModel for the body of a tracking webhook call: the package’s tracking info, and where to fetch it again.
API_TRACKis thetrackevent’s resource type andTRACK_EVENT_V2thetrack_event_v2one’s.- data: TrackingInfo[source]¶