Voucher Check

Voucher abuse recommendations need to be enabled on your account before they can be used. Please speak to your account manager about enabling voucher abuse recommendations.

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

Show all
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 redeem 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 uses of the voucher from the target customer to the configured depth in their network. We return ABUSE if the total count of uses in the customer's network is greater than or equal to the threshold. If omitted or zero, Ravelin will use the configured value for the voucher type, or the default value (3) 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