saveCopilotSupplierRule
Requires permission catalog:copilot:chat.
Saves the import rules for one supplier: a column map, a price rule and a minimum order quantity rule. There is one rule per supplier, and saving again for the same supplier replaces it. Supplier names that differ only in case or punctuation are the same supplier. Limited to 20 requests a minute. Needs the catalog copilot feature on the plan and permission to chat with the copilot.
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 SaveCopilotSupplierRule($input: SaveCopilotSupplierRuleInput!) {
saveCopilotSupplierRule(input: $input) {
supplierName
columnMap
moqRule
priceRule
savedAt
savedBy
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation SaveCopilotSupplierRule($input: SaveCopilotSupplierRuleInput!) {\n saveCopilotSupplierRule(input: $input) {\n supplierName\n columnMap\n moqRule\n priceRule\n savedAt\n savedBy\n }\n}",
"variables": {
"input": {
"supplierName": "string"
}
}
}
EOF
Variables:
{
"input": {
"supplierName": "string"
}
}
Response:
{
"data": {
"saveCopilotSupplierRule": {
"supplierName": "string",
"columnMap": {},
"moqRule": "string",
"priceRule": "string",
"savedAt": "string",
"savedBy": "string"
}
}
}
saveCopilotSupplierRule(
input: SaveCopilotSupplierRuleInput!
): SupplierRuleType!
Arguments
saveCopilotSupplierRule.input ● SaveCopilotSupplierRuleInput! non-null input
The supplier name and the optional column map, price rule and minimum order quantity rule.
Type
SupplierRuleType object
A saved way of reading one supplier's price list.