Page tree
Skip to end of metadata
Go to start of metadata

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 VariableExplanation
&apimode0
&quantityinteger larger than 0
&gctemplateis the Listing ID of the Card template you wish to use to generate the cards

Optional Variables


URL VariableExplanation
&pendingwhen set to 1. All generated cards will set to pending
&priceoverrideinteger 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 VariableExplanation
&apimode1
&gctemplateis the Listing ID of the Card template you wish to use to generate the cards

Optional Variables


URL VariableExplanation
&pendingwhen set to 1. All generated cards will set to pending
&priceoverrideinteger larger than 0 -when used, it will override the card's face value
&notifyemailwhen 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 VariableExplanation
&apimode2
&gctemplateis the Listing ID of the Card template you wish to use to generate the cards

Optional Variables


URL VariableExplanation
&pendingwhen set to 1. All generated cards will set to pending
&priceoverrideinteger larger than 0 -when used, it will override the card's face value
&notifyemailwhen 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 VariableExplanation
&apimode3
&gctemplateis the Listing ID of the Card template you wish to use to generate the cards

Optional Variables


URL VariableExplaination
&pendingwhen set to 1. All generated cards will set to pending
&priceoverrideinteger larger than 0 -when used, it will override the card's face value
&notifyemailwhen 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 VariableExplanation
&apimode4
&gctemplateis the Listing ID of the Card template you wish to use to generate the cards
&clientidthe client id you want to assign the card to

Optional Variables

URL VariableExplanation
&pendingwhen set to 1. All generated cards will set to pending
&priceoverrideinteger larger than 0 -when used, it will override the card's face value
&notifyemailwhen 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 VariableExplanation
&apimode5
&gctemplateis the Listing ID of the Card template you wish to use to generate the cards
&clientgroupidthe client group id

Optional Variables

URL VariableExplanation
&pendingwhen set to 1. All generated cards will set to pending
&priceoverrideinteger larger than 0 -when used, it will override the card's face value
&notifyemailwhen 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 VariableExplanation
&apimode6
&gctemplateis the Listing ID of the Card template you wish to use to generate the cards
&clientgroupidthe client group id

Optional Variables

URL VariableExplanation
&pendingwhen set to 1. All generated cards will set to pending
&priceoverrideinteger larger than 0 -when used, it will override the card's face value
&notifyemailwhen 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 VariableExplanation
&apimode7
&gctemplateis the Listing ID of the Card template you wish to use to generate the cards
&clientgroupidthe client group id

Optional Variables

URL VariableExplanation
&pendingwhen set to 1. All generated cards will set to pending
&priceoverrideinteger larger than 0 -when used, it will override the card's face value
&notifyemailwhen 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 VariableExplanation
&apimode10
&giftcardurlencode(the gift card)

Optional Variables

URL VariableExplanation

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 VariableExplanation
&apimode11
&clientidthe client id
&giftcardurlencode(the gift card)

Optional Variables

URL VariableExplanation

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 VariableExplanation
&apimode12
&giftcardurlencode(the gift card) Must not be redeemed or voided

Optional Variables


URL VariableExplanation
&setvaluepositive integer for new gift value
&setexpiry0-6 (never/24 hours/7 days/30 days/90days/180 days/365 days) for expiry mode
&setstatus0/1/9 (Pending/Approved/Void)
&setselfredeem1 to enable self redemption, 0 to disable
&setmaster1 to enable splitting for the card, 0 to disable
&resetdate1 to reset the creation date to today
&setassignClient 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