Skip to content

cartSetPurchaseOrderNumber

Mutationin CartB2B only

Record the buyer's own reference for this purchase, usually a purchase order number. It belongs to the company rather than the shopper, so only an associate of the business unit the cart belongs to may record one -- which is why this is part of the B2B schema and not the cart every storefront gets.

Pass null to clear a reference already recorded.

Arguments

ArgumentTypeDescription
idID!
versionString
purchaseOrderNumberString

Returns

CartSetPurchaseOrderNumberResponse!

FieldTypeDescription
cartB2BCartThe cart carrying the reference
cartErrorsB2B[CartSetPurchaseOrderNumberError!]Error details if the reference could not be recorded

Example

mutation CartSetPurchaseOrderNumber(
$id: ID!
$version: String
$purchaseOrderNumber: String
) {
cartSetPurchaseOrderNumber(
id: $id
version: $version
purchaseOrderNumber: $purchaseOrderNumber
) {
cart {
id
version
createdAt
lastModifiedAt
currency
customerEmail
isGuest
totalQuantity
deliveryRemarks
vatNumber
purchaseOrderNumber
deliverySplit
requestedDeliveryDate
earliestCompleteDeliveryDate
name
defaultName
status
}
cartErrors {
__typename
... on ValidationError {
message
}
... on CartError {
message
code
}
}
}
}

The query selects the return type's fields two levels deep; pick the ones you need. The response shows its shape with placeholder values.

Served by

@evolve-framework/commercetoolsResolved
@evolve-framework/medusaResolved
@evolve-framework/sfccNot resolved

Used by

The storefront packages that send it, in these GraphQL documents: