# Distributor organization


<style>
  span[class^="pill-"] {
    color: white;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.6em;
    vertical-align: middle;
    margin-right: 12px;
    font-family: sans-serif;
    font-weight: bold;
    display: inline-block;
    line-height: 1;
  }
  span.pill-GET { background-color: #61affe; }
  span.pill-POST { background-color: #49cc90; }
  span.pill-PUT { background-color: #fca130; }
  span.pill-DELETE { background-color: #f93e3e; }
  span.pill-PATCH { background-color: #50e3c2; }
  span[class^="pill-"]:after {
    content: attr(data-label);
    font-size: 0.9rem;
  }
</style>

Provisioning and lifecycle management of end-customer organizations for members of the Exoscale distributor program.

[Read more](https://www.exoscale.com/partner-programs/)

## <span data-label="POST" class="pill-POST"></span>create-distributor-organization

```
POST /distributor/organization
```

Create an Organization linked to your Distributor Organization.

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `billing-address` | [ISO 20022 Structured Billing Address](/reference/partner-api/_schemas/billing-address/) | **yes** | ISO 20022 Structured Billing Address |
| `display-name` | string | **yes** | Organization Display Name<br/><br/>Min length: `1`. Max length: `191`. |
| `owner-email` | string | **yes** | Email Address of the first Owner<br/><br/>Min length: `1`. Max length: `75`. |
| `client-id` | string | no | Organization Client ID<br/><br/>Max length: `191`. |

<details>
<summary>Example</summary>

```json
{
  "billing-address": {
    "address": "string",
    "building-number": "string",
    "city": "string",
    "country": "string",
    "name": "string",
    "postal-code": "string",
    "street-name": "string"
  },
  "client-id": "string",
  "display-name": "string",
  "owner-email": "string"
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `billing-address` | [ISO 20022 Structured Billing Address](/reference/partner-api/_schemas/billing-address/) | ISO 20022 Structured Billing Address |
| `client-id` | string | Organization Client ID<br/><br/>Max length: `191`. |
| `id` | string | Organization ID<br/><br/>Must be a valid UUID. |
| `status` | string | Organization Status<br/><br/>Allowed values: `created`, `suspended`, `active`, `terminated`. |

<details>
<summary>Example output</summary>

```json
{
  "billing-address": {
    "address": "string",
    "building-number": "string",
    "city": "string",
    "country": "string",
    "name": "string",
    "postal-code": "string",
    "street-name": "string"
  },
  "client-id": "string",
  "id": "string",
  "status": "created"
}
```
</details>


SDK reference for `create-distributor-organization`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.CreateDistributorOrganization) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.create_distributor_organization) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#createDistributorOrganization(com.exoscale.sdk.model.CreateDistributorOrganizationRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api create-distributor-organization`

## <span data-label="GET" class="pill-GET"></span>get-distributor-organization

```
GET /distributor/organization/{id}
```

Get an Organization linked to your Distributor Organization.

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `billing-address` | [ISO 20022 Structured Billing Address](/reference/partner-api/_schemas/billing-address/) | ISO 20022 Structured Billing Address |
| `client-id` | string | Organization Client ID<br/><br/>Max length: `191`. |
| `id` | string | Organization ID<br/><br/>Must be a valid UUID. |
| `status` | string | Organization Status<br/><br/>Allowed values: `created`, `suspended`, `active`, `terminated`. |

<details>
<summary>Example output</summary>

```json
{
  "billing-address": {
    "address": "string",
    "building-number": "string",
    "city": "string",
    "country": "string",
    "name": "string",
    "postal-code": "string",
    "street-name": "string"
  },
  "client-id": "string",
  "id": "string",
  "status": "created"
}
```
</details>


SDK reference for `get-distributor-organization`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.GetDistributorOrganization) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.get_distributor_organization) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#getDistributorOrganization(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api get-distributor-organization`


---

## Other Operations

## <span data-label="PUT" class="pill-PUT"></span>activate-distributor-organization

```
PUT /distributor/organization/{id}:activate
```

Activate an Organization linked to your Distributor Organization.

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `billing-address` | [ISO 20022 Structured Billing Address](/reference/partner-api/_schemas/billing-address/) | ISO 20022 Structured Billing Address |
| `client-id` | string | Organization Client ID<br/><br/>Max length: `191`. |
| `id` | string | Organization ID<br/><br/>Must be a valid UUID. |
| `status` | string | Organization Status<br/><br/>Allowed values: `created`, `suspended`, `active`, `terminated`. |

<details>
<summary>Example output</summary>

```json
{
  "billing-address": {
    "address": "string",
    "building-number": "string",
    "city": "string",
    "country": "string",
    "name": "string",
    "postal-code": "string",
    "street-name": "string"
  },
  "client-id": "string",
  "id": "string",
  "status": "created"
}
```
</details>


SDK reference for `activate-distributor-organization`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ActivateDistributorOrganization) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.activate_distributor_organization) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#activateDistributorOrganization(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api activate-distributor-organization`

## <span data-label="GET" class="pill-GET"></span>list-distributor-organization-usage

```
GET /distributor/organization/{id}/usage
```

List usage records of a sub-Organization.

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Query parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `period` | `query` | no | Min length: `7`. Max length: `7`. |

### Responses

Status: `200` - 200

Content-Type: `application/json`


<details>
<summary>Example output</summary>

```json
[
  {
    "code": "string",
    "currency": "string",
    "end-date": "2024-01-01T12:00:00Z",
    "start-date": "2024-01-01T12:00:00Z",
    "total-excl-vat": 0,
    "total-incl-vat": 0,
    "usage": [
      {
        "description": "string",
        "product": "string",
        "quantity": 0,
        "total-excl-vat": 0,
        "total-incl-vat": 0,
        "unit": "string",
        "variable": "string"
      }
    ]
  }
]
```
</details>


SDK reference for `list-distributor-organization-usage`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ListDistributorOrganizationUsage) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.list_distributor_organization_usage) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#listDistributorOrganizationUsage(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api list-distributor-organization-usage`

