Manage gift cards
Gift cards enables your customers to credit an amount of money on a card to make purchases within your store later.
The card is linked to a single code and can be redeemed by anybody in possession of the card.
#1/ Setting up gift cards
In the Apps section of your account install the 'Gift cards' application (Premium option required).
A 'Gift card' product is automatically created in your product database.
This product is linked to your default tax rate. The tax is normally due at the time the card is sold, but the tax impact will be neutral since the tax paid on the card sale is deducted when it is redeemed.
In the application settings, you can enter a validity period that will apply to all gift cards sold.
If you don’t input a period, gift cards can be redeemed indefinitely.
You can change the validity period when you sell a gift card or into the application for cards already sold.
#2/ Selling gift cards
Create a sale and click on the 'Gift card' button under the sale detail.
Enter the card amount in the 'Sell a gift card' section.
The Validity field is automatically fulfilled, but you can change it. Leave it empty for unlimited validity.
The 'Code' field enables to input the code of a printed physical gift card. Leave it empty to generate a code automatically.
Click on the 'Add to the sale' button to confirm the creation of the gift card: the gift card product is added to the sale for the selected amount and you will find the card code in the S/N field (serial number).
Click on the top right button 'Back to the sale'.
Finish the sale as per usual with the payment method used to buy the card.
To sell gift cards from your website, see section 6 (API).
On Internet, you can buy batches of printed physical gift cards with single barcodes, you can customize with your brand image.
If the S/N field is not available in sales, go to 'Settings/Users/Access management' and enable the right: 'Manage product serial numbers'.
#3/ Redeeming gift cards
Create a sale and add products purchased by the customer.
Click on the 'Gift card' button under the sale detail.
Scan or input the gift card code in the 'Use a gift card' section and confirm. A credit line for the gift card value is added to the sale.
Complete the sale:
If the total amount of the sale is positive, cash in your customer for the remaining amount,
If the total amount of the sale is negative, add a new gift card to the sale to balance it at 0. Validate the sale with any payment method.
If you don’t want to generate a new gift card, you can use the store credit account of your customer.
The negative amount of the sale will be paid with the CRED payment method to credit your customer account for the remaining amount to redeem. More information.
#4/ Tracking gift cards
In the 'Gift card' app you can track gift cards issued, used and expired.
You can filter and export results in CSV.
In your reports:
The turnover linked to the 'Gift card' product is the total amount of issued gift cards,
The negative turnover linked to the 'Credit/Gift card' product is the total amount of redeemed gift cards.
#5/ Printing gift cards
If you don’t use printed physical gift cards, you can print your gift card in a PDF file or on a receipt ticket.
#a/ PDF file
– Install the'PDF Documents' application in the Apps section of your account.
– Download the 'Gift Card' template and complete and customize it in your text editor.
– Save the file in .odt and upload it in the 'PDF documents' app.
In the sale with the gift card, use the top right 'Action' drop-down menu to select the 'Gift card' template and generate your PDF gift card.
#b/ Receipt ticket
– In 'Settings/Users/Access management', enable the right : 'Print individual tickets for each item line of the sale'.
– In 'Settings/Printing/Ticketing', add the following code and modify the content with your own information:
#@@@@@@= =@@@@@@#
+@@@*..-*#. .#*-..*@@@*
=@@@- -= == -@@@+
:#@@#- #@@@@% -*@@#-
-##############****##############-
*@@@@@@@@@@@@@: :@@@@@@@@@@@@@#
*@@@@@@@@@@@@@: :@@@@@@@@@@@@@#
-+*************************-
#@@@@@@@@@@: :@@@@@@@@@@%
#@@@@@@@@@@: :@@@@@@@@@@%
#@@@@@@@@@@: :@@@@@@@@@@%
*@@@@@@@@@@: :@@@@@@@@@@#
<hibou_use_font_b>
<hibou_font_size>2|2
<hibou_bold>
HIBOUTIK
</hibou_bold>
<hibou_font_size>1|1
30 Central place - 01234 MYTOWN
1 234 567 8910 - contact@hiboutik.com
-------------------------------------------
### <hibou_print_product_serial>###
-------------------------------------------
<hibou_font_size>2|2
<hibou_bold>
GIFT CARD
-- <hibou_print_price_product> USD --
</hibou_bold>
<hibou_font_size>1|2
Code: <hibou_print_product_serial>
<hibou_font_size>1|1
Valid until <hibou_print_product_comment>
-------------------------------------------
### <hibou_print_product_serial>###
-------------------------------------------
<hibou_print_this_code128_barcode><hibou_print_product_serial>
<hibou_use_font_a>
Created on <hibou_print_date_time> - # <hibou_print_num_order_unique>
<hibou_cut_paper_partial>
In the Payment section of the gift card sale, click on the 'Ticketing' button to print you receipt gift card.
#6/ API
The application provides an API to sell gift cards from a tool other than the register, for example an online sales page with Stripe payment, and to look up available cards.
This section is intended for the person who develops your website or integration.
Gift cards created through the API are identical to those sold at the register: same 'Gift card' product, code in the S/N field, validity date in the product comment, tracking in the application.
a/ Enabling the API
In the application, open the Settings, then in the API section click on 'Generate a key'.
The API address and your account key are displayed.
– The key gives access to the gift cards of your account: keep it secret and only use it from a server, never in a web page visible to your customers.
– The 'Regenerate the key' button immediately disables the previous key: remember to update your integrations.
– As long as no key has been generated, the API is disabled for your account.
b/ Calling the API
All requests use the following address, with the requested action:
https://cartescadeaux.hiboutik.net/api/?account=account&action=...
The slash / before the ? is mandatory.
The key is sent in the Authorization HTTP header (or in the X-Api-Key header):
Authorization: Bearer YOUR_KEY
Responses are in JSON format.
c/ Checking the configuration: action=config
GET https://cartescadeaux.hiboutik.net/api/?account=account&action=config
Response:
{
"product_id": 7,
"product_label": "Gift card",
"validity_days": 365,
"vat_rate": 0.2,
"can_sell": true
}
validity_days is the default validity period, in days (0: unlimited validity).
can_sell is false if the tax rate of the 'Gift card' product is 0: the API then refuses to create gift cards.
d/ Adding a gift card to a sale: action=add
The gift card is added to an open sale of your account, created for example with the Hiboutik API (POST /sales/).
POST https://cartescadeaux.hiboutik.net/api/?account=account&action=add
Content-Type: application/json
{ "sale_id": 1001, "amount": 50 }
Parameters, in JSON or form format:
– sale_id (required): sale number. The sale must still be open.
– amount (required): gift card amount including tax, for example 50 or 49.90.
– code (optional): code of a printed physical gift card. It must be unique (3 to 64 characters: letters, digits, - and _). Without a code, one is generated automatically.
– validite (optional): expiry date in YYYY-MM-DD format. Without this parameter, the default validity period applies. If sent empty, the gift card has unlimited validity.
Response (HTTP code 201):
{
"card": {
"code": "1001hi555",
"amount": 50,
"validite": "2027-11-16",
"sale_id": 1001,
"line_item_id": 555,
"product_id": 7
}
}
The gift card can be redeemed once the sale is closed, i.e. paid. It can then be used at the register as described in section 3.
As long as the sale is not completed, the gift card does not appear among the available cards.
e/ Listing available gift cards: action=list
A gift card is available when it has been sold (sale closed), has not been redeemed yet and has not been archived.
By default, gift cards whose validity date has passed are not listed.
GET https://cartescadeaux.hiboutik.net/api/?account=account&action=list
Optional filters:
– code: a specific gift card, for example to check a card before accepting it.
– sale_id: gift cards sold in a given sale.
– include_expired=1: include expired gift cards, flagged with "expired": true.
– limit (100 by default, 500 maximum) and offset: pagination.
Response:
{
"total": 1,
"limit": 100,
"offset": 0,
"cards": [
{
"code": "1001hi555",
"amount": 50,
"validite": "2027-11-16",
"expired": false,
"date_sold": "2026-11-16 14:05:12",
"sale_id": 1001,
"line_item_id": 555,
"store_id_sold": 1
}
]
}
A gift card with unlimited validity has an empty validite ("").
f/ Looking up a gift card: action=card
Returns a specific gift card whatever its status, for example to display the card to its recipient.
GET https://cartescadeaux.hiboutik.net/api/?account=account&action=card&code=1001hi555
Response:
{
"card": {
"code": "1001hi555",
"amount": 50,
"validite": "2027-11-16",
"expired": false,
"date_sold": "2026-11-16 14:05:12",
"sale_id": 1001,
"line_item_id": 555,
"store_id_sold": 1,
"status": "available",
"date_used": ""
}
}
status gives the gift card status:
– pending: the sale of the gift card is not closed yet (payment pending).
– available: the gift card can be redeemed.
– expired: the validity date has passed.
– used: the gift card has already been redeemed (date in date_used).
– archived: the gift card has been archived in the application.
g/ Errors
In case of error, the API returns an HTTP code and a message:
{ "error": "sale_closed", "error_description": "La vente est déjà clôturée." }
The error_description message is in French: rely on the error code.
– 401 unauthorized: missing or invalid key for this account.
– 404 sale_not_found: sale not found.
– 404 card_not_found: gift card not found.
– 409 sale_closed: the sale is already closed.
– 409 code_in_use: this code is already assigned to another gift card.
– 409 vat_zero: the tax rate of the 'Gift card' product is 0.
– 409 not_configured: 'Gift card' product not found. Open the application in Hiboutik to create it again.
– 422 invalid_sale_id, invalid_amount, invalid_code, invalid_validite: missing or invalid parameter.
– 502 hiboutik_error: the gift card could not be added to the sale.