# Web Cloud › Email and Collaborative Solutions › Microsoft 365 › Licenses API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Web Cloud product's sections: https://developers.eu.ovhcloud.com/reference/web-cloud/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 15 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/web-cloud/email-and-collaborative-solutions/microsoft-365/licenses/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/web-cloud/email-and-collaborative-solutions/microsoft-365/licenses.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/web-cloud/email-and-collaborative-solutions/microsoft-365/licenses.json?format=openapi3

## Operations

- `GET /license/office/{serviceName}/user` — List users
- `GET /license/office/{serviceName}/user/{activationEmail}` — Get a user
- `POST /license/office/{serviceName}/user` — Create a user
- `PUT /license/office/{serviceName}/user/{activationEmail}` — Update a user
- `DELETE /license/office/{serviceName}/user/{activationEmail}` — Delete a user
- `POST /license/office/{serviceName}/user/{activationEmail}/changePassword` — Change a user password
- `GET /license/officePrepaid` — List prepaid users
- `GET /license/officePrepaid/{serviceName}` — Get a prepaid user
- `PUT /license/officePrepaid/{serviceName}` — Update a prepaid user
- `POST /license/officePrepaid/{serviceName}/changePassword` — Change a prepaid user password
- `GET /license/officePrepaid/{serviceName}/serviceInfos` — Get service information
- `PUT /license/officePrepaid/{serviceName}/serviceInfos` — Update service information
- `POST /license/officePrepaid/{serviceName}/unconfigure` — Unconfigure a prepaid user
- `POST /license/officePrepaid/{serviceName}/terminate` — Request service termination
- `POST /license/officePrepaid/{serviceName}/confirmTermination` — Confirm service termination

## List users

`GET /1.0/license/office/{serviceName}/user`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-365/licenses/#get-license-office-servicename-user

**Status:** Stable production version  
**IAM actions:** `licenseOffice:apiovh:user/get`

Returns the activation emails of the users of the tenant. Filter them by `activationEmail`, `firstName`, `lastName` or `licences`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `activationEmail` | query | string |  |  |
| `firstName` | query | string |  |  |
| `lastName` | query | string |  |  |
| `licences` | query | license.office.LicenseEnum[] |  |  |
| `serviceName` | path | string | yes | Service name |

### Responses

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

```json
[
  "string"
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/license/office/{serviceName}/user" \
  -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("/license/office/{serviceName}/user")

# 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("/license/office/{serviceName}/user");

print_r($result);
?>
```

## Get a user

