-
Notifications
You must be signed in to change notification settings - Fork 121
Webapi Documentation added for Public Requisition List sharing feature #617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cod40403
wants to merge
5
commits into
AdobeDocs:main
Choose a base branch
from
cod40403:USF-4385
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d2dc720
Webapi Documentation added for Public Requisition List sharing feature
cod40403 9323036
Feedback fixed
cod40403 16feee5
feedback fixed
cod40403 4c4e0dc
Merge branch 'main' into USF-4385
cod40403 7d9c71b
Doc added for updateCompanyConfig mutation
cod40403 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
src/pages/graphql/schema/b2b/company/mutations/update-company-config.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
151 changes: 151 additions & 0 deletions
151
...ema/b2b/requisition-list/mutations/add-public-requisition-list-items-to-cart.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
|
|
||
| ## 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. | ||
|
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": [] | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.