InventoryLevel API
  • 21 Jun 2024
  • 3 Minutes to read
  • Contributors
  • Dark
    Light

InventoryLevel API

  • Dark
    Light

Article summary

The following details how to retrieve sku inventory information via an API request. Only applicable to clients using Landmark for fulfillment.

Overview

The protocol is based on XML data exchange with HTTP used as a transport. A non-validating parser is used and hence no internal or external DTD needs to be specified. The data must be well formed and all validation is handled at the application (not parser) level. Error handling will be done by always including the <Errors> container in the response. The Errors element will not be returned if no errors are found.

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/InventoryLevel.php

Encoding

Mercury uses UTF-8 for character encoding. If your system outputs in an encoding other than UTF-8, please include an encoding flag in your XML header. 

     Example: <?xml version="1.0" encoding="UTF-8"?>

     Example: <?xml version="1.0" encoding="ISO-8859-1"?>

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, orders will not be cancelled but errors will be reported when appropriate.

During a test API call, validation will be very basic, focusing on fields being required and passing sane values. Assuming the request passes the basic validation, responses are randomized. Some requests will succeed and some will fail with different error messages. This is done so that the programmer has an opportunity to see a wide variety of responses and can be prepared to handle many potential results.

InventoryLevelRequest

<?xml version="1.0"?>

<InventoryLevelRequest>

     <Login>

           <Username>demoapi</Username>

           <Password>demo123</Password>

     </Login>

     <Test>true</Test>

     <ClientID>65</ClientID>   <!-- Required if more than one client under user, otherwise Optional-->

     <Sku>K2034</Sku>   <!-- Optional; if left out, all SKUs are returned -->

     <Facility>AUS</Facility>   <!-- Optional; if left out, all Facilities are returned. Can pass by Id, Name, or ShortName -->

</InventoryLevelRequest>

InventoryLevelResponse

<?xml version="1.0"?>

<InventoryLevelResponse>

     <Facility>

          <Id>222</Id>

          <Name>Landmark AUS</Name>

          <ShortName>AUS</ShortName>

          <Item>

               <Sku>K2034</Sku>

               <OnHand>1000</OnHand>

               <Available>800</Available>

               <Reserve>50</Reserve>

               <Quarantine>20</Quarantine>

               <Allocated>130</Allocated>

               <Backorder>0</Backorder>

               <Sellable>815</Sellable>

               <SellableBuffer>10</SellableBuffer>

         </Item>

    </Facility>

    <Result>

         <Success>true</Success>

    </Result>

</InventoryLevelResponse>


Possible Errors

This table lists all errors that may be returned by the InventoryLevel 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)ErrorMessageDetails/Action
General Errors
User, APIUser [username] does not have permissions to this API
Failure authenticating user
User is not available. Check your username/password
N/AUnable to parse charactersEnsure 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
LoginRequired element Login not foundProvide 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 userIf user has access to more than one client, the ClientID is required
Username, passwordThe username/password combination provided is invalid
The username/password combination provided is disabled
Password not provided
Errors Specific to InventoryLevel API
ClientID, FacilityNo Landmark facilities are set up to handle fulfillment for [client name]
There are no facilities configured for fulfillment for this client
The selected facility does not handle fulfillment for this client

The client selected does not use inventory management
FacilityUnknown facility: [facility]Confirm facility with Integration Manager. Can pass by ID, Name, or ShortName
Facility: [facility] is not set up to support inventory for [client name]

Unknown sku: [sku]

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.