copyItemsBetweenRequisitionLists mutation
Magento Commerce for B2B only
The copyItemsBetweenRequisitionLists
mutation copies 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 {
copyItemsBetweenRequisitionLists(
sourceRequisitionListUid: ID!,
destinationRequisitionListUid: ID,
requisitionListItem: CopyItemsBetweenRequisitionListsInput
) {
CopyItemsFromRequisitionListsOutput
}
}
Example usage
The following example copies 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
mutation {
copyItemsBetweenRequisitionLists(
sourceRequisitionListUid: "Mg==",
destinationRequisitionListUid: "Mw==",
requisitionListItem: {
requisitionListItemUids: [
"Nw=="
]
}
) {
requisition_list {
uid
name
items_count
}
}
}
Response:
1
2
3
4
5
6
7
8
9
10
11
{
"data": {
"copyItemsBetweenRequisitionLists": {
"requisition_list": {
"uid": "Mw==",
"name": "Rarely ordered items",
"items_count": 3
}
}
}
}
Input attributes
The copyItemsBetweenRequisitionLists
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 |
[CopyItemsBetweenRequisitionListsInput] | An array of selected requisition list items that are to be copied |
sourceRequisitionListUid |
ID! | The unique ID of the source requisition list |
CopyItemsBetweenRequisitionListsInput attributes
The CopyItemsBetweenRequisitionListsInput
type contains the list of products to copy from one requisition list to other.
Attribute | Data Type | Description |
---|---|---|
requisitionListItemUids |
[ID!]! | An array of IDs representing products copied from one requisition list to another |
Output attributes
The copyItemsBetweenRequisitionLists
mutation returns the requisition list object to which the products were copied to.
Attribute | Data Type | Description |
---|---|---|
requisition_list |
[RequisitionList] | The destination requisition list after the items were copied |
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 |