AvailableCoupon
Type: schema
Description
A coupon and its selected coupon code.
TypeScript Definition
typescript
AvailableCoupon: {((components["schemas"]["DiscountCouponPromotion"] & {
/** @constant */
coupon_type: "discount"
}Component References
| Reference | Resolves To |
|---|---|
components["schemas"]["DiscountCouponPromotion"] | DiscountCouponPromotion |
OpenAPI Schema
json
{
"title": "AvailableCoupon",
"description": "A coupon and its selected coupon code.",
"externalDocs": {
"url": "https://llm-docs.commercengine.io/storefront/schemas/AvailableCoupon",
"description": "API reference for the AvailableCoupon schema"
},
"allOf": [
{
"oneOf": [
{
"allOf": [
{
"$ref": "#/components/schemas/DiscountCouponPromotion"
},
{
"type": "object",
"properties": {
"coupon_type": {
"type": "string",
"const": "discount"
}
},
"required": [
"coupon_type"
]
}
]
},
{
"allOf": [
{
"$ref": "#/components/schemas/FreeGoodCouponPromotion"
},
{
"type": "object",
"properties": {
"coupon_type": {
"type": "string",
"const": "free-goods"
}
},
"required": [
"coupon_type"
]
}
]
},
{
"allOf": [
{
"$ref": "#/components/schemas/FixedPriceCouponPromotion"
},
{
"type": "object",
"properties": {
"coupon_type": {
"type": "string",
"const": "fixed-price"
}
},
"required": [
"coupon_type"
]
}
]
},
{
"allOf": [
{
"$ref": "#/components/schemas/BuyXGetYCouponPromotion"
},
{
"type": "object",
"properties": {
"coupon_type": {
"type": "string",
"const": "buy-x-get-y"
}
},
"required": [
"coupon_type"
]
}
]
},
{
"allOf": [
{
"$ref": "#/components/schemas/VolumeBasedCouponPromotion"
},
{
"type": "object",
"properties": {
"coupon_type": {
"type": "string",
"const": "volume-based"
}
},
"required": [
"coupon_type"
]
}
]
},
{
"allOf": [
{
"$ref": "#/components/schemas/FreeShippingCouponPromotion"
},
{
"type": "object",
"required": [
"coupon_type"
],
"properties": {
"coupon_type": {
"const": "free-shipping"
}
}
}
]
},
{
"allOf": [
{
"$ref": "#/components/schemas/AcceleratedRewardCouponPromotion"
},
{
"type": "object",
"properties": {
"coupon_type": {
"type": "string",
"const": "accelerated-rewards"
}
},
"required": [
"coupon_type"
]
}
]
},
{
"allOf": [
{
"$ref": "#/components/schemas/TieredDiscountCouponPromotion"
},
{
"type": "object",
"properties": {
"coupon_type": {
"type": "string",
"const": "tiered-discount"
}
},
"required": [
"coupon_type"
]
}
]
}
]
},
{
"type": "object",
"required": [
"coupon_type",
"coupon_code",
"application_rules",
"can_be_used_with_promotion",
"can_earn_loyalty_points",
"can_redeem_loyalty_points",
"terms_and_conditions"
],
"properties": {
"coupon_type": {
"enum": [
"discount",
"free-goods",
"fixed-price",
"free-shipping",
"buy-x-get-y",
"volume-based",
"accelerated-rewards",
"tiered-discount"
]
},
"coupon_code": {
"description": "Selected coupon code, or null when no code is available.",
"type": [
"string",
"null"
]
},
"application_rules": {
"type": [
"object",
"null"
],
"properties": {
"max_applicable_items": {
"type": [
"integer",
"null"
]
},
"application_priority": {
"type": [
"string",
"null"
],
"enum": [
"cheapest_first",
"most_expensive_first",
"first_added",
null
]
}
},
"required": [
"max_applicable_items",
"application_priority"
]
},
"can_be_used_with_promotion": {
"type": "boolean"
},
"can_earn_loyalty_points": {
"type": "boolean"
},
"can_redeem_loyalty_points": {
"type": "boolean"
},
"terms_and_conditions": {
"description": "The coupon's terms as Markdown (bold, italics, lists). A coupon without terms of its own gets a sentence from its validity, per-customer limit and minimum order value; `null` when there is nothing to state.",
"type": [
"string",
"null"
]
},
"has_redemption_limit": {
"type": "boolean"
},
"redemption_limit": {
"type": [
"integer",
"null"
]
},
"require_minimum_order_total": {
"type": "boolean"
}
}
}
]
}Auto-generated from OpenAPI spec and TypeScript definitions