These calls provide the functionality to validate coupons.
Validates if a coupon code can be used for the specified items, contact ID, etc. The code must be specified. If the coupon code is invalid, a ValidationException will be thrown. If the coupon code is valid, a CouponCodeValidation object will be returned.
/rest/orders/coupons/codes/{coupon}
Field | Type | Description |
---|---|---|
coupon | String |
The coupon to validate. |
callFromScheduler | Bool |
Flag that indicates whether the validation is requested by a subscription order or not. TRUE = The validation is requested by a subscription order. FALSE = The validation is not requested by a subscription order. |
plentyId | Int |
The plenty id. |
shipToCountry | Int |
The country of delivery. |
taxIdNumber | String |
The tax id number. |
contactClass | Int |
The contact class. |
contactType | Int |
The contact type. |
Field | Type | Description |
---|---|---|
validationType | String |
The type of the campaign. Currently the only type available is plentymarkets. optional allowed values are plenty |
items | \CouponCodeValidationItem[]|\Collection |
The list of items or variations to be validated required array |
contactId | Int |
The ID of the contact that wants to redeem the coupon required |
currency | String |
The currency of the purchase optional |
referrer | Float |
The order referrer optional |
Field | Type | Description |
---|---|---|
campaignId | Int |
The ID of the campaign |
validationType | String |
The type of the campaign. Currently the only type available is plentymarkets. |
contactId | Int |
The ID of the contact that wants to redeem the coupon |
couponCode | String |
The coupon code |
currency | String |
The currency of the purchase |
referrer | Float |
The order referrer |
salesDiscount | Float |
The total discount from a coupon applied to an order. The discount is given as gross amount. |
salesDiscountNet | Float |
The net discount from a coupon applied to an order. The net discount is the total discount minus the vat amount. |
itemDiscount | Float |
The discount amount applied to items. |
itemDiscountNet | Float |
The net discount applied to items. |
shippingDiscount | Float |
The discount applied to shipping costs. |
shippingDiscountNet | Float |
The net discount applied to shipping costs. |
usedVatFields | Array |
The vat fields used for the validation |
restCouponAmount | Float |
The remaining coupon amount |
checkedItems | Array |
The list of variations that passed the validation |
validateParams | Array |
Validation parameters |
couponCampaignType | String |
The campaign type |
Code | Exception | Description |
---|---|---|
401 | League\OAuth2\Server\Exception\AccessDeniedException |
The resource owner or authorization server denied the request. |
401 | League\OAuth2\Server\Exception\InvalidRequestException |
The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the "access token" parameter. |
Validates if multiple coupon codes can be used for the specified items, contact ID, etc. At least one code must be specified. Only one coupon code for special offers (promotional code) can be specified. Promotional codes are validated first. Gift card codes are validated and redeemed after the promotional code to ensure that any discounts are calculated correctly. If any coupon code is invalid, a CouponCodeValidation object with an exception parameter will be added to the list. If the coupon code is valid, a CouponCodeValidation object will be added to the list.
/rest/orders/coupons/codes
Field | Type | Description |
---|---|---|
coupons | String[] |
The coupons to validate. |
callFromScheduler | Bool |
Flag that indicates whether the validation is requested by a subscription order or not. TRUE = The validation is requested by a subscription order. FALSE = The validation is not requested by a subscription order. |
plentyId | Int |
The plenty id. |
shipToCountry | Int |
The country of delivery. |
taxIdNumber | String |
The tax id number. |
contactClass | Int |
The contact class. |
contactType | Int |
The contact type. |
Field | Type | Description |
---|---|---|
validationType | String |
The type of the campaign. Currently the only type available is plentymarkets. optional allowed values are plenty |
items | \CouponCodeValidationItem[]|\Collection |
The list of items or variations to be validated required array |
contactId | Int |
The ID of the contact that wants to redeem the coupon required |
currency | String |
The currency of the purchase optional |
referrer | Float |
The order referrer optional |
List
Field | Type | Description |
---|---|---|
campaignId | Int |
The ID of the campaign |
validationType | String |
The type of the campaign. Currently the only type available is plentymarkets. |
contactId | Int |
The ID of the contact that wants to redeem the coupon |
couponCode | String |
The coupon code |
currency | String |
The currency of the purchase |
referrer | Float |
The order referrer |
salesDiscount | Float |
The total discount from a coupon applied to an order. The discount is given as gross amount. |
salesDiscountNet | Float |
The net discount from a coupon applied to an order. The net discount is the total discount minus the vat amount. |
itemDiscount | Float |
The discount amount applied to items. |
itemDiscountNet | Float |
The net discount applied to items. |
shippingDiscount | Float |
The discount applied to shipping costs. |
shippingDiscountNet | Float |
The net discount applied to shipping costs. |
usedVatFields | Array |
The vat fields used for the validation |
restCouponAmount | Float |
The remaining coupon amount |
checkedItems | Array |
The list of variations that passed the validation |
validateParams | Array |
Validation parameters |
couponCampaignType | String |
The campaign type |
Code | Exception | Description |
---|---|---|
401 | League\OAuth2\Server\Exception\AccessDeniedException |
The resource owner or authorization server denied the request. |
401 | League\OAuth2\Server\Exception\InvalidRequestException |
The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the "access token" parameter. |