Create Voucher
Create Voucher
When our system need to create a voucher, we will be sending request body including what the voucher needs to do. See dataset below.
Interface
interface VoucherCreate {
id: string,
amount: number, //Minor units
type: "percentage" | "fixed",
code: string,
deliveryIncluded: boolean,
maxUsage?: number,
}Create Voucher
POST
Headers
Name
Type
Description
Authorization*
String
sha256 hashed version of your token
Request Body
Name
Type
Description
module*
String
"fanvoucher" or "voucher"
event*
String
create
data*
Object
data.id*
String
Random unique id we generate
data.amount*
Number
Amount of value (Minor units)
data.type*
Enum
"Fixed" or "Percentage"
data.code*
String
Our generated voucher code
data.deliveryIncluded*
Boolean
If delivery is included with the discount
data.maxUsage
Number
How many times the code can be used. (Optional)
{
// Response
}{
// Response
}{
// Response
}Last updated