Skip to main content

vendorProductsByVariant

Requires at least one of the permissions purchase:grn:read, purchase:purchase_order:read or suppliers:supplier:read.

Lists the vendors (suppliers) who supply one product variant, with each vendor's SKU, cost and lead time. Needs the suppliers read, purchase order read or GRN read permission.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

query VendorProductsByVariant($productId: ID!, $variantId: ID!) {
vendorProductsByVariant(productId: $productId, variantId: $variantId) {
id
vendorName
createdAt
averageCost
averageLeadTime
averageOrderValue
product {
id
name
barcode
sku
}
}
}

Variables:

{
"productId": "id",
"variantId": "id"
}

Response:

{
"data": {
"vendorProductsByVariant": [
{
"id": "id",
"vendorName": "string",
"createdAt": "2025-01-15T00:00:00Z",
"averageCost": 0,
"averageLeadTime": 0,
"averageOrderValue": 0,
"product": {
"id": "id",
"name": "string",
"barcode": "string",
"sku": "string"
}
}
]
}
}
vendorProductsByVariant(
productId: ID!
variantId: ID!
): [VendorProduct!]!

Arguments​

vendorProductsByVariant.productId ● ID! non-null scalar​

The ID of the product.

vendorProductsByVariant.variantId ● ID! non-null scalar​

The ID of the variant.

Type​

VendorProduct object​

A product variant a vendor supplies, with the vendor's own code, terms, costs and delivery record. Costs and lead times are updated from goods receipts.