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.

Additional scope info

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

Required scopes
This endpoint requires the following scopes:
  • : Needed to retrieve shopping lists.
Authorizations
OAuth2clientCredentialsRequired
Token URL:
Path parameters
tenantstringRequired

Your Emporix tenant 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
/shoppinglist/{tenant}/shopping-lists
GET /shoppinglist/{tenant}/shopping-lists HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_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.


Additional scope info

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

Authorizations
AuthorizationstringRequired

To generate a customer access token, go to the Logging in a customer endpoint.

Path parameters
tenantstringRequired

Your Emporix tenant name.

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

Example: saasdev2
Body
one ofOptional
or
Responses
post
/shoppinglist/{tenant}/shopping-lists
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.


Authorizations
AuthorizationstringRequired

To generate a customer access token, go to the Logging in a customer endpoint.

Path parameters
tenantstringRequired

Your Emporix tenant 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
/shoppinglist/{tenant}/shopping-lists/{customerId}
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.


Additional scope info

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

Authorizations
AuthorizationstringRequired

To generate a customer access token, go to the Logging in a customer endpoint.

Path parameters
tenantstringRequired

Your Emporix tenant name.

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

Example: saasdev2
customerIdstringRequired

Unique identifier of the customer.

Example: C120053
Body
Responses
put
/shoppinglist/{tenant}/shopping-lists/{customerId}
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.


Additional scope info

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

Required scopes
This endpoint requires the following scopes:
  • : Needed to delete shopping lists.
Authorizations
OAuth2clientCredentialsRequired
Token URL:
Path parameters
tenantstringRequired

Your Emporix tenant 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
delete
/shoppinglist/{tenant}/shopping-lists/{customerId}
DELETE /shoppinglist/{tenant}/shopping-lists/{customerId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*

No content

Last updated

Was this helpful?