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
12 changes: 12 additions & 0 deletions src/data/navigation/sections/graphql.js
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,10 @@ module.exports = [
title: "negotiableQuotes",
path: "/graphql/schema/b2b/negotiable-quote/queries/quotes/",
},
{
title: "negotiableQuoteTemplates",
path: "/graphql/schema/b2b/negotiable-quote/queries/templates/",
},
],
},
{
Expand All @@ -775,6 +779,10 @@ module.exports = [
title: "placeNegotiableQuoteOrder",
path: "/graphql/schema/b2b/negotiable-quote/mutations/place-order/",
},
{
title: "placeNegotiableQuoteOrderV2",
path: "/graphql/schema/b2b/negotiable-quote/mutations/place-order-v2/",
},
{
title: "removeNegotiableQuoteItems",
path: "/graphql/schema/b2b/negotiable-quote/mutations/remove-items/",
Expand Down Expand Up @@ -803,6 +811,10 @@ module.exports = [
title: "setNegotiableQuoteShippingMethods",
path: "/graphql/schema/b2b/negotiable-quote/mutations/set-shipping-methods/",
},
{
title: "setQuoteTemplateExpirationDate",
path: "/graphql/schema/b2b/negotiable-quote/mutations/set-quote-template-expiration-date/",
},
{
title: "updateNegotiableQuoteQuantities",
path: "/graphql/schema/b2b/negotiable-quote/mutations/update-quantities/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ The B2B negotiable quote mutations allow you to perform the following operations
- [Set the shipping method](set-shipping-methods.md)
- [Set the payment method](set-payment-method.md)
- [Place the order](place-order.md)
- [Place the order V2](place-order-v2.md)
- Manage Quote Templates
- [Set Negotiable Quote Template Expiration Date](set-quote-template-expiration-date.md)

Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
title: placeNegotiableQuoteOrderV2 mutation
edition: saas
keywords:
- B2B
---

import CommerceOnly from '/src/_includes/commerce-only.md'

<CommerceOnly />

# placeNegotiableQuoteOrderV2 mutation

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

This mutation is part of the B2B Storefront Compatibility Package and is only available on [Adobe Commerce as a Cloud Service](https://experienceleague.adobe.com/en/docs/commerce/cloud-service/overview).

The `placeNegotiableQuoteOrderV2` mutation converts a negotiable quote into an order and returns the full order object.

The negotiable quote must have one of the following statuses:

- SUBMITTED
- DECLINED
- EXPIRED

If the status is DECLINED or EXPIRED, the negotiable quote is processed like a standard cart, without applying any discounts. The negotiable quote is not converted to a standard cart.

Perform the following actions before using the `placeNegotiableQuoteOrderV2` mutation. It might be necessary to perform additional steps during the process of coming to an agreement during the negotiable quote lifecycle.

- [Create an empty cart](../../../cart/mutations/create-empty-cart.md)
- [Add one or more products](../../../cart/mutations/add-products.md) to the cart
- [Request a negotiable quote](request.md)
- [Set the billing address](set-billing-address.md)
- [Set the shipping address](set-shipping-address.md)
- [Set the shipping method](set-shipping-methods.md)
- [Set the payment method](set-payment-method.md)

You cannot manage orders with GraphQL, because orders are part of the backend. You can use REST calls to manage orders to their completion.

## Syntax

```graphql
mutation {
placeNegotiableQuoteOrderV2(
input: PlaceNegotiableQuoteOrderInput
) {
PlaceNegotiableQuoteOrderOutputV2
}
}
```

<!--
## Reference

The [`placeNegotiableQuoteOrderV2`](https://developer.adobe.com/commerce/webapi/graphql-api/saas/index.html#mutation-placeNegotiableQuoteOrderV2) reference provides detailed information about the types and fields defined in this mutation.
-->

## Example usage

**Request:**

```graphql
mutation {
placeNegotiableQuoteOrderV2(
input: {
quote_uid: "xCA4wSZEHsb5QbFiKfoq5k1Dk8vIPBgb"
}
) {
order {
number
token
#...
}
errors {
message
code
}
}
}
```

**Response:**

```json
{
"data": {
"placeNegotiableQuoteOrderV2": {
"order": {
"number": "000000006",
"token": "0:3:OSScWU6PKLn3kFyMhNWyskG0opgVvFBnJmtuaFHKGwDFT83S6Kv9U39iYwixuU+vhwDz2AF4pCs3GtLhHbQ="
},
"errors": []
}
}
}
```

## Errors

Code | Error | Description
--- | --- | ---
`CART_NOT_FOUND` | `Could not find a cart with ID` | The specified cart ID is invalid.
`CART_NOT_ACTIVE` | `The cart isn't active.` | The specified cart ID is not active.
`GUEST_EMAIL_MISSING` | `Guest email for cart is missing.` | The guest attempted to place an order but did not provide an email address. See [setGuestEmailOnCart](../../../cart/mutations/set-guest-email.md) mutation.
`UNABLE_TO_PLACE_ORDER` | `A server error stopped your order from being placed. Please try to place your order again` | The shopper tried to place an order when no products are in the shopping cart.
`UNABLE_TO_PLACE_ORDER` | `Some addresses can't be used due to the configurations for specific countries` | The shipping method was not set. See [setShippingMethodsOnCart](set-shipping-methods.md) mutation.
`UNABLE_TO_PLACE_ORDER` | `The shipping method is missing. Select the shipping method and try again` | The shipping method was not set. See [setShippingMethodsOnCart](set-shipping-methods.md) mutation.
`UNABLE_TO_PLACE_ORDER` | `Please check the billing address information` | The billing address was not set. See [setBillingAddressOnCart](../../../cart/mutations/set-billing-address.md) mutation.
`UNABLE_TO_PLACE_ORDER` | `Enter a valid payment method and try again` | The payment method was not set. See [setPaymentMethodOnCart](../../../cart/mutations/set-payment-method.md) mutation.
`UNABLE_TO_PLACE_ORDER` | `Some of the products are out of stock` | One of the products in the shopping cart are currently out of stock.
`UNDEFINED` | `UNDEFINED` | The error message does not match any error code
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import CommerceOnly from '/src/_includes/commerce-only.md'

# placeNegotiableQuoteOrder mutation

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

This mutation has been deprecated in Adobe Commerce as a Cloud Service. Use the [placeNegotiableQuoteOrderV2 mutation](./place-order-v2.md) instead.

The `placeNegotiableQuoteOrder` mutation converts a negotiable quote into an order and returns an order ID.

The negotiable quote must have one of the following statuses:
Expand All @@ -30,7 +34,7 @@ Perform the following actions before using the `placeNegotiableQuoteOrder` mutat
- [Set the shipping method](set-shipping-methods.md)
- [Set the payment method](set-payment-method.md)

You cannot manage orders with GraphQL, because orders are part of the backend. You can use REST or SOAP calls to manage orders to their completion.
You cannot manage orders with GraphQL, because orders are part of the backend. You can use REST calls to manage orders to their completion.

## Syntax

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
title: setQuoteTemplateExpirationDate mutation
edition: saas
keywords:
- B2B
---

import CommerceOnly from '/src/_includes/commerce-only.md'

<CommerceOnly />

# setQuoteTemplateExpirationDate mutation

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

This mutation is part of the B2B Storefront Compatibility Package and is only available on [Adobe Commerce as a Cloud Service](https://experienceleague.adobe.com/en/docs/commerce/cloud-service/overview).

The `setQuoteTemplateExpirationDate` mutation can be used to set an expiration date for a negotiable quote, as it is not set by default. The mutation requires `template_id` and `expiration_date` as input parameters.

## Syntax

```graphql
{
setQuoteTemplateExpirationDate(
input: QuoteTemplateExpirationDateInput!
): NegotiableQuoteTemplate
}
```

<!--
## Reference

The [`setQuoteTemplateExpirationDate`](https://developer.adobe.com/commerce/webapi/graphql-api/saas/index.html#mutation-setQuoteTemplateExpirationDate) reference provides detailed information about the types and fields defined in this mutation.
-->

## Example usage

The following example sets the expiration date for a negotiable quote.

**Request:**

```graphql
mutation {
setQuoteTemplateExpirationDate(
input: {
template_id: "10"
expiration_date: "2030-13-01"
}
) {
template_id
expiration_date
}
}
```

**Response:**

```json
{
"data": {
"setQuoteTemplateExpirationDate": {
"template_id": "10",
"expiration_date": "2030-13-01"
}
}
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ import CommerceOnly from '/src/_includes/commerce-only.md'

# Negotiable quote (B2B) queries

B2B for Adobe Commerce provides two negotiable quote queries. [`negotiableQuote`](./quote.md) returns details about a single quote. [`negotiableQuotes`](./quotes.md) returns multiple quotes, filtered by name or ID.
B2B for Adobe Commerce provides two negotiable quote queries.

- [`negotiableQuote`](./quote.md) returns details about a single quote.
- [`negotiableQuotes`](./quotes.md) returns multiple quotes, filtered by name or ID.
- [`negotiableQuoteTemplates`](./templates.md) returns multiple quote templates, filtered by name or ID.
122 changes: 122 additions & 0 deletions src/pages/graphql/schema/b2b/negotiable-quote/queries/templates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
title: negotiableQuoteTemplates query
edition: saas
keywords:
- B2B
---

import CommerceOnly from '/src/_includes/commerce-only.md'

<CommerceOnly />

# negotiableQuoteTemplates query

The `negotiableQuoteTemplates` query returns a list of negotiable quote templates that can be viewed by the logged-in customer, including quote templates created by the customer or by subordinates in the company hierarchy.

This query requires a valid [customer authentication token](../../../customer/mutations/generate-token.md).

## Syntax

```graphql
{
negotiableQuoteTemplates(
filter: NegotiableQuoteTemplateFilterInput,
pageSize: Int = 20,
currentPage: Int = 1
sort: NegotiableQuoteTemplateSortInput
): NegotiableQuoteTemplatesOutput
}
```

## Reference

The [`negotiableQuoteTemplates`](https://developer.adobe.com/commerce/webapi/graphql-api/index.html#query-negotiableQuoteTemplates) reference provides detailed information about the types and fields defined in this query.

## Example usage

### Find quote templates that contain a specific string

The following example returns general information about the negotiable quote templates containing the string `request` that are accessible to the company user. The results are sorted by negotiable quote name, listed in ascending order.

**Request:**

```graphql
query {
negotiableQuoteTemplates(filter: { name:
{ match: "request" }
})
{
items {
uid
name
created_at
status
}
total_count
page_info {
page_size
current_page
total_pages
}
sort_fields {
default
options {
label
value
}
}
}
}
```

**Response:**

```json
{
"data": {
"negotiableQuoteTemplates": {
"items": [
{
"uid": "MTU0",
"name": "Last request Template",
"created_at": "2021-04-28 15:43:09",
"status": "Active"
},
{
"uid": "MTUz",
"name": "Latest request Template",
"created_at": "2021-04-26 16:35:48",
"status": "Active"
},
{
"uid": "MTUy",
"name": "April 22 request",
"created_at": "2021-04-22 15:59:47",
"status": "Active"
},
{
"uid": "MTUx",
"name": "Discount request",
"created_at": "2021-04-20 19:01:38",
"status": "Active"
}
],
"total_count": 4,
"page_info": {
"page_size": 20,
"current_page": 1,
"total_pages": 1
},
"sort_fields": {
"default": "TEMPLATE_ID",
"options": [
{
"label": "Last Shared",
"value": "LAST_SHARED_AT"
}
]
}
}
}
}
```