Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 9982f26

Browse files
sathiyaaarogyarkeharper
authored
Added documentation for copy, move and delete requisition list items mutations (#8202)
* Added documentation for copy, move and remove requisition list items mutations * fixed json format * arranged the attributes alphabetically * added backticks and spaces as mentioned * Update src/guides/v2.4/graphql/mutations/copy-items-between-requisition-list.md Co-authored-by: Yaroslav Rogoza <[email protected]> * modified attribute name * Modified the documentation according to the schema change * Apply suggestions from code review Co-authored-by: Kevin Harper <[email protected]> * modified as per review comments * removed a period * added a missing attribute * added the attributes alphabetically * deleted extra line * modified a description * modified the uid's and item uid's Co-authored-by: Yaroslav Rogoza <[email protected]> Co-authored-by: Kevin Harper <[email protected]>
1 parent 82ba059 commit 9982f26

File tree

5 files changed

+307
-0
lines changed

5 files changed

+307
-0
lines changed

src/_data/toc/graphql.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@ pages:
210210
- label: changeCustomerPassword mutation
211211
url: /graphql/mutations/change-customer-password.html
212212

213+
- label: copyItemsBetweenRequisitionLists mutation
214+
url: /graphql/mutations/copy-items-between-requisition-lists.html
215+
edition: b2b-only
216+
exclude_versions: [ "2.3" ]
217+
213218
- label: copyProductsToWishlist mutation
214219
url: /graphql/mutations/copy-products-to-wishlist.html
215220
edition: ee-only
@@ -293,6 +298,11 @@ pages:
293298
- label: deleteCustomerAddress mutation
294299
url: /graphql/mutations/delete-customer-address.html
295300

301+
- label: deleteRequisitionListItems mutation
302+
url: /graphql/mutations/delete-requisition-list-items.html
303+
edition: b2b-only
304+
exclude_versions: [ "2.3" ]
305+
296306
- label: deleteWishlist mutation
297307
url: /graphql/mutations/delete-wishlist.html
298308
edition: ee-only
@@ -324,6 +334,11 @@ pages:
324334
edition: ee-only
325335
exclude_versions: ["2.3"]
326336

337+
- label: moveItemsBetweenRequisitionLists mutation
338+
url: /graphql/mutations/move-items-between-requisition-lists.html
339+
edition: b2b-only
340+
exclude_versions: [ "2.3" ]
341+
327342
- label: placeOrder mutation
328343
url: /graphql/mutations/place-order.html
329344

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
The `RequisitionList` object contains the following attributes.
2+
3+
Attribute | Data Type | Description
4+
--- | --- | ---
5+
`description` | String | Optional text that describes the requisition list
6+
`items` | RequistionListItems | An array of products added to the requisition list
7+
`items_count` | Int! | The number of items in the list
8+
`name` | String! | The requisition list name
9+
`uid` | ID! | The unique requisition list ID
10+
`updated_at` | String | The time of the last modification of the requisition list
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
group: graphql
3+
title: copyItemsBetweenRequisitionLists mutation
4+
b2b_only: true
5+
contributor_name: EY
6+
---
7+
The `copyItemsBetweenRequisitionLists` mutation copies items from one requisition list to another.
8+
9+
This mutation requires a valid [customer authentication token]({{page.baseurl}}/graphql/mutations/generate-customer-token.html).
10+
11+
{:.bs-callout-info}
12+
Use the [storeConfig query]({{page.baseurl}}/graphql/queries/store-config.html) with the `btob_website_configuration_requisition_list_active` attribute to determine whether requisition lists are supported.
13+
14+
## Syntax
15+
16+
```graphql
17+
mutation {
18+
copyItemsBetweenRequisitionLists(
19+
sourceRequisitionListUid: ID!,
20+
destinationRequisitionListUid: ID,
21+
requisitionListItem: CopyItemsBetweenRequisitionListsInput
22+
) {
23+
CopyItemsFromRequisitionListsOutput
24+
}
25+
}
26+
```
27+
28+
## Example usage
29+
30+
The following example copies items from one requisition list to another.
31+
32+
**Request:**
33+
34+
``` graphql
35+
mutation {
36+
copyItemsBetweenRequisitionLists(
37+
sourceRequisitionListUid: "Y29uZmlndXJhYmxlLzkzLzUz",
38+
destinationRequisitionListUid: "W16uZmlndXJhYmxlLakzLzUz",
39+
requisitionListItemUids: ["2","3"]
40+
) {
41+
requisition_list {
42+
uid
43+
items_count
44+
}
45+
}
46+
}
47+
```
48+
49+
**Response:**
50+
51+
``` json
52+
{
53+
"data": {
54+
"copyItemsBetweenRequisitionLists": {
55+
"requisition_list": {
56+
"uid": "W16uZmlndXJhYmxlLakzLzUz",
57+
"items_count": 2
58+
}
59+
}
60+
}
61+
}
62+
```
63+
64+
## Input attributes
65+
66+
The `copyItemsBetweenRequisitionLists` mutation requires the following input.
67+
68+
Attribute | Data Type | Description
69+
--- | --- | ---
70+
`destinationRequisitionListUid`| ID | The unique ID of the destination requisition list. If null, a new requisition list will be created
71+
`requisitionListItem`| [[CopyItemsBetweenRequisitionListsInput](#CopyItemsBetweenRequisitionListsInput)] | An array of selected requisition list items that are to be copied
72+
`sourceRequisitionListUid`| ID! | The unique ID of the source requisition list
73+
74+
## Output attributes
75+
76+
The `copyItemsBetweenRequisitionLists` mutation returns the requisition list object to which the products were copied to.
77+
78+
Attribute | Data Type | Description
79+
--- | --- | ---
80+
`requisition_list` | [[RequisitionList](#RequisitionList)] | The destination requisition list after the items were copied
81+
82+
### CopyItemsBetweenRequisitionListsInput attributes {#CopyItemsBetweenRequisitionListsInput}
83+
84+
The `CopyItemsBetweenRequisitionListsInput` type contains the list of products to copy from one requisition list to other.
85+
86+
Attribute | Data Type | Description
87+
--- | --- | ---
88+
`requisitionListItemUids` | [ID!]! | An array of IDs representing products copied from one requisition list to another
89+
90+
### RequisitionList attributes {#RequisitionList}
91+
{% include graphql/requisition-list.md %}
92+
93+
## Related topics
94+
95+
* [moveItemsBetweenRequisitionLists mutation]({{page.baseurl}}/graphql/mutations/move-items-between-requisition-lists.html)
96+
* [deleteRequisitionListItems mutation]({{page.baseurl}}/graphql/mutations/delete-requisition-list-items.html)
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
group: graphql
3+
title: deleteRequisitionListItems mutation
4+
b2b_only: true
5+
contributor_name: EY
6+
---
7+
The `deleteRequisitionListItems` mutation removes items from the specified requisiton list for the logged in customer.
8+
9+
This mutation requires a valid [customer authentication token]({{page.baseurl}}/graphql/mutations/generate-customer-token.html).
10+
11+
{:.bs-callout-info}
12+
Use the [storeConfig query]({{page.baseurl}}/graphql/queries/store-config.html) with the `btob_website_configuration_requisition_list_active` attribute to determine whether requisition lists are supported.
13+
14+
## Syntax
15+
16+
```graphql
17+
mutation {
18+
deleteRequisitionListItems(
19+
requisitionListUid: ID!
20+
requisitionListItemUids: [ID!]!
21+
) {
22+
DeleteRequisitionListItemsOutput
23+
}
24+
}
25+
```
26+
## Example usage
27+
28+
The following example removes the specified items from the requisition list.
29+
30+
**Request:**
31+
32+
``` graphql
33+
mutation {
34+
deleteRequisitionListItems(
35+
requisitionListUid: "Y29uZmlndXJhYmxlLzkzLzUz",
36+
requisitionListItemUids: ["2","3"]
37+
) {
38+
requisition_list {
39+
uid
40+
items_count
41+
}
42+
}
43+
}
44+
```
45+
46+
**Response:**
47+
48+
``` json
49+
{
50+
"data": {
51+
"deleteRequisitionListItems": {
52+
"requisition_list": {
53+
"uid": "Y29uZmlndXJhYmxlLzkzLzUz",
54+
"items_count": 0
55+
}
56+
}
57+
}
58+
}
59+
```
60+
61+
## Input attributes
62+
63+
The `deleteRequisitionListItems` mutation requires the following input.
64+
65+
Attribute | Data Type | Description
66+
--- | --- | ---
67+
`requisitionListItemUids`| [ID!]! | An array of UIDs representing products to be removed from the requisition list
68+
`requisitionListUid`| ID! | The unique ID of the requisition list
69+
70+
## Output attributes
71+
72+
The `deleteRequisitionListItems` object returns the requisition list after the deletion of items.
73+
74+
Attribute | Data Type | Description
75+
--- | --- | ---
76+
`requisition_list` | RequisitionList | The requisition list after removing items
77+
78+
## Related topics
79+
80+
* [renameRequisitionList mutation]({{page.baseurl}}/graphql/mutations/rename-requisition-list.html)
81+
* [deleteRequisitionList mutation]({{page.baseurl}}/graphql/mutations/delete-requisition-list.html)
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
group: graphql
3+
title: moveItemsBetweenRequisitionLists mutation
4+
b2b_only: true
5+
contributor_name: EY
6+
---
7+
The `moveItemsBetweenRequisitionLists` mutation moves items from one requisition list to another.
8+
9+
This mutation requires a valid [customer authentication token]({{page.baseurl}}/graphql/mutations/generate-customer-token.html).
10+
11+
{:.bs-callout-info}
12+
Use the [storeConfig query]({{page.baseurl}}/graphql/queries/store-config.html) with the `btob_website_configuration_requisition_list_active` attribute to determine whether requisition lists are supported.
13+
14+
## Syntax
15+
16+
```graphql
17+
mutation {
18+
moveItemsBetweenRequisitionLists(
19+
sourceRequisitionListUid: ID!
20+
destinationRequisitionListUid: ID
21+
requisitionListItem: MoveItemsBetweenRequisitionListsInput
22+
) {
23+
MoveItemsBetweenRequisitionListsOutput
24+
}
25+
}
26+
```
27+
28+
## Example usage
29+
30+
The following example moves items from one requisition list to another.
31+
32+
**Request:**
33+
34+
``` graphql
35+
mutation {
36+
moveItemsBetweenRequisitionLists(
37+
sourceRequisitionListUid: "Y29uZmlndXJhYmxlLzkzLzUz"
38+
destinationRequisitionListUid: "W16uZmlndXJhYmxlLakzLzUz"
39+
requisitionListItemUids: ["2","3"]
40+
) {
41+
source_requisition_list {
42+
uid
43+
items_count
44+
}
45+
destination_requisition_list {
46+
uid
47+
items_count
48+
}
49+
}
50+
}
51+
```
52+
53+
**Response:**
54+
55+
``` json
56+
{
57+
"data": {
58+
"moveItemsBetweenRequisitionLists": {
59+
"source_requisition_list": {
60+
"uid": "Y29uZmlndXJhYmxlLzkzLzUz",
61+
"items_count": 0
62+
},
63+
"destination_requisition_list": {
64+
"uid": "W16uZmlndXJhYmxlLakzLzUz",
65+
"items_count": 2
66+
}
67+
}
68+
}
69+
}
70+
```
71+
72+
## Input attributes
73+
74+
The `moveItemsBetweenRequisitionLists` mutation requires the following input.
75+
76+
Attribute | Data Type | Description
77+
--- | --- | ---
78+
`destinationRequisitionListUid`| ID! | The unique ID of the destination requisition list. If null, a new requisition list will be created
79+
`requisitionListItem`| [[MoveItemsBetweenRequisitionListsInput](#MoveItemsBetweenRequisitionListsInput)] | An array of selected requisition list items that are to be moved from the source to the destination list
80+
`sourceRequisitionListUid`| ID! | The unique ID of the source requisition list
81+
82+
## Output attributes
83+
84+
The `moveItemsBetweenRequisitionLists` object returns the source requisition list and the destination requisition list object.
85+
86+
Attribute | Data Type | Description
87+
--- | --- | ---
88+
`destination_requisition_list` | [[RequisitionList](#RequisitionList)] | The destination requisition list after moving items
89+
`source_requisition_list` | [[RequisitionList](#RequisitionList)] | The source requisition list after moving items
90+
91+
### MoveItemsBetweenRequisitionListsInput attributes {#MoveItemsBetweenRequisitionListsInput}
92+
93+
The `MoveItemsBetweenRequisitionListsInput` type contains the list of products to move from one requisition list to other.
94+
95+
Attribute | Data Type | Description
96+
--- | --- | ---
97+
`requisitionListItemUids` | [ID!]! | An array of IDs representing products moved from one requisition list to another
98+
99+
### RequisitionList attributes {#RequisitionList}
100+
{% include graphql/requisition-list.md %}
101+
102+
## Related topics
103+
104+
* [copyItemsBetweenRequisitionLists mutation]({{page.baseurl}}/graphql/mutations/copy-items-between-requisition-lists.html)
105+
* [deleteRequisitionListItems mutation]({{page.baseurl}}/graphql/mutations/delete-requisition-list-items.html)

0 commit comments

Comments
 (0)