A. Gift card
A3. Create a gift card
- User clicks to view the detail of gift card in the merchant mini program.
- The mini program sends a request to the merchant to obtain the detail of gift card by using TemplateID.
- The mini program displays the detail of gift card that is received from the merchant.
- The user confirms to issue the gift card in the mini program.
- The mini program will issue a payment request if the purchase is required. please refer to the online payment intergration listed below, the merchant can choose to use either IPAY or ABOSS.
- When the payment is completed, the mini program sends a request to the merchant to issue the gift card by using Merchant ID, OpenID, and TemplateID.
- The merchant creates the gift card record and associated with a BizSerialID, which is used to identify the gift card record in their system.
- The merchant sends a createPass request (alipay.intl.user.pass.createPass) to AlipayHK by using MerchantID, OpenID, TemplateID, BizSerialID, start date, end date, and code message.
- AlipayHK handles the createPass request associated with a PassID, a unique identifier for the new gift card in the AlipayHK.
- AlipayHK returns the handling result with the PassID to the merchant.
- Merchant updates its gift card record to associate with the PassID from AlipayHK.
- Merchant returns the pass issue record to the mini program.
- The mini program displays the issued gift card.
A4. Share a gift card
- Pass sender requests to share a gift card in merchant mini program. The mini program sends a gift card update request to the merchant to reset the owner, and change status to
sharing
by using BizSerialID. The merchant will then send a updatePass (alipay.intl.user.pass.updatePass) request to AlipayHK to close the gift card in the pass sender's wallet by using MerchantID, OpenID, and PassID to update the gift card status toCLOSED
. AlipayHK responds to the handling result to the merchant. The merchant will commit the gift card updates and return the handling result to the mini program. The mini program will complete the pass sharing request and display the pass sharing URL to the pass sender. The pass sender can further forward the pass sharing URL via any social platform. - Pass receiver clicks the pass sharing URL with BizSerialID to open the merchant mini program. IT retrieves the gift card detail by using BizSerialID from the merchant. When the merchant responds to the gift card detail, the mini program display to pass receiver.
- Pass receiver confirms the gift card in the mini program. It sends a gift card update request to the merchant by using BizSerialID and OpenID. The merchant sends a createPass (alipay.intl.user.pass.createPass) request to AlipayHK to add the gift card to pass receiver's wallet by using MerchantID, OpenID, TemplateID, BizSerialI, start date, end date, and code message. Upon AlipayHK returns the handling result with PassID to the merchant, and update the status of the gift card to
available
with OpenID, PassID. After all, the merchant will commit all changes and return the handling result to the mini program.
A5. Redeem a gift card
- The user opens an in-app gift card wallet and selects a gift card. AlipayHK app will send a request to AlipayHK with PassID to obtain the detail of gift card. The merchant cashier can use a POS scanner to scan the QR code/barcode from user's gift card wallet to parse and obtain the BizSerialID.
- This is an alternative approach. The user opens the merchant's mini program and selects a gift card. The mini program will send a request to the merchant with BizSerialID to obtain the detail of gift card. The merchant cashier can use a POS scanner to scan the QR code/barcode from user's mini program to parse and obtain the BizSerialID.
- The merchant POS sends a gift card redemption request to the merchant by using BizSerial and VerifyCode. The merchant will check the validity of the gift card.
- If the gift card is not valid, the merchant will return a redemption failure result to the merchant POS. The POS will fail the message of the gift card redemption.
- If the gift card is valid, the merchant will update the gift card record status to
used
by using BizSerialID. Then, it will send a updatePass (alipay.intl.user.pass.updatePass) request to AlipayHK to update gift card status toUSED
by using MerchantID, PassID and VerifyCode. AlipayHK will update the gift card record and return the handling result to the merchant. The merchant commits all changes upon receiving the response from AlipayHK and returns the redemption result to the merchant POS. The POS will display the redemption result and continue to process the order.
A6. Close a gift card
- The merchant initializes a gift card update request to update its status to
closed
by using BizSerialID. - The merchant sends a updatePass (alipay.intl.user.pass.updatePass) request to AlipayHK to update the gift card status to
CLOSED
by using MerhcantID, OpenID and PassID. AlipayHK updates to close the gift card record and returns the handling result to the merchant.