diff --git a/src/_data/toc/graphql.yml b/src/_data/toc/graphql.yml index 78e801fd11e..4d3f31bf126 100644 --- a/src/_data/toc/graphql.yml +++ b/src/_data/toc/graphql.yml @@ -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 @@ -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 @@ -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 diff --git a/src/_includes/graphql/requisition-list.md b/src/_includes/graphql/requisition-list.md new file mode 100644 index 00000000000..4b9a8c73727 --- /dev/null +++ b/src/_includes/graphql/requisition-list.md @@ -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 diff --git a/src/guides/v2.4/graphql/mutations/copy-items-between-requisition-lists.md b/src/guides/v2.4/graphql/mutations/copy-items-between-requisition-lists.md new file mode 100644 index 00000000000..cde7d55a517 --- /dev/null +++ b/src/guides/v2.4/graphql/mutations/copy-items-between-requisition-lists.md @@ -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: "Y29uZmlndXJhYmxlLzkzLzUz", + destinationRequisitionListUid: "W16uZmlndXJhYmxlLakzLzUz", + requisitionListItemUids: ["2","3"] + ) { + requisition_list { + uid + items_count + } + } +} +``` + +**Response:** + +``` json +{ + "data": { + "copyItemsBetweenRequisitionLists": { + "requisition_list": { + "uid": "W16uZmlndXJhYmxlLakzLzUz", + "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) \ No newline at end of file diff --git a/src/guides/v2.4/graphql/mutations/delete-requisition-list-items.md b/src/guides/v2.4/graphql/mutations/delete-requisition-list-items.md new file mode 100644 index 00000000000..9b38496c119 --- /dev/null +++ b/src/guides/v2.4/graphql/mutations/delete-requisition-list-items.md @@ -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: "Y29uZmlndXJhYmxlLzkzLzUz", + requisitionListItemUids: ["2","3"] + ) { + requisition_list { + uid + items_count + } + } +} +``` + +**Response:** + +``` json +{ + "data": { + "deleteRequisitionListItems": { + "requisition_list": { + "uid": "Y29uZmlndXJhYmxlLzkzLzUz", + "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) \ No newline at end of file diff --git a/src/guides/v2.4/graphql/mutations/move-items-between-requisition-lists.md b/src/guides/v2.4/graphql/mutations/move-items-between-requisition-lists.md new file mode 100644 index 00000000000..a5abbe3bf2f --- /dev/null +++ b/src/guides/v2.4/graphql/mutations/move-items-between-requisition-lists.md @@ -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: "Y29uZmlndXJhYmxlLzkzLzUz" + destinationRequisitionListUid: "W16uZmlndXJhYmxlLakzLzUz" + requisitionListItemUids: ["2","3"] + ) { + source_requisition_list { + uid + items_count + } + destination_requisition_list { + uid + items_count + } + } +} +``` + +**Response:** + +``` json +{ + "data": { + "moveItemsBetweenRequisitionLists": { + "source_requisition_list": { + "uid": "Y29uZmlndXJhYmxlLzkzLzUz", + "items_count": 0 + }, + "destination_requisition_list": { + "uid": "W16uZmlndXJhYmxlLakzLzUz", + "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) \ No newline at end of file