Megaventory API v2017a

<back to all web services

ShippingInformationGet

The following routes are available for this service:
GET POST/ShippingInformation/ShippingInformationGetGets information of documents related shipping providers data.Uses your API Key and a valid DocumentId to retrieve the shipping information of the specified document. The response includes detailed ShippingInfo data and an optional LabelURL pointing to a PDF label file.

Examples:



A.

Retrieve shipping information for a document with DocumentId = 12345

Value:

{
    "DocumentId": 12345
}


Response:

{
    "ShippingInfo": {
        "ProviderInfo": {
            "ProviderId": 2018,
            "ServiceId": "EXPRESS",
            "PackageId": "PKG001"
        },
        "CostInfo": {
            "ShippingCost": 4.50,
            "OtherCosts": 0.50,
            "TotalCost": 5.00
        },
        "WeightInfo": {
            "Weight": 1.2,
            "WeightUnitId": 1
        },
        "ShipmentDimensionsInfo": {
            "ShipmentDimensionsLength": 30.0,
            "ShipmentDimensionsWidth": 20.0,
            "ShipmentDimensionsHeight": 10.0,
            "ShipmentDimensionsUnit": "centimeter"
        },
        "ShipDateInfo": {
            "ShipDate": "2024-05-17"
        },
        "GenericAftersalesProServicesInfo": {
            "COD": false,
            "GTEEC": false,
            "Protocol": false,
            "Reception": false,
            "Insurance": false,
            "ChequeCod": false,
            "SpecialRate": false,
            "VipDelivery": false,
            "SenderCharge": false,
            "PackageReturn": false,
            "ReturnDocument": false,
            "CodTotalInCents": 0,
            "MorningDelivery": false,
            "SameDayIntracity": false,
            "SaturdayDelivery": false,
            "SeaFreightCyprus": false,
            "RefrigeratedGoods": false,
            "LessThanTwoKilograms": false,
            "LessThanFourKilograms": false,
            "SubmissionOfTenderDocuments": false,
            "NextDayAirTransportToIslands": false,
            "ContainsDocumentsOnlyAndIsLessThanTwoKilograms": false
        },
        "TrackingId": "TRK-000123456789",
        "LockerId": 42
    },
    "LabelURL": "https://URLPATH/123456789_shipping-label.pdf",
    "ResponseStatus": {
        "ErrorCode": "0",
        "Message": ""
    }
}


A valid DocumentId is required. If an invalid DocumentId is provided, the response will contain an appropriate error message.

To override the Content-type in your clients HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /xml/reply/ShippingInformationGet HTTP/1.1 
Host: api.megaventory.com 
Content-Type: application/xml
Content-Length: length

<ShippingInformationGet xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <APIKEY>String</APIKEY>
  <DocumentId>0</DocumentId>
</ShippingInformationGet>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ShippingInformationGetResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <LabelURL>String</LabelURL>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
      </d2p1:ResponseError>
    </d2p1:Errors>
  </ResponseStatus>
  <ShippingInfo xmlns:d2p1="http://schemas.datacontract.org/2004/07/Megaventory.Models.DTOs.MvShippingProviderDTOs">
    <d2p1:ProviderInfo>
      <d2p1:ProviderId>0</d2p1:ProviderId>
      <d2p1:ServiceId>String</d2p1:ServiceId>
      <d2p1:PackageId>String</d2p1:PackageId>
    </d2p1:ProviderInfo>
    <d2p1:CostInfo>
      <d2p1:ShippingCost>0</d2p1:ShippingCost>
      <d2p1:OtherCosts>0</d2p1:OtherCosts>
      <d2p1:TotalCost>0</d2p1:TotalCost>
    </d2p1:CostInfo>
    <d2p1:WeightInfo>
      <d2p1:Weight>0</d2p1:Weight>
      <d2p1:WeightUnitId>0</d2p1:WeightUnitId>
    </d2p1:WeightInfo>
    <d2p1:ShipmentDimensionsInfo>
      <d2p1:ShipmentDimensionsLength>0</d2p1:ShipmentDimensionsLength>
      <d2p1:ShipmentDimensionsWidth>0</d2p1:ShipmentDimensionsWidth>
      <d2p1:ShipmentDimensionsHeight>0</d2p1:ShipmentDimensionsHeight>
      <d2p1:ShipmentDimensionsUnit>String</d2p1:ShipmentDimensionsUnit>
    </d2p1:ShipmentDimensionsInfo>
    <d2p1:ShipDateInfo>
      <d2p1:ShipDate>String</d2p1:ShipDate>
    </d2p1:ShipDateInfo>
    <d2p1:GenericAftersalesProServicesInfo>
      <d2p1:COD>false</d2p1:COD>
      <d2p1:GTEEC>false</d2p1:GTEEC>
      <d2p1:Protocol>false</d2p1:Protocol>
      <d2p1:Reception>false</d2p1:Reception>
      <d2p1:Insurance>false</d2p1:Insurance>
      <d2p1:ChequeCod>false</d2p1:ChequeCod>
      <d2p1:SpecialRate>false</d2p1:SpecialRate>
      <d2p1:VipDelivery>false</d2p1:VipDelivery>
      <d2p1:SenderCharge>false</d2p1:SenderCharge>
      <d2p1:PackageReturn>false</d2p1:PackageReturn>
      <d2p1:CodTotalInCents>0</d2p1:CodTotalInCents>
      <d2p1:ReturnDocument>false</d2p1:ReturnDocument>
      <d2p1:MorningDelivery>false</d2p1:MorningDelivery>
      <d2p1:SameDayIntracity>false</d2p1:SameDayIntracity>
      <d2p1:SaturdayDelivery>false</d2p1:SaturdayDelivery>
      <d2p1:SeaFreightCyprus>false</d2p1:SeaFreightCyprus>
      <d2p1:RefrigeratedGoods>false</d2p1:RefrigeratedGoods>
      <d2p1:LessThanTwoKilograms>false</d2p1:LessThanTwoKilograms>
      <d2p1:LessThanFourKilograms>false</d2p1:LessThanFourKilograms>
      <d2p1:SubmissionOfTenderDocuments>false</d2p1:SubmissionOfTenderDocuments>
      <d2p1:NextDayAirTransportToIslands>false</d2p1:NextDayAirTransportToIslands>
      <d2p1:ContainsDocumentsOnlyAndIsLessThanTwoKilograms>false</d2p1:ContainsDocumentsOnlyAndIsLessThanTwoKilograms>
    </d2p1:GenericAftersalesProServicesInfo>
    <d2p1:LockerId>0</d2p1:LockerId>
    <d2p1:TrackingId>String</d2p1:TrackingId>
  </ShippingInfo>
</ShippingInformationGetResponse>