Vouchers
Listed below are all the voucher methods, along with their parameters, filters, and includes. All parameters that contain (*) are required.
Create Voucher
Returns a dict with the information of the voucher created.
If any of the supplied parameters are in the wrong format or are missing, an error will be returned.
uses: int
-> The number of times this voucher can be used. *
credits: int
-> The amount of credits the user will receive when using this voucher. *
code: Optional[str
] -> The voucher code. If none is provided, a random code will be generated.
memo: Optional[str
] -> The voucher memo.
expires_at: Optional[str
| datetime
] -> A str
or datetime
object containing the voucher expiration date.
List Vouchers
Returns all registered vouchers, or
None
if a specific voucher is not found.
Optionally you can provide Filters and Includes for user query.
code: str
-> The voucher code.
memo: str
-> The voucher memo.
credits: int
-> The voucher credits.
uses: int
-> The uses for voucher.
includes: list
-> List of includes. Available Includes: ['users', 'usersCount']
.
Voucher Details
Returns a dict with the specific voucher data, or
None
if none is found.
includes: list
-> List of includes. Available Includes: ['users', 'usersCount']
.
Update Voucher
Returns a dict containing the updated voucher information, or an error if the voucher ID does not exist.
id: int
-> The voucher ID. *
code: str
-> The voucher code. *
uses: int
-> The uses for voucher. *
credits: int
-> The voucher credits. *
memo: Optional[str
] -> The voucher memo.
expires_at: Optional[str
| datetime
] -> A str
or datetime
object containing the voucher expiration date.
Delete Voucher
Returns a dict with the deleted voucher information, or an error if the passed ID does not exist.
id: int
-> The voucher ID. *