Gifting

Learn how to mark a product as a gift and send it to a recipient programmatically.

Gifting allows customers to buy products as gifts for others. This feature restricts gift orders to one recipient per order, requiring the shopper to select the gift checkbox that appears during checkout and enter recipient details such as name, address, and email address during checkout. The purchaser can also enter a personal message.

Prerequisite: To enable gifting for physical and digital products, activate Gift Messaging in Global Commerce. After enabling, select the Gift checkbox in Product Options when creating or updating a product.

The following instructions explain how to send a gift programmatically.

Adding a gift to a cart programmatically

To programmatically add a gift to a cart, you'll need to include specific attributes in your API requests. This ensures the order is correctly marked as a gift, and that both the purchaser and recipient receive all pertinent information. Your role in following the outlined steps is crucial, as it allows you to automatically handle gift orders, whether they involve physical or digital products, ensuring a seamless customer experience.

To add a gift to a cart programmatically, include the giftInfo object when sending a POST /v1/shoppers/me/carts/active request. It will mark the order as a gift and ensure the purchaser and recipient receive all necessary information, including any personalized message.

You must include specific attributes in your API requests to handle gift orders correctly. These attributes ensure the order is accurately processed and the purchaser and recipient receive the necessary information. Your attention to detail in including the recipient's information is crucial in this process.

Below is a breakdown of the payload example provided:

  • billingAddress: The billing details of the purchaser. It may include street address, city, state, ZIP code, and country.

  • shippingAddress: The recipient's address details. When placing an order for physical gifts, this is the address to which the fulfiller will send the gift. When placing an order for digital gifts, the shippingAddress object, which includes the recipient's email address, is used to send emails and calculate the tax. For gift orders of purely digital products, we recommend allowing customers to specify if the recipient will use the digital product in a different location (country and city) during checkout. The tax engine will calculate the tax using that shipping address based on the recipient's ZIP code, state, and city if a different location is specified. The recipient will receive an email notification with redemption details, excluding pricing information, and a personalized message using the recipient's email address provided in the shippingAddress object. It ensures that the recipient's experience is seamless and personalized.

    • firstName: Recipient's first name.

    • lastName: Recipient's last name.

    • companyName: Company name of the recipient (if applicable).

    • line1: First line of the recipient's address.

    • city: City of the recipient's address.

    • countrySubdivision: State or province of the recipient's address.

    • postalCode: Postal code of the recipient's address.

    • country: Country code of the recipient's address.

    • countryName: Full country name of the recipient's address.

    • phoneNumber: Phone number of the recipient.

    • emailAddress: Recipient's email address.

  • giftInfo:

    • enabled: Set to true to mark the order as a gift.

    • message: A personal message from the purchaser to the recipient.

These attributes ensure that the gift order is processed accurately and that the recipient receives the necessary information.

}
    ...
    "billingAddress": {...},
    "shippingAddress": {
        ...
        "firstName": "Jane",
        "lastName": "Doe",
        "emailAddress": "jdoe@digitalriver.com"
    },
    "giftInfo": {
        "enabled":true,
        "message": "Happy Birthday! Wishing you a day filled with love, joy, and laughter. Enjoy your special gift! - Your Friend"
}

See Updating a cart for additional information on creating or updating a cart.

Digital gift

Digital gifts offer a convenient and modern way to give a present to friends and family. By purchasing a digital product as a gift, the shopper can quickly send it via email, making it an excellent option for last-minute presents or sending to recipients in different locations. The process involves selecting the gift option, providing the recipient's details, and optionally including a personal message. The recipient will receive an email notification containing the gift and redemption instructions, ensuring a seamless and delightful experience.

When adding a digital gift to a cart, the shopper must provide the recipient's first and last name and email address. The shopper can also choose to enter a personal message.

}
    ...
    "billingAddress": {...},
    "shippingAddress": {
        ...
        "firstName": "Jane",
        "lastName": "Doe",
        "emailAddress": "jdoe@digitalriver.com",
        "city": "Waconia",
        "country": "US"
    },
    "giftInfo": {
        "enabled":true,
        "message": "Happy Birthday! Wishing you a day filled with love, joy, and laughter. Enjoy your special gift! - Your Friend"
}

When the shopper submits the order, they will see their billing information, payment method, order information, and the gift recipient's information.

When creating the checkout page for a digital product, it is recommended to include an optional prompt for the customer to specify if the digital product will be used in a different location (country and city). This will help the tax engine to accurately calculate the tax. See shippingAddress in Adding a gift to a cart programmatically for more information.

Both purchaser and recipient receive email notifications. The purchaser will receive an email stating that an email with redemption details has been sent to the recipient.

The recipient will receive an email notification with redemption details, possibly including a personal message and excluding pricing information.

Physical or mixed gift

When purchasing gifts, it's important to differentiate between digital and physical items. Physical gifts include any tangible product bought with the intention of gifting. Mixed gifts involve a combination of physical items and digital elements. Providing accurate shipping information for physical and mixed gifts is crucial to facilitating proper delivery and tax calculation. This section outlines the necessary steps and considerations for handling these types of gifts within Commerce API.

When adding a physical or mixed gift to a cart, the shopper must provide the recipient's first and last name, email address, and shipping address to ensure proper delivery. Commerce API uses this address for shipping and tax purposes. The shopper can also choose to enter a personal message.

}
    ...
    "billingAddress": {...},
    "shippingAddress": {
        ...
        "firstName": "Jane",
        "lastName": "Doe",
        "companyName": "Digital River",
        "line1": "PO BOX 6930",
        "city": "Waconia",
        "countrySubdivision": "MN",
        "postalCode": "5387",
        "country": "US",
        "countryName": "United States",
        "phoneNumber": "952-555-0199",
        "emailAddress": "jdoe@digitalriver.com"
    },
    "giftInfo": {
        "enabled":true,
        "message": "Happy Birthday! Wishing you a day filled with love, joy, and laughter. Enjoy your special gift! - Your Friend"
}

When the shopper submits the order, they will see their billing information, payment method, order information, and the gift recipient's information.

Both purchaser and recipient receive email notifications. The purchaser will receive an email stating that an email with redemption details has been sent to the recipient.

The recipient will receive an email notification with redemption details, possibly including a personal message and excluding pricing information.

Refunds and returns

Gift recipients or purchasers can request a refund or return for any product in an order marked as a gift, similar to any other product in the store. When the recipient or the purchaser initiates a refund or return, the system will send an appropriate email detailing any necessary actions to complete the process to either the recipient or the purchaser.

Last updated