attribute

Description

An attribute is a non-standard property that can be applied to multiple resources such as a client, user, store, transaction, cart, subscription, shipment, item, and customer. You can set the visibility to control whether or not other client implementations can also view the property or if that property should not be visible unless connected with the proper client credentials.

Client Attribute Restrictions: To modify, view or create a client attribute, you must be connected to the API using an OAuth token which has client_full_access scope.

User Attribute Restrictions: To modify, view or create a user attribute, you must be connected to the API using an OAuth token which has user_full_access scope.

Sandbox Example

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

Actions

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

Properties

Property Description Type Constraints
visibility Controls who can see this attribute. Public attributes can be shown to anyone, including customers. Private attributes are more suitable for configuration or technical details which are irrelevant to the public. Restricted attributes can only be viewed by the OAuth client who creates them. String public, private or restricted. Defaults to private. Can not be modified once set.
name The name of this attribute. String Required. 500 characters or less.
value The value of this attribute. String Required. 1000 characters or less.
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/store_attributes/1002",
            "title": "This store attribute"
        },
        "fx:store": {
            "href": "https://api.foxycart.com/stores/66",
            "title": "This Store"
        }
    },
    "visibility": "private",
    "name": "Hours",
    "value": "9am to 5pm",
    "date_created": "2013-08-05T14:15:59-0700",
    "date_modified": "2013-08-05T14:15:59-0700"
}
<?xml version="1.0" encoding="UTF-8"?>
<resource href="https://api.foxycart.com/store_attributes/1002" rel="https://api.foxycart.com/rels/attribute">
  <link rel="self" href="https://api.foxycart.com/store_attributes/1002" title="This store attribute"/>
  <link rel="https://api.foxycart.com/rels/store" href="https://api.foxycart.com/stores/66" title="This Store"/>
  <visibility>private</visibility>
  <name>Hours</name>
  <value>9am to 5pm</value>
  <date_created>2013-08-05T14:15:59-0700</date_created>
  <date_modified>2013-08-05T14:15:59-0700</date_modified>
</resource>
{
    "class": [
        "attribute"
    ],
    "properties": {
        "visibility": "private",
        "name": "Hours",
        "value": "9am to 5pm",
        "date_created": "2013-08-05T14:15:59-0700",
        "date_modified": "2013-08-05T14:15:59-0700"
    },
    "links": [
        {
            "rel": [
                "self"
            ],
            "href": "https://api.foxycart.com/store_attributes/1002"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/store"
            ],
            "href": "https://api.foxycart.com/stores/66"
        }
    ]
}

Zoomable Resources

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