Skip to content

updatePricingRule

WRITE

Update pricing rule.

POST /api/v1/sales/updatePricingRule
curl -X POST '<your-host>/api/v1/sales/updatePricingRule' \
  -H 'Authorization: Bearer <api-key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "string",
    "data": {}
  }'
Response
{
  "id": "string"
}

Parameters

ParameterType
min 0
"Percentage""Fixed"
min 0
min 0
min length 1
min 0max 9007199254740991
"Discount""Markup"

Input schema

schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "data": {
      "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": [
    "id",
    "data"
  ]
}