{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/salesforce-commerce-cloud/json-schema/salesforce-commerce-cloud-price-adjustment-schema.json",
  "title": "PriceAdjustment",
  "description": "Document representing a price adjustment within a basket or order. Price adjustments\ncan be assigned at the order, product, or shipping level.",
  "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/PriceAdjustment",
  "properties": {
    "appliedDiscount": {
      "description": "Details describing the discount this price adjustment is based on. For adjustments\nnot based on a discount, this value is null.",
      "allOf": [
        {
          "$ref": "#/$defs/Discount"
        }
      ]
    },
    "couponCode": {
      "description": "The coupon code of the coupon this price adjustment is based on. For adjustments\nnot based on a coupon, this value is null. It is read only.",
      "type": "string"
    },
    "createdBy": {
      "description": "The user who created the price adjustment. It is read only.",
      "type": "string"
    },
    "creationDate": {
      "description": "The timestamp when the price adjustment was created. It is read only.",
      "type": "string",
      "format": "date-time"
    },
    "custom": {
      "description": "A flag indicating whether this price adjustment was created by custom logic. This\nflag is set to true unless the price adjustment was created by the promotion\nengine.",
      "type": "boolean"
    },
    "itemText": {
      "description": "The text describing the item.",
      "type": "string"
    },
    "lastModified": {
      "description": "The timestamp when the price adjustment was last modified. It is read only.",
      "type": "string",
      "format": "date-time"
    },
    "manual": {
      "description": "A flag indicating whether this price adjustment was created by a manual process.\nIf the price adjustment was created by the promotion engine, this value is always\nfalse.",
      "type": "boolean"
    },
    "price": {
      "format": "double",
      "description": "The adjustment price. It is read only.",
      "type": "number"
    },
    "priceAdjustmentId": {
      "description": "The price adjustment ID. It is read only.",
      "allOf": [
        {
          "$ref": "#/$defs/PriceAdjustmentId"
        }
      ]
    },
    "promotionId": {
      "description": "The ID of the related promotion. Custom price adjustments\ncan be assigned any promotion ID so long it is not\nused by a price adjustment belonging to the same item,\nand is not used by a promotion defined in the promotion engine.\nIf not specified, a promotion ID is generated.",
      "type": "string"
    },
    "reasonCode": {
      "description": "The reason for the price adjustment.",
      "type": "string"
    }
  },
  "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."
  },
  "$defs": {
    "Discount": {
      "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."
      },
      "description": "Document representing a discount.",
      "type": "object",
      "properties": {
        "amount": {
          "format": "double",
          "description": "The discount amount for discount types that define specific discount amounts. It is read only.",
          "type": "number"
        },
        "percentage": {
          "format": "double",
          "description": "The discount percent for discount types that define percentage discounts. It is read only.",
          "type": "number"
        },
        "priceBookId": {
          "description": "The price book ID that is used with some types. It is read only.",
          "type": "string"
        },
        "type": {
          "description": "The type of discount. It is read only.",
          "enum": [
            "percentage",
            "fixed_price",
            "amount",
            "free",
            "price_book_price",
            "bonus",
            "total_fixed_price",
            "bonus_choice",
            "percentage_off_options"
          ],
          "type": "string"
        }
      },
      "required": [
        "type"
      ]
    },
    "PriceAdjustmentId": {
      "type": "string"
    }
  }
}