e.g. application/json
Sortly API (1.0.0)
Sortly API can be used to manage items and folders in your Sortly account. Our API is organized around REST. It returns JSON-encoded responses and uses standard HTTP response codes. This API is only available on Sortly Enterprise Plan subscription.
NOTE:
This feature is currently under beta. Please expect minor updates in the near future.
Contact dev-support@sortly.com for developer support.
Authentication to the API is performed via OAuth 2.0. Under this, you must provide your secret key as the Bearer token in the Authorization header. All requests must be made over HTTPS.
Visit: https://app.sortly.com/public-api to obtain an API access key pair for your account.
Use the secret key as the
Bearertoken.
Sortly API calls are rate limited. You can make 1000 requests per API in a 15-minute window. Rate limit information in available in the HTTP headers of the API response.
| Header | Description |
|---|---|
Sortly-Rate-Limit-Max | Maximum number of requests allowed within the 15-minute window |
Sortly-Rate-Limit-Remaining | Number of requests remaining in the current 15-minute window |
Sortly-Rate-Limit-Reset | The time at which the current rate limit window resets.(in seconds) |
Once you go over the rate limit you will receive a HTTP 429 Too Many Requests error response.
QR OR barcode type.
Allowed values: [ org.gs1.UPC-E, org.iso.Code39, org.iso.Code39Mod43, org.gs1.EAN-13, org.gs1.EAN-8, com.intermec.Code93, org.iso.Code128, org.iso.PDF417, org.iso.Aztec, org.iso.QRCode, org.ansi.Interleaved2of5, org.iso.DataMatrix, com.sortly.textEntry ]
QR OR barcode type.
Allowed values: [ org.gs1.UPC-E, org.iso.Code39, org.iso.Code39Mod43, org.gs1.EAN-13, org.gs1.EAN-8, com.intermec.Code93, org.iso.Code128, org.iso.PDF417, org.iso.Aztec, org.iso.QRCode, org.ansi.Interleaved2of5, org.iso.DataMatrix, com.sortly.textEntry ]
ID of option of attribute in Item Variant Group for Item. Required if populated item_group_id. See Item Groups
ID Item Variant Group for Item. Required if populated option_value_ids. See Item Groups
- Mock serverhttps://developer.sortly.com/_mock/api/v1/items
- https://api.sortly.co/api/v1/items
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://developer.sortly.com/_mock/api/v1/items \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Enter Secret Key Here>' \
-H 'Content-Type: application/json' \
-d '{
"name": "My New Folder",
"type": "folder"
}'{ "id": 2, "name": "itemName", "price": 10, "quantity": 1, "min_quantity": 1, "notes": "newNotes", "type": "item", "parent_id": 1, "created_at": "2019-01-22T18:31:42", "updated_at": "2019-01-22T18:31:42", "sid": "S01QSR0001", "label_url": "AB123AB45", "label_url_type": "org.iso.Code128", "label_url_extra": "9780066620992", "label_url_extra_type": "org.gs1.EAN-13", "tag_names": [ "T1", "T2" ], "tags": [ { … }, { … } ], "photos": [ { … }, { … } ], "custom_attribute_values": [ { … } ], "measured_quantity": { "value": 1, "type": "weight", "name": "lbs", "scale": 4 }, "option_value_ids": [ "a03faad7-5689-4c6d-aee1-f282052fad8d", "b527720d-19ec-478c-8a06-ac11713f47a1" ], "item_group_id": "309ec621-bcf1-4567-922f-f64a52900fff" }
- Mock serverhttps://developer.sortly.com/_mock/api/v1/items
- https://api.sortly.co/api/v1/items
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://developer.sortly.com/_mock/api/v1/items?per_page=2&page=1&folder_id=1&include=custom_attributes%2Cphotos%2Coptions' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Enter Secret Key Here>'{ "data": [ { … }, { … } ], "meta": { "pagination": { … } } }
- Mock serverhttps://developer.sortly.com/_mock/api/v1/items/recent
- https://api.sortly.co/api/v1/items/recent
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://developer.sortly.com/_mock/api/v1/items/recent?per_page=2&page=1&updated_since=1559120004&include=custom_attributes%2Cphotos%2Coptions' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Enter Secret Key Here>'No content- Mock serverhttps://developer.sortly.com/_mock/api/v1/items/{item_id}
- https://api.sortly.co/api/v1/items/{item_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
https://developer.sortly.com/_mock/api/v1/items/3 \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Enter Secret Key Here>'- Mock serverhttps://developer.sortly.com/_mock/api/v1/items/{item_id}
- https://api.sortly.co/api/v1/items/{item_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://developer.sortly.com/_mock/api/v1/items/1?include=custom_attributes%2Cphotos%2Coptions' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Enter Secret Key Here>'{ "data": { "id": 1, "name": "itemName", "price": 10, "quantity": 1, "min_quantity": 1, "notes": "newNotes", "type": "folder", "parent_id": 1, "created_at": "2019-01-22T18:31:42", "updated_at": "2019-01-22T18:31:42", "sid": "S01QSR0001", "label_url": "AB123AB45", "label_url_type": "org.iso.Code128", "label_url_extra": "9780066620992", "label_url_extra_type": "org.gs1.EAN-13", "tag_names": [ … ], "tags": [ … ], "photos": [ … ], "custom_attribute_values": [ … ], "option_value_ids": [ … ], "item_group_id": "309ec621-bcf1-4567-922f-f64a52900fff" } }
QR OR barcode type.
Allowed values: [ org.gs1.UPC-E, org.iso.Code39, org.iso.Code39Mod43, org.gs1.EAN-13, org.gs1.EAN-8, com.intermec.Code93, org.iso.Code128, org.iso.PDF417, org.iso.Aztec, org.iso.QRCode, org.ansi.Interleaved2of5, org.iso.DataMatrix, com.sortly.textEntry ]
QR OR barcode type.
Allowed values: [ org.gs1.UPC-E, org.iso.Code39, org.iso.Code39Mod43, org.gs1.EAN-13, org.gs1.EAN-8, com.intermec.Code93, org.iso.Code128, org.iso.PDF417, org.iso.Aztec, org.iso.QRCode, org.ansi.Interleaved2of5, org.iso.DataMatrix, com.sortly.textEntry ]
ID of option of attribute in Item Variant Group for Item. Required if populated item_group_id. See Item Groups
ID Item Variant Group for Item. Required if populated option_value_ids. See Item Groups
- Mock serverhttps://developer.sortly.com/_mock/api/v1/items/{item_id}
- https://api.sortly.co/api/v1/items/{item_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
https://developer.sortly.com/_mock/api/v1/items/1 \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Enter Secret Key Here>' \
-H 'Content-Type: application/json' \
-d '{
"name": "itemName",
"notes": "newNotes",
"price": 10,
"quantity": 1,
"min_quantity": 1,
"parent_id": 1,
"label_url": "AB123AB45",
"label_url_type": "org.iso.Code128",
"label_url_extra": "9780066620992",
"label_url_extra_type": "org.gs1.EAN-13",
"tags": [
{
"name": "Tag1"
},
{
"name": "Tag2"
}
],
"custom_attribute_values": [
{
"custom_attribute_id": 2,
"custom_attribute_name": "Custom Field",
"value": "newValue"
}
],
"photo_ids": [
1
],
"option_value_ids": [
"a03faad7-5689-4c6d-aee1-f282052fad8d",
"b527720d-14rc-478c-8a06-ac11713f47a1"
]
}'{}
- Mock serverhttps://developer.sortly.com/_mock/api/v1/items/{item_id}/move
- https://api.sortly.co/api/v1/items/{item_id}/move
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://developer.sortly.com/_mock/api/v1/items/2/move \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Enter Secret Key Here>' \
-H 'Content-Type: application/json' \
-d '{
"quantity": 2,
"folder_id": 1,
"leave_zero_quantity": false
}'{ "data": { "id": 1, "name": "with photo id2", "price": 10, "quantity": 2, "notes": "some notes", "parent_id": 2, "sid": "S000XT3976", "tag_names": [ … ], "tags": [ … ], "type": "item", "created_at": "2019-02-14T16:49:55.006Z", "updated_at": "2019-02-15T11:11:11.167Z" } }
- Mock serverhttps://developer.sortly.com/_mock/api/v1/items/{item_id}/copy
- https://api.sortly.co/api/v1/items/{item_id}/copy
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://developer.sortly.com/_mock/api/v1/items/2/copy \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Enter Secret Key Here>' \
-H 'Content-Type: application/json' \
-d '{
"quantity": 2,
"folder_id": 1,
"include_subtree": true,
"new_sid": true
}'{ "data": { "id": 3, "name": "itemName", "price": 10, "quantity": 1, "notes": "newNotes", "type": "folder", "parent_id": 1, "created_at": "2019-01-22T18:31:42", "updated_at": "2019-01-22T18:31:42", "sid": "S01QSR0002", "tag_names": [ … ], "tags": [ … ], "photos": [ … ], "custom_attribute_values": [ … ] } }
The type of thing to search for. Allowed values are "all", "item", and "folder" with "all" being the default
ID of related Item Group. See Item Groups
Array of comma-separated numeric folder ids in which to search
Array of objects with the key being the field to sort by (only name is currently supported) and the value being the direction. Acceptable sort directions are "asc" and "desc". Multiple sort objects are allowed.
Page number | Defaults to 1 (the same body should be passed to the next page url for pagination)
- Mock serverhttps://developer.sortly.com/_mock/api/v1/items/search
- https://api.sortly.co/api/v1/items/search
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://developer.sortly.com/_mock/api/v1/items/search?name=string&type=string&item_group_id=string&folder_ids=%5B1234%2C+5678%5D&sort=%5B{+%22name%22%3A+%22asc%22+}%5D&per_page=2&page=1&include=custom_attributes%2Cphotos%2Coptions' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Enter Secret Key Here>' \
-H 'Content-Type: application/json' \
-d '{
"name": "itemName",
"folder_ids": [
123456,
7890123
],
"sort": [
{
"name": "asc"
}
]
}'{ "data": [ { … }, { … } ], "meta": { "pagination": { … } } }