gift_card_codes

Description

This link relationship returns a collection of resources. You can easily paginate through this collection using the hypermedia links provided and the link relationships of first, prev, next, and last. Scroll down to view a representation of a single resource embedded within this collection.

Sandbox Example

You can interact with this resource and run actions against the sandbox API via our HAL Brower.

Actions

GET
View a list of gift_card_codes
POST
Create a new gift_card_code
HEAD
Get just the header response
OPTIONS
Get a response explaining which HTTP methods are supported

Example Representation

{
  "_links": {
    "curies": [
      {
        "name": "fx",
        "href": "https://api.foxycart.com/rels/{rel}",
        "templated": true
      }
    ],
    "self": {
      "href": "...",
      "title": "This Collection"
    },
    "first": {
      "href": "...?offset=0",
      "title": "First Page of this Collection"
    },
    "prev": {
      "href": "...?offset=0",
      "title": "Previous Page of this Collection"
    },
    "next": {
      "href": "...?offset=0",
      "title": "Next Page of this Collection"
    },
    "last": {
      "href": "...?offset=0",
      "title": "Last Page of this Collection"
    }
  },
  "_embedded": {
    "fx:gift_card_codes": [...]
  },
  "total_items": "5",
  "returned_items": 5,
  "limit": 20,
  "offset": 0
}
<?xml version="1.0" encoding="UTF-8"?>
<resource href="...">
  <link rel="self" href="..." title="This Collection"/>
  <link rel="first" href="...?offset=0" title="First Page of this Collection"/>
  <link rel="prev" href="...?offset=0" title="Previous Page of this Collection"/>
  <link rel="next" href="...?offset=0" title="Next Page of this Collection"/>
  <link rel="last" href="...?offset=0" title="Last Page of this Collection"/>
  <resource href="..." rel="https://api.foxycart.com/rels/gift_card_code">
  ...
  </resource>
  <total_items>5</total_items>
  <returned_items>5</returned_items>
  <limit>20</limit>
  <offset>0</offset>
</resource>
{
    "properties": {
        "total_items": "5",
        "returned_items": 5,
        "limit": 20,
        "offset": 0
    },
    "entities": [...],
    "links": [
        {
            "rel": [
                "self"
            ],
            "href": "..."
        },
        {
            "rel": [
                "first"
            ],
            "href": "...?offset=0"
        },
        {
            "rel": [
                "prev"
            ],
            "href": "...?offset=0"
        },
        {
            "rel": [
                "next"
            ],
            "href": "...?offset=0"
        },
        {
            "rel": [
                "last"
            ],
            "href": "...?offset=0"
        }
    ],
    "actions": [
    ]
}

Embedded Resource: gift_card_code

Description

Gift card codes are the individual resources that maintain balances, and that are entered by customers. The properties of a gift card code is inherited from the gift_card it belongs to.

If you would like to create multiple gift card codes at once, see the gift card documentation.

Sandbox Example

You can interact with this resource and run actions against the sandbox API via our HAL Brower.

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

Property Description Type Constraints
code The string value of this gift card code which your customer will add to their cart to use this gift card. String Required. 50 characters or less.
current_balance Current balance on the gift card. Decimal Required
end_date The date when this gift card code will expire. Date Optional
date_created The date this resource was created.. Date Read only
date_modified The date this resource was last modified. Date Read only

Example Representation

{
    "_links": {
        "curies": [
            {
                "name": "fx",
                "href": "https://api.foxycart.com/rels/{rel}",
                "templated": true
            }
        ],
        "self": {
            "href": "https://api.foxycart.com/gift_card_codes/33",
            "title": "gf4"
        },
        "fx:store": {
            "href": "https://api.foxycart.com/stores/40075",
            "title": "This Store"
        },
        "fx:gift_card": {
            "href": "https://api.foxycart.com/gift_cards/6",
            "title": "This Gift Card"
        },
        "fx:gift_card_code_logs": {
            "href": "https://api.foxycart.com/gift_card_codes/33/logs",
            "title": "Transactions using this Gift Card Code"
        },
        "fx:provisioned_by_transaction_detail_id": {
            "href": "https://api.foxycart.com/transactions/5639772",
            "title": "This Transaction"
        }
    },
    "code": "37373-8LX2VW9D-JTSXQ",
    "current_balance": 12,
    "date_created": "2021-11-10T09:04:39-0800",
    "date_modified": "2021-11-10T09:04:39-0800"
}
<?xml version="1.0" encoding="UTF-8"?>
<resource href="https://api.foxycart.com/gift_card_codes/33" rel="https://api.foxycart.com/rels/gift_card_code">
  <link rel="self" href="https://api.foxycart.com/gift_card_codes/33" title="gf4"/>
  <link rel="https://api.foxycart.com/rels/store" href="https://api.foxycart.com/stores/40075" title="This Store"/>
  <link rel="https://api.foxycart.com/rels/gift_card" href="https://api.foxycart.com/gift_cards/6" title="This Gift Card"/>
  <link rel="https://api.foxycart.com/rels/gift_card_code_logs" href="https://api.foxycart.com/gift_card_codes/33/logs" title="Transactions using this Gift Card Code"/>
  <code>gf4</code>
  <current_balance>0</current_balance>
  <end_date></end_date>
  <date_created>2021-11-10T09: 04: 39-0800</date_created>
  <date_modified>2021-11-10T09: 04: 39-0800</date_modified>
</resource>
{
    "class": [
        "gift_card_code"
    ],
    "properties": {
        "code": "gf4",
        "current_balance": 0,
        "end_date": null,
        "date_created": "2021-11-10T09:04:39-0800",
        "date_modified": "2021-11-10T09:04:39-0800"
    },
    "links": [
        {
            "rel": [
                "self"
            ],
            "href": "https://api.foxycart.com/gift_card_codes/33"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/store"
            ],
            "href": "https://api.foxycart.com/stores/40075"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/gift_card"
            ],
            "href": "https://api.foxycart.com/gift_cards/6"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/gift_card_code_logs"
            ],
            "href": "https://api.foxycart.com/gift_card_codes/33/logs"
        }
    ],
    "actions": [
        {
            "name": "self",
            "title": "Update Gift Card Code",
            "method": "PATCH",
            "href": "https://api.foxycart.com/gift_card_codes/33",
            "type": "application/x-www-form-urlencoded",
            "fields": [
                {
                    "name": "code",
                    "title": "Code",
                    "type": "text",
                    "value": "gf4"
                },
                {
                    "name": "current_balance",
                    "title": "Current Balance",
                    "type": "text",
                    "value": 0
                },
                {
                    "name": "end_date",
                    "title": "End Date",
                    "type": "datetime",
                    "value": null
                }
            ]
        }
    ]
}

Zoomable Resources

This resource has no linked resources which can be "zoomed" in on, filtered and embedded within this resource.