Glue API: Share company user carts
Edit on GitHubCompany users can share their carts with other company users, so multiple representatives of a company can work on the same order. When sharing carts, users can choose what type of access they want to grant to different each other.
This endpoint allows sharing carts with company users.
Installation
For detailed information on the modules that provide the API functionality and related installation instructions, see Install the Shared Carts feature.
Share a cart
To share a cart, send the request:
POST
/carts/{{cart-uuid}}/shared-carts
PATH PARAMETER | DESCRIPTION |
---|---|
{{cart-uuid}} | The unique ID of a cart to share. |
Request
HEADER KEY | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
Authorization | string | ✓ | A string containing digits, letters, and symbols that authorize the company user. Authenticate as a company user to get the value. |
Request sample: POST https://glue.mysprykershop.com/carts/f23f5cfa-7fde-5706-aefb-ac6c6bbadeab/shared-carts
{
"data": {
"type": "shared-carts",
"attributes": {
"idCompanyUser": "4c677a6b-2f65-5645-9bf8-0ef3532bead1",
"idCartPermissionGroup": 1
}
}
}
ATTRIBUTE | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
idCompanyUser | String | ✓ | The unique ID of a company user to share the cart with. The user must belong to the same company as the cart owner. |
idCartPermissionGroup | Integer | ✓ | The unique ID of a cart permission group that defines the permissions of the company user for the cart. To get the full list of cart permission groups, retrieve permission groups. |
Response
Response sample:
{
"data": {
"type": "shared-carts",
"id": "4c677a6b-2f65-5645-9bf8-0ef3532bbbccaa",
"attributes": {
"idCompanyUser": "4c677a6b-2f65-5645-9bf8-0ef3532bead1",
"idCartPermissionGroup": 1
},
"links": {
"self": "https://glue.mysprykershop.com/shared-carts/4c677a6b-2f65-5645-9bf8-0ef3532bbbccaa"
}
}
}
RESOURCE | ATTRIBUTE | TYPE | DESCRIPTION |
---|---|---|---|
shared-carts | id | String | The unique ID used for sharing the cart. |
shared-carts | idCompanyUser | String | The unique ID of the company user the cart is shared with. |
shared-carts | idCartPermissionGroup | Integer | The unique ID of the cart permission group that describes the permissions granted to the user the cart is shared with. |
Possible errors
CODE | REASON |
---|---|
001 | The access token is invalid. |
002 | The access token is missing. |
101 | Cart is not found. |
104 | Cart uuid is missing. |
422 | Failed to share a cart. |
901 | idCompanyUser field is not specified or empty. |
2501 | Cart permission group is not found. |
2701 | Action is forbidden. |
2702 | Failed to share a cart. |
2703 | Shared cart not found. |
2704 | Shared cart ID is missing. |
2705 | Shared cart is not found. |
2706 | Failed to save the shared cart. |
Next steps
Thank you!
For submitting the form