# Offers & Services › Services API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Offers & Services product's sections: https://developers.eu.ovhcloud.com/reference/offers-services/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 8 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/offers-services/services/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/offers-services/services.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/offers-services/services.json?format=openapi3

## Operations

- `GET /service` — Services
- `GET /service/{serviceId}` — Get this object properties
- `PUT /service/{serviceId}` — Alter this object properties
- `GET /service/{serviceId}/renew` — List possible renews for this service
- `POST /service/{serviceId}/renew` — Create a renew order
- `POST /service/{serviceId}/reopen` — Reopen a suspended service
- `POST /service/{serviceId}/suspend` — Suspend the service. The service won't be accessible, but you will still be charged for it
- `POST /service/{serviceId}/terminate` — Terminates a suspended service

## Services

`GET /1.0/service`

Link: https://developers.eu.ovhcloud.com/reference/offers-services/services/#get-service

**Status:** Beta version  
**IAM actions:** `account:apiovh:service/get`

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | integer[] | successful operation |

```json
[
  0
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/service" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/service")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/service");

print_r($result);
?>
```

## Get this object properties

`GET /1.0/service/{serviceId}`

Link: https://developers.eu.ovhcloud.com/reference/offers-services/services/#get-service-serviceid

**Status:** Beta version  
**IAM actions:** `account:apiovh:service/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceId` | path | integer | yes | The internal ID of your service |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | serviceList.Service | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creationDate` | string (date) | read-only | Creation date |
| `details` | complexType.SafeKeyValue_string[] | read-only | Resource details |
| `details[].key` | string |  |  |
| `details[].value` | string |  |  |
| `engagementDate` | string (date) | read-only | Engagement date |
| `expirationDate` | string (date) | read-only | Expiration date |
| `nextBillingDate` | string (date) | read-only | The next billing date |
| `plan` | service.Plan | read-only | Plan service description |
| `plan.code` | string |  | Product code |
| `plan.product` | service.plan.Product |  | Product plan information |
| `plan.product.name` | string |  | Product name |
| `quantity` | integer | read-only | Quantity |
| `renew` | service.Renew | read-only | Renew service description |
| `renew.dayOfMonth` | integer |  | Renew day number |
| `renew.interval` | service.renew.Interval |  | Interval between each renewal — one of `P1M`, `P1Y`, `P2Y`, `P3M`, `P3Y`, `P6M` |
| `renew.mode` | service.renew.Mode |  | Renewal mode — one of `automaticForcedProduct`, `automaticV2012`, `automaticV2014`, `automaticV2016`, `automaticV2024`, `deleteAtEndEngagement`, `deleteAtExpiration`, `manual`, `oneShot`, `option` |
| `renew.possibleIntervals` | service.renew.Interval[] |  | Possible interval between each renewal |
| `renew.possibleModes` | service.renew.Mode[] |  | Possible renewal mode |
| `resource` | service.Resource |  | Resource service description |
| `resource.displayName` | string |  | Custom display name of the service |
| `resource.name` | string |  | Name of the service |
| `resource.state` | service.ResourceStateEnum |  | Resource state — one of `deleted`, `deleting`, `ok`, `opening`, `suspended`, `suspending`, `toDelete`, `toOpen`, `toSuspend` |
| `route` | service.Route | read-only | Route to use in API |
| `route.path` | string |  | Path to use in API |
| `route.url` | string |  | Path with variables applyed |
| `route.vars` | complexType.SafeKeyValue_string[] |  | Variables to use in the path |
| `route.vars[].key` | string |  |  |
| `route.vars[].value` | string |  |  |
| `state` | service.BillingStateEnum | read-only | Billing state of your service — one of `expired`, `ok`, `pending`, `unpaid` |

```json
{
  "creationDate": "2024-01-01",
  "details": [
    {
      "key": "string",
      "value": "string"
    }
  ],
  "engagementDate": "2024-01-01",
  "expirationDate": "2024-01-01",
  "nextBillingDate": "2024-01-01",
  "plan": {
    "code": "string",
    "product": {
      "name": "string"
    }
  },
  "quantity": 0,
  "renew": {
    "dayOfMonth": 0,
    "interval": "P1M",
    "mode": "automaticForcedProduct",
    "possibleIntervals": [
      "P1M"
    ],
    "possibleModes": [
      "automaticForcedProduct"
    ]
  },
  "resource": {
    "displayName": "string",
    "name": "string",
    "state": "deleted"
  },
  "route": {
    "path": "string",
    "url": "string",
    "vars": [
      {
        "key": "string",
        "value": "string"
      }
    ]
  },
  "state": "expired"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/service/{serviceId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/service/{serviceId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/service/{serviceId}");

print_r($result);
?>
```

## Alter this object properties

`PUT /1.0/service/{serviceId}`

Link: https://developers.eu.ovhcloud.com/reference/offers-services/services/#put-service-serviceid

**Status:** Beta version  
**IAM actions:** `account:apiovh:service/edit`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceId` | path | integer | yes | The internal ID of your service |

### Request body (required)

Type: `serviceList.Service`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creationDate` | string (date) | read-only | Creation date |
| `details` | complexType.SafeKeyValue_string[] | read-only | Resource details |
| `details[].key` | string |  |  |
| `details[].value` | string |  |  |
| `engagementDate` | string (date) | read-only | Engagement date |
| `expirationDate` | string (date) | read-only | Expiration date |
| `nextBillingDate` | string (date) | read-only | The next billing date |
| `plan` | service.Plan | read-only | Plan service description |
| `plan.code` | string |  | Product code |
| `plan.product` | service.plan.Product |  | Product plan information |
| `plan.product.name` | string |  | Product name |
| `quantity` | integer | read-only | Quantity |
| `renew` | service.Renew | read-only | Renew service description |
| `renew.dayOfMonth` | integer |  | Renew day number |
| `renew.interval` | service.renew.Interval |  | Interval between each renewal — one of `P1M`, `P1Y`, `P2Y`, `P3M`, `P3Y`, `P6M` |
| `renew.mode` | service.renew.Mode |  | Renewal mode — one of `automaticForcedProduct`, `automaticV2012`, `automaticV2014`, `automaticV2016`, `automaticV2024`, `deleteAtEndEngagement`, `deleteAtExpiration`, `manual`, `oneShot`, `option` |
| `renew.possibleIntervals` | service.renew.Interval[] |  | Possible interval between each renewal |
| `renew.possibleModes` | service.renew.Mode[] |  | Possible renewal mode |
| `resource` | service.Resource |  | Resource service description |
| `resource.displayName` | string |  | Custom display name of the service |
| `resource.name` | string |  | Name of the service |
| `resource.state` | service.ResourceStateEnum |  | Resource state — one of `deleted`, `deleting`, `ok`, `opening`, `suspended`, `suspending`, `toDelete`, `toOpen`, `toSuspend` |
| `route` | service.Route | read-only | Route to use in API |
| `route.path` | string |  | Path to use in API |
| `route.url` | string |  | Path with variables applyed |
| `route.vars` | complexType.SafeKeyValue_string[] |  | Variables to use in the path |
| `route.vars[].key` | string |  |  |
| `route.vars[].value` | string |  |  |
| `state` | service.BillingStateEnum | read-only | Billing state of your service — one of `expired`, `ok`, `pending`, `unpaid` |

```json
{
  "resource": {
    "displayName": "string",
    "name": "string",
    "state": "deleted"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/service/{serviceId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: serviceList.Service
result = client.put("/service/{serviceId}",
	resource = None, # Resource service description (type: service.Resource)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: serviceList.Service
$result = $ovh->put("/service/{serviceId}", array(
	resource => null, // Resource service description (type: service.Resource)
));

print_r($result);
?>
```

## List possible renews for this service

`GET /1.0/service/{serviceId}/renew`

Link: https://developers.eu.ovhcloud.com/reference/offers-services/services/#get-service-serviceid-renew

**Status:** Beta version  
**IAM actions:** `account:apiovh:service/renew/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `includeOptions` | query | boolean |  | Include service's option(s) |
| `serviceId` | path | string | yes | Service Id |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | service.renew.RenewDescription[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `renewPeriod` | duration (duration) | read-only | ISO8601 formatted renewal duration |
| `strategies` | service.renew.RenewStrategy[] | read-only | List possible strategies |
| `strategies[].price` | order.Price | read-only | Price of the product |
| `strategies[].price.currencyCode` | order.CurrencyCodeEnum |  | one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `strategies[].price.text` | string |  |  |
| `strategies[].price.value` | number |  |  |
| `strategies[].priceInUcents` | integer | read-only | Price of the product in micro-centims |
| `strategies[].services` | integer[] | read-only | Services renewed by strategy |
| `strategies[].servicesDetails` | service.renew.Service[] | read-only | Details of services renewed by strategy |
| `strategies[].servicesDetails[].serviceId` | integer | read-only | ID of the service |
| `strategies[].servicesDetails[].serviceName` | string | read-only | Name of the service |
| `strategies[].servicesDetails[].serviceType` | string | read-only | Type of the service |

```json
[
  {
    "renewPeriod": {},
    "strategies": [
      {
        "price": {
          "currencyCode": "AUD",
          "text": "string",
          "value": 0
        },
        "priceInUcents": 0,
        "services": [
          0
        ],
        "servicesDetails": [
          {
            "serviceId": 0,
            "serviceName": "string",
            "serviceType": "string"
          }
        ]
      }
    ]
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/service/{serviceId}/renew" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/service/{serviceId}/renew")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/service/{serviceId}/renew");

print_r($result);
?>
```

## Create a renew order

`POST /1.0/service/{serviceId}/renew`

Link: https://developers.eu.ovhcloud.com/reference/offers-services/services/#post-service-serviceid-renew

**Status:** Beta version  
**IAM actions:** `account:apiovh:service/renew/create`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceId` | path | string | yes | Service Id |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `dryRun` | boolean |  | Indicates if renew order is generated |
| `duration` | string (duration) | yes | Renew duration |
| `services` | integer[] | yes | List of services to renew |

```json
{
  "dryRun": true,
  "duration": "string",
  "services": [
    0
  ]
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | service.renew.RenewOrder | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `date` | string (date-time) | read-only | Creation date of the renew Order |
| `expirationDate` | string (date-time) | read-only | Expiration date of the renew Order |
| `orderId` | integer | read-only | ID of the renew Order |
| `password` | string | read-only | Password |
| `pdfUrl` | string | read-only | Public pdf URL of the generated renew Order |
| `priceWithTax` | order.Price | read-only | Price of the product with tax |
| `priceWithTax.currencyCode` | order.CurrencyCodeEnum |  | one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `priceWithTax.text` | string |  |  |
| `priceWithTax.value` | number |  |  |
| `priceWithoutTax` | order.Price | read-only | Price of the product without tax |
| `priceWithoutTax.currencyCode` | order.CurrencyCodeEnum |  | one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `priceWithoutTax.text` | string |  |  |
| `priceWithoutTax.value` | number |  |  |
| `retractionDate` | string (date-time) | read-only | Retraction date |
| `tax` | order.Price | read-only | Value of the tax |
| `tax.currencyCode` | order.CurrencyCodeEnum |  | one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `tax.text` | string |  |  |
| `tax.value` | number |  |  |
| `url` | string | read-only | Public URL to display generated renew Order |

```json
{
  "date": "2024-01-01T12:00:00Z",
  "expirationDate": "2024-01-01T12:00:00Z",
  "orderId": 0,
  "password": "string",
  "pdfUrl": "string",
  "priceWithTax": {
    "currencyCode": "AUD",
    "text": "string",
    "value": 0
  },
  "priceWithoutTax": {
    "currencyCode": "AUD",
    "text": "string",
    "value": 0
  },
  "retractionDate": "2024-01-01T12:00:00Z",
  "tax": {
    "currencyCode": "AUD",
    "text": "string",
    "value": 0
  },
  "url": "string"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/service/{serviceId}/renew" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: coreTypes.ServiceId[]:long[]
result = client.post("/service/{serviceId}/renew",
	dryRun = None, # Indicates if renew order is generated (type: boolean, nullable)
	duration = None, # Renew duration (type: duration)
	services = None, # List of services to renew (type: coreTypes.ServiceId[]:long[])
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: coreTypes.ServiceId[]:long[]
$result = $ovh->post("/service/{serviceId}/renew", array(
	dryRun => null, // Indicates if renew order is generated (type: boolean, nullable)
	duration => null, // Renew duration (type: duration)
	services => null, // List of services to renew (type: coreTypes.ServiceId[]:long[])
));

print_r($result);
?>
```

## Reopen a suspended service

`POST /1.0/service/{serviceId}/reopen`

Link: https://developers.eu.ovhcloud.com/reference/offers-services/services/#post-service-serviceid-reopen

**Status:** Beta version  
**IAM actions:** `account:apiovh:service/reopen`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceId` | path | integer | yes | The internal ID of your service |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/service/{serviceId}/reopen" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.post("/service/{serviceId}/reopen")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->post("/service/{serviceId}/reopen");

print_r($result);
?>
```

## Suspend the service. The service won't be accessible, but you will still be charged for it

`POST /1.0/service/{serviceId}/suspend`

Link: https://developers.eu.ovhcloud.com/reference/offers-services/services/#post-service-serviceid-suspend

**Status:** Beta version  
**IAM actions:** `account:apiovh:service/suspend`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceId` | path | integer | yes | The internal ID of your service |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/service/{serviceId}/suspend" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.post("/service/{serviceId}/suspend")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->post("/service/{serviceId}/suspend");

print_r($result);
?>
```

## Terminates a suspended service

`POST /1.0/service/{serviceId}/terminate`

Link: https://developers.eu.ovhcloud.com/reference/offers-services/services/#post-service-serviceid-terminate

**Status:** Beta version  
**IAM actions:** `account:apiovh:service/terminate`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceId` | path | integer | yes | The internal ID of your service |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/service/{serviceId}/terminate" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.post("/service/{serviceId}/terminate")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->post("/service/{serviceId}/terminate");

print_r($result);
?>
```
