Edit in GitHubLog an issue
B2B feature. Learn more

addPurchaseOrderItemsToCart mutation

The addPurchaseOrderItemsToCart mutation adds all purchase order items to the shopping cart. The request must specify a cart_id and a purchase_order_uid. If the value of replace_existing_cart_items is set to true, the mutation deletes the pre-existing items from the purchase order. Otherwise, the mutation merges the pre-existing items with the new items.

Syntax

Copied to your clipboard
mutation {
addPurchaseOrderItemsToCart(
input: AddPurchaseOrderItemsToCartInput!
){
AddProductsToCartOutput
}
}

Reference

The addPurchaseOrderItemsToCart reference provides detailed information about the types and fields defined in this mutation.

Example usage

The following example adds all purchase order items to the shopping cart.

Request:

Copied to your clipboard
mutation {
addPurchaseOrderItemsToCart(
input: {
purchase_order_uid: "MQ==",
cart_id: "hJUrIcPm77uCyYkSTBRGyjSvS40mw1Qd",
replace_existing_cart_items: false
}
) {
cart {
id
items {
product {
sku
}
}
}
user_errors {
message
code
}
}
}

Response:

Copied to your clipboard
{
"data": {
"addPurchaseOrderItemsToCart": {
"cart": {
"id": "hJUrIcPm77uCyYkSTBRGyjSvS40mw1Qd",
"items": [
{
"product": {
"sku": "Simple product"
}
}
]
},
"user_errors": []
}
}
}
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.