Glue API: Create warehouse user assignments

Edit on GitHub

A warehouse user can have multiple warehouses assigned to them. However, because a user can be physically present only in one warehouse, a single warehouse assignment can be active for them at a time. This endpoint lets you create active and inactive warehouse user assignments.

Installation

For detailed information about the modules that provide the API functionality and related installation instructions, see:

Create a warehouse user assignment


POST /warehouse-user-assignments


Request

HEADER KEY HEADER VALUE REQUIRED DESCRIPTION
Authorization string Alphanumeric string that authorizes the Back Office user to send requests to protected resources. Get it by authenticating as a Back Office user.
STRING PARAMETER DESCRIPTION EXEMPLARY VALUES
include Adds resource relationships to the request. users
REQUEST USAGE
POST http://glue-backend.mysprykershop.com/warehouse-user-assignments Create a warehouse user assignment.
POST http://glue-backend.mysprykershop.com/warehouse-user-assignments?include=users Create a warehouse user assignment. Include information about the user in the response.

Request sample:

{
    "data": {
        "type": "warehouse-user-assignments",
        "attributes": {
            "userUuid": "ce63fe5c-4897-5a17-b683-39f2825316b8",
            "warehouse": {
                "uuid": "3899fb51-7419-5df6-9257-4599c9b857a5"
            },
            "isActive": false
        }
    }
}
ATTRIBUTE TYPE REQUIRED DESCRIPTION
userUuid String Unique identifier of the warehouse user to create the assignment for.
warehouse.uuid String Unique identifier of the warehouse to create the assignment for.
isActive Boolean Defines if the assignment is to be active.

Response

Create a warehouse user assignment
{
    "data": {
        "type": "warehouse-user-assignments",
        "id": "75d8832e-0aa8-570e-9761-f2ccad7e3a37",
        "attributes": {
            "userUuid": "ce63fe5c-4897-5a17-b683-39f2825316b8",
            "isActive": false,
            "warehouse": {
                "name": "Warehouse2",
                "uuid": "3899fb51-7419-5df6-9257-4599c9b857a5",
                "isActive": true
            }
        },
        "links": {
            "self": "https://glue-backend.mysprykershop.com/warehouse-user-assignments/75d8832e-0aa8-570e-9761-f2ccad7e3a37"
        }
    }
}
Create a warehouse user assignment with user information included
{
    "data": {
        "type": "warehouse-user-assignments",
        "id": "624c30c2-4ce9-5f1d-a368-fb2df62a8f6c",
        "attributes": {
            "userUuid": "ce63fe5c-4897-5a17-b683-39f2825316b8",
            "isActive": false,
            "warehouse": {
                "name": "Warehouse2",
                "uuid": "3899fb51-7419-5df6-9257-4599c9b857a5",
                "isActive": true
            }
        },
        "relationships": {
            "users": {
                "data": [
                    {
                        "type": "users",
                        "id": "ce63fe5c-4897-5a17-b683-39f2825316b8"
                    }
                ]
            }
        },
        "links": {
            "self": "https://glue-backend.mysprykershop.com/warehouse-user-assignments/624c30c2-4ce9-5f1d-a368-fb2df62a8f6c?include=users"
        }
    },
    "included": [
        {
            "type": "users",
            "id": "ce63fe5c-4897-5a17-b683-39f2825316b8",
            "attributes": {
                "username": "herald.hopkins@spryker.com",
                "firstName": "Herald",
                "lastName": "Hopkins"
            },
            "links": {
                "self": "https://glue-backend.mysprykershop.com/users/ce63fe5c-4897-5a17-b683-39f2825316b8?include=users"
            }
        }
    ]
}
ATTRIBUTE TYPE DESCRIPTION
userUuid String Unique identifier of the warehouse user the assignment belongs to.
isActive Boolean Defines if the warehouse assignment is active.
warehouse.name String Name of the warehouse in the assignment.
warehouse.uuid String Unique identifier of the warehouse in the assignment.
warehouse.isActive Boolean Defines if the warehouse in the assignment is active.
RESOURCE ATTRIBUTE TYPE DESCRIPTION
users username String Username of the user you are authenticated with.
users firstName String First name.
users lastName String Last name.

Possible errors

CODE REASON
5201 The provided user or warehouse ID is invalid.

To view generic errors that originate from the Glue Application, see Reference information: GlueApplication errors.