Megaventory API v2017a

<back to all web services

ShippingInformationCreateLabel

The following routes are available for this service:
POST/ShippingInformation/ShippingInformationCreateLabelCreates a shipping label against the Shipping Information of a Shipping Provider for a document.Uses your API Key, a valid DocumentId, and optionally a ShippingInfo object to create a shipping label for the specified document. The NotifyCustomer flag is used to inform external integrations such as Magento, WooCommerce, or Shopify when the label is created.

If ShippingInfo is omitted, the document's existing ShippingInfo (if any) will be used.

Examples:



A.

Create a shipping label using existing ShippingInfo for DocumentId = 12345 and notify external integrations

Value:

{
   "DocumentId": 12345,
   "NotifyCustomer": true
}


B.

Create a shipping label with a custom ShippingInfo

Value:

{
   "DocumentId": 12345,
   "ShippingInfo": {
      "ProviderInfo": {
         "ProviderId": 2018,
         "ServiceId": "EXPRESS",
         "PackageId": "PKG001"
      },
      "CostInfo": {
         "ShippingCost": 6.00,
         "OtherCosts": 1.00,
         "TotalCost": 7.00
      },
      "WeightInfo": {
         "Weight": 1.5,
         "WeightUnitId": 1
      },
      "ShipmentDimensionsInfo": {
         "ShipmentDimensionsLength": 35.0,
         "ShipmentDimensionsWidth": 22.0,
         "ShipmentDimensionsHeight": 12.0,
         "ShipmentDimensionsUnit": "cm"
      },
      "ShipDateInfo": {
         "ShipDate": "2024-05-18"
      },
      "GenericAftersalesProServicesInfo": {
         "COD": false,
         "GTEEC": false,
         "Protocol": false
      },
      "TrackingId": "TRK-000999888777",
      "LockerId": 42
   },
   "NotifyCustomer": true
}


Response:

{
   "ShippingInfo": {
      "ProviderInfo": {
         "ProviderId": 2018,
         "ServiceId": "EXPRESS",
         "PackageId": "PKG001"
      },
      "CostInfo": {
         "ShippingCost": 6.00,
         "OtherCosts": 1.00,
         "TotalCost": 7.00
      },
      "WeightInfo": {
         "Weight": 1.5,
         "WeightUnitId": 1
      },
      "ShipmentDimensionsInfo": {
         "ShipmentDimensionsLength": 35.0,
         "ShipmentDimensionsWidth": 22.0,
         "ShipmentDimensionsHeight": 12.0,
         "ShipmentDimensionsUnit": "cm"
      },
      "ShipDateInfo": {
         "ShipDate": "2024-05-18"
      },
      "GenericAftersalesProServicesInfo": {
         "COD": false,
         "GTEEC": false,
         "Protocol": false
      },
      "TrackingId": "TRK-000999888777",
      "LockerId": 42
   },
   "LabelURL": "https://URLPATH/123456789_shipping-label.pdf",
   "ResponseStatus": {
      "ErrorCode": "0",
      "Message": ""
   }
}


A valid DocumentId is required. ShippingInfo is optional; if omitted, the document's existing ShippingInfo will be used. NotifyCustomer indicates whether external integrations such as Magento, WooCommerce, or Shopify should be informed. 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 .csv suffix or ?format=csv

HTTP + CSV

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

POST /csv/reply/ShippingInformationCreateLabel HTTP/1.1 
Host: api.megaventory.com 
Content-Type: text/csv
Content-Length: length

ProviderInfo,CostInfo,WeightInfo,ShipmentDimensionsInfo,ShipDateInfo,GenericAftersalesProServicesInfo,TrackingId,LockerId
"{ProviderId:0,ServiceId:String,PackageId:String}","{ShippingCost:0,OtherCosts:0,TotalCost:0}","{Weight:0,WeightUnitId:0}","{ShipmentDimensionsLength:0,ShipmentDimensionsWidth:0,ShipmentDimensionsHeight:0,ShipmentDimensionsUnit:String}",{ShipDate:String},"{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}",String,0

HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

ProviderInfo,CostInfo,WeightInfo,ShipmentDimensionsInfo,ShipDateInfo,GenericAftersalesProServicesInfo,TrackingId,LockerId
"{ProviderId:0,ServiceId:String,PackageId:String}","{ShippingCost:0,OtherCosts:0,TotalCost:0}","{Weight:0,WeightUnitId:0}","{ShipmentDimensionsLength:0,ShipmentDimensionsWidth:0,ShipmentDimensionsHeight:0,ShipmentDimensionsUnit:String}",{ShipDate:String},"{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}",String,0