updateVendorProduct
Requires permission suppliers:supplier:update.
Updates a supplier-to-variant mapping. Re-pointing it to another supplier, product or variant is checked against the organization. Needs the suppliers update 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:
- GraphQL
- cURL
mutation UpdateVendorProduct($updateVendorProductInput: UpdateVendorProductInput!) {
updateVendorProduct(updateVendorProductInput: $updateVendorProductInput) {
id
vendorName
createdAt
averageCost
averageLeadTime
averageOrderValue
product {
id
name
barcode
sku
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation UpdateVendorProduct($updateVendorProductInput: UpdateVendorProductInput!) {\n updateVendorProduct(updateVendorProductInput: $updateVendorProductInput) {\n id\n vendorName\n createdAt\n averageCost\n averageLeadTime\n averageOrderValue\n product {\n id\n name\n barcode\n sku\n }\n }\n}",
"variables": {
"updateVendorProductInput": {
"id": "id"
}
}
}
EOF
Variables:
{
"updateVendorProductInput": {
"id": "id"
}
}
Response:
{
"data": {
"updateVendorProduct": {
"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"
}
}
}
}
updateVendorProduct(
updateVendorProductInput: UpdateVendorProductInput!
): VendorProduct!
Arguments
updateVendorProduct.updateVendorProductInput ● UpdateVendorProductInput! non-null input
The ID of the mapping and the fields to change.
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.