Gift Certificates
Last updatedHow do Gift Certificates work in Centra?#
In Centra, gift certificates can be purchased with a similar flow as standard products. Once you buy a certificate and pay for it, a voucher will be automatically generated and sent to your end customer via e-mail. However, since gift certificates are virtual items, there are some differences:
- Gift certificates cannot belong to the same selection as "real" products. Once you add a gift certificate to your selection, other items will be removed from it.
- You can only buy one gift certificate at a time. If you add a new gift certificate to your selection, previous one will be removed.
- Orders including gift certificates will be automatically finalised, with an automatically created, completed Shipment.
Because of those limitations, it is highly recommended that you sell your Gift Certificates on a separate mini-checkout page dedicated just for GCs. You should be able to re-use much of your main checkout code, but it will be much simplified: Always just one order line, no Ingrid needed, only some payment methods supported. This sub-page only needs to support the following functions:
- Simple form to add customer details
- Selecting a specific GC value from the list (or a dynamic input field for custom GC value) using POST /items/gift-certificates/{id} endpoint
- Proceeding to checkout using POST /payment endpoint, where you should submit all the
addressdetails and continue to payment - Checking the payment status using POST /payment-result and displaying the "Thank you" page with GET /receipt
Types of Gift Certificates#
You can learn the basics of creating gift certificates in Gift Certificates in B2C article on our Support site. There are two types of gift certificates:
Priceoff- this is a certificate that has pre-defined value in each of currencies you want to sell in,Dynamic Priceoff- this is a certificate with no pre-defined value, you can choose it in your front end.
Payment flow when purchasing a Gift Certificate#
Here's what they each look like when you fetch them using GET /gift-certificates call:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{
"gift-2": {
"giftCertificate": "gift-2",
"name": "Pre-defined gift certificate",
"currencyOfSaleOnly": true,
"showGiftAmount": false,
"type": "predeterminedAmount",
"amountByCurrency": {
"USD": {
"amount": "10.00 USD",
"amountAsNumber": 10
},
"SEK": {
"amount": "100 SEK",
"amountAsNumber": 100
},
"JPY": {
"amount": "1 000 JPY",
"amountAsNumber": 1000
}
}
},
"gift-1": {
"giftCertificate": "gift-1",
"name": "Dynamic gift certificate",
"currencyOfSaleOnly": false,
"showGiftAmount": true,
"type": "anyAmount"
}
}
As you can see, Dynamic gift certificate can have any value, while the Pre-defined gift certificate allows you to only purchase a GB for 10 USD, 100 SEK or 1000 JPY.
Once you have the list of available GCs, you can add them to your selection by calling POST /selections/{selection}/gift-certificates/{giftCertificate}, for example:
POST /selections/{selection}/gift-certificates/gift-2
In case of a Dynamic Priceoff certificate, you will either need to add "amount": X to your POST body, or call POST /selections/{selection}/gift-certificates/{giftCertificate}/amount/{amount}, e.g.:
POST /selections/{selection}/gift-certificates/gift-1/amount/100
The amount is always specified in the currency of the selection.
Once the certificate is added to your selection, you can proceed with the normal payment flow - with POST /selections/{selection}/payment followed by POST /selections/{selection}/payment-result to finalise it. Additionally, you can add "giftMessage": "ABC" to your POST /payment call. This message will be saved on the order.
Once the payment is finalised, the Order will have an automatic Shipment created and completed, resulting in Order being finalised as well. Your customer will receive the purchased voucher code via e-mail. You can also see the generated credit voucher in Promo -> Vouchers.
Payment flow when paying with a Gift Certificate#
After you have purchased the gift certificate, and are now using it as a credit voucher code to pay for another order, you can normally proceed to POST /payment step in order to finalise the purchase.
While discount type vouchers are used to lower the prices of your order items, credit is instead used more like a payment method, to pay for your order fully or partially. That means even if you use your credit GC code to cover the entire order total value, the calculated taxes will still be based on the original price of the items in your order. In other words, taxes are calculated before the credit amount is subtracted from your total.
Here's an example of order totals which was partially covered by a credit GC:
| Field | Value | Explanation |
|---|---|---|
| Original total | $5,500 | The full, initial value of the order, including tax, before the credit is applied. |
| Original total tax | $1,100 | The full, initial tax amount based on a 25% tax-included rate. This is the amount the tax authority expects. |
| Credit voucher applied | $1,000 | The amount deducted from the order total. |
| Order summary view "Total" | $4,500 | The value remaining to pay after credit. |
In Centra AMS backend, this order details view will show "Total Tax" at $1,100, which is tax based on original total. Remember, taxes first, credit later.