Coupon Validation

Validating redeemability of a coupon

post

Checks whether the coupon can be successfully redeemed. Performs all checks that are executed during actual redemption, but does not result in a redeemed coupon. Only the status of the validation is reported.

The endpoint was previously available under the /coupon-v2/ base path.


Required scopes

  • coupon.coupon_redeem_on_behalf - needed only if the service should use the customer identification specified in the request body (customerNumber attribute) instead of the one associated with current authentication token.

Authorizations
Path parameters
codestringRequired

Code of a coupon

tenantstring · min: 3 · max: 16Required

The tenant that the caller is acting upon.

Please note that this value is always lowercase.

Body

Defines a coupon redemption request payload that affects a coupon instance.

orderCodestringOptional

Code of the associated order.

customerNumberstringOptional

The customer Id of the user, e.g. C0123456789. Can be specified only if coupon.coupon_redeem_on_behalf scope is present.

legalEntityIdstringOptional

The id of the legal entity to which customer is assigned. When customer is assigned to many legal entities then he can redeem the same coupon separately for each legal entity.

orderTotalall ofRequired
and
anyOptional

The amount of the purchase.

discountall ofRequired
and
anyOptional

The absolute amount of the granted discount.

Responses
200
The coupon can be successfully redeemed.
post
POST /coupon/{tenant}/coupons/{code}/validation HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 118

{
  "customerNumber": "CustomerId",
  "orderTotal": {
    "amount": 1090,
    "currency": "EUR"
  },
  "discount": {
    "amount": 5,
    "currency": "EUR"
  }
}

No content

Was this helpful?