createVendorProduct
Requires permission suppliers:supplier:update.
Links a supplier to a product variant with the supplier's own SKU, cost, order limits and lead time. The supplier and the variant must exist, and one mapping per supplier and variant is allowed. 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 CreateVendorProduct($createVendorProductInput: CreateVendorProductInput!) {
createVendorProduct(createVendorProductInput: $createVendorProductInput) {
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 CreateVendorProduct($createVendorProductInput: CreateVendorProductInput!) {\n createVendorProduct(createVendorProductInput: $createVendorProductInput) {\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": {
"createVendorProductInput": {
"creditAmount": 0,
"creditDays": 0,
"isActive": true,
"isPreferred": true,
"leadTimeDays": 0,
"minOrderQuantity": 0,
"orderMultiple": 0,
"productId": "string",
"variantId": "string",
"vendorPartnerId": "string",
"vendorSku": "string"
}
}
}
EOF
Variables:
{
"createVendorProductInput": {
"creditAmount": 0,
"creditDays": 0,
"isActive": true,
"isPreferred": true,
"leadTimeDays": 0,
"minOrderQuantity": 0,
"orderMultiple": 0,
"productId": "string",
"variantId": "string",
"vendorPartnerId": "string",
"vendorSku": "string"
}
}
Response:
{
"data": {
"createVendorProduct": {
"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"
}
}
}
}
createVendorProduct(
createVendorProductInput: CreateVendorProductInput!
): VendorProduct!
Arguments
createVendorProduct.createVendorProductInput ● CreateVendorProductInput! non-null input
The supplier, product, variant and supplier SKU, with optional cost, order limits, lead time, ratings and notes.
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.