public interface VoucherifyApi
| Modifier and Type | Method and Description |
|---|---|
Customer |
createCustomer(Customer customer)
Create a customer using given Customer
|
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 |
deleteCustomer(java.lang.String customerId)
Delete a Customer by ID
|
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.
|
Customer |
getCustomer(java.lang.String customerId)
Get a Customer using Customer ID
|
RedemptionsList |
listRedemptions(RedemptionsFilter filter)
List redemptions across all vouchers.
|
java.util.List<Voucher> |
listVouchers(VouchersFilter filter)
List vouchers which meet provided filters.
|
Voucher |
publishVoucher(PublishParams publishParams)
Publish voucher.
|
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
|
VoucherRedemptionResult |
rollbackRedemption(java.lang.String redemptionId,
java.lang.String trackingId,
java.lang.String reason)
Redemption rollback reverts a redemption.
|
Customer |
updateCustomer(java.lang.String customerId,
Customer customer)
Update a Customer by ID, using given Customer object
|
Voucher |
updateVoucher(java.lang.String code,
VoucherUpdate voucherUpdate)
Update voucher.
|
@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@PUT(value="/vouchers/{code}")
Voucher updateVoucher(@Path(value="code")
java.lang.String code,
@Body
VoucherUpdate voucherUpdate)
voucherUpdate - voucher fields to be updated@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@POST(value="/vouchers/publish") Voucher publishVoucher(@Body PublishParams publishParams)
publishParams - voucher code or campaign name with publish details@GET(value="/redemptions") RedemptionsList listRedemptions(@QueryMap RedemptionsFilter filter)
filter - a set of conditions to narrow down the result@POST(value="/redemptions/{id}/rollback")
VoucherRedemptionResult rollbackRedemption(@Path(value="id")
java.lang.String redemptionId,
@Query(value="tracking_id")
java.lang.String trackingId,
@Query(value="reason")
java.lang.String reason)
redemptionId - (required)
id of a redemptiontrackingId - (optional)
id of a customerreason - (optional)@POST(value="/customers") Customer createCustomer(@Body Customer customer)
customer - (required)@GET(value="/customers/{id}")
Customer getCustomer(@Path(value="id")
java.lang.String customerId)
customerId - (required)@PUT(value="/customers/{id}")
Customer updateCustomer(@Path(value="id")
java.lang.String customerId,
@Body
Customer customer)
customerId - (required)customer - (optional)@DELETE(value="/customers/{id}")
com.squareup.okhttp.Response deleteCustomer(@Path(value="id")
java.lang.String customerId)
customerId - (required)