- Created by Dev on Jul 29, 2020
Base URL
index.php?m=giftcard&action=api&apikey=KEY&apipass=PASS
Where apikey/apipass is the respective key/pass found in the module
Mode 0 - Generate Card based on quantity
Required Variables
URL Variable | Explanation |
---|---|
&apimode | 0 |
&quantity | integer larger than 0 |
&gctemplate | is the Listing ID of the Card template you wish to use to generate the cards |
Optional Variables
URL Variable | Explanation |
---|---|
&pending | when set to 1. All generated cards will set to pending |
&priceoverride | integer larger than 0 -when used, it will override the card's face value |
Sample API URL
index.php?m=giftcard&action=api&apikey=123&apipass=DEF&gctemplate=1&apimode=0&quantity=10
Return (Success)
JSON, giftcardcode,giftcardcode,giftcardcode
["GC-1","GC2","GC3"]
Return (Fail)
JSON, fail:msg
["fail:gctemplate ID don't exist"]
["fail:quantity not valid"]
["fail:pending can only be 1"]
["fail:priceoverride must be positive integer larger than 0"]
Mode 1 - Generate Card and assign to All Active Client
Required Variables
URL Variable | Explanation |
---|---|
&apimode | 1 |
&gctemplate | is the Listing ID of the Card template you wish to use to generate the cards |
Optional Variables
URL Variable | Explanation |
---|---|
&pending | when set to 1. All generated cards will set to pending |
&priceoverride | integer larger than 0 -when used, it will override the card's face value |
¬ifyemail | when set to 1. An email notification is sent to the client regarding gift card assigned |
Sample API URL
index.php?m=giftcard&action=api&apikey=123&apipass=DEF&gctemplate=1&apimode=0
Return (Success)
JSON, giftcardcode:card value:clientid,giftcardcode:card value:clientid
["GC-1:123:1","GC2:123:2","GC3:123:3"]
Return (Fail)
JSON, fail:msg
["fail:gctemplate ID don't exist"]
["fail:pending can only be 1"]
["fail:priceoverride must be positive integer larger than 0"]
["fail:notifyemail can only be 1"]
Mode 2 - Generate Card and assign to All Clients (Active+Inactive)
Required Variables
URL Variable | Explanation |
---|---|
&apimode | 2 |
&gctemplate | is the Listing ID of the Card template you wish to use to generate the cards |
Optional Variables
URL Variable | Explanation |
---|---|
&pending | when set to 1. All generated cards will set to pending |
&priceoverride | integer larger than 0 -when used, it will override the card's face value |
¬ifyemail | when set to 1. An email notification is sent to the client regarding gift card assigned |
Sample API URL
index.php?m=giftcard&action=api&apikey=123&apipass=DEF&gctemplate=1&apimode=2
Return (Success)
JSON, giftcardcode:card value:clientid
["GC-1:123:1","GC2:123:2","GC3:123:3"]
Return (Fail)
JSON, fail:msg
["fail:gctemplate ID don't exist"]
["fail:pending can only be 1"]
["fail:priceoverride must be positive integer larger than 0"]
["fail:notifyemail can only be 1"]
Mode 3 - Generate Card and assign to All Inactive Client
Required Variables
URL Variable | Explanation |
---|---|
&apimode | 3 |
&gctemplate | is the Listing ID of the Card template you wish to use to generate the cards |
Optional Variables
URL Variable | Explaination |
---|---|
&pending | when set to 1. All generated cards will set to pending |
&priceoverride | integer larger than 0 -when used, it will override the card's face value |
¬ifyemail | when set to 1. An email notification is sent to the client regarding gift card assigned |
Sample API URL
index.php?m=giftcard&action=api&apikey=123&apipass=DEF&gctemplate=1&apimode=3
Return (Success)
JSON, giftcardcode:card value:clientid
["GC-1:123:1","GC2:123:2","GC3:123:3"]
Return (Fail)
JSON, fail:msg
["fail:gctemplate ID don't exist"]
["fail:pending can only be 1"]
["fail:priceoverride must be positive integer larger than 0"]
["fail:notifyemail can only be 1"]
Mode 4 - Generate Card and assign to specific client
Required Variables
URL Variable | Explanation |
---|---|
&apimode | 4 |
&gctemplate | is the Listing ID of the Card template you wish to use to generate the cards |
&clientid | the client id you want to assign the card to |
Optional Variables
URL Variable | Explanation |
---|---|
&pending | when set to 1. All generated cards will set to pending |
&priceoverride | integer larger than 0 -when used, it will override the card's face value |
¬ifyemail | when set to 1. An email notification is sent to the client regarding gift card assigned |
Sample API URL
index.php?m=giftcard&action=api&apikey=123&apipass=DEF&gctemplate=1&apimode=4&clientid=2
Return (Success)
JSON, giftcardcode:card value:clientid
["GC-1:123:1"]
Return (Fail)
JSON, fail:msg
["fail:gctemplate ID don't exist"]
["fail:pending can only be 1"]
["fail:priceoverride must be positive integer larger than 0"]
["fail:notifyemail can only be 1"]
["fail:Client ID invalid"]
Mode 5 - Generate Card and assign to All Active Client in a client group
Required Variables
URL Variable | Explanation |
---|---|
&apimode | 5 |
&gctemplate | is the Listing ID of the Card template you wish to use to generate the cards |
&clientgroupid | the client group id |
Optional Variables
URL Variable | Explanation |
---|---|
&pending | when set to 1. All generated cards will set to pending |
&priceoverride | integer larger than 0 -when used, it will override the card's face value |
¬ifyemail | when set to 1. An email notification is sent to the client regarding gift card assigned |
Sample API URL
index.php?m=giftcard&action=api&apikey=123&apipass=DEF&gctemplate=1&apimode=5&clientgroupid=1
Return (Success)
JSON, giftcardcode:card value:clientid
["GC-1:123:1","GC2:123:2","GC3:123:3"]
Return (Fail)
JSON, fail:msg
["fail:gctemplate ID don't exist"]
["fail:pending can only be 1"]
["fail:priceoverride must be positive integer larger than 0"]
["fail:notifyemail can only be 1"]
["fail:Client group ID is invalid"]
Mode 6 - Generate Card and assign to All Client (Active & Inactive) in a client group
Required Variables
URL Variable | Explanation |
---|---|
&apimode | 6 |
&gctemplate | is the Listing ID of the Card template you wish to use to generate the cards |
&clientgroupid | the client group id |
Optional Variables
URL Variable | Explanation |
---|---|
&pending | when set to 1. All generated cards will set to pending |
&priceoverride | integer larger than 0 -when used, it will override the card's face value |
¬ifyemail | when set to 1. An email notification is sent to the client regarding gift card assigned |
Sample API URL
index.php?m=giftcard&action=api&apikey=123&apipass=DEF&gctemplate=1&apimode=6&clientgroupid=1
Return (Success)
JSON, giftcardcode:card value:clientid
["GC-1:123:1","GC2:123:2","GC3:123:3"]
Return (Fail)
JSON, fail:msg
["fail:gctemplate ID don't exist"]
["fail:pending can only be 1"]
["fail:priceoverride must be positive integer larger than 0"]
["fail:notifyemail can only be 1"]
["fail:Client group ID is invalid"]
Mode 7 - Generate Card and assign to All Inactive Client in a client group
Required Variables
URL Variable | Explanation |
---|---|
&apimode | 7 |
&gctemplate | is the Listing ID of the Card template you wish to use to generate the cards |
&clientgroupid | the client group id |
Optional Variables
URL Variable | Explanation |
---|---|
&pending | when set to 1. All generated cards will set to pending |
&priceoverride | integer larger than 0 -when used, it will override the card's face value |
¬ifyemail | when set to 1. An email notification is sent to the client regarding gift card assigned |
Sample API URL
index.php?m=giftcard&action=api&apikey=123&apipass=DEF&gctemplate=1&apimode=7&clientgroupid=1
Return (Success)
JSON, giftcardcode:card value:clientid
["GC-1:123:1","GC2:123:2","GC3:123:3"]
Return (Fail)
JSON, fail:msg
["fail:gctemplate ID don't exist"]
["fail:pending can only be 1"]
["fail:priceoverride must be positive integer larger than 0"]
["fail:notifyemail can only be 1"]
["fail:Client group ID is invalid"]
Mode 10 - Check Gift Card Status
Required Variables
URL Variable | Explanation |
---|---|
&apimode | 10 |
&giftcard | urlencode(the gift card) |
Optional Variables
URL Variable | Explanation |
---|
Sample API URL
index.php?m=giftcard&action=api&apikey=123&apipass=DEF&apimode=10&giftcard=abccd
Return (Success)
JSON, success:gift card:status:expiry time:expiry mode:gift card value:buyer id:redeemer id:order id:invoice id:allow self redemption:master card:subcards:onetime use
{"success":"GC-12345:redeemed:31536000:7days:20:0:1:0:0:0:0:0:1"}
Return (Fail)
JSON, fail:msg
["fail:Gift Card not exist"]
Mode 11 - Redeem a Gift Card to a client
Required Variables
URL Variable | Explanation |
---|---|
&apimode | 11 |
&clientid | the client id |
&giftcard | urlencode(the gift card) |
Optional Variables
URL Variable | Explanation |
---|
Sample API URL
index.php?m=giftcard&action=api&apikey=123&apipass=DEF&apimode=11&client=1&giftcard=abccd
Return (Success)
JSON, success:msg
["success:deposited to client]
Return (Fail)
JSON, fail:msg
["fail:Client ID invalid"]
["fail:Gift Card not exist"]
["fail:Gift Card Invalid"]
["fail:Card not allow to self redemption"]
["fail:Card already used"]
["fail:Card Expired"]
["fail:Unable to deposit"]
["fail:Similar Card Used"] (New in 2.31)
Mode 12 - Modify Gift Card
Required Variables
URL Variable | Explanation |
---|---|
&apimode | 12 |
&giftcard | urlencode(the gift card) Must not be redeemed or voided |
Optional Variables
URL Variable | Explanation |
---|---|
&setvalue | positive integer for new gift value |
&setexpiry | 0-6 (never/24 hours/7 days/30 days/90days/180 days/365 days) for expiry mode |
&setstatus | 0/1/9 (Pending/Approved/Void) |
&setselfredeem | 1 to enable self redemption, 0 to disable |
&setmaster | 1 to enable splitting for the card, 0 to disable |
&resetdate | 1 to reset the creation date to today |
&setassign | Client ID to assign the card to |
&setonetime (new in 2.31) | 1 to enable one time use, 0 to disable |
Sample API URL
index.php?m=giftcard&action=api&apikey=123&apipass=DEF&apimode=12&client=1&giftcard=abccd
Return (Success)
JSON, success:msg
["success:gift card updated]
Return (Fail)
JSON, fail:msg
["fail:Gift Card already redeemded"]
["fail:Gift Card is void"]
["fail:setvalue must be positive integer larger than 0"]
["fail:setexpiry must be between 0-6"]
["fail:setstatus must be between 0,1,9"]
["fail:setselfredeem must be between 0 or 1"]
["fail:setmaster must be between 0 or 1"]
["fail:resetdate must be 1"]
["fail:clientid invalid"]
- No labels