public interface VoucherifyApi
| Modifier and Type | Method and Description |
|---|---|
Voucher |
createVoucher(Voucher voucher)
Create a voucher with generated code.
|
Voucher |
createVoucherWithCode(java.lang.String code,
Voucher voucher)
Create a voucher with specified code.
|
com.squareup.okhttp.Response |
disableVoucher(java.lang.String code)
Disable a voucher.
|
com.squareup.okhttp.Response |
enableVoucher(java.lang.String code)
Enable a voucher.
|
Voucher |
fetch(java.lang.String code)
Fetch details for a specific voucher.
|
java.util.List<RedemptionDetails> |
listRedemptions(RedemptionsFilter filter)
List redemptions across all vouchers.
|
java.util.List<Voucher> |
listVouchers(VouchersFilter filter)
List vouchers which meet provided filters.
|
VoucherRedemptionResult |
redeem(java.lang.String code,
java.lang.String trackingId)
Method used to redeem a voucher identified by code
|
VoucherRedemptionResult |
redeem(java.lang.String code,
VoucherRedemptionContext redemptionContext)
Method used to redeem a voucher and provide a context information.
|
VoucherRedemption |
redemption(java.lang.String code)
Fetch information about voucher redemption details
|
@GET(value="/vouchers/") java.util.List<Voucher> listVouchers(@QueryMap VouchersFilter filter)
filter - a set of conditions to narrow down the result@GET(value="/vouchers/{code}")
Voucher fetch(@Path(value="code")
java.lang.String code)
code - code of the voucher@POST(value="/vouchers/") Voucher createVoucher(@Body Voucher voucher)
voucher - voucher to be created@POST(value="/vouchers/{code}")
Voucher createVoucherWithCode(@Path(value="code")
java.lang.String code,
@Body
Voucher voucher)
voucher - voucher to be created@POST(value="/vouchers/{code}/disable")
com.squareup.okhttp.Response disableVoucher(@Path(value="code")
java.lang.String code)
code - code of a voucher that should be disabled@POST(value="/vouchers/{code}/enable")
com.squareup.okhttp.Response enableVoucher(@Path(value="code")
java.lang.String code)
code - code of a voucher that should be enabled@POST(value="/vouchers/{code}/redemption")
VoucherRedemptionResult redeem(@Path(value="code")
java.lang.String code,
@Query(value="tracking_id")
java.lang.String trackingId)
code - code of the vouchertrackingId - an id enabling you to correlate who has redeemed the voucher@POST(value="/vouchers/{code}/redemption")
VoucherRedemptionResult redeem(@Path(value="code")
java.lang.String code,
@Body
VoucherRedemptionContext redemptionContext)
code - code of the voucherredemptionContext - a context in terms of which the voucher is being redeemed (e.g. customer profile)@GET(value="/vouchers/{code}/redemption")
VoucherRedemption redemption(@Path(value="code")
java.lang.String code)
code - of the voucher@GET(value="/redemptions") java.util.List<RedemptionDetails> listRedemptions(@QueryMap RedemptionsFilter filter)
filter - a set of conditions to narrow down the result