Voucher Check

POST api.ravelin.com/v2/voucher/check

customerId string
required

The ID of the customer attempting to redeem this voucher.

timestamp integer
optional

The time at which this data payload was valid. When sending events in realtime, this will usually be 'now'. This is used to merge data that arrives out-of-order.

A unix timestamp preferably as an integer count of milliseconds since 1970-01-01T00:00 UTC (nanoseconds are also accepted).

voucherCode string
optional

A unique identifier for the voucher, usually the code a customer enters to redeed the voucher.

voucherType string
optional

The type of voucher.

One of: GENERAL, REFERRAL, or REACTIVATION.

depth integer
optional

How far Ravelin will search for the voucher from the target customer. If omitted or zero, Ravelin will use the configured value for the voucher type, or the default value (10) if there is no configuration. Maxmimum depth is 10.

threshold integer
optional

The threshold for deciding upon abuse. Ravelin searches for the owner and users of the voucher from the target customer Id for the configured depth. We return ABUSE if the total found is greater than the threshold. If omitted or zero Ravelin will use the configured value for the voucher type, or the default value (2) if there is no configuration.

POST https://api.ravelin.com/v2/voucher/check HTTP/1.1
Authorization: token ...
Content-Type: application/json

{
    "timestamp": 1512828988826,
    "voucherCode": "DISCOUNT-1234",
    "customerId": "abc-123-ZYZ",
    "voucherType": "GENERAL",
    "depth": 10,
    "threshold": 2
}

Response

timestamp integer

A unix timestamp indicating when we finished handling the request.

recommendation string

Ravelin’s recommendation for whether to allow the customer to redeem the voucher.

One of: OK or ABUSE.

{
  "timestamp": 1512828988,
  "recommendation": "OK"
}

Feedback

© Ravelin Technology Ltd. All rights reserved