Basic Admin API Documentation


1. Connecting

The base url for the application is https://lps.insidedata.co.uk, this needs to be prefixed to all the API endpoints in the documentation below.

All of the API endpoints require headers to be set to authenticate the request. These are:

Headers

$headers = [
    'api-key' => '123-456-789',
    'content-type' => 'application/json'
];
                    

2. Testing Connection

To test everything is running correctly, you can ping the system by issuing a GET request to the following API endpoint

Request

/api/admin/application/connection/ping
                    
JSON

{
    "message": "You have successfully connected to the admin Ping API endpoint",
    "result": true
}
                    

If have any issues, you will get an error message back indicating what went wrong.
JSON

{
    "result": false,
    "error": "You are not authenticated to use this endpoint"
}
                    

JSON

{
    "result": false,
    "message": "The api key passed was not valid [2]"
}
                    



Lightning Specific API Documentation

1. Endpoints

There are four endpoint specific for Lightning Packaging. These are as follows. The format of the data sent and received from these endpoint types has not changed between POMs and ISD.


/api/admin/lps/ext/stock_feed
/api/admin/lps/ext/export
/api/admin/lps/ext/confirm/{id}/{order_number}
/api/admin/lps/ext/shipped_order
                    

2. Stock Feed

The stock feed endpoint /api/admin/lps/ext/stock_feed is used for updating ISD with the stock levels within the business. This is a POST request and includes the payload with the stock file.

For testing purposes, this is storing the data for later processing.

If everything goes well, you will get back a JSON object which shows the action was successful

JSON

{
    "result": true
}
                    

3. Export

The export endpoint /api/admin/lps/ext/export is used to pull orders from ISD down to Sage using a GET request. These are formatted in JSON and remain the same from the POMs data structure

4. Confim

The confirm endpoint /api/admin/lps/ext/confirm/{id}/{order_number} is used to confirm that an order has been successfully downloaded. The GET request needs to include the order number provided as part of the export request {id} along with the Sage order number {order_number}

If everything goes well, you will get back a JSON object which shows the action was successful

If there is an issues such as the order number isn't recognised, an appropriate error is generated

JSON

{
    "result": true
}
                

JSON

{
    "result": false,
    "error": "The order number was not found"
}
                

5. Shipped Order

The shipped order endpoint /api/admin/lps/ext/shipped_order is a POST endpoint which is used to notify ISD when an order is shipped.

JSON

{
    "result": true
}