{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/salesforce-commerce-cloud/json-schema/salesforce-commerce-cloud-price-adjustment-request-schema.json",
  "title": "PriceAdjustmentRequest",
  "description": "Request that represents a price adjustment.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/salesforce-commerce-cloud-shopper-baskets-api-openapi.yml#/components/schemas/PriceAdjustmentRequest",
  "type": "object",
  "additionalProperties": {
    "title": "Additional Property Support",
    "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix."
  },
  "properties": {
    "discount": {
      "description": "A discount that can be specified instead of a price.",
      "allOf": [
        {
          "$ref": "#/$defs/DiscountRequest"
        }
      ]
    },
    "itemId": {
      "description": "The item to which the price adjustment should be added, depending on the specified level. If the level is ´order´, item id is not needed. If `shipping`, specify the UUID of the shipping item. If `product`, specify the UUID of the product item.",
      "type": "string"
    },
    "itemText": {
      "description": "The text describing the item in more detail.",
      "type": "string"
    },
    "level": {
      "description": "The level at which the adjustment is applied.\n- `order` indicates that the price adjustment should be added directly to basket.\n- `product` indicates that the price adjustment should be added to the product item.\n- `shipping` indicates that the price adjustment is added to the shipping item.",
      "enum": [
        "product",
        "shipping",
        "order"
      ],
      "type": "string"
    },
    "promotionId": {
      "description": "The ID of the related promotion. Custom price adjustments can be assigned any promotion ID as long as it's not used by a price adjustment belonging to the same item and isn't used by a promotion defined in the promotion engine. If not specified, a promotion ID is generated.",
      "type": "string"
    },
    "reasonCode": {
      "description": "The reason for the price adjustment.",
      "type": "string"
    }
  },
  "required": [
    "level"
  ],
  "$defs": {
    "DiscountRequest": {
      "description": "Request that represents a discount to be applied to a custom price adjustment.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "type": {
          "description": "The type of discount.\n- `amount` describes a (unit) price discount, and its corresponding value (positive) defines the amount each unit is to be reduced by. Example: For a $10 discount, set `type` to `amount` and `value` to `10.00`.\n- `percentage` describes a percentage discount, and its corresponding value (positive) defines the percentage reduction. Example: For a 5% discount, set `type` to `percentage` and `value` to `5.00`.\n- `fixed_price` describes a fixed price discount, and its corresponding value (positive) defines the resulting fixed price for the item. Only one `fixed_price` discount can be set for each item. Example: To set a fixed price of $15, set `type` to `fixed_price` and `value` to `15.00`. **Important**: Setting `type` to `fixed_price` is not supported when `level` is set to `order`.",
          "enum": [
            "percentage",
            "fixed_price",
            "amount"
          ],
          "type": "string"
        },
        "value": {
          "format": "double",
          "description": "The amount of the discount.",
          "type": "number"
        }
      },
      "required": [
        "type",
        "value"
      ]
    }
  }
}