createPricingRule
WRITECreate pricing rule.
POST /api/v1/sales/createPricingRule
curl -X POST '<your-host>/api/v1/sales/createPricingRule' \
-H 'Authorization: Bearer <api-key>' \
-H 'Content-Type: application/json' \
-d '{
"name": "string",
"ruleType": "Discount",
"amountType": "Percentage",
"amount": 0
}'Response
{
"id": "string"
}Parameters
ParameterType
min 0
"Percentage""Fixed"
min length 1
"Discount""Markup"
min 0
min 0
min 0max 9007199254740991
Input schema
schema
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string",
"minLength": 1
},
"ruleType": {
"type": "string",
"enum": [
"Discount",
"Markup"
]
},
"amountType": {
"type": "string",
"enum": [
"Percentage",
"Fixed"
]
},
"amount": {
"type": "number",
"minimum": 0
},
"minQuantity": {
"type": "number",
"minimum": 0
},
"maxQuantity": {
"type": "number",
"minimum": 0
},
"customerIds": {
"default": [],
"type": "array",
"items": {
"type": "string"
}
},
"customerTypeIds": {
"default": [],
"type": "array",
"items": {
"type": "string"
}
},
"itemIds": {
"default": [],
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"itemPostingGroupId": {
"type": "string"
},
"validFrom": {
"type": "string"
},
"validTo": {
"type": "string"
},
"priority": {
"default": 0,
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"active": {
"type": "boolean"
}
},
"required": [
"name",
"ruleType",
"amountType",
"amount"
]
}