Skip to content

cartSetVatNumber

Mutationin Cart

Record the VAT number of the company the buyer orders for, with its country prefix, such as DE123456789. It travels to the order. Where the engine can, it checks the number against the EU's register as it records it; only a number found valid can make the cart reverse-charged, and Cart.vatOutcome says how it went. Recording the same number again checks it again.

Pass null to clear a number already recorded.

Arguments

ArgumentTypeDescription
idID!
versionString
vatNumberString

Returns

CartSetVatNumberResponse!

FieldTypeDescription
cartCartThe cart carrying the VAT number
cartErrors[CartSetVatNumberError!]Error details if the VAT number could not be recorded

Example

mutation CartSetVatNumber($id: ID!, $version: String, $vatNumber: String) {
cartSetVatNumber(id: $id, version: $version, vatNumber: $vatNumber) {
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: