> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.skailama.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Klaviyo <> GiftKart - Public API Integration

In this article, we'll discuss how you can Integrate Klaviyo and GiftKart using the Public API. 

Use Cases Enabled: 

Using the Public API integration, you can create any segment in Klaviyo and create personalized gift card codes for the users in that segment and also send them emails. 

The Process is divided into two parts. 

**Part 1: Klaviyo sends GiftKart the details about the customers, gift card amount, expiry date **
**Part 2: We Send Klaviyo the Gift Card Code which is then merged with the Email that goes out from Klaviyo**

Part 1: Klaviyo Sends GiftKart the Gift Card Details

Check this video out first: 


${youtube}[Integrate Klaviyo with Giftkart - Part 1](XwoMzi4AVNw)

**Request for Secret Key and Destination URL from the customer support team! **

```json

{

  "giftcardOrigin": "GIFTCARDREFERRAL",
  "senderName": "BrandName",
  "receiverName": "{{ person|lookup:'First Name'|default:'' }}",
  "giftcardNote": "",
  "cardImage": "",
  "expiresAfter": "14",
  "senderEmail": "SenderEmail",
  "receiverEmail": "{{ person.Email|default:'' }}",
  "replyToEmail": "SenderEmail",
  "sendEmailToCustomer": false,
  "giftcardAmount" : 10,
  "campaignName" : "UNIQUE NAME"
}

```

It is important to change the following fields before you copy over the JSON code to the webhook:
1. senderName - The Brand Name
2. expiresAfter - Days after the Card should Expire after issuing
3. senderEmail - What email address do you want to send this from?
4. replyToEmail - Which email do you want the customers to reply to?
5. giftcardAmount - Amount of the Gift Card
6. campaignName - A Unique Name that will be used to send the emails in Part 2


--------------------------------------

Part 2: Sending Emails from Klaviyo with the Personalised Gift Card Codes



${youtube}[Send Gift Card Emails from Klaviyo with Personalized Codes](FExiOd4qLLY)


List of Variables that you can use in Klaviyo Gift Card Emails: 

{{ event.dynamicGiftcardProductVariantImg }} - Gift Card Image
{{ event.giftcardAmount }} - Gift Card Amount
{{ event.hrefLink }} - Redeem Page Link
{{ event.receiverEmail }} - Recipient Email
{{ event.receiverName }} - Receiver Name
{{ event.replyToEmail }} - Brand Email
{{ event.senderEmail }} - Sender Email
{{ event.senderName }} - Sender Name
{{ event.shopName }} - Store Name
{{ event.giftcardNote }} - Gift Note
{{ event.giftcardCode }} - Gift Card Code








