Codes
Last updated
Last updated
These endpoints are specifically built for handling voucher codes and common actions against them such as redeeming or topups.
All voucher codes have 3 key attributes: Status, expiry date and balance. You can view the list of status values you may encounter here.
Avoid costly redemption logic
If the lookup is happening at a fixed location such as a point-of-sale terminal then we recommend passing the locationID
with the lookup to ensure the code both exists and can be redeemed at the location based on it's current settings.
If it can't then an error is returned with code location_not_allowed
GET
https://api.giftpro.co.uk/codes/{code}/
The code must already have been sold or activated as part of an existing order before it will be returned.
If the lookup is happening at a fixed location such as a point-of-sale terminal then we recommend passing the locationID
with the lookup to ensure the code both exists and can be redeemed at the location based on it's current settings.
locationID
String
If the code isn't redeemable at the locationID provided an error is returned and feedback can be offered to the end user.
POST
https://api.giftpro.co.uk/codes/{code}/topup/
Add value to a voucher code. If the voucher hasn't been seen before the first topup will return a balance event "Activation".
A successful topup will return a balance event, which also contains a row representing the voucher and the order the row is in.
amount*
String
locationID*
int
POST
https://api.giftpro.co.uk/codes/{code}/redeem/
This endpoint accepts two parameters that should be used when redeeming a voucher, which parameter you use depends on if you want to redeem the entire amount or not.
The response is a balance event specific to this redemption which you may need if you want to later reverse.
locationID*
int
amount
String
If an amount is not provided, the default is to use all remaining balance.