gift_card_code
Collection: gift_card_codes
Gift card codes are the individual resources that maintain balances, and that are entered by customers. The properties of a gift card code are inherited from the gift_card it belongs to.
In order to link a gift card code to a customer, send a PATCH request with a customer_id property or a _links.customer_uri value.
If you would like to create multiple gift card codes at once, see the gift_card documentation.
Required Scopes
store_full_access gift_cards_read gift_cards_write Actions
Properties (6)
code String · Required · max 50 The string value of this gift card code which your customer will add to their cart to use this gift card.
current_balance Number · Required Current balance on the gift card.
Format: Decimal
end_date String (nullable) · Optional The date when this gift card code will expire.
Format: ISO date
customer_id Number (nullable) · Optional PATCH-only field to link or unlink a gift card code to a customer.
date_created String (nullable) · Read-only The date this resource was created.
date_modified String (nullable) · Read-only The date this resource was last modified.
Link Relations (8)
self This Gift Card Code fx:provisioned_by_transaction_detail_id GET This Transaction Only present when the gift card code was provisioned by a transaction.
Only present when the gift card code is linked to a customer.
Only present when the gift card code has an associated customer.
Example Representation
{
"_links": {
"curies": [
{
"name": "fx",
"href": "https://api.foxycart.com/rels/{rel}",
"templated": true
}
],
"self": {
"href": "https://api.foxycart.com/gift_card_codes/123",
"title": "This Gift Card Code"
},
"fx:store": {
"href": "https://api.foxycart.com/stores/456",
"title": "This Store"
},
"fx:gift_card": {
"href": "https://api.foxycart.com/gift_cards/999",
"title": "This Gift Card"
},
"fx:gift_card_code_logs": {
"href": "https://api.foxycart.com/gift_card_codes/123/logs",
"title": "Transactions using this Gift Card Code"
},
"fx:provisioned_by_transaction_detail_id": {
"href": "https://api.foxycart.com/items/999",
"title": "This Transaction"
}
},
"code": "37373-8LX2VW9D-JTSXQ",
"current_balance": 12,
"end_date": "2022-11-10T09:04:39-0800",
"date_created": "2021-11-10T09:04:39-0800",
"date_modified": "2021-11-10T09:04:39-0800"
}