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

Added documentation for copy, move and delete requisition list items mutations #8202

Merged
merged 17 commits into from
Dec 11, 2020
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/_data/toc/graphql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ pages:
- label: changeCustomerPassword mutation
url: /graphql/mutations/change-customer-password.html

- label: copyItemsBetweenRequisitionLists mutation
url: /graphql/mutations/copy-items-between-requisition-lists.html
edition: b2b-only
exclude_versions: [ "2.3" ]

- label: copyProductsToWishlist mutation
url: /graphql/mutations/copy-products-to-wishlist.html
edition: ee-only
Expand Down Expand Up @@ -278,6 +283,11 @@ pages:
- label: deleteCustomerAddress mutation
url: /graphql/mutations/delete-customer-address.html

- label: deleteRequisitionListItems mutation
url: /graphql/mutations/delete-requisition-list-items.html
edition: b2b-only
exclude_versions: [ "2.3" ]

- label: deleteWishlist mutation
url: /graphql/mutations/delete-wishlist.html
edition: ee-only
Expand Down Expand Up @@ -305,6 +315,11 @@ pages:
edition: ee-only
exclude_versions: ["2.3"]

- label: moveItemsBetweenRequisitionLists mutation
url: /graphql/mutations/move-items-between-requisition-lists.html
edition: b2b-only
exclude_versions: [ "2.3" ]

- label: placeOrder mutation
url: /graphql/mutations/place-order.html

Expand Down
10 changes: 10 additions & 0 deletions src/_includes/graphql/requisition-list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
group: graphql
title: copyItemsBetweenRequisitionLists mutation
b2b_only: true
contributor_name: EY
---
The `copyItemsBetweenRequisitionLists` mutation copies items from one requisition list to another.

This mutation requires a valid [customer authentication token]({{page.baseurl}}/graphql/mutations/generate-customer-token.html).

{:.bs-callout-info}
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.

## Syntax

```graphql
mutation {
copyItemsBetweenRequisitionLists(
sourceRequisitionListUid: ID!,
destinationRequisitionListUid: ID,
requisitionListItem: CopyItemsBetweenRequisitionListsInput
) {
CopyItemsFromRequisitionListsOutput
}
}
```

## Example usage

The following example copies items from one requisition list to another.

**Request:**

``` graphql
mutation {
copyItemsBetweenRequisitionLists(
sourceRequisitionListUid: "4",
destinationRequisitionListUid: "5",
requisitionListItem: ["2","3"]
) {
requisition_list {
uid
items_count
}
}
}
```

**Response:**

``` json
{
"data": {
"copyItemsBetweenRequisitionLists": {
"requisition_list": {
"uid": "4",
"items_count": 2
}
}
}
}
```

## 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](#CopyItemsBetweenRequisitionListsInput)] | An array of selected requisition list items that are to be copied
`sourceRequisitionListUid`| ID! | The unique ID of the source requisition list

## Output attributes

The `copyItemsBetweenRequisitionLists` mutation returns the requisition list object to which the products were copied to.

Attribute | Data Type | Description
--- | --- | ---
`requisition_list` | [[RequisitionList](#RequisitionList)] | The destination requisition list after the items were copied

### CopyItemsBetweenRequisitionListsInput attributes {#CopyItemsBetweenRequisitionListsInput}

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

### RequisitionList attributes {#RequisitionList}
{% include graphql/requisition-list.md %}

## Related topics

* [moveItemsBetweenRequisitionLists mutation]({{page.baseurl}}/graphql/mutations/move-items-between-requisition-lists.html)
* [deleteRequisitionListItems mutation]({{page.baseurl}}/graphql/mutations/delete-requisition-list-items.html)
81 changes: 81 additions & 0 deletions src/guides/v2.4/graphql/mutations/delete-requisition-list-items.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
group: graphql
title: deleteRequisitionListItems mutation
b2b_only: true
contributor_name: EY
---
The `deleteRequisitionListItems` mutation removes items from the specified requisiton list for the logged in customer.

This mutation requires a valid [customer authentication token]({{page.baseurl}}/graphql/mutations/generate-customer-token.html).

{:.bs-callout-info}
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.

## Syntax

```graphql
mutation {
deleteRequisitionListItems(
requisitionListUid: ID!
requisitionListItemUids: [ID!]!
) {
DeleteRequisitionListItemsOutput
}
}
```
## Example usage

The following example removes the specified items from the requisition list.

**Request:**

``` graphql
mutation {
deleteRequisitionListItems(
requisitionListUid: "4",
requisitionListItemUids: ["2","3"]
) {
requisition_list {
uid
items_count
}
}
}
```

**Response:**

``` json
{
"data": {
"deleteRequisitionListItems": {
"requisition_list": {
"uid": "4",
"items_count": 0
}
}
}
}
```

## Input attributes

The `deleteRequisitionListItems` mutation requires the following input.

Attribute | Data Type | Description
--- | --- | ---
`requisitionListItemUids`| [ID!]! | An array of UIDs representing products to be removed from the requisition list
`requisitionListUid`| ID! | The unique ID of the requisition list

## Output attributes

The `deleteRequisitionListItems` object returns the requisition list after the deletion of items.

Attribute | Data Type | Description
--- | --- | ---
`requisition_list` | RequisitionList | The requisition list after removing items

## Related topics

* [renameRequisitionList mutation]({{page.baseurl}}/graphql/mutations/rename-requisition-list.html)
* [deleteRequisitionList mutation]({{page.baseurl}}/graphql/mutations/delete-requisition-list.html)
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
group: graphql
title: moveItemsBetweenRequisitionLists mutation
b2b_only: true
contributor_name: EY
---
The `moveItemsBetweenRequisitionLists` mutation moves items from one requisition list to another.

This mutation requires a valid [customer authentication token]({{page.baseurl}}/graphql/mutations/generate-customer-token.html).

{:.bs-callout-info}
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.

## Syntax

```graphql
mutation {
moveItemsBetweenRequisitionLists(
sourceRequisitionListUid: ID!
destinationRequisitionListUid: ID
requisitionListItem: MoveItemsBetweenRequisitionListsInput
) {
MoveItemsBetweenRequisitionListsOutput
}
}
```

## Example usage

The following example moves items from one requisition list to another.

**Request:**

``` graphql
mutation {
moveItemsBetweenRequisitionLists(
sourceRequisitionListUid: "4"
destinationRequisitionListUid: "5"
requisitionListItem: ["2","3"]
) {
source_requisition_list {
uid
items_count
}
destination_requisition_list {
uid
items_count
}
}
}
```

**Response:**

``` json
{
"data": {
"moveItemsBetweenRequisitionLists": {
"source_requisition_list": {
"uid": "4",
"items_count": 0
},
"destination_requisition_list": {
"uid": "5",
"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](#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

## Output attributes

The `moveItemsBetweenRequisitionLists` object returns the source requisition list and the destination requisition list object.

Attribute | Data Type | Description
--- | --- | ---
`destination_requisition_list` | [[RequisitionList](#RequisitionList)] | The destination requisition list after moving items
`source_requisition_list` | [[RequisitionList](#RequisitionList)] | The source requisition list after moving items

### MoveItemsBetweenRequisitionListsInput attributes {#MoveItemsBetweenRequisitionListsInput}

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

### RequisitionList attributes {#RequisitionList}
{% include graphql/requisition-list.md %}

## Related topics

* [copyItemsBetweenRequisitionLists mutation]({{page.baseurl}}/graphql/mutations/copy-items-between-requisition-lists.html)
* [deleteRequisitionListItems mutation]({{page.baseurl}}/graphql/mutations/delete-requisition-list-items.html)