allBlogsList

Gift Cards in Sitecore OrderCloud

Introduction

In my previous blog, I wrote about leveraging an accelerator to seed your OrderCloud environment in a quick and easy way. In this blog, I will describe how to set up and use Gift Cards using Sitecore’s SaaS offering - OrderCloud. If you are still unaware of what Sitecore OrderCloud is, you can refer to my previous blogs to get an overview.

What are Gift Cards

Gift cards or eCommerce gift cards are virtual cards that can be used to make purchases in your store, which can be digital or physical in nature. Gift cards can be quite handy for indecisive buyers when they're choosing what to purchase as a gift.

Gift cards contain a unique code that is assigned by the seller. Buyers can then use this code to make payments for the products they purchase. Gift cards can be used to make partial payments and/or full payments depending on the order total and the amount available.

Setting up Gift Card Product

1. Price Schedule Setup

Setting up a product to be used as a Gift Card is pretty simple and straightforward. In the Sitecore OrderCloud portal, go to Price Schedule (PS) and create a PS for the amount you want to set up the Gift Card product for, for example, $100.

Sample payload:

{
  "Name": "Gift Card PS - 100",
  "ApplyTax": false,
  "ApplyShipping": false,
  "MinQuantity": 1,
  "MaxQuantity": 10,
  "UseCumulativeQuantity": true,
  "PriceBreaks": [
    {
      "Quantity": 1,
      "Price": 100,
      "SalePrice": "",
      "SubscriptionPrice": ""
    }
  ]
}

2. Product Setup

Similar to the above, set up a product in OrderCloud with the Default Price Schedule ID being the record created in step 1.

Sample payload:

{
  "Active": true,
  "Name": "e-Gift Card - $100",
  "Description": "$100 e-gift card",
  "DefaultPriceScheduleID": "KfWjLNABAEmE2vSCRqxUBA"
}

Assign the created product to an Active catalog that's being used in your storefront site:

{
  "CatalogID": "Default_XC_Headstart_Catalog",
  "ProductID": "aRV4516m1EqUr2Bs9VKCWQ"
}

 You should now be able to see the newly added Gift Card product in your storefront. If you are still not seeing the product, verify that all the visibility rules have been met.

Purchase Gift Card, Spending Accounts

Gift cards are managed through Spending Accounts in OrderCloud. Once a user makes a purchase of the product identified as a Gift Card, then you must create an associated Spending Account for that amount in OrderCloud.

Sample payload:

{
  "Name": "$100 Gift Card",
  "Balance": 100,
  "AllowAsPaymentMethod": true
}

Make sure to mark it in order to be accepted as a payment method. Capture the ID of the Spending Account record you created and send it off to the purchaser. This will be the Gift Card Code that will be used to make the payment for the purchase.

Capture Gift Card as Payment

Capturing a gift card as payment is quite simple in OrderCloud. Above, the amount entered to be redeemed is then automatically adjusted from the Gift Card balance.

The user enters the gift card code as part of the checkout along with the amount to be redeemed. Capture this code and use it as a payment method.

Sample payload:

{
  "Type": "SpendingAccount",
  "SpendingAccountID": "eaJ8ajYWiU6haOKkVJiNbw",
  "Amount": 80
}

In this case, the user only wants to redeem $80 from the gift card, and the rest will be the regular payment method.

Once the order is submitted, if you then see the balance of the gift card, OrderCloud should have automatically adjusted it:

GC OC

OrderCloud allows us to use Spending Account to give the user store credit instead of a refund back to their original payment method. Furthermore, these can be used as "corporate dollars",  and/or "rewards dollars”.

Stay Tuned for more…

References