Magento Commerce only

Gift card product data types

The GiftCardProduct data type defines properties of a gift card, including the minimum and maximum values and an array that contains the current and past values on the specific gift card

It implements the following interfaces:

  • ProductInterface
  • PhysicalProductInterface
  • CustomizableProductInterface

GiftCardProduct object

The GiftCardProduct object contains the following attributes:

Attribute Type Description
allow_message Boolean Indicates whether the customer can provide a message to accompany the gift card
allow_open_amount Boolean Indicates whether customers have the ability to set the value of the gift card
giftcard_amounts [GiftCardAmounts] An array that contains information about the values and ID of a gift card
giftcard_type GiftCardTypeEnum Either VIRTUAL, PHYSICAL, or COMBINED
is_redeemable Boolean Indicates whether the customer can redeem the value on the card for cash
lifetime Int The number of days after purchase until the gift card expires. A null value means there is no limit
message_max_length Int The maximum number of characters a gift card message can contain
open_amount_max Float The maximum acceptable value of an open amount gift card
open_amount_min Float The minimum acceptable value of an open amount gift card

GiftCardAmounts object

The GiftCardAmounts object contains the following attributes:

Attribute Type Description
attribute_id Int An internal attribute ID
value_id Int An ID that is assigned to each unique gift card amount
value Float The value of the gift card
website_value Float The value of the gift card
website_id Int ID of the website that generated the gift card

Sample Query

The following query returns information about gift card product GiftCard25. (It is not defined in the sample data.)

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
{
  products(filter: { sku: { eq: "GiftCard25" } }) {
    items {
      id
      type_id
      name
      sku
    }
    ... on GiftCardProduct {
      allow_message
      message_max_length
      allow_open_amount
      open_amount_min
      open_amount_max
      is_returnable
      is_redeemable
      giftcard_type
      giftcard_amounts {
        value_id
        website_id
        value
        attribute_id
        website_value
      }
    }
  }
}