Pay with Gift Certificates

Last updated

How 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.

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 with Gift Certificates#

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.