# Organization API: Customers: Commerce

> The 4 Organization API operations for commerce.

Source: https://www.coritan.com/docs/api/reference/organizations/customers/commerce/

Part of [Customers](/docs/api/reference/organizations/customers/).

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| PUT | [`/api/v1/orgs/{org_slug}/commerce/customer-groups/{group_id}/customers`](#op-put-api-v1-orgs-org-slug-commerce-customer-groups-group-id-customers) | Set group customers |
| GET | [`/api/v1/orgs/{org_slug}/commerce/customers`](#op-get-api-v1-orgs-org-slug-commerce-customers) | Newest first, with each customer's order count, spend and groups |
| GET | [`/api/v1/orgs/{org_slug}/commerce/customers/{customer_id}`](#op-get-api-v1-orgs-org-slug-commerce-customers-customer-id) | The customer, their saved addresses, note, tags, groups and spend |
| PATCH | [`/api/v1/orgs/{org_slug}/commerce/customers/{customer_id}`](#op-patch-api-v1-orgs-org-slug-commerce-customers-customer-id) | Note, tags, tax exemption, VAT id and its check; acceptsmarketing takes only false |

### Set group customers {#op-put-api-v1-orgs-org-slug-commerce-customer-groups-group-id-customers}

`PUT /api/v1/orgs/{org_slug}/commerce/customer-groups/{group_id}/customers`

Make ``customer_ids`` exactly the group's customers (at most 1000); an
id that is not one of the store's customers is not found.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `group_id` | path | integer | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `customer_ids` | array of integer | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Newest first, with each customer's order count, spend and groups {#op-get-api-v1-orgs-org-slug-commerce-customers}

`GET /api/v1/orgs/{org_slug}/commerce/customers`

Newest first, with each customer's order count, spend and groups.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org_slug` | path | string | yes |  |
| `q` | query | string or null | no | Part of an email or a name. |
| `group_id` | query | integer or null | no |  |
| `limit` | query | integer | no | Default: `50`. |
| `offset` | query | integer | no | Default: `0`. |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### The customer, their saved addresses, note, tags, groups and spend {#op-get-api-v1-orgs-org-slug-commerce-customers-customer-id}

`GET /api/v1/orgs/{org_slug}/commerce/customers/{customer_id}`

The customer, their saved addresses, note, tags, groups and spend.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `customer_id` | path | integer | yes |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Note, tags, tax exemption, VAT id and its check; acceptsmarketing takes only false {#op-patch-api-v1-orgs-org-slug-commerce-customers-customer-id}

`PATCH /api/v1/orgs/{org_slug}/commerce/customers/{customer_id}`

Note, tags, tax exemption, VAT id and its check; ``accepts_marketing``
takes only false. Changing ``vat_id`` clears its check.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `customer_id` | path | integer | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accepts_marketing` | boolean or null | no | Only false: a store can turn consent off. |
| `note` | string or null | no |  |
| `tags` | array of string or null | no |  |
| `tax_exempt` | boolean or null | no |  |
| `vat_id` | string or null | no |  |
| `vat_id_valid` | boolean or null | no | Whether the VAT id was checked and found valid. |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |
