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

Full store_full_access
Read gift_cards_read
Write gift_cards_write

Actions

GET View a gift card code
PATCH Update a gift card code (send only the properties you want to modify)
PUT Replace a gift card code (send the entire representation)
DELETE Delete a gift card code
HEAD Get just the header response
OPTIONS Get a response explaining which HTTP methods are supported

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:store GET PATCH PUT DELETE This Store
fx:gift_card GET PATCH PUT DELETE This Gift Card
fx:gift_card_code_logs GET Transactions using 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.

fx:customer GET PATCH PUT DELETE Link to the customer this gift card code is linked to.

Only present when the gift card code is linked to a customer.

fx:customer GET PATCH PUT DELETE The customer associated with this gift card code.

Only present when the gift card code has an associated customer.

https://api.foxycart.com/gift_card_codes/{id}
Available via fx:gift_card_code on gift_card_code_log_detail

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"
}