cartSetVatNumber
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
| Argument | Type | Description |
|---|---|---|
id | ID! | |
version | String | |
vatNumber | String |
Returns
| Field | Type | Description |
|---|---|---|
cart | Cart | The 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 } } }}{ "id": "id-1", "version": "Example", "vatNumber": "Example"}{ "data": { "cartSetVatNumber": { "cart": { "id": "id-1", "version": "Example", "createdAt": "2026-10-01T09:30:00Z", "lastModifiedAt": "2026-10-01T09:30:00Z", "currency": "EUR", "customerEmail": "jane@example.com", "isGuest": true, "totalQuantity": 1, "deliveryRemarks": "Example", "vatNumber": "Example", "purchaseOrderNumber": "Example", "deliverySplit": "COMPLETE", "requestedDeliveryDate": "2026-10-01", "earliestCompleteDeliveryDate": "2026-10-01", "name": "Example", "defaultName": "Example", "status": "ACTIVE" }, "cartErrors": [ { "__typename": "ValidationError", "message": "Example" } ] } }}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/commercetools | Resolved |
| @evolve-framework/medusa | Resolved |
| @evolve-framework/sfcc | Not resolved |
Used by
The storefront packages that send it, in these GraphQL documents:
- @evolve-storefront/feature-cart:
CartSetVatNumber

