users

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.

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 list of users
POST
Create a new user
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:users": [...]
  },
  "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/user">
  ...
  </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: user

Description

As part of security protections against abuse, an hCaptcha header is required as part of user creation. It is passed through a h-captcha-code header with the POST request to create a user. If you have a need to create users as part of a platform integration, please get in touch with our support team to discuss this requirement further.

To modify a user, you must be connected to the API using an OAuth token with user_full_access scope.

A FoxyCart User is someone who manages and configures a FoxyCart Store. It is often the owner of that store, but might also be someone paid to be responsible for aspects of the store. There can be many users per store and any user can access many stores. Before creating a user, you must create a client. When you create a user, you'll get a response back containing an OAuth token giving you access to the user.

If you create custom attributes for a user, they will automatically be included in the response as embedded resources without having to zoom in on them.

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 user
PATCH
Update a user (send only the properties you want to modify)
PUT
Replace a user (send the entire representation)
DELETE
Delete a user
HEAD
Get just the header response
OPTIONS
Get a response explaining which HTTP methods are supported

Properties

Property Description Type Constraints
first_name The user's given name. String Required. 50 characters or less.
last_name The user's surname. String Required. 50 characters or less.
email The user's email address. This is used as the login to the FoxyCart admin for this user. Email Required. 100 characters or less.
phone The user's phone number. String 50 characters or less.
affiliate_id This can only be set during user creation. Contact us if you need this value changed later. Integer Can only be set on creation.
is_programmer If this user is a programmer who writes server side code in languages like PHP, .NET, Python, Java, Ruby, etc Boolean true or false, 1 or 0.
is_front_end_developer If this user is a front end developer who writes code in things like HTML, CSS, and maybe some JavaScript. Boolean true or false, 1 or 0.
is_designer If this user is a front end designer who works in wireframes, graphic designs, and user interfaces. Boolean true or false, 1 or 0.
is_merchant If this user is a a merchant or store admin involved in the item and money side of the e-commerce business. Boolean true or false, 1 or 0.
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/users/1",
            "title": "This User"
        },
        "fx:attributes": {
            "href": "https://api.foxycart.com/users/1/attributes",
            "title": "Attributes for This User"
        },
        "fx:default_store": {
            "href": "https://api.foxycart.com/stores/66",
            "title": "Example Store"
        },
        "fx:stores": {
            "href": "https://api.foxycart.com/users/1/stores",
            "title": "Stores for This User"
        }
    },
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@example.com",
    "phone": "555-555-5555",
    "affiliate_id": 0,
    "is_programmer": true,
    "is_front_end_developer": false,
    "is_designer": false,
    "is_merchant": true,
    "date_created": "2007-05-23T16:09:12-0700",
    "date_modified": "2013-07-10T22:37:49-0700"
}
<?xml version="1.0" encoding="UTF-8"?>
<resource href="https://api.foxycart.com/users/1" rel="https://api.foxycart.com/rels/user">
  <link rel="self" href="https://api.foxycart.com/users/1" title="This User"/>
  <link rel="https://api.foxycart.com/rels/attributes" href="https://api.foxycart.com/users/1/attributes" title="Attributes for This User"/>
  <link rel="https://api.foxycart.com/rels/default_store" href="https://api.foxycart.com/stores/66" title="Example Store"/>
  <link rel="https://api.foxycart.com/rels/stores" href="https://api.foxycart.com/users/1/stores" title="Stores for This User"/>
  <first_name>John</first_name>
  <last_name>Doe</last_name>
  <email>john.doe@example.com</email>
  <phone>555-555-5555</phone>
  <affiliate_id>0</affiliate_id>
  <is_programmer>true</is_programmer>
  <is_front_end_developer>false</is_front_end_developer>
  <is_designer>false</is_designer>
  <is_merchant>true</is_merchant>
  <date_created>2007-05-23T16:09:12-0700</date_created>
  <date_modified>2013-07-10T22:37:49-0700</date_modified>
</resource>
{
    "class": [
        "user"
    ],
    "properties": {
        "first_name": "John",
        "last_name": "Doe",
        "email": "john.doe@example.com",
        "phone": "555-555-5555",
        "affiliate_id": 0,
        "is_programmer": true,
        "is_front_end_developer": false,
        "is_designer": false,
        "is_merchant": true,
        "date_created": "2007-05-23T16:09:12-0700",
        "date_modified": "2013-07-10T22:37:49-0700"
    },
    "links": [
        {
            "rel": [
                "self"
            ],
            "href": "https://api.foxycart.com/users/1"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/attributes"
            ],
            "href": "https://api.foxycart.com/users/1/attributes"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/default_store"
            ],
            "href": "https://api.foxycart.com/stores/66"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/stores"
            ],
            "href": "https://api.foxycart.com/users/1/stores"
        }
    ]
}

Zoomable Resources

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