Overview
The NorthScope Web Services API exposes a single endpoint for developers to issue automated requests against the NorthScope system and receive information about the current state of the system. NorthScope exposes several Request Types (listed below), each accepting their own request information and returning their own request-specific response document. The endpoint is exposed at the same location as the NorthScope web application (will vary from environment to environment), in the services folder.
If your NorthScope installation is accessible at NorthScope.example.com, the endpoint would be located at: NorthScope.example.com/services/ActionCommand.svc/APIExecute
From a high level, the process flow is as follows:
Anatomy of a Request
NorthScope accepts requests in either JSON or XML formats. The Web Services API will respond to a request with a document in the same format as it was requested. For example, if you make a request with a JSON document you will receive a JSON response.
Independent of format, the HTTP POST body will contain the document outlining both which request is being called and any parameters being supplied for. All requests have a root element named NSRequest, which has two child elements: RequestName and RequestContent. The value of RequestName defines which action is being requested. The value of RequestContent will vary from request to request and will contain the request-specific parameters (if necessary). Some requests do not accept any parameters and in those cases RequestContent can either be omitted or left as an empty element.
All requests will return with a basic set of information and will include request-specific return information. Much like the request body, the response body will consist of a root element named NSResponse, which will always include two children elements: Timestamp and Success. Timestamp will indicate the time at which the NorthScope Web Services API responded to the request and Success will be a Boolean indicating whether the request itself succeed or not.
Obtaining a Token
Authentication to the NorthScope Data Service can be accomplished by one of two means: static or session-based tokens. By supporting these two methods, NorthScope can accommodate the authentication requirements for many integration partners.
Using a static token
To use a static token, you must have a user configured in NorthScope that contains the API Key (token). Go to System > Users & Security > Users and either add a new user or edit an existing user that will be used for the API. On the Properties tab of the user, set the ‘API Authentication Mode’ to “Static Token’ and click the Save icon in the toolbar. When the page refreshes a new ‘API Key’ property will be visible, click the ‘Generate API Key’ icon in the toolbar to generate the token id. Once this is set, pass this information along to the party you are integrating with so they can use this value when using the API.
Note: It is recommended that you add a unique user for this process rather than using an existing user as this process is session specific so more than one process cannot be using NorthScope at the same time.
Requesting a session token
The request to obtain a token is made using the GenerateSessionToken request. This is the only request in the NorthScope Web Services API that does not require authentication information in the HTTP headers. The purpose of this request it to accept authentication information to be used in subsequent API calls.
When calling the GenerateSessionToken process to create a new token for use in subsequent requests, these headers may be omitted (they will not be used if supplied).
The token created from the GenerateSessionToken process will be tied to both the specific user that generated it as well as the IP address of the machine that issued the request. One user can only be authenticated from one location at a time (including the website itself) which means if a user attempts to both authenticate via the NorthScope Web Services API and log in to NorthScope itself, the earlier authentication will be invalidated.
Parameter Name | Required | Value |
RequestName | Yes | GenerateSessionToken |
LoginEmail | Yes | The email address of the NorthScope User for whom the token is being generated. |
Password | Yes | The password to authenticate that user. |
GenerateSessionToken: JSON Example
POST /services/ActionCommand.svc/APIExecute HTTP/1.1 Host: NorthScope.example.com { "NSRequest": { "RequestName": "GenerateSessionToken", "RequestContent": { "LoginEmail": "TestAPIUser@NorthScope.example.com", "Password": "StrongPassword" } } }
GenerateSessionToken: XML Example
POST /services/ActionCommand.svc/APIExecute HTTP/1.1 Host: NorthScope.example.com <NSRequest> <RequestName>GenerateSessionToken</RequestName> <RequestContent> <LoginEmail>TestAPIUser@NorthScope.example.com</LoginEmail> <Password>StrongPassword</Password> </RequestContent> </NSRequest>
If the request was valid, a response will be sent as follows:
GenerateSessionToken Response: JSON Example
{ "NSResponse": { "Timestamp": "2018-09-20T15:21:23.425", "Success": "true", "ResponseContent": { "SessionToken": "00000000-0000-0000-0000-000000000000" } } }
GenerateSessionToken Response: XML Example
<NSResponse> <Timestamp>2018-09-20T15:21:23.425</Timestamp> <Success>true</Success> <ResponseContent> <SessionToken>00000000-0000-0000-0000-000000000000</SessionToken> </ResponseContent> </NSResponse>
If an invalid authentication request is made, the following result will be generated:
Example: Validation failure in JSON
{ "NSResponse": { "Timestamp": "2018-09-20T14:57:51.830", "Success": "false", "Error": "The login information that was provided was invalid." } }
Example: Validation failure in XML
<NSResponse> <Timestamp>2018-09-20T14:57:51.830</Timestamp> <Success>false</Success> <Error>The login information that was provided was invalid.</Error> </NSResponse>
Authenticating a Request
Except the request GenerateSessionToken, all other requests issued against the NorthScope Web Services API require authentication information. This information is supplied as headers in the HTTP request. The two headers required to be supplied are:
NSLogin: This will house the email address of the user being authenticated.
NSAPISession: This will house the token returned from a previous GenerateSessionToken request.
When calling the GenerateSessionToken process to create a new token for use in subsequent requests, these headers may be omitted (they will not be used if supplied).
The token created from the GenerateSessionToken process will be tied to both the specific user that generated it as well as the IP address of the machine that issued the request. One user can only be authenticated from one location at a time (including the website itself) which means if a user attempts to both authenticate via the NorthScope Web Services API and log in to NorthScope itself, the earlier authentication will be invalidated.
In the event the incorrect information is supplied, either when generating a new session token or when using a previously fetched token, you will receive an error from the web service of the following structure:
Example: Validation failure in JSON
{ "NSResponse": { "Timestamp": "2018-09-20T14:57:51.830", "Success": "false", "Error": "The login information that was provided was invalid." } }
Example: Validation failure in XML
<NSResponse> <Timestamp>2018-09-20T14:57:51.830</Timestamp> <Success>false</Success> <Error>The login information that was provided was invalid.</Error> </NSResponse>
Using a Static or Session token to make subsequent requests
Once you have generated an API Session Token or are assigned a static token, you can then supply it, along with the login email, in subsequent requests like so:
POST /services/ActionCommand.svc/APIExecute HTTP/1.1 Host: NorthScope.example.com NSLogin: TestAPIUser@NorthScope.example.com NSAPISession: 00000000-0000-0000-0000-000000000000 <NSRequest> <RequestName>ListCompanies</RequestName> </NSRequest>
Testing via Postman
Testing web service request code can be tricky.
It’s recommended you use a tool like Postman to get started sending web service requests.
In this document, header
How to test your first command
Please refer to the screenshot of Postman below. There’s nothing special about Postman, except that it’s a handy tool. But please ensure all the information listed below is
Part 1. Obtain a token
Referencing the two screenshots below, set the following information
1. Set the URL of the web service request
2. Set the request type to POST
3. Set the message format to Text
4. Enter the login request XML into the bottom left pane.
5. Verify in the headers tab that no other other headers have been set, other than those shown in the screenshot below
6. Click the send button to issue the request. The pane in the bottom right should show <Success>true</Success> and have a valid session token you can use for step 2.
Part 2. Send a request for data
1. Modify the bottom left pane to use the ListCompanies request XML.
2. In the headers tab, add a header for NSLogin. Set this to equal the email address used in part 1
3. Add another header for NSAPISession. Set this to equal the token retrieved from part 1.
Click the send button to issue the ListCompanies request. If the system is working properly, you will see a response in the lower right pane with a list of companies from the instance of NorthScope.
Now you’re able to test any of the web service requests listed below.
Available Requests
The NorthScope Web Services API exposes the following requests to perform automated functionality within the NorthScope system.
ListCompanies
This request will provide a list of NorthScope companies your user has access to along with the numeric identifier, DataEntityCompanySK, which may be required by other API requests. This information is not likely to change so it usually would only need to be called once (to fetch and store known companies).
Accepted Information
This request accepts no parameters, the RequestContent node could be omitted entirely (or left empty).
Example Requests
POST /services/ActionCommand.svc/APIExecute HTTP/1.1 Host: NorthScope.example.com NSLogin: TestAPIUser@NorthScope.example.com NSAPISession: 00000000-0000-0000-0000-000000000000 { "NSRequest": { "RequestName": "ListCompanies" } }
POST /services/ActionCommand.svc/APIExecute HTTP/1.1 Host: NorthScope.example.com NSLogin: TestAPIUser@NorthScope.example.com NSAPISession: 00000000-0000-0000-0000-000000000000 <NSRequest> <RequestName>ListCompanies</RequestName> </NSRequest>
Example Responses
{ "NSResponse": { "Timestamp": "2018-09-20T15:58:07.367", "Success": "true", "Companies": { "Company": [ { "DataEntityCompanySK": "1", "CompanyID": "WESTTEST", "CompanyName": "West Coast Testing Company" }, { "DataEntityCompanySK": "2", "CompanyID": "EASTTEST", "CompanyName": "East Coast Testing Company" } ] } } } }
<NSResponse> <Timestamp>2018-09-20T15:58:07.367</Timestamp> <Success>true</Success> <Companies> <Company> <DataEntityCompanySK>1</DataEntityCompanySK> <CompanyID>WESTTEST</CompanyID> <CompanyName>West Coast Testing Company</CompanyName> </Company> <Company> <DataEntityCompanySK>2</DataEntityCompanySK> <CompanyID>EASTTEST</CompanyID> <CompanyName>East Coast Testing Company</CompanyName> </Company> </Companies> </NSResponse>
ListSalesOrders
This request will generate a list of Sales Orders in a given NorthScope company that match the supplied filtering criteria. Except for the DataEntityCompanySK, all criteria are not required, and you could provide multiple of any other criteria. The Sales Orders returned must match any of the provided criteria of a type. For instance, if you supply criteria of multiple sites and multiple order date ranges, any sales order that both matches one of the provided sites and one of the provided ranges will be returned.
Accepted Information
Parameter Name | Required | Comment |
DataEntityCompanySK | Yes | The identifier for the company from which to pull Sales Orders. |
Status | No | The desired status for returned Sales Orders. Available values are: New, Released, In Process, Staging, Loading, Shipped, Approved, Ready To Post, Posted, or Void. |
OrderDateFrom | No | The lower bound for an acceptable date range for Sales Orders’ Order Date, inclusive. |
OrderDateTo | No | The upper bound for an acceptable date range for Sales Orders’ Order Date, inclusive. |
ScheduledShipDateFrom | No | The lower bound for an acceptable date range for Sales Orders’ Scheduled Ship Date, inclusive. |
ScheduledShipDateTo | No | The upper bound for an acceptable date range for Sales Orders’ Scheduled Ship Date, inclusive. |
LineItemSite | No | The desired Site for any Sales Orders’ Line Items. If this is provided the returned Line Items may not reflect all items on a returned Sales Order, if it has items that span Sites. |
LineItemCarrier | No | The desired Carrier for any Sales Orders’ Line Items. If this is provided the returned Line Items may not reflect all items on a returned Sales Order, if it has items that span Carriers. |
LoadID | No | The desired LoadID’s for any Sales Orders’ Line Items. If this is provided the returned Line Items may not reflect all items on a returned Sales Order, if it has items that span Loads. |
Example Requests
POST /services/ActionCommand.svc/APIExecute HTTP/1.1 Host: NorthScope.example.com NSLogin: TestAPIUser@NorthScope.example.com NSAPISession: 00000000-0000-0000-0000-000000000000 { "NSRequest": { "RequestName": "ListSalesOrders", "RequestContent": { "DataEntityCompanySK": "1", "Statuses": { "Status": [ "New", "Released" ] }, "OrderDateRanges": { "OrderDateRange": [ { "OrderDateTo": "2016-01-01" }, { "OrderDateFrom": "2017-01-01", "OrderDateTo": "2018-01-01" }, { "OrderDateFrom": "2019-01-01" } ] }, "ScheduledShipDateRanges": { "ScheduledShipDateRange": [ { "ScheduledShipDateTo": "2016-01-01" }, { "ScheduledShipDateFrom": "2017-01-01", "ScheduledShipDateTo": "2018-01-01" }, { "ScheduledShipDateFrom": "2019-01-01" } ] }, "LineItemSites": { "LineItemSite": [ "PRIMARY", "SECONDARY" ] }, "LineItemCarriers": { "LineItemCarrier": [ "Our Truck", "3rd Party" ] }, "LoadIDs": { "LoadID": [ "12345", "54321" ] } } } }
POST /services/ActionCommand.svc/APIExecute HTTP/1.1 Host: NorthScope.example.com NSLogin: TestAPIUser@NorthScope.example.com NSAPISession: 00000000-0000-0000-0000-000000000000 <NSRequest> <RequestName>ListSalesOrders</RequestName> <RequestContent> <DataEntityCompanySK>1</DataEntityCompanySK> <Statuses> <Status>New</Status> <Status>Released</Status> </Statuses> <OrderDateRanges> <OrderDateRange> <OrderDateTo>2016-01-01</OrderDateTo> </OrderDateRange> <OrderDateRange> <OrderDateFrom>2017-01-01</OrderDateFrom> <OrderDateTo>2018-01-01</OrderDateTo> </OrderDateRange> <OrderDateRange> <OrderDateFrom>2019-01-01</OrderDateFrom> </OrderDateRange> </OrderDateRanges> <ScheduledShipDateRanges> <ScheduledShipDateRange> <ScheduledShipDateTo>2016-01-01</ScheduledShipDateTo> </ScheduledShipDateRange> <ScheduledShipDateRange> <ScheduledShipDateFrom>2017-01-01</ScheduledShipDateFrom> <ScheduledShipDateTo>2018-01-01</ScheduledShipDateTo> </ScheduledShipDateRange> <ScheduledShipDateRange> <ScheduledShipDateFrom>2019-01-01</ScheduledShipDateFrom> </ScheduledShipDateRange> </ScheduledShipDateRanges> <LineItemSites> <LineItemSite>PRIMARY</LineItemSite> <LineItemSite>SECONDARY</LineItemSite> </LineItemSites> <LineItemCarriers> <LineItemCarrier>Our Truck</LineItemCarrier> <LineItemCarrier>3rd Party</LineItemCarrier> </LineItemCarriers> <LoadIDs> <LoadID>12345</LoadID> <LoadID>54321</LoadID> </LoadIDs> </RequestContent> </NSRequest>
Example Responses
{ "NSResponse": { "Timestamp": "2018-09-21T09:30:35.137", "Success": "true", "SalesOrders": { "SalesOrder": [ { "OrderHeaderSK": "1", "OrderID": "ORD180920001", "OrderStatus": "New", "Customer": "TESTCUST", "OrderDate": "2018-09-21T00:00:00", "ScheduledShipDate": "2018-09-21T00:00:00", "ScheduledDeliveryDate": "2018-09-21T00:00:00", "LineItems": { "LineItem": { "OrderItemSK": "1", "Site": "PRIMARY", "ItemSort": "1", "ItemID": "ITEM1", "OrderedUnits": "5.00000", "AllocatedUnits": "0.00000", "UnitsUOM": "Case", "OrderedWeight": "113.40000", "AllocatedWeight": "0.00000", "WeightUOM": "kg", "PriceOption": "Units", "ItemPrice": "3.00000", "LoadID": "54321" } } }, { "OrderHeaderSK": "2", "OrderID": "ORD180920002", "OrderStatus": "New", "Customer": "TESTCUST", "OrderDate": "2018-09-21T00:00:00", "ScheduledShipDate": "2018-09-21T00:00:00", "ScheduledDeliveryDate": "2018-09-21T00:00:00", "LineItems": { "LineItem": [ { "OrderItemSK": "2", "Site": "SECONDARY", "ItemSort": "1", "ItemID": "ITEM1", "OrderedUnits": "5.00000", "AllocatedUnits": "0.00000", "UnitsUOM": "Case", "OrderedWeight": "113.40000", "AllocatedWeight": "0.00000", "WeightUOM": "kg", "PriceOption": "Units", "ItemPrice": "2.00000", "Carrier": "Our Truck", "LoadID": "12345" }, { "OrderItemSK": "3", "Site": "SECONDARY", "ItemSort": "2", "ItemID": "ITEM2", "OrderedUnits": "5.00000", "AllocatedUnits": "0.00000", "UnitsUOM": "Case", "OrderedWeight": "113.40000", "AllocatedWeight": "0.00000", "WeightUOM": "kg", "PriceOption": "Units", "ItemPrice": "3.00000", "Carrier": "Our Truck", "LoadID": "12345" } ] } } ] } } }
<NSResponse> <Timestamp>2018-09-21T09:30:35.137</Timestamp> <Success>true</Success> <SalesOrders> <SalesOrder> <OrderHeaderSK>1</OrderHeaderSK> <OrderID>ORD180920001</OrderID> <OrderStatus>New</OrderStatus> <Customer>TESTCUST</Customer> <OrderDate>2018-09-21T00:00:00</OrderDate> <ScheduledShipDate>2018-09-21T00:00:00</ScheduledShipDate> <ScheduledDeliveryDate>2018-09-21T00:00:00</ScheduledDeliveryDate> <LineItems> <LineItem> <OrderItemSK>1</OrderItemSK> <Site>PRIMARY</Site> <ItemSort>1</ItemSort> <ItemID>ITEM1</ItemID> <OrderedUnits>5.00000</OrderedUnits> <AllocatedUnits>0.00000</AllocatedUnits> <UnitsUOM>Case</UnitsUOM> <OrderedWeight>113.40000</OrderedWeight> <AllocatedWeight>0.00000</AllocatedWeight> <WeightUOM>kg</WeightUOM> <PriceOption>Units</PriceOption> <ItemPrice>3.00000</ItemPrice> <LoadID>54321</LoadID> </LineItem> </LineItems> </SalesOrder> <SalesOrder> <OrderHeaderSK>2</OrderHeaderSK> <OrderID>ORD180920002</OrderID> <OrderStatus>New</OrderStatus> <Customer>TESTCUST</Customer> <OrderDate>2018-09-21T00:00:00</OrderDate> <ScheduledShipDate>2018-09-21T00:00:00</ScheduledShipDate> <ScheduledDeliveryDate>2018-09-21T00:00:00</ScheduledDeliveryDate> <LineItems> <LineItem> <OrderItemSK>2</OrderItemSK> <Site>SECONDARY</Site> <ItemSort>1</ItemSort> <ItemID>ITEM1</ItemID> <OrderedUnits>5.00000</OrderedUnits> <AllocatedUnits>0.00000</AllocatedUnits> <UnitsUOM>Case</UnitsUOM> <OrderedWeight>113.40000</OrderedWeight> <AllocatedWeight>0.00000</AllocatedWeight> <WeightUOM>kg</WeightUOM> <PriceOption>Units</PriceOption> <ItemPrice>2.00000</ItemPrice> <Carrier>Our Truck</Carrier> <LoadID>12345</LoadID> </LineItem> <LineItem> <OrderItemSK>3</OrderItemSK> <Site>SECONDARY</Site> <ItemSort>2</ItemSort> <ItemID>ITEM2</ItemID> <OrderedUnits>5.00000</OrderedUnits> <AllocatedUnits>0.00000</AllocatedUnits> <UnitsUOM>Case</UnitsUOM> <OrderedWeight>113.40000</OrderedWeight> <AllocatedWeight>0.00000</AllocatedWeight> <WeightUOM>kg</WeightUOM> <PriceOption>Units</PriceOption> <ItemPrice>3.00000</ItemPrice> <Carrier>Our Truck</Carrier> <LoadID>12345</LoadID> </LineItem> </LineItems> </SalesOrder> </SalesOrders> </NSResponse>
ListInventoryLots
This request will generate a list of Inventory Lots in a given NorthScope company that match the supplied filtering criteria. Except for the DataEntityCompanySK, all criteria are not required, and you could provide multiple of any other criteria. The Lots returned must match any of the provided criteria of a type. For instance, if you supply criteria of multiple sites and multiple items, any Lot that both matches one of the provided sites and one of the provided items will be returned. Any empty element can be included to indicate filtering on a value being not set.
Accepted Information
Parameter Name | Required | Comment |
DataEntityCompanySK | Yes | The identifier for the company from which to pull Inventory Lots. |
Item | No | The desired ItemID for the Inventory Lot. |
Site | No | The site in which the Inventory Lot resides. |
ProductionLot | No | The Production Lot ID for the desired Inventory Lot. Can supply an empty value to indicate filtering for lots where this is not defined. |
WarehouseLot | No | The Warehouse Lot ID for the desired Inventory Lot. Can supply an empty value to indicate filtering for lots where this is not defined. |
Owner | No | The Owner Name of the desired Lot. |
Example Requests
POST /services/ActionCommand.svc/APIExecute HTTP/1.1 Host: NorthScope.example.com NSLogin: TestAPIUser@NorthScope.example.com NSAPISession: 00000000-0000-0000-0000-000000000000 { "NSRequest": { "RequestName": "ListInventoryLots", "RequestContent": { "DataEntityCompanySK": "1", "Items": { "Item": [ "ITEM1", "ITEM2" ] }, "Sites": { "Site": [ "PRIMARY", "SECONDARY" ] }, "ProductionLots": { "ProductionLot": [ "", "LOT1" ] }, "WarehouseLots": { "WarehouseLot": [ "", "WHLOT1" ] }, "Owners": { "Owner": "Default Owner" } } } }
POST /services/ActionCommand.svc/APIExecute HTTP/1.1 Host: NorthScope.example.com NSLogin: TestAPIUser@NorthScope.example.com NSAPISession: 00000000-0000-0000-0000-000000000000 <NSRequest> <RequestName>ListInventoryLots</RequestName> <RequestContent> <DataEntityCompanySK>1</DataEntityCompanySK> <Items> <Item>ITEM1</Item> <Item>ITEM2</Item> </Items> <Sites> <Site>PRIMARY</Site> <Site>SECONDARY</Site> </Sites> <ProductionLots> <ProductionLot /> <ProductionLot>LOT1</ProductionLot> </ProductionLots> <WarehouseLots> <WarehouseLot /> <WarehouseLot>WHLOT1</WarehouseLot> </WarehouseLots> <Owners> <Owner>Default Owner</Owner> </Owners> </RequestContent> </NSRequest>
Example Responses
{ "NSResponse": { "Timestamp": "2018-09-21T10:20:41.636", "Success": "true", "InventoryLots": { "InventoryLot": [ { "LotSK": "1", "LotStatus": "Open", "ItemID": "ITEM1", "Site": "PRIMARY", "ProductionLot": "LOT1", "WarehouseLot": "WHLOT1", "Owner": "Default Owner", "OnHandUnits": "1000.00000", "AllocatedUnits": "0.00000", "HoldUnits": "0.00000", "AvailableUnits": "1000.00000", "UnitsUOM": "Case", "OnHandWeight": "22680.00000", "AllocatedWeight": "0.00000", "HoldWeight": "0.00000", "AvailableWeight": "22680.00000", "WeightUOM": "kg", "ActualCost": "0.00000", "MarketCost": "0.00000", "StandardCost": "0.00000" }, { "LotSK": "2", "LotStatus": "Open", "ItemID": "ITEM2", "Site": "SECONDARY", "Owner": "Default Owner", "OnHandUnits": "1000.00000", "AllocatedUnits": "0.00000", "HoldUnits": "0.00000", "AvailableUnits": "1000.00000", "UnitsUOM": "Case", "OnHandWeight": "22680.00000", "AllocatedWeight": "0.00000", "HoldWeight": "0.00000", "AvailableWeight": "22680.00000", "WeightUOM": "kg", "ActualCost": "0.00000", "MarketCost": "0.00000", "StandardCost": "0.00000" } ] } } }
<NSResponse> <Timestamp>2018-09-21T10:20:41.636</Timestamp> <Success>true</Success> <InventoryLots> <InventoryLot> <LotSK>1</LotSK> <LotStatus>Open</LotStatus> <ItemID>ITEM1</ItemID> <Site>PRIMARY</Site> <ProductionLot>LOT1</ProductionLot> <WarehouseLot>WHLOT1</WarehouseLot> <Owner>Default Owner</Owner> <OnHandUnits>1000.00000</OnHandUnits> <AllocatedUnits>0.00000</AllocatedUnits> <HoldUnits>0.00000</HoldUnits> <AvailableUnits>1000.00000</AvailableUnits> <UnitsUOM>Case</UnitsUOM> <OnHandWeight>22680.00000</OnHandWeight> <AllocatedWeight>0.00000</AllocatedWeight> <HoldWeight>0.00000</HoldWeight> <AvailableWeight>22680.00000</AvailableWeight> <WeightUOM>kg</WeightUOM> <ActualCost>0.00000</ActualCost> <MarketCost>0.00000</MarketCost> <StandardCost>0.00000</StandardCost> </InventoryLot> <InventoryLot> <LotSK>2</LotSK> <LotStatus>Open</LotStatus> <ItemID>ITEM2</ItemID> <Site>SECONDARY</Site> <Owner>Default Owner</Owner> <OnHandUnits>1000.00000</OnHandUnits> <AllocatedUnits>0.00000</AllocatedUnits> <HoldUnits>0.00000</HoldUnits> <AvailableUnits>1000.00000</AvailableUnits> <UnitsUOM>Case</UnitsUOM> <OnHandWeight>22680.00000</OnHandWeight> <AllocatedWeight>0.00000</AllocatedWeight> <HoldWeight>0.00000</HoldWeight> <AvailableWeight>22680.00000</AvailableWeight> <WeightUOM>kg</WeightUOM> <ActualCost>0.00000</ActualCost> <MarketCost>0.00000</MarketCost> <StandardCost>0.00000</StandardCost> </InventoryLot> </InventoryLots> </NSResponse>
AllocateSalesOrders
This request will accept a list of allocations to perform, verify they are valid and then allocate the inventory from a given LotSK to a given OrderItemSK. Both LotSK and OrderItemSK can be retrieved from the ListInventoryLots and ListSalesOrders requests, respectively.
Accepted Information
Parameter Name | Required | Comment |
OrderItemSK | Yes | The identifier for the Sales Order Line Item being allocated. |
LotSK | Yes | The identifier for the Inventory Lot from which the inventory will be drawn. |
AllocateUnits | No | The number of Units (in the supplied Unit of Measure) to allocate. Not required if the item is managed by Weight only. |
UnitsUOM | No | The Unit of Measure ID for the units in which the inventory is being allocated. |
AllocateWeight | No | The amount of Weight (in the supplied Unit of Measure) to allocate. Not required if the item is managed by Units only. |
WeightUOM | No | The Unit of Measure ID for the weight in which the inventory is being allocated. |
JSON Example
POST /services/ActionCommand.svc/APIExecute HTTP/1.1 Host: NorthScope.example.com NSLogin: TestAPIUser@NorthScope.example.com NSAPISession: 00000000-0000-0000-0000-000000000000 { "NSRequest": { "RequestName": "AllocateSalesOrders", "RequestContent": { "Allocation": [ { "OrderItemSK": "100", "LotSK": "1", "AllocateUnits": "5", "UnitsUOM": "Case", "AllocateWeight": "113.4", "WeightUOM": "kg" }, { "OrderItemSK": "101", "LotSK": "1", "AllocateUnits": "5", "UnitsUOM": "Case", "AllocateWeight": "113.4", "WeightUOM": "kg" } ] } } }
XML Example
POST /services/ActionCommand.svc/APIExecute HTTP/1.1 Host: NorthScope.example.com NSLogin: TestAPIUser@NorthScope.example.com NSAPISession: 00000000-0000-0000-0000-000000000000 <NSRequest> <RequestName>AllocateSalesOrders</RequestName> <RequestContent> <Allocation> <OrderItemSK>100</OrderItemSK> <LotSK>1</LotSK> <AllocateUnits>5</AllocateUnits> <UnitsUOM>Case</UnitsUOM> <AllocateWeight>113.4</AllocateWeight> <WeightUOM>kg</WeightUOM> </Allocation> <Allocation> <OrderItemSK>101</OrderItemSK> <LotSK>1</LotSK> <AllocateUnits>5</AllocateUnits> <UnitsUOM>Case</UnitsUOM> <AllocateWeight>113.4</AllocateWeight> <WeightUOM>kg</WeightUOM> </Allocation> </RequestContent> </NSRequest>
Example Response
This request has no specific response, instead you would receive a generic success or failure with a timestamp and error (assuming the request failed).
InsertInboundIntegration
This request provides a way to leverage NorthScope’s existing mechanism for 3rd party integrations. Using the InsertInboundIntegration web request, data can be inserted into a NorthScope instance’s inbound queue.
Everything in the <Integ> </Integ> section is what will be placed into the inbound queue. For more information on the inbound queue and what to send there, see IM Adjustment (XML) for details. The example sends a fake transaction ‘TransactionABC’ of type ‘IMTransferXYZ’. To send a different kind of transaction to the inbound queue, simply replace the XML inside the <Integ> </Integ> section. For building XML to place inside the <Integ> </Integ> section, see IM Adjustment (XML).
Request Example
POST /services/ActionCommand.svc/APIExecute HTTP/1.1 Host: NorthScope.example.com NSLogin: TestAPIUser@NorthScope.example.com NSAPISession: 00000000-0000-0000-0000-000000000000 <NSRequest> <RequestName>InsertInboundIntegration</RequestName> <RequestContent> <InboundIntegration> <Created>2019-12-2</Created> <SourceSystem>NS Test</SourceSystem> <SourceTransactionID>TransactionABC</SourceTransactionID> <TransactionType>IMTransferXYZ</TransactionType> <Data> <TransactionHeader> <TransactionType>Adjustment</TransactionType> <TransactionClassID>Default</TransactionClassID> <TransactionID>A123456</TransactionID> <TransactionStatusName>Ready To Post</TransactionStatusName> <SiteID>ABC</SiteID> <TransactionDate>2017-12-19</TransactionDate> <ReasonCode /> <UserID>Integrated</UserID> <CompanyID>XYZ</CompanyID> <TransactionDetail> <ItemSort /> <ItemID>1234321</ItemID> <TransactionUnits>5.00000</TransactionUnits> <UnitsUOMID>CASE</UnitsUOMID> <TransactionWeight>150.5500</TransactionWeight> <WeightUOMID>LB</WeightUOMID> <Lot>18001</Lot> <Owner>NLP</Owner> </TransactionDetail> </TransactionHeader> </Data> </InboundIntegration> </RequestContent> </NSRequest>
Example Response
<NSResponse> <Timestamp>2019-12-02T14:15:11.539</Timestamp> <Success>true</Success> </NSResponse>
ListUOMSchedules
This request will retrieve a list of UOM schedules.
Accepted Information
Parameter Name | Required | Comment |
DataEntityCompanySK | Yes | The identifier for the company from which to pull sites. |
WhereClause | No | Filtering parameter for returned data. |
The WhereClause parameter enables only a selection of data to be sent back in the reply, based on filter criteria written with SQL syntax. Any of the UOM schedule properties can be referenced.
Example Request
<NSRequest> <RequestName>NorthPacificUOMScheduleMaster</RequestName> <RequestContent> <DataEntityCompanySK>1</DataEntityCompanySK> </RequestContent> </NSRequest>
Example Response
<NSResponse> <Timestamp>2019-12-02T14:15:10.148</Timestamp> <Success>true</Success> <ScheduleList> <Schedule> <ScheduleSK>1</ScheduleSK> <FromUOMID>Each</FromUOMID> <ToUOMID>Each</ToUOMID> <ConversionValue>1.00000</ConversionValue> </Schedule> <Schedule> <ScheduleSK>2</ScheduleSK> <FromUOMID>Each</FromUOMID> <ToUOMID>Bag</ToUOMID> <ConversionValue>1.00000</ConversionValue> </Schedule> <Schedule> <ScheduleSK>3</ScheduleSK> <FromUOMID>Bag</FromUOMID> <ToUOMID>kg</ToUOMID> <ConversionValue>18.14369</ConversionValue> </Schedule> </ScheduleList> </NSResponse>
ListSites
This request will retrieve a list of sites.
Accepted Information
Parameter Name | Required | Comment |
DataEntityCompanySK | Yes | The identifier for the company from which to pull sites. |
WhereClause | No | Filtering parameter for returned data. |
The WhereClause parameter enables only a selection of data to be sent back in the reply, based on filter criteria written with SQL syntax. Any of the site properties can be referenced.
Example Request
<NSRequest> <RequestName>ListSites</RequestName> <RequestContent> <DataEntityCompanySK>1</DataEntityCompanySK> <WhereClause>State = 'WA' OR SiteName LIKE '%a%'</WhereClause> </RequestContent> </NSRequest>
Note: JSON is not supported for this command.
Example Response
<NSResponse> <Timestamp>2019-12-02T10:00:10.405</Timestamp> <Success>true</Success> <SiteList> <Site> <SiteSK>1</SiteSK> <SiteID>ABC</SiteID> <SiteName>Site Name 1</SiteName> <CompanyID>Company ID 1</CompanyID> <DataEntityCompanySK>1</DataEntityCompanySK> <AddressLine1>1234 NE Street</AddressLine1> <AddressLine2 /> <City>Seattle</City> <State>WA</State> <Zip>99999</Zip> <Country>USA</Country> <Phone1>123-456-7890</Phone1> <Fax>123-456-7891</Fax> </Site> <Site> <SiteSK>2</SiteSK> <SiteID>ABD</SiteID> <SiteName>Site Name 2</SiteName> <CompanyID>Company ID 1</CompanyID> <DataEntityCompanySK>1</DataEntityCompanySK> <AddressLine1>1234 SE Street</AddressLine1> <AddressLine2 /> <City>Houston</City> <State>TX</State> <Zip>99999</Zip> <Country>USA</Country> <Phone1>123-000-7890</Phone1> <Fax>123-000-7891</Fax> </Site> </SiteList> </NSResponse>
ListSalesOrders
This request will retrieve a list of sales orders and sales order details.
Accepted Information
Parameter Name | Required | Comment |
DataEntityCompanySK | Yes | The identifier for the company from which to pull sites. |
WhereClause | No | Filtering parameter for returned data. |
The WhereClause parameter enables only a selection of data to be sent back in the reply, based on filter criteria written with SQL syntax. Any of the sales order (not detail) properties can be referenced.
Example Request
<NSRequest> <RequestName>NorthPacificSalesOrder</RequestName> <RequestContent> <DataEntityCompanySK>1</DataEntityCompanySK> <WhereClause>SiteID = '400'</WhereClause> </RequestContent> </NSRequest>
Note: JSON is not supported for this request.
Example Response
<NSResponse> <Timestamp>2019-12-02T14:15:06.265</Timestamp> <Success>true</Success> <SalesOrders> <SalesOrder> <CompanyID>Acme</CompanyID> <SiteID>123</SiteID> <OrderID>PO500</OrderID> <CustomerID>BrownCo</CustomerID> <CustomerSK>889</CustomerSK> <AddressID>BrownCoPPT1</AddressID> <ScheduledShipDate>2019-11-20T00:00:00</ScheduledShipDate> <ScheduledDeliveryDate>2019-11-29T00:00:00</ScheduledDeliveryDate> <CarrierName>Good Old Shipping Company</CarrierName> <OrderDate>2019-11-13T00:00:00</OrderDate> <ShipAddressSK>7878</ShipAddressSK> <OrderHeaderSK>9090</OrderHeaderSK> <OrderStatusSK>2</OrderStatusSK> <OrderTypeSK>2</OrderTypeSK> <OrderDetails> <OrderDetail> <OrderItemSK>400</OrderItemSK> <OrderHeaderSK>9090</OrderHeaderSK> <ItemID>8998</ItemID> <ManageItemsByEN>3</ManageItemsByEN> <WeightUOMID>Lbs</WeightUOMID> <UnitUOMID>Each</UnitUOMID> <ItemDescription>Pudding 6-10 Lbs. Fresh</ItemDescription> <OrderedUnits>22</OrderedUnits> <OrderedWeight>220</OrderedWeight> <ItemSort>2</ItemSort> </OrderDetail> <OrderDetail> <OrderItemSK>900</OrderItemSK> <OrderHeaderSK>9090</OrderHeaderSK> <ItemID>2359</ItemID> <ManageItemsByEN>3</ManageItemsByEN> <WeightUOMID>Lbs</WeightUOMID> <UnitUOMID>Case</UnitUOMID> <ItemDescription>Flakes Cereal #2</ItemDescription> <OrderedUnits>15.00000</OrderedUnits> <OrderedWeight>150.00000</OrderedWeight> <ItemSort>1</ItemSort> </OrderDetail> </OrderDetails> </SalesOrder> </SalesOrders> </NSResponse>
ListItems
This request will retrieve a list of items.
Accepted Information
Parameter Name | Required | Comment |
DataEntityCompanySK | Yes | The identifier for the company from which to pull sites. |
WhereClause | No | Filtering parameter for returned data. |
The WhereClause parameter enables only a selection of data to be sent back in the reply, based on filter criteria written with SQL syntax. Any of the Item properties can be referenced.
Example Request
<NSRequest> <RequestName>NorthPacificItemMaster</RequestName> <RequestContent> <DataEntityCompanySK>1</DataEntityCompanySK> </RequestContent> </NSRequest>
Note: JSON is not supported for this command.
Example Response
<NSResponse> <Timestamp>2019-12-02T14:15:04.574</Timestamp> <Success>true</Success> <ItemList> <Item> <ItemID>4010</ItemID> <ItemSK>1</ItemSK> <ItemDescription>A do-dad</ItemDescription> <CompanyID>Acme</CompanyID> <TrackMethodEN>3</TrackMethodEN> <ManageItemsByEN>3</ManageItemsByEN> <IsItemVariableWeight>1</IsItemVariableWeight> <ClassID>Wholesale</ClassID> <UnitsUOMID>Each</UnitsUOMID> <WeightUOMID>Lbs</WeightUOMID> <BaseUOMID>Lbs</BaseUOMID> <ExpirationDays>999</ExpirationDays> <ScheduleSK>58</ScheduleSK> <ShippingWeight>1</ShippingWeight> </Item> <Item> <ItemID>5050</ItemID> <ItemSK>2</ItemSK> <ItemDescription>A thingamajig</ItemDescription> <CompanyID>Acme</CompanyID> <TrackMethodEN>3</TrackMethodEN> <ManageItemsByEN>3</ManageItemsByEN> <IsItemVariableWeight>1</IsItemVariableWeight> <ClassID>Wholesale</ClassID> <UnitsUOMID>Each</UnitsUOMID> <WeightUOMID>Lbs</WeightUOMID> <BaseUOMID>Lbs</BaseUOMID> <ExpirationDays>999</ExpirationDays> <ScheduleSK>57</ScheduleSK> <ShippingWeight>0</ShippingWeight> </Item> </ItemList> </NSResponse>
ListCustomerAddresses
This request will retrieve a list of customer addresses.
Accepted Information
Parameter Name | Required | Comment |
DataEntityCompanySK | Yes | The identifier for the company from which to pull sites. |
WhereClause | No | Filtering parameter for returned data. |
The WhereClause parameter enables only a selection of data to be sent back in the reply, based on filter criteria written with SQL syntax. Any of the customer address properties can be referenced.
Example Request
<NSRequest> <RequestName>NorthPacificCustomer</RequestName> <RequestContent> <DataEntityCompanySK>1</DataEntityCompanySK> </RequestContent> </NSRequest>
Note: JSON is not supported for this web request.
Example Response
<NSResponse> <Timestamp>2019-12-02T14:15:07.058</Timestamp> <Success>true</Success> <CustomerShipToList> <CustomerShipTo> <CustomerSK>8001</CustomerSK> <CustomerID>CustomerID1</CustomerID> <CustomerName>Acme Company</CustomerName> <AddressID>ACMEADDR1</AddressID> <AddressName>Acme Building A</AddressName> <AddressLine1>1234 SE StreetName BLD A</AddressLine1> <AddressLine2 /> <City>Seattle</City> <State>WA</State> <Zip>98125</Zip> <Country>USA</Country> <AddressTypeEN>3</AddressTypeEN> <CompanyID>CompanyID</CompanyID> </CustomerShipTo> <CustomerShipTo> <CustomerSK>8001</CustomerSK> <CustomerID>CustomerID1</CustomerID> <CustomerName>Acme Company</CustomerName> <AddressID>ACMEADDR2</AddressID> <AddressName>Acme Building B</AddressName> <AddressLine1>1234 SE StreetName BLD A</AddressLine1> <AddressLine2 /> <City>Seattle</City> <State>WA</State> <Zip>98125</Zip> <Country>USA</Country> <AddressTypeEN>4</AddressTypeEN> <CompanyID>CompanyID</CompanyID> </CustomerShipTo> </CustomerShipToList> </NSResponse>