moveItemsBetweenRequisitionLists mutation
The moveItemsBetweenRequisitionLists
mutation moves items from one requisition list to another.
This mutation requires a valid customer authentication token.
Use the storeConfig query with the is_requisition_list_active
attribute to determine whether requisition lists are enabled.
Syntax
1
2
3
4
5
6
7
8
9
mutation {
moveItemsBetweenRequisitionLists(
sourceRequisitionListUid: ID!
destinationRequisitionListUid: ID
requisitionListItem: MoveItemsBetweenRequisitionListsInput
) {
MoveItemsBetweenRequisitionListsOutput
}
}
Example usage
The following example moves an item from one requisition list to another.
Request:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
mutation {
moveItemsBetweenRequisitionLists(
sourceRequisitionListUid: "Mg=="
destinationRequisitionListUid: "Mw=="
requisitionListItem: {
requisitionListItemUids:
["MTI="]
}
) {
source_requisition_list {
uid
name
items_count
}
destination_requisition_list {
uid
name
items_count
}
}
}
Response:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"data": {
"moveItemsBetweenRequisitionLists": {
"source_requisition_list": {
"uid": "Mg==",
"name": "Frequently Ordered Products",
"items_count": 3
},
"destination_requisition_list": {
"uid": "Mw==",
"name": "Rarely ordered items",
"items_count": 2
}
}
}
}
Input attributes
The moveItemsBetweenRequisitionLists
mutation requires the following input.
Attribute | Data Type | Description |
---|---|---|
destinationRequisitionListUid |
ID! | The unique ID of the destination requisition list. If null, a new requisition list will be created |
requisitionListItem |
[MoveItemsBetweenRequisitionListsInput] | An array of selected requisition list items that are to be moved from the source to the destination list |
sourceRequisitionListUid |
ID! | The unique ID of the source requisition list |
MoveItemsBetweenRequisitionListsInput attributes
The MoveItemsBetweenRequisitionListsInput
type contains the list of products to move from one requisition list to other.
Attribute | Data Type | Description |
---|---|---|
requisitionListItemUids |
[ID!]! | An array of IDs representing products moved from one requisition list to another |
Output attributes
The moveItemsBetweenRequisitionLists
object returns the source requisition list and the destination requisition list object.
Attribute | Data Type | Description |
---|---|---|
destination_requisition_list |
[RequisitionList] | The destination requisition list after moving items |
source_requisition_list |
[RequisitionList] | The source requisition list after moving items |
RequisitionList attributes
The RequisitionList
object contains the following attributes.
Attribute | Data Type | Description |
---|---|---|
description |
String | Optional text that describes the requisition list |
items |
RequistionListItems | An array of products added to the requisition list |
items_count |
Int! | The number of items in the list |
name |
String! | The requisition list name |
uid |
ID! | The unique requisition list ID |
updated_at |
String | The time of the last modification of the requisition list |
RequistionListItems attributes
The RequistionListItems
object contains the following attributes.
Attribute | Data Type | Description |
---|---|---|
items |
[RequisitionListItemInterface]! | An array of items in the requisition list |
page_info |
SearchResultPageInfo | Contains pagination metadata |
total_pages |
Int! | The number of pages returned |