attribute

Collection: attributes

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.

Notes

The endpoint URL for attributes varies depending on the parent resource. For example, store attributes are at /store_attributes/{id}, transaction attributes at /transaction_attributes/{id}, customer attributes at /customer_attributes/{id}, and so on. The URL shown above uses store_attributes as a default, but the actual path will differ based on the parent resource type.

Required Scopes

Full store_full_access

On a store:

Read stores_read
Write stores_write

On a customer:

Read customers_read
Write customers_write

On a completed transaction:

Read transactions_read
Write transactions_write

On a cart:

Read carts_read
Write carts_write

On an item (completed transaction):

Read transactions_read
Write transactions_write

On an item (cart):

Read carts_read
Write carts_write

On a subscription:

Read subscriptions_read
Write subscriptions_write

On a shipment:

Read transactions_read
Write transactions_write

On a coupon:

Read coupons_read
Write coupons_write

On a gift card:

Read gift_cards_read
Write gift_cards_write

On a client (requires client_full_access):

Read clients_read
Write clients_write

On a user (requires user_full_access):

Read users_read
Write users_write

Actions

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

Properties (5)

name String · Required · max 500

The name of this attribute.

value String · Required · max 1000

The value of this attribute.

visibility String

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.

Cannot be modified once set.

Default: private

publicprivaterestricted
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 (1)

self This Attribute
https://api.foxycart.com/store_attributes/{id}

Example Representation

{
  "_links": {
    "curies": [
      {
        "name": "fx",
        "href": "https://api.foxycart.com/rels/{rel}",
        "templated": true
      }
    ],
    "self": {
      "href": "https://api.foxycart.com/store_attributes/123",
      "title": "This Attribute"
    }
  },
  "name": "Hours",
  "value": "9am to 5pm",
  "visibility": "private",
  "date_created": "2013-08-05T14:15:59-0700",
  "date_modified": "2013-08-05T14:15:59-0700"
}