> For the complete documentation index, see [llms.txt](https://ofn-user-guide.gitbook.io/ofn-api-handbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ofn-user-guide.gitbook.io/ofn-api-handbook/ofn-api-v1/customers.md).

# Customers

Beta Release

### Index

{% openapi src="/files/mU4G9wzywO2g1nU8ejqK" path="/api/v1/customers" method="get" %}
[swagger (1).yaml](https://2749008000-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNv32980j4B1B2UoS6UMi%2Fuploads%2FTfYIJjj9eGQl66gsDz5W%2Fswagger%20\(1\).yaml?alt=media\&token=7367c11e-e412-4731-b83f-7dc5804e46d5)
{% endopenapi %}

#### Code Examples

{% tabs %}
{% tab title="url (with browser session)" %}

```
https://INSTANCE_URL/api/v1/customers
```

```
https://INSTANCE_URL/api/v1/customers?enterprise_id=ENTERPRISE_ID
```

{% endtab %}
{% endtabs %}

### Show

{% openapi src="/files/mU4G9wzywO2g1nU8ejqK" path="/api/v1/customers/{id}" method="get" %}
[swagger (1).yaml](https://2749008000-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNv32980j4B1B2UoS6UMi%2Fuploads%2FTfYIJjj9eGQl66gsDz5W%2Fswagger%20\(1\).yaml?alt=media\&token=7367c11e-e412-4731-b83f-7dc5804e46d5)
{% endopenapi %}

#### Code Examples

{% tabs %}
{% tab title="coming soon..." %}

{% endtab %}
{% endtabs %}

### Create

{% openapi src="/files/mU4G9wzywO2g1nU8ejqK" path="/api/v1/customers" method="post" %}
[swagger (1).yaml](https://2749008000-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNv32980j4B1B2UoS6UMi%2Fuploads%2FTfYIJjj9eGQl66gsDz5W%2Fswagger%20\(1\).yaml?alt=media\&token=7367c11e-e412-4731-b83f-7dc5804e46d5)
{% endopenapi %}

#### Code Examples

{% tabs %}
{% tab title="curl" %}

```
curl -X POST "INSTANCE_URL/api/v1/customers" 
     -H "X-Spree-Token: YOUR_API_KEY" 
     -H "accept: application/json"
     -d "enterprise_id: ENTERPRISE_ID"
     -d "email: EMAIL"
     -d "first_name: FIRST_NAME"
     -d "last_name: LAST_NAME"
     -d "tags: TAG_LIST" 
```

{% endtab %}

{% tab title="javascript" %}

```javascript
const myOptions = {
  url: INSTANCE_URL+'/api/v1/customers',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
  },
  params: {
    'token': API_TOKEN,
  },
  body: {
    'enterprise_id': ENTERPRISE_ID,
    'email': EMAIL,
    'first_name': FIRST_NAME,
    'last_name': LAST_NAME,
    'tags': TAG_LIST
  }
}

const myRequest = new Request('customers.json', myOptions);
fetch(myRequest).then((response) => {
  // ...
});
    
```

{% endtab %}
{% endtabs %}

### Update

{% openapi src="/files/mU4G9wzywO2g1nU8ejqK" path="/api/v1/customers/{id}" method="put" %}
[swagger (1).yaml](https://2749008000-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNv32980j4B1B2UoS6UMi%2Fuploads%2FTfYIJjj9eGQl66gsDz5W%2Fswagger%20\(1\).yaml?alt=media\&token=7367c11e-e412-4731-b83f-7dc5804e46d5)
{% endopenapi %}

{% tabs %}
{% tab title="coming soon..." %}

{% endtab %}
{% endtabs %}

### Destroy

{% openapi src="/files/mU4G9wzywO2g1nU8ejqK" path="/api/v1/customers/{id}" method="delete" %}
[swagger (1).yaml](https://2749008000-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNv32980j4B1B2UoS6UMi%2Fuploads%2FTfYIJjj9eGQl66gsDz5W%2Fswagger%20\(1\).yaml?alt=media\&token=7367c11e-e412-4731-b83f-7dc5804e46d5)
{% endopenapi %}

#### Code Examples

{% tabs %}
{% tab title="coming soon" %}

{% endtab %}
{% endtabs %}
