# Web Cloud › Internet › Access › Spare & RMA 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

> 16 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/internet/access/spare-rma/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/web-cloud/internet/access/spare-rma.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/web-cloud/internet/access/spare-rma.json?format=openapi3

## Operations

- `GET /xdsl/{serviceName}/modem/comfortExchange` — Get the modem exchange offer
- `POST /xdsl/{serviceName}/modem/comfortExchange` — Order a modem exchange
- `GET /xdsl/{serviceName}/rma` — List the RMAs of an xDSL access
- `GET /xdsl/{serviceName}/rma/{id}` — Get an RMA of an xDSL access
- `PUT /xdsl/{serviceName}/rma/{id}` — Update an RMA of an xDSL access
- `DELETE /xdsl/{serviceName}/rma/{id}` — Delete an RMA of an xDSL access
- `POST /xdsl/{serviceName}/rma/{id}/changeType` — Change the type of an RMA
- `GET /xdsl/spare` — List the xDSL spares
- `GET /xdsl/spare/{spare}` — Get an xDSL spare
- `GET /xdsl/spare/brands` — List the brands of xDSL spares
- `GET /xdsl/spare/{spare}/compatibleReplacement` — List the replacement brands of a spare
- `GET /xdsl/spare/{spare}/serviceInfos` — Get service information
- `PUT /xdsl/spare/{spare}/serviceInfos` — Update service information
- `POST /xdsl/spare/{spare}/replace` — Replace a modem with a spare
- `POST /xdsl/spare/{spare}/returnMerchandise` — Return a broken spare
- `DELETE /xdsl/spare/{spare}` — Delete an xDSL spare

## Get the modem exchange offer

`GET /1.0/xdsl/{serviceName}/modem/comfortExchange`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/access/spare-rma/#getAccessModemReplacement

**Status:** Stable production version  
**IAM actions:** `xdsl:apiovh:modem/comfortExchange/get`

Returns whether the modem of the access can be exchanged for the latest model, the new model and the price with and without tax.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | xdsl.ModemExchangeInfo | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `canExchange` | boolean | read-only | To know if you can exchange your modem |
| `newModel` | string | read-only | Model of the new modem |
| `price` | order.Price | read-only | Price with it's currency and textual representation |
| `price.currencyCode` | order.CurrencyCodeEnum | read-only | Currency code — one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `price.priceInUcents` | integer | read-only | Price in microcents |
| `price.text` | string | read-only | Textual representation |
| `price.value` | number | read-only | The effective price |
| `priceWithTax` | order.Price | read-only | Price with it's currency and textual representation |
| `priceWithTax.currencyCode` | order.CurrencyCodeEnum | read-only | Currency code — one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `priceWithTax.priceInUcents` | integer | read-only | Price in microcents |
| `priceWithTax.text` | string | read-only | Textual representation |
| `priceWithTax.value` | number | read-only | The effective price |

```json
{
  "canExchange": true,
  "newModel": "string",
  "price": {
    "currencyCode": "AUD",
    "priceInUcents": 0,
    "text": "string",
    "value": 0
  },
  "priceWithTax": {
    "currencyCode": "AUD",
    "priceInUcents": 0,
    "text": "string",
    "value": 0
  }
}
```

### Example

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

# 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("/xdsl/{serviceName}/modem/comfortExchange");

print_r($result);
?>
```

## Order a modem exchange

`POST /1.0/xdsl/{serviceName}/modem/comfortExchange`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/access/spare-rma/#replaceAccessModem

**Status:** Stable production version  
**IAM actions:** `xdsl:apiovh:modem/comfortExchange/create`

Orders the replacement of the modem of the access by the latest model. Fees apply. Returns the order.

### Parameters

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

### Request body (required)

Type: `xdsl.modem.comfortExchange.post`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `contactShipping` | string |  | Customer identifier for shipping address. By default Internet access address will be used. Allowed values are nichandle or «/me/contact/xyz» |

```json
{
  "contactShipping": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | order.Order | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `contracts` | order.Contract[] | read-only | List of contracts related to the order |
| `contracts[].content` | string | read-only | Terms of the contract |
| `contracts[].name` | string | read-only | Name of the contract |
| `contracts[].url` | string | read-only | URL to download the contract |
| `details` | order.OrderDetail[] | read-only | Details of the order |
| `details[].cartItemID` | integer | read-only | Cart Item ID the details is related to |
| `details[].description` | string | read-only | Description of the detail |
| `details[].detailType` | order.OrderDetailTypeEnum | read-only | Type of detail — one of `ACCESSORY`, `CAUTION`, `CHOOSED`, `CONSUMPTION`, `CREATION`, `DELIVERY`, `DURATION`, `GIFT`, `INSTALLATION`, `LICENSE`, `MUTE`, `OTHER`, … |
| `details[].domain` | string | read-only | Service name |
| `details[].originalTotalPrice` | order.Price | read-only | Original price of the detail before reduction application |
| `details[].originalTotalPrice.currencyCode` | order.CurrencyCodeEnum | read-only | Currency code — one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `details[].originalTotalPrice.priceInUcents` | integer | read-only | Price in microcents |
| `details[].originalTotalPrice.text` | string | read-only | Textual representation |
| `details[].originalTotalPrice.value` | number | read-only | The effective price |
| `details[].quantity` | integer | read-only | Quantity of the service |
| `details[].reductionTotalPrice` | order.Price | read-only | Total price of the reduction |
| `details[].reductionTotalPrice.currencyCode` | order.CurrencyCodeEnum | read-only | Currency code — one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `details[].reductionTotalPrice.priceInUcents` | integer | read-only | Price in microcents |
| `details[].reductionTotalPrice.text` | string | read-only | Textual representation |
| `details[].reductionTotalPrice.value` | number | read-only | The effective price |
| `details[].reductions` | order.Reduction[] | read-only | List of reductions applied to the detail |
| `details[].reductions[].context` | order.ReductionContextEnum | read-only | In which context the reduction is applied — one of `promotion`, `voucher` |
| `details[].reductions[].description` | string | read-only | Promotion description |
| `details[].reductions[].price` | order.Price | read-only | Reduction price applied with this promotion |
| `details[].reductions[].reductionDescription` | string | read-only | Reduction description |
| `details[].reductions[].type` | order.ReductionTypeEnum | read-only | Reduction effect, price modification — one of `fixed_amount`, `forced_amount`, `percentage` |
| `details[].reductions[].value` | order.Price | read-only | The reduction value |
| `details[].totalPrice` | order.Price | read-only | Price total of the services |
| `details[].totalPrice.currencyCode` | order.CurrencyCodeEnum | read-only | Currency code — one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `details[].totalPrice.priceInUcents` | integer | read-only | Price in microcents |
| `details[].totalPrice.text` | string | read-only | Textual representation |
| `details[].totalPrice.value` | number | read-only | The effective price |
| `details[].unitPrice` | order.Price | read-only | Unitary price of the service |
| `details[].unitPrice.currencyCode` | order.CurrencyCodeEnum | read-only | Currency code — one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `details[].unitPrice.priceInUcents` | integer | read-only | Price in microcents |
| `details[].unitPrice.text` | string | read-only | Textual representation |
| `details[].unitPrice.value` | number | read-only | The effective price |
| `orderId` | integer | read-only | Identifier of the order |
| `prices` | order.OrderPrices | read-only | Prices of the order including with and without taxes |
| `prices.originalWithoutTax` | order.Price | read-only | Price before reduction application |
| `prices.originalWithoutTax.currencyCode` | order.CurrencyCodeEnum | read-only | Currency code — one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `prices.originalWithoutTax.priceInUcents` | integer | read-only | Price in microcents |
| `prices.originalWithoutTax.text` | string | read-only | Textual representation |
| `prices.originalWithoutTax.value` | number | read-only | The effective price |
| `prices.reduction` | order.Price | read-only | Price concerning the reduced amount |
| `prices.reduction.currencyCode` | order.CurrencyCodeEnum | read-only | Currency code — one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `prices.reduction.priceInUcents` | integer | read-only | Price in microcents |
| `prices.reduction.text` | string | read-only | Textual representation |
| `prices.reduction.value` | number | read-only | The effective price |
| `prices.tax` | order.Price | read-only | Tax amount |
| `prices.tax.currencyCode` | order.CurrencyCodeEnum | read-only | Currency code — one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `prices.tax.priceInUcents` | integer | read-only | Price in microcents |
| `prices.tax.text` | string | read-only | Textual representation |
| `prices.tax.value` | number | read-only | The effective price |
| `prices.withTax` | order.Price | read-only | Price with tax |
| `prices.withTax.currencyCode` | order.CurrencyCodeEnum | read-only | Currency code — one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `prices.withTax.priceInUcents` | integer | read-only | Price in microcents |
| `prices.withTax.text` | string | read-only | Textual representation |
| `prices.withTax.value` | number | read-only | The effective price |
| `prices.withoutTax` | order.Price | read-only | Price without tax |
| `prices.withoutTax.currencyCode` | order.CurrencyCodeEnum | read-only | Currency code — one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `prices.withoutTax.priceInUcents` | integer | read-only | Price in microcents |
| `prices.withoutTax.text` | string | read-only | Textual representation |
| `prices.withoutTax.value` | number | read-only | The effective price |
| `url` | string | read-only | URL to download the order |

```json
{
  "contracts": [
    {
      "content": "string",
      "name": "string",
      "url": "string"
    }
  ],
  "details": [
    {
      "cartItemID": 0,
      "description": "string",
      "detailType": "ACCESSORY",
      "domain": "string",
      "originalTotalPrice": {
        "currencyCode": "AUD",
        "priceInUcents": 0,
        "text": "string",
        "value": 0
      },
      "quantity": 0,
      "reductionTotalPrice": {
        "currencyCode": "AUD",
        "priceInUcents": 0,
        "text": "string",
        "value": 0
      },
      "reductions": [
        {
          "context": "promotion",
          "description": "string",
          "price": {
            "currencyCode": "AUD",
            "priceInUcents": 0,
            "text": "string",
            "value": 0
          },
          "reductionDescription": "string",
          "type": "fixed_amount",
          "value": {
            "currencyCode": "AUD",
            "priceInUcents": 0,
            "text": "string",
            "value": 0
          }
        }
      ],
      "totalPrice": {
        "currencyCode": "AUD",
        "priceInUcents": 0,
        "text": "string",
        "value": 0
      },
      "unitPrice": {
        "currencyCode": "AUD",
        "priceInUcents": 0,
        "text": "string",
        "value": 0
      }
    }
  ],
  "orderId": 0,
  "prices": {
    "originalWithoutTax": {
      "currencyCode": "AUD",
      "priceInUcents": 0,
      "text": "string",
      "value": 0
    },
    "reduction": {
      "currencyCode": "AUD",
      "priceInUcents": 0,
      "text": "string",
  …
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/xdsl/{serviceName}/modem/comfortExchange" \
  -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: xdsl.modem.comfortExchange.post
result = client.post("/xdsl/{serviceName}/modem/comfortExchange",
	contactShipping = None, # Customer identifier for shipping address. By default Internet access address will be used. Allowed values are nichandle or «/me/contact/xyz» (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

// Request body type: xdsl.modem.comfortExchange.post
$result = $ovh->post("/xdsl/{serviceName}/modem/comfortExchange", array(
	contactShipping => null, // Customer identifier for shipping address. By default Internet access address will be used. Allowed values are nichandle or «/me/contact/xyz» (type: string)
));

print_r($result);
?>
```

## List the RMAs of an xDSL access

`GET /1.0/xdsl/{serviceName}/rma`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/access/spare-rma/#get-xdsl-servicename-rma

**Status:** Stable production version  
**IAM actions:** `xdsl:apiovh:rma/get`

Returns the IDs of the return merchandise authorizations of the access.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `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/xdsl/{serviceName}/rma" \
  -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("/xdsl/{serviceName}/rma")

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

print_r($result);
?>
```

## Get an RMA of an xDSL access

`GET /1.0/xdsl/{serviceName}/rma/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/access/spare-rma/#get-xdsl-servicename-rma-id

**Status:** Stable production version  
**IAM actions:** `xdsl:apiovh:rma/get`

Returns a return merchandise authorization with its type, process, status and steps, the returned and new equipment, the shipping contact and its dates.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | telephony.Rma | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `cancellable` | boolean | read-only | Is the RMA cancellable? |
| `creationDatetime` | string (date-time) | read-only | Creation datetime of the return merchandise authorisation ticket |
| `equipmentReference` | string | read-only | Merchandise reference |
| `id` | string | read-only | Return merchandise authorisation identifier |
| `newMerchandise` | string | read-only | New merchandise brand in case of exchange |
| `offerTypeNew` | telephony.RmaOfferTypeEnum | read-only | Offer type of the new merchandise in case of exchange — one of `deposit`, `loan`, `purchase` |
| `offerTypeOld` | telephony.RmaOfferTypeEnum | read-only | Offer type of the return merchandise — one of `deposit`, `loan`, `purchase` |
| `process` | telephony.RmaReplaceTypeEnum |  | Return merchandise authorisation type — one of `changePhone`, `phoneRestitution`, `undefined` |
| `receptionDatetime` | string (date-time) | read-only | Reception datetime of the return merchandise authorisation ticket |
| `shippingContact` | telephony.Contact |  | Contact information structure |
| `shippingContact.address` | string |  | Contact address |
| `shippingContact.city` | string |  | Contact city |
| `shippingContact.country` | coreTypes.CountryEnum |  | Contact country — one of `ac`, `ad`, `ae`, `af`, `ag`, `ai`, `al`, `am`, `an`, `ao`, `aq`, `ar`, … |
| `shippingContact.email` | string |  |  |
| `shippingContact.firstname` | string |  | Contact firstname |
| `shippingContact.name` | string |  | Contact name |
| `shippingContact.organisation` | string |  | Contact organisation |
| `shippingContact.phone` | string |  | Contact phone |
| `shippingContact.zip` | string |  | Contact zip |
| `status` | telephony.RmaStatusEnum | read-only | Return merchandise authorisation step — one of `closed`, `open`, `received` |
| `steps` | telephony.RmaStep[] | read-only | Indicates the current status of the RMA with a list of steps |
| `steps[].description` | string | read-only | A brief description of the step |
| `steps[].doneDate` | string (date-time) | read-only | The date when this step was done |
| `steps[].infos` | string | read-only | Additional information about the step |
| `steps[].name` | telephony.RmaStepNameEnum | read-only | RMA step names — one of `dispatchJustification`, `equipmentSending`, `equipmentTesting`, `opening`, `parcelReception`, `parcelValidation`, `validation` |
| `steps[].status` | telephony.RmaStepStatusEnum | read-only | Status of the RMA step — one of `done`, `todo` |
| `terminationDatetime` | string (date-time) | read-only | Termination datetime of the return merchandise authorisation ticket |
| `type` | telephony.RmaTypeEnum | read-only | Typology process of merchandise return — one of `after sale equipment service exchange`, `after sale phone service exchange`, `equipment restitution`, `fast exchange`, `old merchandise reception before exchange`, `phone restitution`, `resends due to shipping lost by the carrier`, `resends due to shipping not withdraw`, `specific return merchandise authorisation`, `termination`, `unknown` |

```json
{
  "cancellable": true,
  "creationDatetime": "2024-01-01T12:00:00Z",
  "equipmentReference": "string",
  "id": "string",
  "newMerchandise": "string",
  "offerTypeNew": "deposit",
  "offerTypeOld": "deposit",
  "process": "changePhone",
  "receptionDatetime": "2024-01-01T12:00:00Z",
  "shippingContact": {
    "address": "string",
    "city": "string",
    "country": "ac",
    "email": "string",
    "firstname": "string",
    "name": "string",
    "organisation": "string",
    "phone": "string",
    "zip": "string"
  },
  "status": "closed",
  "steps": [
    {
      "description": "string",
      "doneDate": "2024-01-01T12:00:00Z",
      "infos": "string",
      "name": "dispatchJustification",
      "status": "done"
    }
  ],
  "terminationDatetime": "2024-01-01T12:00:00Z",
  "type": "after sale equipment service exchange"
}
```

### Example

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

# 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("/xdsl/{serviceName}/rma/{id}");

print_r($result);
?>
```

## Update an RMA of an xDSL access

`PUT /1.0/xdsl/{serviceName}/rma/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/access/spare-rma/#put-xdsl-servicename-rma-id

**Status:** Stable production version  
**IAM actions:** `xdsl:apiovh:rma/edit`

Changes the process or the shipping contact of a return merchandise authorization.

### Parameters

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

### Request body (required)

Type: `telephony.Rma`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `cancellable` | boolean | read-only | Is the RMA cancellable? |
| `creationDatetime` | string (date-time) | read-only | Creation datetime of the return merchandise authorisation ticket |
| `equipmentReference` | string | read-only | Merchandise reference |
| `id` | string | read-only | Return merchandise authorisation identifier |
| `newMerchandise` | string | read-only | New merchandise brand in case of exchange |
| `offerTypeNew` | telephony.RmaOfferTypeEnum | read-only | Offer type of the new merchandise in case of exchange — one of `deposit`, `loan`, `purchase` |
| `offerTypeOld` | telephony.RmaOfferTypeEnum | read-only | Offer type of the return merchandise — one of `deposit`, `loan`, `purchase` |
| `process` | telephony.RmaReplaceTypeEnum |  | Return merchandise authorisation type — one of `changePhone`, `phoneRestitution`, `undefined` |
| `receptionDatetime` | string (date-time) | read-only | Reception datetime of the return merchandise authorisation ticket |
| `shippingContact` | telephony.Contact |  | Contact information structure |
| `shippingContact.address` | string |  | Contact address |
| `shippingContact.city` | string |  | Contact city |
| `shippingContact.country` | coreTypes.CountryEnum |  | Contact country — one of `ac`, `ad`, `ae`, `af`, `ag`, `ai`, `al`, `am`, `an`, `ao`, `aq`, `ar`, … |
| `shippingContact.email` | string |  |  |
| `shippingContact.firstname` | string |  | Contact firstname |
| `shippingContact.name` | string |  | Contact name |
| `shippingContact.organisation` | string |  | Contact organisation |
| `shippingContact.phone` | string |  | Contact phone |
| `shippingContact.zip` | string |  | Contact zip |
| `status` | telephony.RmaStatusEnum | read-only | Return merchandise authorisation step — one of `closed`, `open`, `received` |
| `steps` | telephony.RmaStep[] | read-only | Indicates the current status of the RMA with a list of steps |
| `steps[].description` | string | read-only | A brief description of the step |
| `steps[].doneDate` | string (date-time) | read-only | The date when this step was done |
| `steps[].infos` | string | read-only | Additional information about the step |
| `steps[].name` | telephony.RmaStepNameEnum | read-only | RMA step names — one of `dispatchJustification`, `equipmentSending`, `equipmentTesting`, `opening`, `parcelReception`, `parcelValidation`, `validation` |
| `steps[].status` | telephony.RmaStepStatusEnum | read-only | Status of the RMA step — one of `done`, `todo` |
| `terminationDatetime` | string (date-time) | read-only | Termination datetime of the return merchandise authorisation ticket |
| `type` | telephony.RmaTypeEnum | read-only | Typology process of merchandise return — one of `after sale equipment service exchange`, `after sale phone service exchange`, `equipment restitution`, `fast exchange`, `old merchandise reception before exchange`, `phone restitution`, `resends due to shipping lost by the carrier`, `resends due to shipping not withdraw`, `specific return merchandise authorisation`, `termination`, `unknown` |

```json
{
  "process": "changePhone",
  "shippingContact": {
    "address": "string",
    "city": "string",
    "country": "ac",
    "email": "string",
    "firstname": "string",
    "name": "string",
    "organisation": "string",
    "phone": "string",
    "zip": "string"
  }
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/xdsl/{serviceName}/rma/{id}" \
  -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: telephony.Rma
result = client.put("/xdsl/{serviceName}/rma/{id}",
	process = None, # Return merchandise authorisation type (type: telephony.RmaReplaceTypeEnum)
	shippingContact = None, # Contact information structure (type: telephony.Contact)
)

# 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: telephony.Rma
$result = $ovh->put("/xdsl/{serviceName}/rma/{id}", array(
	process => null, // Return merchandise authorisation type (type: telephony.RmaReplaceTypeEnum)
	shippingContact => null, // Contact information structure (type: telephony.Contact)
));

print_r($result);
?>
```

## Delete an RMA of an xDSL access

`DELETE /1.0/xdsl/{serviceName}/rma/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/access/spare-rma/#delete-xdsl-servicename-rma-id

**Status:** Stable production version  
**IAM actions:** `xdsl:apiovh:rma/delete`

Cancels the return merchandise authorization, when it is still cancellable.

### Parameters

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

### Responses

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

### Example

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

# 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("/xdsl/{serviceName}/rma/{id}");

print_r($result);
?>
```

## Change the type of an RMA

`POST /1.0/xdsl/{serviceName}/rma/{id}/changeType`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/access/spare-rma/#updateRMAType

**Status:** Stable production version  
**IAM actions:** `xdsl:apiovh:rma/changeType`

Changes a return merchandise authorization to a resiliation or to a SIP switch.

### Parameters

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

### Request body (required)

Type: `xdsl.rma.changeType.post`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | telephony.RmaChangeTypeEnum | yes | Types of return merchandise authorisation you can change to — one of `resiliate`, `toSip` |

```json
{
  "type": "resiliate"
}
```

### Responses

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

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/xdsl/{serviceName}/rma/{id}/changeType" \
  -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: xdsl.rma.changeType.post
result = client.post("/xdsl/{serviceName}/rma/{id}/changeType",
	type = None, # Types of return merchandise authorisation you can change to (type: telephony.RmaChangeTypeEnum)
)

# 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: xdsl.rma.changeType.post
$result = $ovh->post("/xdsl/{serviceName}/rma/{id}/changeType", array(
	type => null, // Types of return merchandise authorisation you can change to (type: telephony.RmaChangeTypeEnum)
));

print_r($result);
?>
```

## List the xDSL spares

`GET /1.0/xdsl/spare`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/access/spare-rma/#get-xdsl-spare

**Status:** Stable production version  
**IAM actions:** `xdslSpare:apiovh:get`

Returns the names of the spare modems of the account.

### 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/xdsl/spare" \
  -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("/xdsl/spare")

# 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("/xdsl/spare");

print_r($result);
?>
```

## Get an xDSL spare

`GET /1.0/xdsl/spare/{spare}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/access/spare-rma/#get-xdsl-spare-spare

**Status:** Stable production version  
**IAM actions:** `xdslSpare:apiovh:get`

Returns the brand and MAC address of a spare modem.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `spare` | path | string | yes | Spare |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | spare.xdsl.XdslSpareWithIAM | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `brand` | string | read-only | Modem brand model |
| `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 |
| `macAddress` | string | read-only | Mac address |

```json
{
  "brand": "string",
  "iam": {
    "displayName": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "state": "EXPIRED",
    "tags": {
      "key": "string"
    },
    "urn": "string"
  },
  "macAddress": "string"
}
```

### Example

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

# 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("/xdsl/spare/{spare}");

print_r($result);
?>
```

## List the brands of xDSL spares

`GET /1.0/xdsl/spare/brands`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/access/spare-rma/#get-xdsl-spare-brands

**Status:** Stable production version

Returns the modem brands available as spares.

### Responses

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

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

### Example

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

# 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("/xdsl/spare/brands");

print_r($result);
?>
```

## List the replacement brands of a spare

`GET /1.0/xdsl/spare/{spare}/compatibleReplacement`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/access/spare-rma/#get-xdsl-spare-spare-compatiblereplacement

**Status:** Stable production version  
**IAM actions:** `xdslSpare:apiovh:compatibleReplacement/get`

Returns the modem brands the spare is compatible with as a replacement.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `spare` | path | string | yes | Spare |

### Responses

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

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

### Example

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

# 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("/xdsl/spare/{spare}/compatibleReplacement");

print_r($result);
?>
```

## Get service information

`GET /1.0/xdsl/spare/{spare}/serviceInfos`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/access/spare-rma/#get-xdsl-spare-spare-serviceinfos

**Status:** Stable production version  
**IAM actions:** `xdslSpare:apiovh:serviceInfos/get`

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `spare` | path | string | yes | Spare |

### 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`, `manual`, `oneShot`, `option` |
| `serviceId` | integer | read-only |  |
| `status` | service.StateEnum | read-only | service.StateEnum — 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/xdsl/spare/{spare}/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("/xdsl/spare/{spare}/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("/xdsl/spare/{spare}/serviceInfos");

print_r($result);
?>
```

## Update service information

`PUT /1.0/xdsl/spare/{spare}/serviceInfos`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/access/spare-rma/#put-xdsl-spare-spare-serviceinfos

**Status:** Stable production version  
**IAM actions:** `xdslSpare:apiovh:serviceInfos/edit`

Changes the renewal settings of the spare: automatic renewal, renewal period and deletion at expiration.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `spare` | path | string | yes | Spare |

### 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`, `manual`, `oneShot`, `option` |
| `serviceId` | integer | read-only |  |
| `status` | service.StateEnum | read-only | service.StateEnum — 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/xdsl/spare/{spare}/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("/xdsl/spare/{spare}/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("/xdsl/spare/{spare}/serviceInfos", array(
	renew => null, // Way of handling the renew (type: service.RenewType, nullable)
));

print_r($result);
?>
```

## Replace a modem with a spare

`POST /1.0/xdsl/spare/{spare}/replace`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/access/spare-rma/#replaceModemBySpare

**Status:** Stable production version  
**IAM actions:** `xdslSpare:apiovh:replace`

Replaces the modem of an access with the spare modem.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `spare` | path | string | yes | Spare |

### Request body (required)

Type: `xdsl.spare.replace.post`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | string | yes | The modem to replace by the spare |

```json
{
  "domain": "string"
}
```

### Responses

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

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/xdsl/spare/{spare}/replace" \
  -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: xdsl.spare.replace.post
result = client.post("/xdsl/spare/{spare}/replace",
	domain = None, # The modem to replace by the spare (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

// Request body type: xdsl.spare.replace.post
$result = $ovh->post("/xdsl/spare/{spare}/replace", array(
	domain => null, // The modem to replace by the spare (type: string)
));

print_r($result);
?>
```

## Return a broken spare

`POST /1.0/xdsl/spare/{spare}/returnMerchandise`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/access/spare-rma/#post-xdsl-spare-spare-returnmerchandise

**Status:** Stable production version  
**IAM actions:** `xdslSpare:apiovh:returnMerchandise`

Returns the broken spare modem with an instant refund.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `spare` | path | string | yes | Spare |

### Responses

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

### Example

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

# 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("/xdsl/spare/{spare}/returnMerchandise");

print_r($result);
?>
```

## Delete an xDSL spare

`DELETE /1.0/xdsl/spare/{spare}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/access/spare-rma/#delete-xdsl-spare-spare

**Status:** Stable production version  
**IAM actions:** `xdslSpare:apiovh:delete`

Removes the spare modem from the account, as if it no longer belonged to OVHcloud.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `spare` | path | string | yes | Spare |

### Responses

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

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/xdsl/spare/{spare}" \
  -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("/xdsl/spare/{spare}")

# 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("/xdsl/spare/{spare}");

print_r($result);
?>
```
