Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions src/pages/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/pages/graphql/schema/b2b/company/mutations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Original file line number Diff line number Diff line change
@@ -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
---

<Fragment src="/includes/commerce-only.md"/>

# updateCompanyConfig mutation

<Fragment src="/includes/scp-b2b-mutation.md" />

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. |
18 changes: 18 additions & 0 deletions src/pages/graphql/schema/b2b/requisition-list/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

<Fragment src="/includes/scp-b2b-query.md" />

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.
Original file line number Diff line number Diff line change
@@ -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
---

<Fragment src="/includes/commerce-only.md"/>

# addPublicRequisitionListItemsToCart mutation

<Fragment src="/includes/scp-b2b-mutation.md" />

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.

<InlineAlert variant="info" slots="text" />

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.

Comment thread
cod40403 marked this conversation as resolved.
## 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.
Comment thread
cod40403 marked this conversation as resolved.

**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": []
}
}
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Loading
Loading