`GET /1.0/license/office/{serviceName}/user/{activationEmail}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-365/licenses/#get-license-office-servicename-user-activationemail

**Status:** Stable production version  
**IAM actions:** `licenseOffice:apiovh:user/get`

Returns the names, activation email, licenses and state of the user. `isVirtual` tells whether it is a user slot or a real user.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `activationEmail` | path | string | yes | Activation email |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | license.office.OfficeUserNative | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `activationEmail` | string | read-only | Email used to activate Microsoft Office |
| `deleteAtExpiration` | boolean | read-only | Whether or not this user slot will be resigned at the next renew period |
| `firstName` | string | read-only | User's first name |
| `isVirtual` | boolean | read-only | Specify if the user is actually a user slot (configureme) or a real user |
| `lastName` | string | read-only | User's last name |
| `licences` | license.office.LicenseEnum[] | read-only | Licenses attributed to the user |
| `status` | license.office.UserStateEnum | read-only | User state — one of `creating`, `deleting`, `ok` |
| `taskPendingId` | integer | read-only | Pending task id |
| `usageLocation` | license.office.CountryEnum | read-only | ISO 3166-1 alpha-2 country code where the user is using Office365 services — one of `ac`, `ad`, `ae`, `af`, `ag`, `ai`, `al`, `am`, `an`, `ao`, `aq`, `ar`, … |

```json
{
  "activationEmail": "string",
  "deleteAtExpiration": true,
  "firstName": "string",
  "isVirtual": true,
  "lastName": "string",
  "licences": [
    "officeBusiness"
  ],
  "status": "creating",
  "taskPendingId": 0,
  "usageLocation": "ac"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/license/office/{serviceName}/user/{activationEmail}" \
  -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("/license/office/{serviceName}/user/{activationEmail}")

# 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("/license/office/{serviceName}/user/{activationEmail}");

print_r($result);
?>
```

## Create a user

`POST /1.0/license/office/{serviceName}/user`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-365/licenses/#post-license-office-servicename-user

**Status:** Stable production version  
**IAM actions:** `licenseOffice:apiovh:user/create`

Creates a user from a `login` on a `domain` of the tenant, with a license, optional first and last names and a usage location, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | Service name |

### Request body (required)

Type: `license.office.PostUserNative`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | string | yes | Office domain |
| `firstName` | string |  | User's first name |
| `lastName` | string |  | User's last name |
| `licence` | license.officePrepaid.LicenseEnum |  | Licenses attributed to the user — one of `officeBusiness`, `officeProPlus` |
| `login` | string | yes | Account login |
| `usageLocation` | license.officePrepaid.CountryEnum |  | ISO 3166-1 alpha-2 country code where the user is using Office365 services — one of `ac`, `ad`, `ae`, `af`, `ag`, `ai`, `al`, `am`, `an`, `ao`, `aq`, `ar`, … |

```json
{
  "domain": "string",
  "firstName": "string",
  "lastName": "string",
  "licence": "officeBusiness",
  "login": "string",
  "usageLocation": "ac"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | license.office.OfficeTaskNative | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | string | read-only | Function name |
| `id` | integer | read-only | Task's unique identifier |
| `status` | license.office.TaskStatusEnum | read-only | Task's unique identifier — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Creation date |

```json
{
  "finishDate": "2024-01-01T12:00:00Z",
  "function": "string",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/license/office/{serviceName}/user" \
  -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: license.office.PostUserNative
result = client.post("/license/office/{serviceName}/user",
	domain = None, # Office domain (type: string)
	firstName = None, # User's first name (type: string)
	lastName = None, # User's last name (type: string)
	licence = None, # Licenses attributed to the user (type: license.officePrepaid.LicenseEnum)
	login = None, # Account login (type: string)
	usageLocation = None, # ISO 3166-1 alpha-2 country code where the user is using Office365 services (type: license.officePrepaid.CountryEnum)
)

# 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: license.office.PostUserNative
$result = $ovh->post("/license/office/{serviceName}/user", array(
	domain => null, // Office domain (type: string)
	firstName => null, // User's first name (type: string)
	lastName => null, // User's last name (type: string)
	licence => null, // Licenses attributed to the user (type: license.officePrepaid.LicenseEnum)
	login => null, // Account login (type: string)
	usageLocation => null, // ISO 3166-1 alpha-2 country code where the user is using Office365 services (type: license.officePrepaid.CountryEnum)
));

print_r($result);
?>
```

## Update a user

`PUT /1.0/license/office/{serviceName}/user/{activationEmail}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-365/licenses/#put-license-office-servicename-user-activationemail

**Status:** Stable production version  
**IAM actions:** `licenseOffice:apiovh:user/edit`

Updates the first name, last name and activation email of the user, and `deleteAtExpiration`, which ends the user slot at the next renewal.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `activationEmail` | path | string | yes | Activation email |
| `serviceName` | path | string | yes | Service name |

### Request body (required)

Type: `license.office.OfficeUserNativeUpdate`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `activationEmail` | string |  | Email used to activate Microsoft Office |
| `deleteAtExpiration` | boolean |  | Whether or not this user slot will be resigned at the next renew period |
| `firstName` | string |  | User's first name |
| `lastName` | string |  | User's last name |
| `usageLocation` | license.office.CountryEnum |  | ISO 3166-1 alpha-2 country code where the user is using Office365 services — one of `ac`, `ad`, `ae`, `af`, `ag`, `ai`, `al`, `am`, `an`, `ao`, `aq`, `ar`, … |

```json
{
  "activationEmail": "string",
  "deleteAtExpiration": true,
  "firstName": "string",
  "lastName": "string",
  "usageLocation": "ac"
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/license/office/{serviceName}/user/{activationEmail}" \
  -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: license.office.OfficeUserNativeUpdate
result = client.put("/license/office/{serviceName}/user/{activationEmail}",
	activationEmail = None, # Email used to activate Microsoft Office (type: string)
	deleteAtExpiration = None, # Whether or not this user slot will be resigned at the next renew period (type: boolean)
	firstName = None, # User's first name (type: string)
	lastName = None, # User's last name (type: string)
	usageLocation = None, # ISO 3166-1 alpha-2 country code where the user is using Office365 services (type: license.office.CountryEnum)
)

# 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: license.office.OfficeUserNativeUpdate
$result = $ovh->put("/license/office/{serviceName}/user/{activationEmail}", array(
	activationEmail => null, // Email used to activate Microsoft Office (type: string)
	deleteAtExpiration => null, // Whether or not this user slot will be resigned at the next renew period (type: boolean)
	firstName => null, // User's first name (type: string)
	lastName => null, // User's last name (type: string)
	usageLocation => null, // ISO 3166-1 alpha-2 country code where the user is using Office365 services (type: license.office.CountryEnum)
));

print_r($result);
?>
```

## Delete a user

`DELETE /1.0/license/office/{serviceName}/user/{activationEmail}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-365/licenses/#delete-license-office-servicename-user-activationemail

**Status:** Stable production version  
**IAM actions:** `licenseOffice:apiovh:user/delete`

Deletes the user and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `activationEmail` | path | string | yes | Activation email |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | license.office.OfficeTaskNative | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | string | read-only | Function name |
| `id` | integer | read-only | Task's unique identifier |
| `status` | license.office.TaskStatusEnum | read-only | Task's unique identifier — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Creation date |

```json
{
  "finishDate": "2024-01-01T12:00:00Z",
  "function": "string",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/license/office/{serviceName}/user/{activationEmail}" \
  -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.delete("/license/office/{serviceName}/user/{activationEmail}")

# 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->delete("/license/office/{serviceName}/user/{activationEmail}");

print_r($result);
?>
```

## Change a user password

`POST /1.0/license/office/{serviceName}/user/{activationEmail}/changePassword`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-365/licenses/#post-license-office-servicename-user-activationemail-changepassword

**Status:** Stable production version  
**IAM actions:** `licenseOffice:apiovh:user/changePassword`

Changes the password of the user and returns the task. Leave `password` empty to receive a generated password by email. Set `shouldSendMail` to send the new password to `notifyEmail`, the admin contact email by default.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `activationEmail` | path | string | yes | Activation email |
| `serviceName` | path | string | yes | Service name |

### Request body (required)

Type: `license.office.OfficeTenantPostChangePassword`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `notifyEmail` | string |  | Email to send the new password to. Default is nicAdmin's email |
| `password` | string (password) |  | New password or empty to receive a generated password by email |
| `shouldSendMail` | boolean | yes | Specify whether the new password should be sent via email or not |

```json
{
  "notifyEmail": "string",
  "password": "string",
  "shouldSendMail": true
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | license.office.OfficeTaskNative | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | string | read-only | Function name |
| `id` | integer | read-only | Task's unique identifier |
| `status` | license.office.TaskStatusEnum | read-only | Task's unique identifier — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Creation date |

```json
{
  "finishDate": "2024-01-01T12:00:00Z",
  "function": "string",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/license/office/{serviceName}/user/{activationEmail}/changePassword" \
  -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: license.office.OfficeTenantPostChangePassword
result = client.post("/license/office/{serviceName}/user/{activationEmail}/changePassword",
	notifyEmail = None, # Email to send the new password to. Default is nicAdmin's email (type: string, nullable)
	password = None, # New password or empty to receive a generated password by email (type: string, nullable)
	shouldSendMail = None, # Specify whether the new password should be sent via email or not (type: boolean)
)

# 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: license.office.OfficeTenantPostChangePassword
$result = $ovh->post("/license/office/{serviceName}/user/{activationEmail}/changePassword", array(
	notifyEmail => null, // Email to send the new password to. Default is nicAdmin's email (type: string, nullable)
	password => null, // New password or empty to receive a generated password by email (type: string, nullable)
	shouldSendMail => null, // Specify whether the new password should be sent via email or not (type: boolean)
));

print_r($result);
?>
```

## List prepaid users

`GET /1.0/license/officePrepaid`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-365/licenses/#get-license-officeprepaid

**Status:** Alpha version  
**IAM actions:** `licenseOfficePrepaid:apiovh:get`

Returns the service names of the prepaid users.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `iamTags` | query | object |  | Filter resources on IAM tags |

### Responses

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

```json
[
  "string"
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/license/officePrepaid" \
  -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("/license/officePrepaid")

# 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("/license/officePrepaid");

print_r($result);
?>
```

## Get a prepaid user

`GET /1.0/license/officePrepaid/{serviceName}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-365/licenses/#get-license-officeprepaid-servicename

**Status:** Alpha version  
**IAM actions:** `licenseOfficePrepaid:apiovh:get`

Returns the names, activation email, licenses and state of the prepaid user, and the service names of the user and of its tenant. `isVirtual` tells whether it is a user slot or a real user.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | license.officePrepaid.OfficeUserNativeWithIAM | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `activationEmail` | string | read-only | Email used to activate Microsoft Office |
| `firstName` | string | read-only | User's first name |
| `iam` | iam.ResourceMetadata | read-only | IAM resource metadata |
| `iam.displayName` | string | read-only | Resource display name |
| `iam.id` | string (uuid) | read-only | Unique identifier of the resource |
| `iam.state` | iam.ResourceMetadata.StateEnum | read-only | Resource state — one of `EXPIRED`, `IN_CREATION`, `OK`, `SUSPENDED` |
| `iam.tags` | object | read-only | Resource tags. Tags that were internally computed are prefixed with ovh: |
| `iam.urn` | string | read-only | Unique resource name used in policies |
| `isVirtual` | boolean | read-only | Specify if the user is actually a user slot (configureme) or a real user |
| `lastName` | string | read-only | User's last name |
| `licences` | license.officePrepaid.LicenseEnum[] | read-only | Licenses attributed to the user |
| `serviceName` | string | read-only | User service name, used in invoices |
| `status` | license.officePrepaid.UserStateEnum | read-only | User state — one of `creating`, `deleting`, `ok`, `suspended`, `unspending` |
| `taskPendingId` | integer | read-only | Pending task id |
| `tenantServiceName` | string | read-only | User's tenant service name, used in invoices |
| `usageLocation` | license.officePrepaid.CountryEnum | read-only | ISO 3166-1 alpha-2 country code where the user is using Office365 services — one of `ac`, `ad`, `ae`, `af`, `ag`, `ai`, `al`, `am`, `an`, `ao`, `aq`, `ar`, … |

```json
{
  "activationEmail": "string",
  "firstName": "string",
  "iam": {
    "displayName": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "state": "EXPIRED",
    "tags": {
      "key": "string"
    },
    "urn": "string"
  },
  "isVirtual": true,
  "lastName": "string",
  "licences": [
    "officeBusiness"
  ],
  "serviceName": "string",
  "status": "creating",
  "taskPendingId": 0,
  "tenantServiceName": "string",
  "usageLocation": "ac"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/license/officePrepaid/{serviceName}" \
  -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("/license/officePrepaid/{serviceName}")

# 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("/license/officePrepaid/{serviceName}");

print_r($result);
?>
```

## Update a prepaid user

`PUT /1.0/license/officePrepaid/{serviceName}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-365/licenses/#put-license-officeprepaid-servicename

**Status:** Alpha version  
**IAM actions:** `licenseOfficePrepaid:apiovh:put`

Updates the first name, last name and activation email of the prepaid user.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | Service name |

### Request body (required)

Type: `license.officePrepaid.PutOfficeUserNative`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `activationEmail` | string |  | Email used to activate Microsoft Office |
| `firstName` | string |  | User's first name |
| `lastName` | string |  | User's last name |
| `usageLocation` | license.officePrepaid.CountryEnum |  | ISO 3166-1 alpha-2 country code where the user is using Office365 services — one of `ac`, `ad`, `ae`, `af`, `ag`, `ai`, `al`, `am`, `an`, `ao`, `aq`, `ar`, … |

```json
{
  "activationEmail": "string",
  "firstName": "string",
  "lastName": "string",
  "usageLocation": "ac"
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/license/officePrepaid/{serviceName}" \
  -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: license.officePrepaid.PutOfficeUserNative
result = client.put("/license/officePrepaid/{serviceName}",
	activationEmail = None, # Email used to activate Microsoft Office (type: string)
	firstName = None, # User's first name (type: string)
	lastName = None, # User's last name (type: string)
	usageLocation = None, # ISO 3166-1 alpha-2 country code where the user is using Office365 services (type: license.officePrepaid.CountryEnum)
)

# 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: license.officePrepaid.PutOfficeUserNative
$result = $ovh->put("/license/officePrepaid/{serviceName}", array(
	activationEmail => null, // Email used to activate Microsoft Office (type: string)
	firstName => null, // User's first name (type: string)
	lastName => null, // User's last name (type: string)
	usageLocation => null, // ISO 3166-1 alpha-2 country code where the user is using Office365 services (type: license.officePrepaid.CountryEnum)
));

print_r($result);
?>
```

## Change a prepaid user password

`POST /1.0/license/officePrepaid/{serviceName}/changePassword`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-365/licenses/#post-license-officeprepaid-servicename-changepassword

**Status:** Alpha version  
**IAM actions:** `licenseOfficePrepaid:apiovh:changePassword`

Changes the password of the prepaid user and returns the task. Leave `password` empty to receive a generated password by email. Set `shouldSendMail` to send the new password to `notifyEmail`, the admin contact email by default.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | Service name |

### Request body (required)

Type: `license.officePrepaid.OfficeTenantPostChangePassword`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `notifyEmail` | string |  | Email to send the new password to. Default is nicAdmin's email |
| `password` | string (password) |  | New password or empty to receive a generated password by email |
| `shouldSendMail` | boolean | yes | Specify if the new password should be send via email or not |

```json
{
  "notifyEmail": "string",
  "password": "string",
  "shouldSendMail": true
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | license.officePrepaid.OfficeTaskNative | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | string | read-only | Function name |
| `id` | integer | read-only | Task's unique identifier |
| `status` | license.officePrepaid.TaskStatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Creation date |

```json
{
  "finishDate": "2024-01-01T12:00:00Z",
  "function": "string",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/license/officePrepaid/{serviceName}/changePassword" \
  -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: license.officePrepaid.OfficeTenantPostChangePassword
result = client.post("/license/officePrepaid/{serviceName}/changePassword",
	notifyEmail = None, # Email to send the new password to. Default is nicAdmin's email (type: string, nullable)
	password = None, # New password or empty to receive a generated password by email (type: string, nullable)
	shouldSendMail = None, # Specify if the new password should be send via email or not (type: boolean)
)

# 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: license.officePrepaid.OfficeTenantPostChangePassword
$result = $ovh->post("/license/officePrepaid/{serviceName}/changePassword", array(
	notifyEmail => null, // Email to send the new password to. Default is nicAdmin's email (type: string, nullable)
	password => null, // New password or empty to receive a generated password by email (type: string, nullable)
	shouldSendMail => null, // Specify if the new password should be send via email or not (type: boolean)
));

print_r($result);
?>
```

## Get service information

`GET /1.0/license/officePrepaid/{serviceName}/serviceInfos`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-365/licenses/#get-license-officeprepaid-servicename-serviceinfos

**Status:** Beta version  
**IAM actions:** `licenseOfficePrepaid:apiovh:serviceInfos/get`

Get service information. Returns the status, creation and expiration dates, contacts and renewal settings of the service.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The service name of your office account |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `canDeleteAtExpiration` | boolean | read-only | Indicates that the service can be set up to be deleted at expiration |
| `contactAdmin` | string | read-only |  |
| `contactBilling` | string | read-only |  |
| `contactTech` | string | read-only |  |
| `creation` | string (date) | read-only |  |
| `domain` | string | read-only |  |
| `engagedUpTo` | string (date) | read-only |  |
| `expiration` | string (date) | read-only |  |
| `possibleRenewPeriod` | integer[] | read-only | All the possible renew period of your service in month |
| `renew` | service.RenewType |  | Way of handling the renew |
| `renew.automatic` | boolean |  | The service is automatically renewed |
| `renew.deleteAtExpiration` | boolean |  | The service will be deleted at expiration |
| `renew.forced` | boolean |  | The service forced to be renewed |
| `renew.manualPayment` | boolean |  | The service needs to be manually renewed and paid |
| `renew.period` | integer |  | period of renew in month |
| `renewalType` | service.RenewalTypeEnum | read-only | Detailed renewal type of a service — one of `automaticForcedProduct`, `automaticV2012`, `automaticV2014`, `automaticV2016`, `automaticV2024`, `manual`, `oneShot`, `option` |
| `serviceId` | integer | read-only |  |
| `status` | service.StateEnum | read-only | one of `autorenewInProgress`, `expired`, `inCreation`, `ok`, `pendingDebt`, `unPaid` |

```json
{
  "canDeleteAtExpiration": true,
  "contactAdmin": "string",
  "contactBilling": "string",
  "contactTech": "string",
  "creation": "2024-01-01",
  "domain": "string",
  "engagedUpTo": "2024-01-01",
  "expiration": "2024-01-01",
  "possibleRenewPeriod": [
    0
  ],
  "renew": {
    "automatic": true,
    "deleteAtExpiration": true,
    "forced": true,
    "manualPayment": true,
    "period": 0
  },
  "renewalType": "automaticForcedProduct",
  "serviceId": 0,
  "status": "autorenewInProgress"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/license/officePrepaid/{serviceName}/serviceInfos" \
  -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("/license/officePrepaid/{serviceName}/serviceInfos")

# 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("/license/officePrepaid/{serviceName}/serviceInfos");

print_r($result);
?>
```

## Update service information

`PUT /1.0/license/officePrepaid/{serviceName}/serviceInfos`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-365/licenses/#put-license-officeprepaid-servicename-serviceinfos

**Status:** Beta version  
**IAM actions:** `licenseOfficePrepaid:apiovh:serviceInfos/edit`

Update service information. Updates the renewal settings of the service: automatic renewal, period, or deletion at expiration.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The service name of your office account |

### Request body (required)

Type: `services.Service`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `canDeleteAtExpiration` | boolean | read-only | Indicates that the service can be set up to be deleted at expiration |
| `contactAdmin` | string | read-only |  |
| `contactBilling` | string | read-only |  |
| `contactTech` | string | read-only |  |
| `creation` | string (date) | read-only |  |
| `domain` | string | read-only |  |
| `engagedUpTo` | string (date) | read-only |  |
| `expiration` | string (date) | read-only |  |
| `possibleRenewPeriod` | integer[] | read-only | All the possible renew period of your service in month |
| `renew` | service.RenewType |  | Way of handling the renew |
| `renew.automatic` | boolean |  | The service is automatically renewed |
| `renew.deleteAtExpiration` | boolean |  | The service will be deleted at expiration |
| `renew.forced` | boolean |  | The service forced to be renewed |
| `renew.manualPayment` | boolean |  | The service needs to be manually renewed and paid |
| `renew.period` | integer |  | period of renew in month |
| `renewalType` | service.RenewalTypeEnum | read-only | Detailed renewal type of a service — one of `automaticForcedProduct`, `automaticV2012`, `automaticV2014`, `automaticV2016`, `automaticV2024`, `manual`, `oneShot`, `option` |
| `serviceId` | integer | read-only |  |
| `status` | service.StateEnum | read-only | one of `autorenewInProgress`, `expired`, `inCreation`, `ok`, `pendingDebt`, `unPaid` |

```json
{
  "renew": {
    "automatic": true,
    "deleteAtExpiration": true,
    "forced": true,
    "manualPayment": true,
    "period": 0
  }
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/license/officePrepaid/{serviceName}/serviceInfos" \
  -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: services.Service
result = client.put("/license/officePrepaid/{serviceName}/serviceInfos",
	renew = None, # Way of handling the renew (type: service.RenewType, nullable)
)

# 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: services.Service
$result = $ovh->put("/license/officePrepaid/{serviceName}/serviceInfos", array(
	renew => null, // Way of handling the renew (type: service.RenewType, nullable)
));

print_r($result);
?>
```

## Unconfigure a prepaid user

`POST /1.0/license/officePrepaid/{serviceName}/unconfigure`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-365/licenses/#post-license-officeprepaid-servicename-unconfigure

**Status:** Stable production version  
**IAM actions:** `licenseOfficePrepaid:apiovh:unconfigure`

Removes the configuration of the prepaid user and turns it back into an unassigned license slot, and returns the task. The prepaid license is kept.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | license.officePrepaid.OfficeTaskNative | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | string | read-only | Function name |
| `id` | integer | read-only | Task's unique identifier |
| `status` | license.officePrepaid.TaskStatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Creation date |

```json
{
  "finishDate": "2024-01-01T12:00:00Z",
  "function": "string",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/license/officePrepaid/{serviceName}/unconfigure" \
  -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("/license/officePrepaid/{serviceName}/unconfigure")

# 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("/license/officePrepaid/{serviceName}/unconfigure");

print_r($result);
?>
```

## Request service termination

`POST /1.0/license/officePrepaid/{serviceName}/terminate`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-365/licenses/#post-license-officeprepaid-servicename-terminate

**Status:** Beta version  
**IAM actions:** `licenseOfficePrepaid:apiovh:terminate`

Request service termination. Starts the termination of the service. The admin contact receives a token by email, to confirm with the `confirmTermination` call.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The service name of your office account |

### Responses

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

```json
"string"
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/license/officePrepaid/{serviceName}/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("/license/officePrepaid/{serviceName}/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("/license/officePrepaid/{serviceName}/terminate");

print_r($result);
?>
```

## Confirm service termination

`POST /1.0/license/officePrepaid/{serviceName}/confirmTermination`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-365/licenses/#post-license-officeprepaid-servicename-confirmtermination

**Status:** Beta version  
**IAM actions:** `licenseOfficePrepaid:apiovh:confirmTermination`

Confirm service termination. Terminates the service with the token sent by email to the admin contact. A reason, a future use and a comment can be given.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The service name of your office account |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `commentary` | string |  | Commentary about your termination request |
| `futureUse` | service.TerminationFutureUseEnum |  | What next after your termination request — one of `NOT_REPLACING_SERVICE`, `OTHER`, `SUBSCRIBE_AN_OTHER_SERVICE`, `SUBSCRIBE_OTHER_KIND_OF_SERVICE_WITH_COMPETITOR`, `SUBSCRIBE_SIMILAR_SERVICE_WITH_COMPETITOR` |
| `reason` | service.TerminationReasonEnum |  | Reason of your termination request — one of `FEATURES_DONT_SUIT_ME`, `LACK_OF_PERFORMANCES`, `MIGRATED_TO_ANOTHER_OVH_PRODUCT`, `MIGRATED_TO_COMPETITOR`, `NOT_ENOUGH_RECOGNITION`, `NOT_NEEDED_ANYMORE`, `NOT_RELIABLE`, `NO_ANSWER`, `OTHER`, `PRODUCT_DIMENSION_DONT_SUIT_ME`, `PRODUCT_TOOLS_DONT_SUIT_ME`, `TOO_EXPENSIVE`, … |
| `token` | string | yes | The termination token sent by email to the admin contact |

```json
{
  "commentary": "string",
  "futureUse": "NOT_REPLACING_SERVICE",
  "reason": "FEATURES_DONT_SUIT_ME",
  "token": "string"
}
```

### Responses

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

```json
"string"
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/license/officePrepaid/{serviceName}/confirmTermination" \
  -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
)

result = client.post("/license/officePrepaid/{serviceName}/confirmTermination",
	commentary = None, # Commentary about your termination request (type: string, nullable)
	futureUse = None, # What next after your termination request (type: service.TerminationFutureUseEnum, nullable)
	reason = None, # Reason of your termination request (type: service.TerminationReasonEnum, nullable)
	token = None, # The termination token sent by email to the admin contact (type: string)
)

# 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("/license/officePrepaid/{serviceName}/confirmTermination", array(
	commentary => null, // Commentary about your termination request (type: string, nullable)
	futureUse => null, // What next after your termination request (type: service.TerminationFutureUseEnum, nullable)
	reason => null, // Reason of your termination request (type: service.TerminationReasonEnum, nullable)
	token => null, // The termination token sent by email to the admin contact (type: string)
));

print_r($result);
?>
```
