diff --git a/src/_data/toc/graphql.yml b/src/_data/toc/graphql.yml index e98641b423a..0ebaa090d30 100644 --- a/src/_data/toc/graphql.yml +++ b/src/_data/toc/graphql.yml @@ -183,6 +183,7 @@ pages: - label: addProductsToRequisitionList mutation url: /graphql/mutations/add-products-to-requisition-list.html + edition: ee-only exclude_versions: [ "2.3" ] - label: addProductsToWishlist mutation @@ -191,6 +192,7 @@ pages: - label: addRequisitionListItemsToCart mutation url: /graphql/mutations/add-requisition-list-items-to-cart.html + edition: ee-only exclude_versions: [ "2.3" ] - label: addSimpleProductsToCart mutation @@ -479,6 +481,7 @@ pages: - label: updateRequisitionListItems mutation url: /graphql/mutations/update-requisition-list-items.html + edition: ee-only exclude_versions: [ "2.3" ] - label: updateWishlist mutation @@ -533,10 +536,16 @@ pages: url: /graphql/interfaces/order-item-interface.html exclude_versions: ["2.3"] + - label: RequisitionListItemInterface attributes and implementations + url: /graphql/interfaces/requisition-list-item-interface.html + edition: b2b-only + exclude_versions: ["2.3"] + - label: ShipmentItemInterface attributes and implementations url: /graphql/interfaces/shipment-item-interface.html exclude_versions: ["2.3"] + - label: Payment methods children: diff --git a/src/_includes/graphql/customer-output-24.md b/src/_includes/graphql/customer-output-24.md index cfa9c27d7f1..86d1b745930 100644 --- a/src/_includes/graphql/customer-output-24.md +++ b/src/_includes/graphql/customer-output-24.md @@ -21,23 +21,25 @@ Attribute | Data Type | Description `firstname` | String | The customer's first name `gender` | Int | The customer's gender (Male - 1, Female - 2) `group_id` | Int | Deprecated. This attribute is not applicable for GraphQL. The group assigned to the user. Default values are 0 (Not logged in), 1 (General), 2 (Wholesale), and 3 (Retailer) -`id` | Int | Deprecated. This attribute is not applicable for GraphQL.The ID assigned to the customer +`id` | Int | Deprecated. This attribute is not applicable for GraphQL. The ID assigned to the customer `is_subscribed` | Boolean | Indicates whether the customer is subscribed to the company's newsletter `lastname` | String | The customer's family name `middlename` |String | The customer's middle name -`orders()` | {{ customeroutput_text }} | A list of the customer's placed orders{{ crossref_text }} +`orders(filter CustomerOrdersFilterInput, currentPage = 1 Int, pageSize = 20 Int)` | {{ customeroutput_text }} | A list of the customer's placed orders{{ crossref_text }} `prefix` | String | An honorific, such as Dr., Mr., or Mrs. `reviews(pageSize: Int = 20 currentPage: Int = 1)` | ProductReviews! | The list of reviews of the product `reward_points` | RewardPoints | Details about the customer's reward points `suffix` | String | A value such as Sr., Jr., or III `taxvat` | String | The customer's Tax/VAT number (for corporate customers) -`wishlist` | Wishlist! | Contains the contents of the customer's wish lists +`wishlist` | Wishlist! | Deprecated. Use `wishlist_v2` instead. Contains the contents of the customer's wish lists +`wishlist_v2(id ID!)` | Wishlist | Retrieve the specified wish list identified by the unique ID for a Wishlist object -For B2B, company users can have the following attributes. +For B2B, company administrators and users can have the following attributes. Attribute | Data Type | Description --- | --- | --- `job_title` | String | The job title for a B2B company user +`requisition_lists (pageSize = 20 Int, currentPage = 1 Int, filter RequisitionListFilterInput)` | RequisitionLists | Contains the customer's requisition lists `role`| CompanyRole | The role name and permissions assigned to the company user `status` | CompanyUserStatusEnum | Indicates whether the company user is ACTIVE or INACTIVE `team` | CompanyTeam | The team the company user is assigned to diff --git a/src/_includes/graphql/requisition-list.md b/src/_includes/graphql/requisition-list.md index 4b9a8c73727..912553db1bc 100644 --- a/src/_includes/graphql/requisition-list.md +++ b/src/_includes/graphql/requisition-list.md @@ -3,8 +3,18 @@ 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` | [RequistionListItems](#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 {#RequistionListItems} + +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 diff --git a/src/guides/v2.4/graphql/interfaces/requisition-list-item-interface.md b/src/guides/v2.4/graphql/interfaces/requisition-list-item-interface.md new file mode 100644 index 00000000000..8515d594c72 --- /dev/null +++ b/src/guides/v2.4/graphql/interfaces/requisition-list-item-interface.md @@ -0,0 +1,159 @@ +--- +group: graphql +title: RequisitionListItemInterface attributes and implementations +--- + +`RequisitionListItemInterface` provides details about items in a requisition list. It has the following implementations: + +* [`BundleRequisitionListItem`](#BundleRequisitionListItem) +* [`ConfigurableRequisitionListItem`](#ConfigurableRequisitionListItem) +* [`DownloadableRequisitionListItem`](#DownloadableRequisitionListItem) +* [`GiftCardRequisitionListItem`](#GiftCardRequisitionListItem) +* [`SimpleRequisitionListItem`](#SimpleRequisitionListItem) +* [`VirtualRequisitionListItem`](#VirtualRequisitionListItem) + +{:.bs-callout-info} +There is not an implementation for grouped products. The items within a grouped product are managed individually. + +## Attributes + +The `RequisitionListItemInterface` defines the following attributes. + +Attribute | Data Type | Description +--- | --- | --- +`customizable_options`: [SelectedCustomizableOption] | Selected custom options for an item in the requisition list +`product` | [ProductInterface!]({{page.baseurl}}/graphql/interfaces/product-interface.html) | Contains details about an item added to a requisition list +`quantity` | Float! | The amount added +`uid` | ID! | The unique ID for the requisition list item + +## Implementations + +### BundleRequisitionListItem attributes {#BundleRequisitionListItem} + +The `BundleRequisitionListItem` implementation adds the following attribute. + +Attribute | Data Type | Description +--- | --- | --- +`bundle_options`| [SelectedBundleOption]! | An array of selected options for a bundle product + +### ConfigurableRequisitionListItem attributes {#ConfigurableRequisitionListItem} + +The `ConfigurableRequisitionListItem` implementation adds the following attribute. + +Attribute | Data Type | Description +--- | --- | --- +`configurable_options`| [SelectedConfigurableOption] | Selected configurable options for an item in the requisition list + +### DownloadableRequisitionListItem attributes {#DownloadableRequisitionListItem} + +The `ConfigurableRequisitionListItem` implementation adds the following attributes. + +Attribute | Data Type | Description +--- | --- | --- +`links`| [DownloadableProductLinks] | An array of links for downloadable products in the requisition list +`samples` | [DownloadableProductSamples] An array of links to downloadable product samples + +### GiftCardRequisitionListItem attributes {#GiftCardRequisitionListItem} + +The `GiftCardRequisitionListItem` implementation adds the following attributes. + +Attribute | Data Type | Description +--- | --- | --- +`gift_card_options` | GiftCardOptions! | An array that defines gift card properties + +#### GiftCardOptions attributes {#GiftCardOptions} + +The GiftCardOptions object provides details about a gift card. All attributes are optional for a requisition list. + +Attribute | Data Type | Description +--- | --- | --- +`amount`| Money | The amount and currency of the gift card +`custom_giftcard_amount` | Money | The custom amount and currency of the gift card +`message` | String | A message to the recipient +`recipient_email` | String | The name of the person receiving the gift card +`sender_email` | String | The email address of the person sending the gift card +`sender_name` | String | The name of the person sending the gift card + +### SimpleRequisitionListItem attributes {#SimpleRequisitionListItem} + +The SimpleRequisitionListItem data type does not provide additional attributes to the `RequisitionListItemInterface`. + +### VirtualRequisitionListItem attributes {#VirtualRequisitionListItem} + +The VirtualRequisitionListItem data type does not provide additional attributes to the `RequisitionListItemInterface`. + +## Example usage + +The following mutation adds a product to a requisition list and returns information about the products in the list. + +**Request:** + +```graphql +mutation { + addProductsToRequisitionList( + requisitionListUid: "Mg==" + requisitionListItems: [ + { + sku: "MS10" + quantity: 1 + selected_options: ["Y29uZmlndXJhYmxlLzkzLzUw","Y29uZmlndXJhYmxlLzE2MC8xNjg"] + } + ] + ) { + requisition_list { + uid + items { + items { + ... on RequisitionListItemInterface { + uid + product { + uid + sku + name + } + quantity + } + } + } + items_count + } + } +} +``` + +**Response:** + +```json +{ + "data": { + "addProductsToRequisitionList": { + "requisition_list": { + "uid": "Mg==", + "items": { + "items": [ + { + "uid": "Mg==", + "product": { + "uid": "MTA=", + "sku": "24-WB05", + "name": "Savvy Shoulder Tote" + }, + "quantity": 1 + }, + { + "uid": "Mw==", + "product": { + "uid": "NTk2", + "sku": "MS10", + "name": "Logan HeatTec® Tee" + }, + "quantity": 1 + } + ] + }, + "items_count": 2 + } + } + } +} +``` diff --git a/src/guides/v2.4/graphql/queries/customer.md b/src/guides/v2.4/graphql/queries/customer.md index 78807350083..1ffa0e39179 100644 --- a/src/guides/v2.4/graphql/queries/customer.md +++ b/src/guides/v2.4/graphql/queries/customer.md @@ -629,26 +629,6 @@ Attribute | Data Type | Description {% include graphql/product-review.md %} -### Wishlist attributes {#Wishlist} - -Attribute | Data type | Description ---- | --- | --- -`items` | [[WishlistItem](#wishlistitem)] | An array of items in the customer's wish list -`items_count` | Int | The number of items in the wish list -`id` | ID | The unique identifier of the wish list -`sharing_code` | String | An encrypted code that Magento uses to link to the wish list -`updated_at` | String | The time of the last modification to the wish list - -#### WishlistItem attributes {#wishlistitem} - -Attribute | Data type | Description ---- | --- | --- -`added_at` | String | The time when the customer added the item to the wish list -`description` | String | The customer's comment about this item -`id` | Int | The wish list item ID -`product` | [ProductInterface]({{ page.baseurl }}/graphql/interfaces/product-interface.html) | The ProductInterface contains attributes that are common to all types of products. Note that descriptions may not be available for custom and EAV attributes -`qty` | Float | The quantity of this wish list item - ### Store credit attributes In {{site.data.var.ee}}, the merchant can assign store credit to customers. Magento maintains the history of all changes to the balance of store credit available to the customer. The customer must be logged in to access the store credit history and balance. @@ -694,6 +674,33 @@ Attribute | Data Type | Description {% include graphql/wishlist.md %} +## B2B output attributes {#B2b} + +If B2B is installed the `Customer` object can contain additional information. + +### RequisitionListFilterInput attributes {#RequisitionListFilterInput} + +The `RequisitionListFilterInput` object defines filters that limit the number of requisition lists returned. + +Attribute | Data Type | Description +--- | --- | --- +`name` | FilterMatchTypeInput | Filter by the display name of the requisition list +`uids` | FilterEqualTypeInput | Filter requisition lists by one or more requisition list IDs + +### RequisitionList attributes {#RequisitionList} + +{% include graphql/requisition-list.md %} + +### RequisitionLists attributes {#RequisitionList} + +The RequisitionLists object contains an array of requisition lists. + +Attribute | Data Type | Description +--- | --- | --- +`items` | [[RequisitionList]](#RequisitionList) | An array of requisition lists +`page_info` | SearchResultPageInfo | Contains pagination metadata +`total_count` | Int | The number of returned requisition lists + ## Related topics * [isEmailAvailable query]({{page.baseurl}}/graphql/queries/is-email-available.html)