diff --git a/src/pages/config.md b/src/pages/config.md index dbff60d6e..67c97954d 100644 --- a/src/pages/config.md +++ b/src/pages/config.md @@ -274,6 +274,7 @@ - [setDefaultCompanyAddress](/graphql/schema/b2b/company/mutations/set-default-address.md) - [updateCompany](/graphql/schema/b2b/company/mutations/update.md) - [updateCompanyAddress](/graphql/schema/b2b/company/mutations/update-address.md) + - [updateCompanyConfig](/graphql/schema/b2b/company/mutations/update-company-config.md) - [unassignChildCompany](/graphql/schema/b2b/company/mutations/unassign-child-company.md) - [updateCompanyRole](/graphql/schema/b2b/company/mutations/update-role.md) - [updateCompanyStructure](/graphql/schema/b2b/company/mutations/update-structure.md) @@ -433,6 +434,7 @@ - [Requisition lists (B2B)](/graphql/schema/b2b/requisition-list/index.md) - [Mutations](/graphql/schema/b2b/requisition-list/mutations/index.md) - [addProductsToRequisitionList](/graphql/schema/b2b/requisition-list/mutations/add-products.md) + - [addPublicRequisitionListItemsToCart](/graphql/schema/b2b/requisition-list/mutations/add-public-requisition-list-items-to-cart.md) - [addRequisitionListItemsToCart](/graphql/schema/b2b/requisition-list/mutations/add-items-to-cart.md) - [clearCustomerCart](/graphql/schema/b2b/requisition-list/mutations/clear-customer-cart.md) - [copyItemsBetweenRequisitionLists](/graphql/schema/b2b/requisition-list/mutations/copy-items.md) @@ -441,11 +443,13 @@ - [deleteRequisitionListItems](/graphql/schema/b2b/requisition-list/mutations/delete-items.md) - [importSharedRequisitionList](/graphql/schema/b2b/requisition-list/mutations/import-shared-requisition-list.md) - [moveItemsBetweenRequisitionLists](/graphql/schema/b2b/requisition-list/mutations/move-items.md) + - [sharePublicRequisitionList](/graphql/schema/b2b/requisition-list/mutations/share-public-requisition-list.md) - [shareRequisitionListByEmail](/graphql/schema/b2b/requisition-list/mutations/share-requisition-list-by-email.md) - [shareRequisitionListByToken](/graphql/schema/b2b/requisition-list/mutations/share-requisition-list-by-token.md) - [updateRequisitionList](/graphql/schema/b2b/requisition-list/mutations/update.md) - [updateRequisitionListItems](/graphql/schema/b2b/requisition-list/mutations/update-items.md) - [Queries](/graphql/schema/b2b/requisition-list/queries/index.md) + - [publicRequisitionList](/graphql/schema/b2b/requisition-list/queries/public-requisition-list.md) - [sharedRequisitionList](/graphql/schema/b2b/requisition-list/queries/shared-requisition-list.md) - [Interfaces](/graphql/schema/b2b/requisition-list/interfaces/index.md) - [Store](/graphql/schema/store/index.md) diff --git a/src/pages/graphql/schema/b2b/company/mutations/index.md b/src/pages/graphql/schema/b2b/company/mutations/index.md index 833dfc0b9..dea546f8a 100644 --- a/src/pages/graphql/schema/b2b/company/mutations/index.md +++ b/src/pages/graphql/schema/b2b/company/mutations/index.md @@ -24,3 +24,4 @@ The company address book mutations allow you to perform the company address mana * Create, update and delete a company address. * Set default company billing or shipping address. +* [Update company address book configuration](update-company-config.md). diff --git a/src/pages/graphql/schema/b2b/company/mutations/update-company-config.md b/src/pages/graphql/schema/b2b/company/mutations/update-company-config.md new file mode 100644 index 000000000..2a5538843 --- /dev/null +++ b/src/pages/graphql/schema/b2b/company/mutations/update-company-config.md @@ -0,0 +1,124 @@ +--- +title: updateCompanyConfig mutation +description: This mutation is part of the B2B Storefront Compatibility Package and is only available on Adobe Commerce as a Cloud Service. +keywords: + - B2B +--- + + + +# updateCompanyConfig mutation + + + +The `updateCompanyConfig` mutation updates configuration settings for the current company context. Currently, this mutation supports the company address book settings: whether the company address book is enabled, and whether custom shipping addresses can be entered at checkout when the address book is enabled. Disabling the address book also disables custom shipping address entry, even if `custom_shipping_address_enabled` is set to `true` in the same request. + +This mutation requires a valid [customer authentication token](../../../customer/mutations/generate-token.md) for a company admin or a company user assigned a role with the `Magento_CompanyStorefrontCompatibility::manage_config` (**Manage Company Configuration**) permission. + +## Syntax + +```graphql +mutation { + updateCompanyConfig( + input: UpdateCompanyConfigInput! + ) { + UpdateCompanyConfigOutput + } +} +``` + +## Reference + +The [`updateCompanyConfig`](/reference/graphql/saas/mutations.md#updatecompanyconfig) reference provides detailed information about the types and fields defined in this mutation. + +## Example usage + +### Enable the company address book and custom shipping addresses + +The following example enables the company address book and allows custom shipping addresses to be entered at checkout. + +**Request:** + +```graphql +mutation UpdateCompanyConfig { + updateCompanyConfig( + input: { + address_book_enabled: true + custom_shipping_address_enabled: true + } + ) { + company { + config { + address_book_enabled + address_book_custom_shipping_address_enabled + } + } + } +} +``` + +**Response:** + +```json +{ + "data": { + "updateCompanyConfig": { + "company": { + "config": { + "address_book_enabled": true, + "address_book_custom_shipping_address_enabled": true + } + } + } + } +} +``` + +### Disable the company address book + +The following example disables the company address book. Custom shipping address entry is disabled as well, even though `custom_shipping_address_enabled` is not specified in the request. + +**Request:** + +```graphql +mutation UpdateCompanyConfig { + updateCompanyConfig( + input: { + address_book_enabled: false + } + ) { + company { + config { + address_book_enabled + address_book_custom_shipping_address_enabled + } + } + } +} +``` + +**Response:** + +```json +{ + "data": { + "updateCompanyConfig": { + "company": { + "config": { + "address_book_enabled": false, + "address_book_custom_shipping_address_enabled": false + } + } + } + } +} +``` + +## Errors + +| Error | Description | +| --- | --- | +| `"input" value should be specified` | The `input` argument was not provided. | +| `At least one supported configuration value must be specified.` | Neither `address_book_enabled` nor `custom_shipping_address_enabled` was specified in `input`. | +| `Company context is required.` | Missing `X-Adobe-Company` header, or the customer is not a company user. | +| `You do not have authorization to perform this action.` | The company user is not assigned the `Manage Company Configuration` permission. | diff --git a/src/pages/graphql/schema/b2b/requisition-list/index.md b/src/pages/graphql/schema/b2b/requisition-list/index.md index 50a533f11..837f74b1e 100644 --- a/src/pages/graphql/schema/b2b/requisition-list/index.md +++ b/src/pages/graphql/schema/b2b/requisition-list/index.md @@ -12,3 +12,21 @@ keywords: Requisition lists are similar to wish lists, except they are used in the context of B2B transactions. Using a requisition list saves time for buyers who frequently purchase products on a continuing basis. Items are added to the shopping cart directly from the requisition list. Customers can maintain multiple lists to streamline their workflow. For example, they can create lists that focus on products from different vendors, buyers, teams, or campaigns. Requisition lists are available for both logged-in users and guests. The [_B2B for Adobe Commerce_](https://experienceleague.adobe.com/en/docs/commerce-admin/b2b/requisition-lists/requisition-lists) guide describes requisition lists in detail. + +## Public requisition list sharing + + + +The B2B Storefront Compatibility Package adds the following fields to the [`RequisitionList`](/reference/graphql/saas/index.md#requisitionlist) object so a requisition list can be shared publicly, without requiring the recipient to be a customer in the same company as the list owner: + +* `is_public` +* `token` + +It also adds an `is_public` field to the [`CreateRequisitionListInput`](/reference/graphql/saas/index.md#createrequisitionlistinput) and [`UpdateRequisitionListInput`](/reference/graphql/saas/index.md#updaterequisitionlistinput) objects used by the [`createRequisitionList`](mutations/create.md) and [`updateRequisitionList`](mutations/update.md) mutations, and the following fields to [`StoreConfig`](/reference/graphql/saas/index.md#storeconfig): + +* `requisition_list_public_sharing_enabled` +* `requisition_list_public_share_link_validity_days` +* `requisition_list_public_share_max_recipients` +* `requisition_list_public_share_storefront_path` + +Use these fields together with the [`publicRequisitionList`](queries/public-requisition-list.md) query and the [`sharePublicRequisitionList`](mutations/share-public-requisition-list.md) and [`addPublicRequisitionListItemsToCart`](mutations/add-public-requisition-list-items-to-cart.md) mutations to let customers generate and share a public link to a requisition list. diff --git a/src/pages/graphql/schema/b2b/requisition-list/mutations/add-public-requisition-list-items-to-cart.md b/src/pages/graphql/schema/b2b/requisition-list/mutations/add-public-requisition-list-items-to-cart.md new file mode 100644 index 000000000..1ba611b35 --- /dev/null +++ b/src/pages/graphql/schema/b2b/requisition-list/mutations/add-public-requisition-list-items-to-cart.md @@ -0,0 +1,151 @@ +--- +title: addPublicRequisitionListItemsToCart mutation +description: This mutation is part of the B2B Storefront Compatibility Package and is only available on Adobe Commerce as a Cloud Service. +keywords: + - B2B +--- + + + +# addPublicRequisitionListItemsToCart mutation + + + +The `addPublicRequisitionListItemsToCart` mutation adds items from a public requisition list, identified by its share token, to a cart. Omit `item_uids` to add every item in the list to the cart. Items that the caller is not permitted to view or purchase are skipped and reported as `RESTRICTED_PRODUCT` errors rather than failing the entire request. + + + +A customer authentication token is optional. Guests must supply the `cart_id` of a guest cart obtained from the [`createGuestCart`](../../../cart/mutations/create-guest-cart.md) mutation. When a valid customer authentication token is provided, the mutation operates on that customer's own cart instead, and catalog-permission checks (including shared catalog grants) are evaluated against the authenticated customer's own customer group rather than the guest group. + +## Syntax + +```graphql +{ + addPublicRequisitionListItemsToCart( + input: AddPublicRequisitionListItemsToCartInput! + ): AddPublicRequisitionListItemsToCartOutput +} +``` + +## Reference + +The [`addPublicRequisitionListItemsToCart`](/reference/graphql/saas/mutations.md#addpublicrequisitionlistitemstocart) reference provides detailed information about the types and fields defined in this mutation. + +## Example usage + +### Add items to a guest cart + +The following example adds two items from a public requisition list to a guest cart. + +**Request:** + +```graphql +mutation AddPublicRequisitionListItemsToCart { + addPublicRequisitionListItemsToCart( + input: { + token: "qEJD2aUhmYnf1jNoaOtlo7XwBP8BRof5GhF0L5kbdJxYMZ13OlFvy2VFy33NnUCp" + cart_id: "Rz3OrE0R8fajxHK5simIkwm4uvWDXlYt" + item_uids: ["NDEw", "NDEx"] + } + ) { + cart { + items { + uid + product { + sku + name + } + } + } + user_errors { + code + message + } + } +} +``` + +**Response:** + +```json +{ + "data": { + "addPublicRequisitionListItemsToCart": { + "cart": { + "items": [ + { + "uid": "OA==", + "product": { + "sku": "Augusta", + "name": "Augusta" + } + } + ] + }, + "user_errors": [] + } + } +} +``` + +### Add items to a logged-in customer's cart + +The following example adds two items from a public requisition list to the cart of an authenticated customer. Send the customer's [authentication token](../../../customer/mutations/generate-token.md) in the `Authorization` header, and specify the `cart_id` of that customer's own cart. Because the caller is authenticated, catalog-permission checks (including shared catalog grants) are evaluated against this customer's own customer group instead of the guest group. + +**Request:** + +```graphql +mutation AddPublicRequisitionListItemsToCart { + addPublicRequisitionListItemsToCart( + input: { + token: "qEJD2aUhmYnf1jNoaOtlo7XwBP8BRof5GhF0L5kbdJxYMZ13OlFvy2VFy33NnUCp" + cart_id: "8Zn6VYaFAyO7WYlj9NLPTolKk3G4dh1o" + item_uids: ["NDEw", "NDEx"] + } + ) { + cart { + items { + uid + product { + sku + name + } + } + } + user_errors { + code + message + } + } +} +``` + +**Response:** + +```json +{ + "data": { + "addPublicRequisitionListItemsToCart": { + "cart": { + "items": [ + { + "uid": "OA==", + "product": { + "sku": "Augusta", + "name": "Augusta" + } + }, + { + "uid": "OQ==", + "product": { + "sku": "24-WB03", + "name": "Driven Backpack" + } + } + ] + }, + "user_errors": [] + } + } +} +``` diff --git a/src/pages/graphql/schema/b2b/requisition-list/mutations/index.md b/src/pages/graphql/schema/b2b/requisition-list/mutations/index.md index 17ab1b31a..d8f1a68f2 100644 --- a/src/pages/graphql/schema/b2b/requisition-list/mutations/index.md +++ b/src/pages/graphql/schema/b2b/requisition-list/mutations/index.md @@ -27,7 +27,9 @@ The B2B requisition list mutations allow you to perform the following operations - [Share requisition list with a token](share-requisition-list-by-token.md) - [Share requisition list by email](share-requisition-list-by-email.md) - [Import shared requisition list](import-shared-requisition-list.md) + - [Share a public requisition list by email](share-public-requisition-list.md) - Manage the cart - [Add requisition list items to the cart](add-items-to-cart.md) + - [Add public requisition list items to the cart](add-public-requisition-list-items-to-cart.md) - [Clear the cart](clear-customer-cart.md) diff --git a/src/pages/graphql/schema/b2b/requisition-list/mutations/share-public-requisition-list.md b/src/pages/graphql/schema/b2b/requisition-list/mutations/share-public-requisition-list.md new file mode 100644 index 000000000..2b378bf09 --- /dev/null +++ b/src/pages/graphql/schema/b2b/requisition-list/mutations/share-public-requisition-list.md @@ -0,0 +1,68 @@ +--- +title: sharePublicRequisitionList mutation +description: This mutation is part of the B2B Storefront Compatibility Package and is only available on Adobe Commerce as a Cloud Service. +keywords: + - B2B +--- + + + +# sharePublicRequisitionList mutation + + + +The `sharePublicRequisitionList` mutation emails the share link for a public requisition list to one or more recipients. Recipients could be registered customers or guests. The mutation requires `requisition_list_uid` and an array of `emails` as input parameters. This mutation returns a `sent_count` which shows the number of emails successfully sent, and `user_errors`, if any. + + + +This mutation requires a valid [customer authentication token](../../../customer/mutations/generate-token.md), and only the owner of the requisition list can call it. The list must already be marked public. Use the [`createRequisitionList`](create.md) or [`updateRequisitionList`](update.md) mutation with `is_public: true` to mark a list public before sharing it. + +## Syntax + +```graphql +{ + sharePublicRequisitionList( + input: SharePublicRequisitionListInput! + ): SharePublicRequisitionListOutput +} +``` + +## Reference + +The [`sharePublicRequisitionList`](/reference/graphql/saas/mutations.md#sharepublicrequisitionlist) reference provides detailed information about the types and fields defined in this mutation. + +## Example usage + +The following example shares a public requisition list with the specified email addresses. + +**Request:** + +```graphql +mutation SharePublicRequisitionList { + sharePublicRequisitionList( + input: { + requisition_list_uid: "OTc5" + emails: ["buyer1@example.com", "buyer2@example.com"] + } + ) { + sent_count + user_errors { + code + message + } + } +} +``` + +**Response:** + +```json +{ + "data": { + "sharePublicRequisitionList": { + "sent_count": 2, + "user_errors": [] + } + } +} +``` diff --git a/src/pages/graphql/schema/b2b/requisition-list/queries/index.md b/src/pages/graphql/schema/b2b/requisition-list/queries/index.md index 9370b03ab..43371bd0e 100644 --- a/src/pages/graphql/schema/b2b/requisition-list/queries/index.md +++ b/src/pages/graphql/schema/b2b/requisition-list/queries/index.md @@ -9,6 +9,7 @@ keywords: # Requisition list (B2B) queries -The following query retrieves a shared requisition list +The following queries retrieve a shared requisition list - [View Shared Requisition List](shared-requisition-list.md) +- [View Public Requisition List](public-requisition-list.md) diff --git a/src/pages/graphql/schema/b2b/requisition-list/queries/public-requisition-list.md b/src/pages/graphql/schema/b2b/requisition-list/queries/public-requisition-list.md new file mode 100644 index 000000000..7e3344196 --- /dev/null +++ b/src/pages/graphql/schema/b2b/requisition-list/queries/public-requisition-list.md @@ -0,0 +1,108 @@ +--- +title: publicRequisitionList query +description: This query is part of the B2B Storefront Compatibility Package and is only available on Adobe Commerce as a Cloud Service. +keywords: + - B2B +--- + + + +# publicRequisitionList query + + + +The `publicRequisitionList` query uses a share token to retrieve a requisition list that its owner has marked public. Unlike [`sharedRequisitionList`](shared-requisition-list.md), this query does not require the requester to be a customer authenticated in the same company as the list owner. Anyone with a valid share link or token can access the public requisition list. The response can contain the `sender_name` and `requisition_list` object. + + + +This query does not require a customer authentication token. If the token is invalid or the list is no longer public, this query returns a GraphQL error. + +## Syntax + +```graphql +{ + publicRequisitionList( + token: ID! + ): PublicRequisitionListOutput +} +``` + +## Reference + +The [`publicRequisitionList`](/reference/graphql/saas/index.md#publicrequisitionlist) reference provides detailed information about the types and fields defined in this query. + +## Example usage + +The following example opens a public requisition list by specifying the share token. + +**Request:** + +```graphql +query PublicRequisitionList { + publicRequisitionList( + token: "qEJD2aUhmYnf1jNoaOtlo7XwBP8BRof5GhF0L5kbdJxYMZ13OlFvy2VFy33NnUCp" + ) { + sender_name + requisition_list { + description + name + uid + is_public + items(currentPage: 1, pageSize: 20) { + total_pages + items { + quantity + sku + uid + product { + attribute_set_id + name + } + } + page_info { + current_page + page_size + total_pages + } + } + } + } +} +``` + +**Response:** + +```json +{ + "data": { + "publicRequisitionList": { + "sender_name": "Jane", + "requisition_list": { + "description": "Test RL sharing", + "name": "Shared RL", + "uid": "OTc5", + "is_public": true, + "items": { + "total_pages": 1, + "items": [ + { + "quantity": 2, + "sku": "Augusta", + "uid": "NDEw", + "product": { + "attribute_set_id": 4, + "name": "Augusta" + } + } + ], + "page_info": { + "current_page": 1, + "page_size": 20, + "total_pages": 1 + } + } + } + } + } +} +```