# Manage customer services

> Order a service for a customer, find any service your customers hold, and suspend or restore one.

Source: https://www.coritan.com/docs/organizations/customer-services/

In the dashboard:

- /dashboard/organizations/…/services: https://www.coritan.com/dashboard/organizations

A customer service is one product a customer holds at one price. Services appear when customers order on your storefront, and you can also order one for a customer yourself, for example to replace a service or to set up a customer by hand. The **Services** tab lists every service your customers hold, and lets you suspend one and restore it.

## Before you begin

- Any member can see services. Ordering, suspending and unsuspending take the owner or admin role.
- To order, you need an `active` customer and a product that is available, with at least one active plan. See [Set up products and pricing](/docs/organizations/products-and-pricing/).

## Find a service

1. In the [dashboard](https://www.coritan.com/dashboard/organizations), open the organization, then the **Services** tab.
2. Type in **Search hostname, customer or product**, or choose a status in the list next to it. The search also matches the plan name, a tag and the service number.
3. Select a service to open it.

The service page shows its **Service ID**, status, **Billing cycle**, price, next due date and **Platform service**: the Coritan service behind a linked product, or **Not set up** when there is none. The **Customer** card links to the customer with **Open customer**.

## Service statuses

| Status | Meaning |
| --- | --- |
| `pending` | Ordered. For a linked product, Coritan is creating the resource. |
| `active` | Running and renewing each billing cycle. |
| `suspended` | Stopped for the customer by you or for an unpaid invoice. |
| `cancelled` | Ended by a cancellation. |
| `terminated` | Ended and removed. |

## Order a service for a customer

1. On the **Services** tab, select **Order for a customer**.
2. Choose the customer, then a **Product** and a **Plan**.
3. Enter a **Hostname** if you want one. It is a label for the service, or the hostname for a server.
4. Select **Order service**.

The dashboard confirms the order, and the service starts as `pending`. For a linked product, Coritan starts creating the resource straight away, on your Coritan account at Coritan's price. Ordering here does not charge the customer. Your [webhooks](/docs/organizations/webhooks/) receive `service.ordered`.

## Suspend or unsuspend a service

1. Select **Suspend** on the service's row, or on the service page.
2. Confirm with **Suspend service**.

The service stops for the customer, and for a linked product Coritan suspends the resource behind it. Billing continues while it is suspended. The customer receives your organization's suspension email, and your webhooks receive `service.suspended`.

To restore it, select **Unsuspend**, then **Unsuspend service**. The service becomes `active` again, the resource starts again, and your webhooks receive `service.unsuspended`.

## Troubleshooting

`Customer not found or inactive`
: The customer is suspended or closed. Set their status back to active on the [Customers](/docs/organizations/customers/) tab first.

`Product not found or inactive` or `Pricing plan not found or inactive`
: The product is not available, or the plan has been turned off. Check them on the **Products** tab.

`Service limit reached (500/500)`
: Your organization holds as many services as Coritan allows it. Ask [support](https://www.coritan.com/dashboard/support) to raise the limit.

`Service is not active` or `Service is not suspended`
: Only an `active` service can be suspended, and only a `suspended` one unsuspended.

`422` with `errors`
: For a linked server or instance, the location or the configuration cannot be ordered, for example because the location has no capacity. The message names the problem.

## Related

- [Set up products and pricing](/docs/organizations/products-and-pricing/)
- [Manage customers](/docs/organizations/customers/)
- [Manage customer invoices](/docs/organizations/billing/invoices/)

## With the API

List services, newest first. The query takes `q`, `status_filter`, `customer_id`, `tag`, `limit`, `offset` and `with_total=true`, as the customer list does.

```bash
curl "https://api.coritan.com/api/v1/orgs/acme/services?customer_id=812&status_filter=active" \
  -H "Authorization: Bearer $CORITAN_TOKEN"
```

Order a service with `customer_id`, `org_product_id` and `org_pricing_id`, and optionally `hostname` (up to 100 characters) and `config` for a linked product that takes options:

```bash
curl -X POST https://api.coritan.com/api/v1/orgs/acme/services \
  -H "Authorization: Bearer $CORITAN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"customer_id": 812, "org_product_id": 5, "org_pricing_id": 11, "hostname": "survival-smp"}'
```

The answer is `201` with the service, including `status`, `billing_cycle`, `amount`, `platform_service_id` and `next_due_date`. Read one with `GET /services/{service_id}`, and suspend or restore it with `POST /services/{service_id}/suspend` and `POST /services/{service_id}/unsuspend`.

### Tag services

Tags are short labels your team searches by. Any member can read them; changing them takes Tier 3 support or higher. `{source_type}` is `org_service` for a customer service, and the tag API also takes `vps` and `container_server`.

- `GET /tags/vocabulary?source_type=org_service` lists every tag in use.
- `GET /tags/sources/org_service/{service_id}` reads a service's tags.
- `POST` on the same path with `{"tag": "vip"}` adds one, and `PUT` with `{"tags": ["vip", "eu"]}` replaces them all.
- `DELETE /tags/sources/org_service/{service_id}/vip` removes one.

## API

- `GET /api/v1/orgs/{org_slug}/services`: The org's services, newest first, each naming its product, plan and customer (https://www.coritan.com/docs/api/reference/organizations/catalog-services/services/#op-get-api-v1-orgs-org-slug-services)
- `POST /api/v1/orgs/{org_slug}/services`: Order service (https://www.coritan.com/docs/api/reference/organizations/catalog-services/services/#op-post-api-v1-orgs-org-slug-services)
- `GET /api/v1/orgs/{org_slug}/services/{service_id}`: Get service (https://www.coritan.com/docs/api/reference/organizations/catalog-services/services/#op-get-api-v1-orgs-org-slug-services-service-id)
- `POST /api/v1/orgs/{org_slug}/services/{service_id}/suspend`: Suspend service (https://www.coritan.com/docs/api/reference/organizations/catalog-services/services/#op-post-api-v1-orgs-org-slug-services-service-id-suspend)
- `POST /api/v1/orgs/{org_slug}/services/{service_id}/unsuspend`: Unsuspend service (https://www.coritan.com/docs/api/reference/organizations/catalog-services/services/#op-post-api-v1-orgs-org-slug-services-service-id-unsuspend)
- `GET /api/v1/orgs/{org_slug}/tags/vocabulary`: List org tag vocabulary (https://www.coritan.com/docs/api/reference/organizations/resource-tags/#op-get-api-v1-orgs-org-slug-tags-vocabulary)
- `GET /api/v1/orgs/{org_slug}/tags/sources/{source_type}/{source_id}`: Get org resource tags (https://www.coritan.com/docs/api/reference/organizations/resource-tags/#op-get-api-v1-orgs-org-slug-tags-sources-source-type-source-id)
- `POST /api/v1/orgs/{org_slug}/tags/sources/{source_type}/{source_id}`: Add org resource tag (https://www.coritan.com/docs/api/reference/organizations/resource-tags/#op-post-api-v1-orgs-org-slug-tags-sources-source-type-source-id)
- `PUT /api/v1/orgs/{org_slug}/tags/sources/{source_type}/{source_id}`: Replace org resource tags (https://www.coritan.com/docs/api/reference/organizations/resource-tags/#op-put-api-v1-orgs-org-slug-tags-sources-source-type-source-id)
- `DELETE /api/v1/orgs/{org_slug}/tags/sources/{source_type}/{source_id}/{tag}`: Remove org resource tag (https://www.coritan.com/docs/api/reference/organizations/resource-tags/#op-delete-api-v1-orgs-org-slug-tags-sources-source-type-source-id-tag)
