For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dev Portal
DocsAPI ReferenceLearnCommunityChangelog
DocsAPI ReferenceLearnCommunityChangelog
    • About Our APIs
  • REST
    • Overview
  • GraphQL
    • Overview
      • Playground
          • QUERYcompanyRoles
          • QUERYcompanyRole
          • QUERYcompanyPermissions
          • QUERYaccountSettings
          • QUERYcustomerAccountSettings
          • QUERYinvoices
          • QUERYinvoice
          • QUERYinvoiceStats
          • QUERYinvoiceCustomerInformation
          • QUERYinvoicePaymentModules
          • QUERYinvoiceBcOrderAllowMethods
          • QUERYinvoicePaymentBcCart
          • QUERYinvoicePaymentFees
          • QUERYreceipts
          • QUERYreceipt
          • QUERYallReceiptLines
          • QUERYreceiptLine
          • QUERYreceiptLines
          • QUERYorder
          • QUERYallOrders
          • QUERYorderProducts
          • QUERYorderedProducts
          • QUERYcustomerOrders
          • QUERYcustomerOrder
          • QUERYcreatedByUser
          • QUERYshoppingLists
          • QUERYshoppingList
          • QUERYshoppingListsIdName
          • QUERYcustomerShoppingLists
          • QUERYcustomerShoppingList
          • QUERYcustomerShoppingListsIdName
          • QUERYcompanyExtraFields
          • QUERYuserCompany
          • QUERYcompanyValidateEmail
          • QUERYcompanyUserInfo
          • QUERYaccountFormFields
          • QUERYcompanyCreditConfig
          • QUERYcompanyPaymentTerms
          • QUERYcompanySubsidiaries
          • QUERYsuperAdminCompanies
          • QUERYsuperAdminMasquerading
          • QUERYquotes
          • QUERYcustomerQuotes
          • QUERYquote
          • QUERYquoteUserStoreInfo
          • QUERYquoteConfig
          • QUERYquoteExtraFieldsConfig
          • QUERYusers
          • QUERYuser
          • QUERYuserEmailCheck
          • QUERYcustomerEmailCheck
          • QUERYuserExtraFields
          • QUERYcurrentUser
          • QUERYcustomerInfo
          • QUERYuserLoginState
          • QUERYuserMasqueradingCompany
          • QUERYorderStatuses
          • QUERYbcOrderStatuses
          • QUERYcurrencies
          • QUERYautoLoader
          • QUERYstoreLimitations
          • QUERYstoreBasicInfo
          • QUERYstorefrontScript
          • QUERYstorefrontDefaultLanguage
          • QUERYstorefrontProductSettings
          • QUERYstorefrontSettings
          • QUERYstoreConfigSwitchStatus
          • QUERYstoreCheckoutConfig
          • QUERYstorefrontConfig
          • QUERYstorefrontConfigs
          • QUERYproductVariantsInfo
          • QUERYvariantSku
          • QUERYproductsInventory
          • QUERYproductsLoad
          • QUERYproductsSearch
          • QUERYtaxZoneRates
          • QUERYproductPurchasable
          • QUERYvalidateProduct
          • QUERYvalidateProducts
          • QUERYpriceProducts
          • QUERYaddresses
          • QUERYaddress
          • QUERYcountries
          • QUERYdefaultShippingAddress
          • QUERYdefaultBillingAddress
          • QUERYcustomerAddresses
          • QUERYcustomerAddress
          • QUERYaddressConfig
          • QUERYaddressExtraFields
  • MCP
    • Overview
Dev Portal
LogoLogo
GraphQLB2BQueries

validateProduct

Example Query
1query ExampleQuery($productId: Int, $variantId: Int, $quantity: Int, $productOptions: [GenericScalar], $storeHash: String, $channelId: Int, $target: String) {
2 validateProduct(productId: $productId, variantId: $variantId, quantity: $quantity, productOptions: $productOptions, storeHash: $storeHash, channelId: $channelId, target: $target) {
3 responseType
4 message
5 errorCode
6 product {
7 productId
8 variantId
9 sku
10 availableToSell
11 unlimitedBackorder
12 }
13 }
14}
Variables
1{
2 "productId": 0,
3 "variantId": 0,
4 "quantity": 0,
5 "productOptions": [
6 "GenericScalar"
7 ],
8 "storeHash": "example",
9 "channelId": 0,
10 "target": "QUOTE"
11}
Example response
1{
2 "data": {
3 "validateProduct": {
4 "responseType": "example",
5 "message": "example",
6 "errorCode": "example",
7 "product": {
8 "productId": 0,
9 "variantId": 0,
10 "sku": "example",
11 "availableToSell": 0,
12 "unlimitedBackorder": true
13 }
14 }
15 }
16}
Was this page helpful?
Previous

productPurchasable

Next

validateProducts

Built with

Arguments

productIdIntegerRequired
Product ID
variantIdIntegerRequired
Variant ID
quantityIntegerRequired
Quantity
productOptionslist of optional GenericScalarOptional
Product options list
storeHashStringOptional
Store hash
channelIdIntegerOptional
Channel ID
targetStringOptional

Validation target: ‘CART’ or ‘QUOTE’ (default). Controls whether OOS/Non-Purchasable products return errors or warnings.

Returns

an optional ValidateProductType
responseTypeString

The type of response returned. Possible values are SUCCESS | WARNING | ERROR.

messageString
The message returned if the product is not valid.
errorCodeString

The error code returned if the product is not valid. Possible values are NON_PURCHASABLE | OOS | INVALID_FIELDS | OTHER.

productProductValidationType
Details of the product