POST api/GetShipments_V1

Get shipments ussing different filters GetShipmentType have the following types ByIds, ByDate, ByCarrierId, ByTrackingNumber, ByReference, ByOrderNumber

Request Information

URI Parameters

None.

Body Parameters

The request is presented below!

WS_Repository.Models.Requests.Ship.GetShipmentsRequest
NameDescriptionTypeAdditional information
WS_Key

(Mandatory) Webservice Key provided by 2ship support

string

None.

ShipmentIds

get by ShipmentId - Array of Shipment Id

Collection of integer

None.

DateStart

get by date - DateStart

date

None.

DateEnd

get by date - DateEnd

date

None.

Type

(Mandatory) Type of the GetShipmentsRequest

WS_Repository.Models.Requests.Ship.GetShipmentType

None.

CarrierId

get by Carrier Id

integer

None.

TrackingNumber

TrackingNumber

string

None.

Reference

get by Reference

string

None.

PONumber

get by PO Number

string

None.

OrderNumber

get by OrderNumber

string

None.

RetrieveBase64StringDocuments

Use to get in the response also the documents in Base64String format

boolean

None.

Request Formats

application/json, text/json

Sample:
{
  "WS_Key": "sample string 1",
  "ShipmentIds": [
    1,
    2
  ],
  "DateStart": "2026-07-09T16:20:43.6561046Z",
  "DateEnd": "2026-07-09T16:20:43.6561046Z",
  "Type": 0,
  "CarrierId": 4,
  "TrackingNumber": "sample string 5",
  "Reference": "sample string 6",
  "PONumber": "sample string 7",
  "OrderNumber": "sample string 8",
  "RetrieveBase64StringDocuments": true
}

application/xml, text/xml

Sample:
<GetShipmentsRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WS_Repository.Models.Requests.Ship">
  <CarrierId>4</CarrierId>
  <DateEnd>2026-07-09T16:20:43.6561046Z</DateEnd>
  <DateStart>2026-07-09T16:20:43.6561046Z</DateStart>
  <OrderNumber>sample string 8</OrderNumber>
  <PONumber>sample string 7</PONumber>
  <Reference>sample string 6</Reference>
  <RetrieveBase64StringDocuments>true</RetrieveBase64StringDocuments>
  <ShipmentIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:int>1</d2p1:int>
    <d2p1:int>2</d2p1:int>
  </ShipmentIds>
  <TrackingNumber>sample string 5</TrackingNumber>
  <Type>ByIds</Type>
  <WS_Key>sample string 1</WS_Key>
</GetShipmentsRequest>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'System.Web.Http.ModelBinding.JQueryMvcFormUrlEncodedFormatter' to write type 'WS_Repository.Models.Requests.Ship.GetShipmentsRequest'.

Response Information

Resource Description

Collection of WS_Repository.Models.Responses.Ship.CarrierShipResponse
NameDescriptionTypeAdditional information
ShipDocuments

Array of Ship Documents

None.

Response Formats

application/json

Sample:

An exception has occurred while using the formatter 'System.Net.Http.Formatting.JsonMediaTypeFormatter' to generate sample for media type 'application/json'. Exception message: Self referencing loop detected with type 'WS_Repository.Models.Responses.Ship.Commodity'. Path '[0].ShipmentDetails.Contents.Commodities[0].BundleComponents'.

text/json

Sample:

An exception has occurred while using the formatter 'System.Net.Http.Formatting.JsonMediaTypeFormatter' to generate sample for media type 'text/json'. Exception message: Self referencing loop detected with type 'WS_Repository.Models.Responses.Ship.Commodity'. Path '[0].ShipmentDetails.Contents.Commodities[0].BundleComponents'.

application/xml

Sample:

An exception has occurred while using the formatter 'System.Net.Http.Formatting.XmlMediaTypeFormatter' to generate sample for media type 'application/xml'. Exception message: Object graph for type 'WS_Repository.Models.Responses.Ship.Commodity' contains cycles and cannot be serialized if reference tracking is disabled.

text/xml

Sample:

An exception has occurred while using the formatter 'System.Net.Http.Formatting.XmlMediaTypeFormatter' to generate sample for media type 'text/xml'. Exception message: Object graph for type 'WS_Repository.Models.Responses.Ship.Commodity' contains cycles and cannot be serialized if reference tracking is disabled.