## <span data-label="GET" class="pill-GET"></span>list-distributor-organizations

```
GET /distributor/organization
```

List Organizations linked to your Distributor Organization.

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `organizations` | array of [Organization representation](/reference/partner-api/_schemas/organization-output/) | The list of organizations. |

<details>
<summary>Example output</summary>

```json
{
  "organizations": [
    {
      "billing-address": {
        "address": "string",
        "building-number": "string",
        "city": "string",
        "country": "string",
        "name": "string",
        "postal-code": "string",
        "street-name": "string"
      },
      "client-id": "string",
      "id": "string",
      "status": "created"
    }
  ]
}
```
</details>


SDK reference for `list-distributor-organizations`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ListDistributorOrganizations) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.list_distributor_organizations) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#listDistributorOrganizations())

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api list-distributor-organizations`

## <span data-label="PUT" class="pill-PUT"></span>schedule-purge-distributor-organization

```
PUT /distributor/organization/{id}:schedule-purge
```

Schedule the purge of an Organization linked to your Distributor Organization.

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

**`200`**: 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `message` | string | The message indicating that the Organization has been successfully purged. |

<details>
<summary>Example output</summary>

```json
{
  "message": "string"
}
```
</details>

**`202`**: 202

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `message` | string | The message indicating that the Organization has been successfully scheduled to be purged. |

<details>
<summary>Example output</summary>

```json
{
  "message": "string"
}
```
</details>


SDK reference for `schedule-purge-distributor-organization`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.SchedulePurgeDistributorOrganization) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.schedule_purge_distributor_organization) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#schedulePurgeDistributorOrganization(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api schedule-purge-distributor-organization`

## <span data-label="PUT" class="pill-PUT"></span>suspend-distributor-organization

```
PUT /distributor/organization/{id}:suspend
```

Suspend an Organization linked to your Distributor Organization.

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `billing-address` | [ISO 20022 Structured Billing Address](/reference/partner-api/_schemas/billing-address/) | ISO 20022 Structured Billing Address |
| `client-id` | string | Organization Client ID<br/><br/>Max length: `191`. |
| `id` | string | Organization ID<br/><br/>Must be a valid UUID. |
| `status` | string | Organization Status<br/><br/>Allowed values: `created`, `suspended`, `active`, `terminated`. |

<details>
<summary>Example output</summary>

```json
{
  "billing-address": {
    "address": "string",
    "building-number": "string",
    "city": "string",
    "country": "string",
    "name": "string",
    "postal-code": "string",
    "street-name": "string"
  },
  "client-id": "string",
  "id": "string",
  "status": "created"
}
```
</details>


SDK reference for `suspend-distributor-organization`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.SuspendDistributorOrganization) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.suspend_distributor_organization) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#suspendDistributorOrganization(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api suspend-distributor-organization`

## <span data-label="DELETE" class="pill-DELETE"></span>terminate-distributor-organization

```
DELETE /distributor/organization/{id}:terminate
```

Terminate an Organization linked to your Distributor Organization.

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `message` | string | The message indicating that the Organization has been successfully terminated. |

<details>
<summary>Example output</summary>

```json
{
  "message": "string"
}
```
</details>


SDK reference for `terminate-distributor-organization`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.TerminateDistributorOrganization) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.terminate_distributor_organization) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#terminateDistributorOrganization(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api terminate-distributor-organization`


