item_option

Description

An item option is a property added to the cart for an item which isn't part of the standard item properties such as name, weight, etc. Examples include size, color, or anything else added during the add to cart process.

Interact with this resource

To interact with this resource and see it in the context of the API, you can utilise Postman or your Terminal/Console to perform requests. If you have a Foxy store, you can also use the API browser in the admin to interact with resources connected to your store.

Actions

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

Properties

Property Description Type Constraints
name The name of this item option. String Required. 100 characters or less.
value The value of this item option. String Required. 1024 characters or less.
price_mod The price modifier for this item option. The price of the item in the cart will be adjusted by this amount because of this item option. Decimal Optional.
weight_mod The weight modifier for this item option. The weight of the item in the cart will be adjusted by this amount because of this item option. Decimal Optional. Up to three decimal places.
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-sandbox.foxycart.com/item_options/2",
            "title": "This Item Option"
        },
        "fx:store": {
            "href": "https://api-sandbox.foxycart.com/stores/8",
            "title": "This Store"
        },
        "fx:transaction": {
            "href": "https://api-sandbox.foxycart.com/transactions/2",
            "title": "This Transaction"
        },
        "fx:item": {
            "href": "https://api-sandbox.foxycart.com/items/2",
            "title": "This Item"
        }
    },
    "name": "color",
    "value": "blue",
    "price_mod": 0,
    "weight_mod": 0,
    "date_created": "2012-02-29T13:55:09-0800",
    "date_modified": "2012-02-29T13:55:09-0800"
}
<?xml version="1.0" encoding="UTF-8"?>
<resource href="https://api-sandbox.foxycart.com/item_options/2" rel="https://api.foxycart.com/rels/item_option">
  <link rel="self" href="https://api-sandbox.foxycart.com/item_options/2" title="This Item Option"/>
  <link rel="https://api.foxycart.com/rels/store" href="https://api-sandbox.foxycart.com/stores/8" title="This Store"/>
  <link rel="https://api.foxycart.com/rels/transaction" href="https://api-sandbox.foxycart.com/transactions/2" title="This Transaction"/>
  <link rel="https://api.foxycart.com/rels/item" href="https://api-sandbox.foxycart.com/items/2" title="This Item"/>
  <name>color</name>
  <value>blue</value>
  <price_mod>0</price_mod>
  <weight_mod>0</weight_mod>
  <date_created>2012-02-29T13:55:09-0800</date_created>
  <date_modified>2012-02-29T13:55:09-0800</date_modified>
</resource>
{
    "class": [
        "item_option"
    ],
    "properties": {
        "name": "color",
        "value": "blue",
        "price_mod": 0,
        "weight_mod": 0,
        "date_created": "2012-02-29T13:55:09-0800",
        "date_modified": "2012-02-29T13:55:09-0800"
    },
    "links": [
        {
            "rel": [
                "self"
            ],
            "href": "https://api-sandbox.foxycart.com/item_options/2"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/store"
            ],
            "href": "https://api-sandbox.foxycart.com/stores/8"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/transaction"
            ],
            "href": "https://api-sandbox.foxycart.com/transactions/2"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/item"
            ],
            "href": "https://api-sandbox.foxycart.com/items/2"
        }
    ]
}

Zoomable Resources

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