Shopping List Tutorial
How to create and use a shopping list
1
curl -L
--request POST
--url 'https://api.emporix.io/oauth/token'
--header 'Content-Type: application/x-www-form-urlencoded'
--data 'grant_type=client_credentials&client_id={CLIENT_ID}&client_secret={CLIENT_SECRET}&scope=shoppinglist.shoppinglist_manage shoppinglist.shoppinglist_read'2
API Reference
curl -L
--request POST
--url 'https://api.emporix.io/shoppinglist/{tenant}/shopping-lists'
--header 'Authorization: Bearer {EMPLOYEE_TOKEN}'
--header 'Content-Type: application/json'
--data '{
"customerId": "C120043",
"name": "weekly-delivery",
"items": [
{
"id": 1,
"productId": "55cdcd91a88ed11babd7ca7e",
"quantity": 7.1,
"cuttingOption": "small",
"servicePackagingOption": "paper",
"comment": "Handle with care"
}
]
}'3
API Reference
curl -L
--request POST
--url 'https://api.emporix.io/customer/{tenant}/login'
--header 'Content-Type: application/json'
--data '{
"username": "[email protected]",
"password": "{CUSTOMER_PASSWORD}"
}'4
API Reference
curl -L
--request POST
--url 'https://api.emporix.io/shoppinglist/{tenant}/shopping-lists'
--header 'Authorization: Bearer {CUSTOMER_TOKEN}'
--header 'Content-Type: application/json'
--data '{
"name": "holiday-menu",
"customAttributes": {
"occasion": "XMAS25"
},
"items": [
{
"id": 1,
"productId": "75cdcd91a88ed11babd7ca9i",
"quantity": 3.5
},
{
"id": 2,
"productId": "23cdcd91a88ed11babd7ca7y",
"quantity": 1.25,
"comment": "Family favorite"
}
]
}'5
API Reference
curl -L
--request GET
--url 'https://api.emporix.io/shoppinglist/{tenant}/shopping-lists'
--header 'Authorization: Bearer {ACCESS_TOKEN}'6
API Reference
curl -L
--request PUT
--url 'https://api.emporix.io/shoppinglist/{tenant}/shopping-lists/{customerId}?name=holiday-menu'
--header 'Authorization: Bearer {ACCESS_TOKEN}'
--header 'Content-Type: application/json'
--data '{
"name": "holiday-menu",
"items": [
{
"id": 1,
"productId": "75cdcd91a88ed11babd7ca9i",
"quantity": 4,
"comment": "Need extras"
},
{
"id": 2,
"productId": "23cdcd91a88ed11babd7ca7y",
"quantity": 0,
"comment": "Remove from list"
}
]
}'Last updated
Was this helpful?

