client

To view and work with a client, you must be connected to the API using an OAuth token with client_full_access scope.

Creating a Client resource is how you register your client application with the API as described in the OAuth 2.0 RFC. It is the first required step for working with the Foxy API. When you register your client, you'll receive an OAuth 2.0 access_token and refresh_token in the response with a client_full_access scope. You'll use these tokens any time you want to view or modify your client registration. The response will also include your client_id and client_secret which you'll need for refreshing your access tokens.

After you connect to the API with your client token, you'll then be able to access your client_id and client_secret which your application will need to interact with the Foxy API's OAuth 2.0 system. The client_secret must be stored securely (preferably encrypted) and should never be stored publicly, such as in a public repo or publicly accessible database.

If your client application is a software as a service, you will only need one client for your application. If your client software, on the other hand, will be distributed for others to download and host themselves, your application will have to talk to the API to create a Client resource and register each installation.

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

Required Scopes

Full client_full_access
Read clients_read
Write clients_write

Actions

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

Properties (13)

client_id String · max 200

A unique identifier for this client. If you do not supply one, one will be automatically generated for you. If you're not hosting the client integration yourself, please use a known prefix when creating your clients. This can not be modified once it is created.

Unique. Can only be set on creation. Between 15 and 200 characters.

client_secret String · Read-only

The password to be used with this client_id for OAuth 2.0 integration. This is generated automatically and can't be changed.

redirect_uri String · Required · max 200

This is the redirection endpoint as described by OAuth 2.0.

project_name String · Required · max 100

The name of this project which will be using the API. This should be specific to the installation and implementation of this client. This information will be displayed on your OAuth 2.0 authentication page.

project_description String · max 200

A description of this project. This information will be displayed on your OAuth 2.0 authentication page.

company_name String · Required · max 100

The name of the company responsible for this project. This information will be displayed on your OAuth 2.0 authentication page.

company_url String · max 200

The URL of the company responsible for this project. This information will be displayed on your OAuth 2.0 authentication page.

company_logo String · max 200

An image URL for this company. This information will be displayed on your OAuth 2.0 authentication page.

contact_name String · Required · max 100

The individual responsible for this integration.

contact_email String · Required · max 100

The email address of the individual responsible for this integration.

contact_phone String · Required · max 100

The phone number of the individual responsible for this integration.

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 (2)

self This Client
fx:attributes GET POST PATCH PUT Attributes for This Client

Zoomable Resources

Embed related resources using ?zoom=<resource>. Filter with ?resource:property=value.

https://api.foxycart.com/clients/{id}
Available via fx:client on api_home·fx:client on integration

Example Representation

Zoom
{
  "_links": {
    "curies": [
      {
        "name": "fx",
        "href": "https://api.foxycart.com/rels/{rel}",
        "templated": true
      }
    ],
    "self": {
      "href": "https://api.foxycart.com/clients/123",
      "title": "This Client"
    },
    "fx:attributes": {
      "href": "https://api.foxycart.com/clients/123/attributes",
      "title": "Attributes for This Client"
    }
  },
  "client_id": "client_JnVvPWxBz4Ep7YcpJFeU",
  "client_secret": "7dn2cmvUS5btm1S6Mfygd7vaVBuv7Cf8Fx1HKqsx",
  "redirect_uri": "http://example.com",
  "project_name": "Example Project",
  "project_description": "A really cool project using the API.",
  "company_name": "Super amazing company",
  "company_url": "http://example.com",
  "company_logo": "",
  "contact_name": "John Doe",
  "contact_email": "john.doe@example.com",
  "contact_phone": "555-555-5555"
}