Salta ai contenuti

validateCoupon

POST
/v2/coupons/validate
curl --request POST \
--url https://api-crm-staging.divinea.com/api/v2/coupons/validate \
--header 'APIKey: <APIKey>' \
--header 'Content-Type: application/json' \
--data '{ "code": "example", "couponRule": { "coupon": { "active": true, "code": "example", "couponRules": [ { "coupon": {}, "createdAt": "2026-04-15T12:00:00Z", "entityId": "example", "entityType": "example", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "rules": {}, "updatedAt": "2026-04-15T12:00:00Z" } ], "createdAt": "2026-04-15T12:00:00Z", "discountCents": 1, "discountPercent": 1, "discountType": "percent", "endAt": "2026-04-15T12:00:00Z", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "minimumOrderCents": 1, "startAt": "2026-04-15T12:00:00Z", "type": "RESERVATION", "updatedAt": "2026-04-15T12:00:00Z", "useCount": 1, "useMax": 1, "useMaxByEmail": 1, "winery": { "createdAt": "2026-04-15T12:00:00Z", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "updatedAt": "2026-04-15T12:00:00Z" } }, "createdAt": "2026-04-15T12:00:00Z", "entityId": "example", "entityType": "example", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "rules": {}, "updatedAt": "2026-04-15T12:00:00Z" }, "email": "example", "purchaseId": "example", "purchaseType": "RESERVATION", "saleEntities": [ { "amountCentsAfterDiscount": 1, "amountCentsBeforeDiscount": 1, "amountCentsPerUnitAfterDiscount": 1, "amountCentsPerUnitBeforeDiscount": 1, "discountCents": 1, "entityId": "example", "entityType": "example", "quantity": 1 } ], "totalAmountCentsBeforeDiscount": 1, "wineryId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

Body

Media typeapplication/json
ConsumeOrValidateCouponRequest
object
code
string
couponRule
CouponRule
object
coupon
Coupon
object
active
boolean
code
string
couponRules
Array<object>
CouponRule
object
coupon
object recursive
createdAt
string format: date-time
entityId
string
entityType
string
id
string format: uuid
rules
object
updatedAt
string format: date-time
createdAt
string format: date-time
discountCents
integer format: int64
discountPercent
integer format: int32
discountType
string
Allowed values: percent absolute
endAt
string format: date-time
id
string format: uuid
minimumOrderCents
integer format: int64
startAt
string format: date-time
type
string
Allowed values: RESERVATION ORDER PREORDER GIFT
updatedAt
string format: date-time
useCount
integer format: int32
useMax
integer format: int32
useMaxByEmail
integer format: int32
winery
Winery
object
createdAt
string format: date-time
id
string format: uuid
name
string
updatedAt
string format: date-time
createdAt
string format: date-time
entityId
string
entityType
string
id
string format: uuid
rules
object
updatedAt
string format: date-time
email
string
purchaseId
string
purchaseType
string
Allowed values: RESERVATION ORDER PREORDER GIFT
saleEntities
Array<object>
SaleEntity
object
amountCentsAfterDiscount
integer format: int64
amountCentsBeforeDiscount
integer format: int64
amountCentsPerUnitAfterDiscount
integer format: int64
amountCentsPerUnitBeforeDiscount
integer format: int64
discountCents
integer format: int64
entityId
string
entityType
string
quantity
integer format: int32
totalAmountCentsBeforeDiscount
integer format: int64
wineryId
string format: uuid

OK

Media type*/*
CouponUtilizationResult
object
coupon
Coupon
object
active
boolean
code
string
couponRules
Array<object>
CouponRule
object
coupon
Coupon
object
active
boolean
code
string
couponRules
Array<object> recursive
createdAt
string format: date-time
discountCents
integer format: int64
discountPercent
integer format: int32
discountType
string
Allowed values: percent absolute
endAt
string format: date-time
id
string format: uuid
minimumOrderCents
integer format: int64
startAt
string format: date-time
type
string
Allowed values: RESERVATION ORDER PREORDER GIFT
updatedAt
string format: date-time
useCount
integer format: int32
useMax
integer format: int32
useMaxByEmail
integer format: int32
winery
Winery
object
createdAt
string format: date-time
id
string format: uuid
name
string
updatedAt
string format: date-time
createdAt
string format: date-time
entityId
string
entityType
string
id
string format: uuid
rules
object
updatedAt
string format: date-time
createdAt
string format: date-time
discountCents
integer format: int64
discountPercent
integer format: int32
discountType
string
Allowed values: percent absolute
endAt
string format: date-time
id
string format: uuid
minimumOrderCents
integer format: int64
startAt
string format: date-time
type
string
Allowed values: RESERVATION ORDER PREORDER GIFT
updatedAt
string format: date-time
useCount
integer format: int32
useMax
integer format: int32
useMaxByEmail
integer format: int32
winery
Winery
object
createdAt
string format: date-time
id
string format: uuid
name
string
updatedAt
string format: date-time
couponCode
string
discountTotalCents
integer format: int64
message
string
saleEntities
Array<object>
SaleEntity
object
amountCentsAfterDiscount
integer format: int64
amountCentsBeforeDiscount
integer format: int64
amountCentsPerUnitAfterDiscount
integer format: int64
amountCentsPerUnitBeforeDiscount
integer format: int64
discountCents
integer format: int64
entityId
string
entityType
string
quantity
integer format: int32
success
boolean
totalAmountCentsAfterDiscount
integer format: int64
totalAmountCentsBeforeDiscount
integer format: int64
wineryId
string format: uuid