# Organization API: Customer Portal: Addons

> The 3 Organization API operations for addons.

Source: https://www.coritan.com/docs/api/reference/organizations/customer-portal/servers-addons/

Part of [Customer Portal](/docs/api/reference/organizations/customer-portal/).

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| GET | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/addons`](#op-get-api-v1-orgs-org-slug-portal-servers-uuid-addons) | The add-ons this store sells for one of your servers, and the ones the server has |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/addons`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-addons) | Buy an add-on for one of your servers |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/addons/preview`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-addons-preview) | What buying an add-on charges, before you buy it |

### The add-ons this store sells for one of your servers, and the ones the server has {#op-get-api-v1-orgs-org-slug-portal-servers-uuid-addons}

`GET /api/v1/orgs/{org_slug}/portal/servers/{uuid}/addons`

The add-ons this store sells for one of your servers, and the ones the server has.

`offers` lists each add-on with its price for the server's billing period
(`price.amount` is per unit), how many more the server takes
(`max_quantity`), and whether you can order it now (`orderable`). When it
cannot be ordered, `reason` says why: `free_server`, `snapshots_disabled`,
`max_reached`, `no_price_for_cycle`, `server_not_ready`, `unpaid_order`,
`not_available`, and `message` is the sentence to show. `applies` says when
the effect reaches the server: `now`, or `after_restart` for extra CPU on a
server that is stopped. `attached` lists the add-ons already on the server,
each one a service you can cancel with `POST /portal/services/{id}/cancel`.

Only the server's owner can read it. Someone the server was shared with gets 403.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org_slug` | path | string | yes |  |
| `uuid` | path | string | yes | The server's UUID. |

#### Responses

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

### Buy an add-on for one of your servers {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-addons}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/addons`

Buy an add-on for one of your servers.

The store invoices the rest of the server's current billing period (the
`total`, with tax) and renews the add-on with the server from then on, at the
full price. The effect starts when the invoice is paid: extra CPU raises the
server's limit and is sent to its host straight away, and a running server that
does not show it needs a restart. Automatic backups start their daily run, and Server
Management lets you ask the store's team for plugin, mod and modpack help by
ticket. The answer is the order's `service_id` (the add-on, which you cancel
from `POST /portal/services/{id}/cancel`), `invoice_id`, `requires_payment`,
`total`, `currency` and `due_date`.

A server on the free plan takes no add-ons. Only the server's owner can order.
Cancelling the add-on, or the server ending, takes the effect away.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org_slug` | path | string | yes |  |
| `uuid` | path | string | yes | The server's UUID. |

#### Request body

`application/json` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `kind` | string | yes | Which add-on to buy: `container_cpu`, `container_auto_backups` or `server_management`. |
| `quantity` | integer | no | How many to buy. Extra CPU is one vCPU a unit, up to the store's limit for a server. Automatic backups and Server Management are sold one at a time, so send 1. |

#### Responses

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

### What buying an add-on charges, before you buy it {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-addons-preview}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/addons/preview`

What buying an add-on charges, before you buy it. Nothing is written.

`due_now` is the add-on's price for the rest of the server's current billing
period, including tax. `renewal_amount` is the full price it renews at, on the
server's renewal date (`renews_at`), in the server's billing period. `applies`
is `now` or `after_restart`, as in the list. It refuses for the same reasons
the order does: `409` with `reason` for a server that cannot take it, and `422`
for an unknown add-on or a quantity the server cannot take. Previews and orders
for one server share a limit of 20 in ten minutes per customer, and `429`
answers past it.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org_slug` | path | string | yes |  |
| `uuid` | path | string | yes | The server's UUID. |

#### Request body

`application/json` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `kind` | string | yes | Which add-on to buy: `container_cpu`, `container_auto_backups` or `server_management`. |
| `quantity` | integer | no | How many to buy. Extra CPU is one vCPU a unit, up to the store's limit for a server. Automatic backups and Server Management are sold one at a time, so send 1. |

#### Responses

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