Shopping Lists

Retrieving a shopping list

get

Gets shopping list by name or defaults to all shopping lists if name is not provided. When scope is provided then all shopping lists are returned. If scope is not provided, then only own shopping list is returned.

Required scopes

  • shoppinglist.shoppinglist_read - required for the employee to read shopping lists. If scope is not present, then the customerId is resolved from the token.

Authorizations
Path parameters
tenantstringRequired

Your Emporix tenant's name.

Note: The tenant name should always be written in lowercase.

Example: saasdev2
Query parameters
namestringOptional

Name of the shopping list. If missing all shopping lists are provided. This query param has no effect when it's used by employee.

Responses
200
Resource successfully retrieved.
application/json
get
GET /shoppinglist/{tenant}/shopping-lists HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
[
  {
    "customerId": "C120046",
    "default": {
      "name": "default",
      "items": [
        {
          "id": 1,
          "productId": "55cdcd91a88ed11babd7ca7e",
          "quantity": 7.1,
          "cuttingOption": "small",
          "servicePackagingOption": "paper",
          "comment": "fragile"
        },
        {
          "id": 2,
          "productId": "75cdcd91a88ed11babd7ca9i",
          "quantity": 1.5,
          "cuttingOption": "small",
          "servicePackagingOption": "paper",
          "comment": "fragile"
        }
      ]
    }
  }
]

Creating a shopping list

post

Creates a shopping list.


Required scopes

  • shoppinglist.shoppinglist_manage - required for the employee to create a shopping list for a provided customer. If scope is not present, then the customerId is resolved from the token.

Authorizations
Path parameters
tenantstringRequired

Your Emporix tenant's name.

Note: The tenant name should always be written in lowercase.

Example: saasdev2
Body
one ofOptional
or
Responses
201
The shopping list resource has been successfully created.
application/json
post
POST /shoppinglist/{tenant}/shopping-lists HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 191

{
  "customerId": "C120043",
  "name": "default",
  "items": [
    {
      "id": 1,
      "productId": "55cdcd91a88ed11babd7ca7e",
      "quantity": 7.1,
      "cuttingOption": "small",
      "servicePackagingOption": "paper",
      "comment": "fragile"
    }
  ]
}
{
  "id": "C120043"
}

Retrieving a customer shopping list

get

Retrieves a shopping list based on the customer number. This endpoint is valid only for the employee.


Required scopes

  • shoppinglist.shoppinglist_read

Authorizations
Path parameters
tenantstringRequired

Your Emporix tenant's name.

Note: The tenant name should always be written in lowercase.

Example: saasdev2
customerIdstringRequired

Unique identifier of the customer.

Example: C120053
Query parameters
namestringOptional

Name of the shopping list

Responses
200
shopping list successfully retrieved.
application/json
get
GET /shoppinglist/{tenant}/shopping-lists/{customerId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "customerId": "C120048",
  "default": {
    "name": "default",
    "items": [
      {
        "id": 1,
        "productId": "55cdcd91a88ed11babd7ca7e",
        "quantity": 7.1,
        "cuttingOption": "small",
        "servicePackagingOption": "paper",
        "comment": "fragile"
      },
      {
        "id": 2,
        "productId": "75cdcd91a88ed11babd7ca9i",
        "quantity": 1.5,
        "cuttingOption": "small",
        "servicePackagingOption": "paper",
        "comment": "fragile"
      }
    ]
  }
}

Updating a customer shopping list

put

Updates a shopping list.


Required scopes

  • shoppinglist.shoppinglist_manage - required for the employee to update a shopping list. If scope is not present, then the operation is allowed for customer to update his own shopping list.

Authorizations
Path parameters
tenantstringRequired

Your Emporix tenant's name.

Note: The tenant name should always be written in lowercase.

Example: saasdev2
customerIdstringRequired

Unique identifier of the customer.

Example: C120053
Body
Responses
204
The resource has been successfully updated.
put
PUT /shoppinglist/{tenant}/shopping-lists/{customerId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 168

{
  "name": "default",
  "items": [
    {
      "id": 3,
      "productId": "23cdcd91a88ed11babd7ca7y",
      "quantity": 2.4,
      "cuttingOption": "small",
      "servicePackagingOption": "paper",
      "comment": "fragile"
    }
  ]
}

No content

Removing a customer shopping list

delete

Deletes a shopping list.


Required scopes

  • shoppinglist.shoppinglist_manage - required for the employee to delete a shopping list. If scope is not present, then the operation is allowed for customer to delete his own shopping list.

Authorizations
Path parameters
tenantstringRequired

Your Emporix tenant's name.

Note: The tenant name should always be written in lowercase.

Example: saasdev2
customerIdstringRequired

Unique identifier of the customer.

Example: C120053
Query parameters
namestringOptional

Name of the shopping list. If no name is provided, then all shopping lists of given customer are removed.

Responses
204
The resource has been successfully deleted.
delete
DELETE /shoppinglist/{tenant}/shopping-lists/{customerId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*

No content

Was this helpful?