Included in this document:
Get a list of Stock sizes
Description
Get list of available stock sizes
Requests
Method: GET
Content Type: application/json
URL: https://api-docs.gosweetspot.com/docs/stock-sizes/get.html
Headers
access_key : your unique API key provided by GSS.
site_id : which site you are requesting action for.
Return format
A JSON array of Stock Size Model, where each object represents a stock size available to your user.Response
Request example
curl --location 'https://api.gosweetspot.com/api/stocksizes' \
--header 'access_key;' \
--header 'site_id;' \
--header 'Content-Type: application/json'
Response example
[
{
"PackageStockId": 5694,
"Name": "AusPost 200g Satchel",
"Height": 2.0000,
"Length": 35.0000,
"Width": 27.0000,
"Cubit": 0.001890,
"Type": "Satchel",
"Weight": 0.2000,
"Sort": 0,
"IsTrackPak": true,
"HeightAdjustable": false,
"Availability": "Entire_Group"
},
{
"PackageStockId": 6101,
"Name": "AusPost 3KG Satchel",
"Height": 3.0000,
"Length": 35.0000,
"Width": 27.0000,
"Cubit": 0.002835,
"Type": "Satchel",
"Weight": 3.0000,
"Sort": 0,
"IsTrackPak": true,
"HeightAdjustable": false,
"Availability": "Entire_Group"
},
{
"PackageStockId": 6073,
"Name": "Castle Max Pack",
"Height": 3.0000,
"Length": 45.0000,
"Width": 45.0000,
"Cubit": 0.006075,
"Type": "Satchel",
"Weight": 3.0000,
"Sort": 0,
"IsTrackPak": true,
"HeightAdjustable": false,
"Availability": "Entire_Group"
},
]
Create new Stock sizes
Description
This method is used to create new stock sizes or update an existing stock size.
Requests
Method: POST
Content Type: application/json
URL: https://api-docs.gosweetspot.com/docs/stock-sizes/post.html
Headers
access_key : your unique API key provided by GSS.
site_id : which site you are requesting action for.
Parameters
A list of Stock Size Model should be sent in JSON format.
Return format
A JSON object with the created shipment details.
Request example
curl --location --request POST 'https://api.gosweetspot.com/api/stocksizes' \
--header 'access_key;' \
--header 'site_id;' \
--header 'Content-Type: application/json' \
--data '{
"Name": "Test",
"Height": 11,
"Length": 12,
"Width": 13,
"Type": "BOX",
"Weight": 5.0,
"Sort": 1,
"Availability": "This_Site_Only"
}'
Response example
{
"PackageStockId": 159880,
"Name": "Test",
"Height": 11,
"Length": 12,
"Width": 13,
"Cubic": 0.002,
"Type": "BOX",
"Weight": 5,
"Sort": 1,
"IsTrackPak": false,
"HeightAdjustable": true,
"Availability": "This_Site_Only"
}
Delete Stock sizes
Description
Delete a stock size from the system.
Requests
Method: DELETE
Content Type: application/json
URL: https://api-docs.gosweetspot.com/docs/stock-sizes/delete.html
Headers
access_key : your unique API key provided by GSS.
site_id : which site you are requesting action for.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | A comma seperated list of stock size ids to be deleted. |
Return format
A JSON array of key/value pair, with stock size id and outcome
Valid outcome states are:
- Invalid Package Stock.
- Cannot be deleted.
- Deleted.
Request example
curl --location --request DELETE 'http://api.gosweetspot.com/api/stocksizes?id=159872%2C159873%2C159874' \
--header 'access_key;' \
--header 'site_id;' \
--header 'Content-Type: application/json' \
--data ''
Response example
{
"159872": "Deleted",
"159873": "Deleted",
"159874": "Deleted"
}