- Print
- DarkLight
The following details the primary method of importing shipment data to Mercury via an API request.
Overview
Connection
To connect to the site, use the following HTTPS URL via regular POST method with the parameter RQXML=<your xml document> https://api.landmarkglobal.com/v2/Import.php
Encoding
Test Mode
When first given access to the API, the client will be placed in Test mode. Requests made while in test mode will not act on live data. After approval has been received to go live from Landmark, all requests are active unless the <Test> flag is passed.
During a test API call, validation will focus on required fields and passing sane values.
Troubleshooting
Please see related API Errors documentation if you encounter an error.
ImportRequest
Will import a shipment into Mercury and generate a Landmark label. This is the recommended method of transmitting shipment data to Landmark, and must be used when fulfillment is handled by Landmark. Consequently, there are options related to adding data to potential pick slip invoice that do not appear in ShipRequest.
For an example label returned by the ImportRequest, please see the Supporting Documents at the bottom of the page.
For checking fulfillment inventory, please see the Inventory API Request.
For declaring shipments travelling together on the same MAWB, please see the PreClearance API Request
--------
<ImportRequest>
<Login>
<Username>demoapi</Username>
<Password>demo123</Password>
</Login>
<Test>true</Test> <!-- Optional. Defaults to true before account activation, false afterwards -->
<ClientID>218</ClientID>
<AccountNumber>L0218A</AccountNumber> <!--Optional. Only used by clients with multiple account numbers. See integration manager for relevant account numbers -->
<Reference>3245325</Reference> <!-- Customer Reference, or Order Number. Primary shipment identifier -->
<ShipTo>
<Name>Test Company</Name> <!-- Max 50 characters -->
<Attention>Ole Olsen</Attention> <!-- Optional. Max 50 characters -->
<Address1>5130 Halford Drive</Address1> <!-- Max 60 characters -->
<Address2>Building #C</Address2> <!-- Optional. Max 60 characters -->
<Address3>Unit 1</Address3> <!-- Optional. Max 60 characters -->
<City>Windsor</City> <!-- Max 40 characters -->
<State>ON</State> <!-- ISO-3166-2 code -->
<PostalCode>N9A6J3</PostalCode> <!-- Max 10 characters -->
<Country>CA</Country> <!-- Use ISO-3166-2 standard -->
<Phone>1-519-737-9101</Phone> <!-- Optional, but encouraged. Max 20 characters -->
<Email>orders@test.com</Email> <!-- Optional. Max 80 characters -->
<ConsigneeTaxID>12345</ConsigneeTaxID> <!-- Optional, for countries that require an individual's tax id to import as DDP. -->
</ShipTo>
<ShippingLane>
<Region>Landmark CMH</Region> <!-- The Region field links the shipment to a Landmark facility combination and is determined on a case-by-case basis. Please contact your Integration Manager for details per shipping facility.-->
</ShippingLane>
<ShipMethod>LGINTSTD</ShipMethod>
<OrderTotal>187.98</OrderTotal> <!-- Conditional. Amount paid by the customer for all the items in their order. Must be passed in instances where the shipment information represents a partial shipment of products comprising a larger order-->
<OrderInsuranceFreightTotal>20.65</OrderInsuranceFreightTotal> <!-- Conditional. Amount paid by the customer for shipping their entire order. Must be passed in instances where the shipment information represents a partial shipment of products comprising a larger order-->
<ShipmentInsuranceFreight>20.65</ShipmentInsuranceFreight> <!-- Amount charged for shipping and any insurance for the shipment. This value does not include the amount charged for purchased items (i.e. Item Unit Value).-->
<ItemsCurrency>USD</ItemsCurrency> <!-- Optional, and only used when client uses multiple currencies. If used, pass the 3 character ISO 4217 code to represent the currency (i.e. USD, CAD) -->
<IsCommercialShipment>0</IsCommercialShipment> <!-- Optional boolean, and only used in cases when client requires shipments to be commercially cleared (i.e. B2B clearance) -->
<ProduceLabel>false</ProduceLabel> <!-- Optional, Whether or not to return a generic label even though the shipment will not be processed. -->
<LabelFormat>PDF</LabelFormat> <!-- Optional, only used if ProduceLabel = true. Default is PDF. Also supports JPG, GIF, BMP, ZPL and PNG -->
<LabelEncoding>LINKS</LabelEncoding>
<!-- Optional, only used if ProduceLabel = true. Default is "LINKS" (if LabelFormat = ZPL, default is "ZPL").
LINKS - returns links to all labels which must be retrieved in <LabelLink> tag.
ZPL - label image returned as ZPL in <LabelImage> tag. This type automatically chosen if LabelFormat = ZPL.
BASE64 - Base64 encoded label image is returned directly in the XML response in <LabelImage> tag.
BASE64COMPRESSED - GZcompressed and Base64 encoded label image is returned directly in the XML response in <LabelImage> tag.
-->
<ShipOptions> <!-- Optional, For a list of available options, contact your account rep -->
<Option>
<Name>dummy_option</Name>
<Value>true</Value>
</Option>
</ShipOptions>
<VendorInformation> <!-- Conditional. Required if providing third party logistics for the client. Information here represents the actual vendor (retailer) name and address for the items sold in the order. -->
<VendorName>Test Company Legal Name</VendorName>
<VendorPhone>12223334444</VendorPhone>
<VendorEmail>contact@vendor.com</VendorEmail>
<VendorAddress1>Sample Company Street</VendorAddress1>
<VendorAddress2>Suite 135</VendorAddress2>
<VendorCity>Santa Barbara</VendorCity>
<VendorState>CA</VendorState>
<VendorPostalCode>93101</VendorPostalCode>
<VendorCountry>US</VendorCountry>
<VendorBusinessNumber>12345</VendorBusinessNumber>
<VendorRGRNumber>123</VendorRGRNumber>
<VendorIOSSNumber>IM1234567891</VendorIOSSNumber>
<VendorEORINumber>12345</VendorEORINumber>
</VendorInformation>
<FulfillmentAddress> <!-- Optional, Enables associating a shipment will a different fulfillment address. -->
<Name>Acme Warehouse</Name> <!-- Required when including FulfillmentAddress, Max 50 characters. -->
<Attention>Returns Dept.</Attention> <!-- Optional. Max 50 characters. -->
<Address1>65-11 Roy St.</Address1> <!-- Required when including FulfillmentAddress, Max 100 characters. -->
<Address2>Suite BA</Address2> <!-- Optional. Max 100 characters. -->
<Address3></Address3> <!-- Optional. Max 100 characters. -->
<City>Kitchener</City> <!-- Required when including FulfillmentAddress, Max 50 characters. -->
<State>ON</State> <!-- Max 20 characters. -->
<PostalCode>N2H 4B4</PostalCode> <!-- Max 10 characters. -->
<Country>CA</Country> <!-- Required when including FulfillmentAddress, 2 character ISO code -->
</FulfillmentAddress>
<SendReturnToAddress> <!-- Optional (rare). Allows overriding the default address where the shipment will be sent back to if it is returned. Contact your integration manager if you plan to use this feature. -->
<Code>GHB78</Code> <!-- Optional. Max length is 32 characters. -->
<Name>Acme Warehouse</Name> <!-- Max 50 characters. -->
<Attention>Returns Dept.</Attention> <!-- Optional. Max 50 characters. -->
<Address1>65-11 Roy St.</Address1> <!-- Max 100 characters. -->
<Address2>Suite BA</Address2> <!-- Optional. Max 100 characters. -->
<Address3></Address3> <!-- Optional. Max 100 characters. -->
<City>Kitchener</City> <!-- Max 50 characters. -->
<State>ON</State> <!-- Max 20 characters. -->
<PostalCode>N2H 4B4</PostalCode> <!-- Max 10 characters. -->
<Country>CA</Country> <!-- 2 character ISO code -->
</SendReturnToAddress>
<AdditionalFields> <!-- Optional. Used to store any other additional information the client wants to pass. Up to 5 additional fields may be passed. -->
<Field1>Any type of data</Field1> <!-- Optional -->
<Field2>Purchased with Credit Card</Field2> <!-- Optional -->
<Field3>99000029327172321</Field3> <!-- Optional -->
<Field4>123198012</Field4> <!-- Optional -->
<Field5>Stored information</Field5> <!-- Optional -->
</AdditionalFields>
<PickSlipAdditions> <!-- Optional, Used to display additional information on the pick slip. Such as a charge or memo -->
<Charges> <!-- Optional. Additional charges besides the charges for each item -->
<Charge>
<Description>Gift Card Code: DISCOUNTHOUND</Description>
<Value>-7.25</Value>
</Charge>
<Charge>
<Description>Sales Tax</Description>
<Value>1.59</Value>
</Charge>
</Charges>
<Memos> <!-- Optional -->
<Memo>You will receive 15% off your next order with coupon code SAVE15</Memo>
</Memos>
</PickSlipAdditions>
<ValueAddedServices> <!-- Optional. Used to request additional services related to the entire shipment during fulfillment (i.e. gift wrapping). Contact your integration manager if you plan to use this feature -->
<Request> <!-- The caller should include one Request per 'Type' being requested -->
<Type>WRAPPING</Type>
<Instructions> <!-- Instructions are displayed to warehouse staff to guide them through completing the VAS request. Include as many Instruction tags as needed. -->
<Instruction>Style: Fancy Paper</Instruction>
<Instruction>Color: Red and White Striped</Instruction>
<Instruction>Include a bow</Instruction>
</Instructions>
</Request>
</ValueAddedServices>
<Packages> <!-- Do not include the Packages node for orders Landmark is fulfilling -->
<Package>
<WeightUnit>LB</WeightUnit> <!-- Optional package weight Unit of Measure. Default is LB (pounds). Supports LB, KG, G -->
<Weight>4.5</Weight> <!-- Default in LB -->
<DimensionsUnit>IN</DimensionsUnit> <!-- Optional package dimension Unit of Measure. Default is IN (inches). Supports IN, CM -->
<Length>12</Length> <!-- Optional -->
<Width>12</Width> <!-- Optional -->
<Height>12</Height> <!-- Optional -->
<PackageReference>98233310</PackageReference> <!-- Optional. Another reference for the client -->
</Package>
</Packages>
<Items>
<!-- Required for customs if the shipment will be crossing the border -->
<Item>
<Sku>7224059</Sku>
<Quantity>2</Quantity>
<UnitPrice>93.99</UnitPrice>
<Description>Women's Shoes</Description>
<HSCode>640399.30.00</HSCode> <!-- Optional -->
<CountryOfOrigin>CN</CountryOfOrigin> <!-- 2 character ISO code -->
<URL></URL> <!-- Optional, web address of the item from your storefront -->
<USMID>CNZHOEAS3ZHON</USMID> <!-- Value for a US Manufacturer's Identification Code. Required for US formal customs entries -->
<ContentCategory> <!-- Optional. Supports GOODS, DOCUMENTS, GIFT, RETURNED_GOODS -->
<ReturnCustomsInfo> <!-- Optional -->
<HSCode>6403993000</HSCode>
<HSRegionCode>US</HSRegionCode>
</ReturnCustomsInfo>
<DangerousGoodsInformation> <!-- This section is required if item contains dangerous goods -->
<ContainsDangerousGoods>1</ContainsDangerousGoods> <!-- Required. Flag to declare that item contains dangerous goods -->
<UNCode>UN3481</UNCode> <!-- Required -->
<PackingGroup>II</PackingGroup> <!-- Required for some UN codes -->
<PackingInstructions>PS967S1</PackingInstructions> <!-- Required for some UN codes -->
<ItemWeight>10</ItemWeight> <!-- Required -->
<ItemWeightUnit>kg</ItemWeightUnit> <!-- Required -->
<ItemVolume>30</ItemVolume> <!-- Required for some UN codes -->
<ItemVolumeUnit>ML</ItemVolumeUnit> <!-- Required for some UN codes -->
</DangerousGoodsInformation>
<ValueAddedServices> <!-- Optional. Used to request additional services related to this item during fulfillment (i.e. manufacturing). Contact your integration manager if you plan to use this feature -->
<Request> <!-- The caller should include one Request per 'Type' being requested -->
<Type>MANUFACTURING</Type>
<Instructions> <!-- Instructions are displayed to warehouse staff to guide them through completing the VAS request. Include as many Instruction tags as needed. -->
<Instruction>Font: Arial</Instruction>
<Instruction>Color: Blue</Instruction>
<Instruction>Text: My text on the t-shirt</Instruction>
</Instructions>
</Request>
</ValueAddedServices>
</Item>
</Items>
<FreightDetails> <!-- Required for all freight shipments -->
<ProNumber>LGBR020409E</ProNumber>
<PieceUnit>Pallet</PieceUnit>
</FreightDetails>
</ImportRequest>
ImportResponse
<ImportResponse>
<Errors> <!-- Only if Error(s) occur is this element included -->
<Error>
<ErrorCode>State</ErrorCode>
<ErrorMessage>State-Province is invalid, must be 2 characters.</ErrorMessage>
</Error>
</Errors>
<Test>true</Test> <!-- Only present if the API call was to the test environment -->
<Result>
<Success>true</Success>
<ResultMessage>Shipment 3245325 was successfully imported.</ResultMessage>
<Packages>
<Package>
<!-- If ProduceLabel = true. If LabelEncoding is LINKS, return links to all package labels. -->
<LabelLink>https://api.landmarkglobal.com/download/get-label.php?hid=5SalTlxR8JkpE%2FCW4HxGD0ghMOXXA%2F0rebjGm9EeaVlkG58%3D_5KAZZsOEn9E4p5Sy</LabelLink>
<!-- If ProduceLabel = true and LabelEncoding is not LINKS, return the encoded label image directly.-->
<LabelImages>
<LabelImage>23987B3KD0LK211AF......</LabelImage> <!-- Encoded label image string -->
</LabelImages>
<TrackingNumber>LTN329122N2</TrackingNumber>
<LandmarkTrackingNumber>LTN329122N2</LandmarkTrackingNumber>
<PackageReference>98233310</PackageReference> <!-- Will be sent back if provided in request -->
</Package>
</Packages>
</Result>
</ImportResponse>
Possible Errors
This table lists all errors that may be returned by the ImportRequest API endpoint. [Brackets] in the ErrorMessage are used to represent to the value passed for the related element. An example is provided when an ErrorMessage is variable.
Related Element(s) | ErrorMessage | Details/Action |
---|---|---|
General Errors | ||
User, API | User [username] does not have permissions to this API | |
Failure authenticating user | ||
User is not available. Check your username/password | ||
N/A | Unable to parse characters | Ensure that special characters are properly encoded and an encoding flag is included in your XML header. Example: <?xml version=""1.0"" encoding=""UTF-8""?> Example: <?xml version=""1.0"" encoding=""ISO-8859-1""?> |
<Login> Errors | ||
Login | Required element Login not found | Provide login credentials and verify the XML can be parsed |
Login name not provided | ||
User, ClientID | Request is missing client ID | |
Unable to authenticate the user credentials | ||
Client is inactive | ||
Client has been deactivated. Permission denied | ||
User [username] does not have permissions to client: [clientID] | ||
Unable to determine desired client for this user | If user has access to more than one client, the ClientID is required | |
Username, password | The username/password combination provided is invalid | |
The username/password combination provided is disabled | ||
Password not provided | ||
Missing Element Errors | ||
Varies by API | Format: Required element [Missing Element] not found Example: Required element Reference not found | Required elements for ImportRequest include Reference, ShipMethod, ShipTo, Name, Address1, City, State, PostalCode, Country, Packages, Package, Weight, Sku and Quantity |
Address Errors | ||
Name, Address1, City, State, PostalCode, Country | Format: Invalid address field: [invalid field] Example: Invalid address field: name | State: For Australia, Canada, Chile and US, please use 2-digit ISO code for the State value. For Hungary and Singapore, remove State value PostalCode: Confirm value is in the correct format for the destination country Country: Use 2-digit ISO country code |
Country required | ||
City, State, PostalCode | At least one of Postal, State, or City required | |
Example: Possible resolutions - Suggested Cities: EDMONDS, WOODWAY; Suggested Postal Codes: 6056, 98004, 98005, 98006 | If an address is invalid, possible resolutions are returned, including states, cities and/or postal codes. | |
City, State, Postal Code do not match | Address validation could not make a suggestion. Confirm city, state and postal code values | |
Errors Specific to ImportRequest API | ||
Reference | Invalid customer reference number | Reference numbers should be alphanumeric and 50 characters or less |
Reference or TrackingNumber is required in ReturnInformation-OutboundShipment, neither found | ||
ShipMethod | The client does not have access to the requested shipping service: [ShipMethod] | Confirm ShipMethod values with Integration Manager |
Invalid shipping service requested: [ShipMethod] | ||
LabelFormat | Example: Invalid label format [LabelFormat] requested. Support image types are pdf, jpg, gif, png, bmp, zpl. | Supported image types may change. |
LabelEncoding | Invalid label encoding [LabelEncoding]. With LabelFormat ZPL, must use label format ZPL or omit the tag. | |
AccountNumber | Invalid account number: [account number] | |
VendorName, VendorAddress1, VendorCity, VendorCountry | Example: No vendor name specified for [Reference], required if providing third party logistics | Error is returned if one of these elements is included but the others are blank VendorInformation is required for 3PLs (third-party logistics) |
Country | Client is not set up for delivery to [country name] | |
CartIntegration | This client is not enabled for cart integration, so the CartIntegration tag is not allowed. To enable cart/payment integration, contact IT support | |
Items | This shipment has no items. One or more is required to process. | At least one item is required for all orders |
Sku | Invalid sku provided for [item element number] | Max length is 64 characters. Use a unique, alphanumeric value and remove special characters other than: - _ |
The sku [sku name] is already stored as a standard, non-virtual sku, thus it cannot be considered a virtual sku now. | ||
Quantity | Invalid quantity provided for [sku name] in [item element number] | Requires integer value |
UnitPrice | Invalid unit price provided for [sku name] in [item element number] | Use real item value |
Description | Invalid description provided for [sku name] in [item element number] | Max length is 255 characters |
CountryOfOrigin | Invalid country of origin provided for [sku name] in [item element number] | Use 2-digit ISO country code |
InsuredValue | Please provide floating point value with a dot as decimal separator or integer e.g. 1.0 or 1 | |
Weight | Pieces of this weight ([package weight]) are not supported when shipping to [country name] | |
WeightUnit | Invalid or unsupported 'WeightUnit' provided on Package [element number] | Supported WeightUnits include LB, KG, G. Defaults to LB if not specified. |
Dimensions | Pieces with these dimensions [length x width x height] are not support when shipping to [additional error detail] | |
DimensionsUnit | Invalid or unsupported 'DimensionsUnit' provided on Package [element number] | Supported DimensionsUnits include IN, CM. Defaults to IN if not specified. |
Freight | Element FreightDetails is required for freight shipments | |
Invalid piece unit type provided: [piece unit] | ||
N/A | Error adding shipment to batch | |
Error loading shipping service validator | ||
The shipment reference [reference number] was already used by [duplicated LTN] on [date] | ||
The referenced original shipment does not exist or does not contain the same items as this shipment | May occur when reshipping | |
Failed to find the original outbound order with the information provided. Finding a match is required when using the 'retrieve_consignee_data_from_outbound' option. |