DiscountCodeRuleUpdated
v0.0.1

DiscountCodeRuleUpdated

This event is triggered when a DiscountRule is created

DiscountCodeRuleUpdated Schema (json)
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "DiscountCodeRuleUpdated",
  "required": ["detail-type", "resources", "detail", "id", "source", "time", "region", "version", "account"],
  "type": "object",
  "x-amazon-events-detail-type": "DiscountCodeRuleUpdated",
  "x-amazon-events-source": "brink.external.v1",
  "properties": {
    "account": {
      "type": "string"
    },
    "detail": {
      "$ref": "#/definitions/Detail"
    },
    "detail-type": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "region": {
      "type": "string"
    },
    "resources": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "source": {
      "type": "string"
    },
    "time": {
      "format": "date-time",
      "type": "string"
    },
    "version": {
      "type": "string"
    }
  },
  "definitions": {
    "Data": {
      "type": "object",
      "required": ["outcomes", "created", "name", "isStackable", "id", "conditions", "isActive", "updated"],
      "properties": {
        "validDateRange": {
          "$ref": "#/definitions/ValidDateRange"
        },
        "conditions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Condition"
          }
        },
        "created": {
          "format": "date-time",
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "isActive": {
          "type": "boolean"
        },
        "isStackable": {
          "type": "boolean"
        },
        "name": {
          "type": "string"
        },
        "outcomes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Outcome"
          }
        },
        "updated": {
          "format": "date-time",
          "type": "string"
        },
        "revision": {
          "description": "the revision number of the DiscountCodeRule",
          "type": "integer"
        }
      }
    },
    "Metadata": {
      "properties": {
        "awsRequestId": {
          "type": "string"
        }
      },
      "required": ["awsRequestId"],
      "type": "object"
    },
    "Detail": {
      "properties": {
        "data": {
          "$ref": "#/definitions/Data"
        },
        "metadata": {
          "$ref": "#/definitions/Metadata"
        }
      },
      "required": ["metadata", "data"],
      "type": "object"
    },
    "ValidDateRange": {
      "properties": {
        "from": {
          "format": "date-time",
          "type": "string"
        },
        "to": {
          "format": "date-time",
          "type": "string"
        }
      },
      "required": ["from", "to"],
      "type": "object"
    },
    "Condition": {
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "itemRule": {
          "$ref": "#/definitions/ItemRule"
        },
        "triggerQuantity": {
          "type": "number"
        },
        "thresholds": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Money"
          }
        },
        "identifiers": {
          "type": ["array", "null"],
          "items": {
            "type": "string"
          }
        }
      },
      "required": ["type", "id", "itemRule", "triggerQuantity", "thresholds", "identifiers"],
      "type": "object"
    },
    "ItemRule": {
      "properties": {
        "excludeDiscountedPrices": {
          "type": "boolean"
        },
        "tagConditions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TagCondition"
          }
        }
      },
      "required": ["excludeDiscountedPrices", "tagConditions"],
      "type": "object"
    },
    "TagCondition": {
      "properties": {
        "mode": {
          "type": "string"
        },
        "key": {
          "type": "string"
        },
        "values": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": ["mode", "key", "values"],
      "type": "object"
    },
    "Money": {
      "properties": {
        "amount": {
          "type": "number"
        },
        "currency": {
          "type": "string"
        }
      },
      "required": ["amount", "currency"],
      "type": "object"
    },
    "Outcome": {
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "discountValue": {
          "$ref": "#/definitions/DiscountValue"
        },
        "triggerItemRule": {
          "$ref": "#/definitions/ItemRule"
        },
        "triggerQuantity": {
          "type": "number"
        },
        "discountItemRule": {
          "$ref": "#/definitions/ItemRule"
        },
        "discountQuantity": {
          "type": "number"
        },
        "isRecurrent": {
          "type": "boolean"
        },
        "combineItemDiscount": {
          "type": "boolean"
        },
        "gifts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Gift"
          }
        }
      },
      "required": [
        "type",
        "id",
        "discountValue",
        "triggerItemRule",
        "triggerQuantity",
        "discountItemRule",
        "discountQuantity",
        "isRecurrent",
        "combineItemDiscount",
        "gifts"
      ],
      "type": "object"
    },
    "DiscountValue": {
      "properties": {
        "type": {
          "type": "string"
        },
        "percentage": {
          "type": "number"
        },
        "fixedDiscounts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Money"
          }
        }
      },
      "required": ["type", "percentage", "fixedDiscounts"],
      "type": "object"
    },
    "Gift": {
      "properties": {
        "productVariantId": {
          "type": "string"
        },
        "quantity": {
          "type": "number"
        }
      },
      "required": ["productVariantId", "quantity"],
      "type": "object"
    }
  }
}
Last updated on 2024/5/6