# Turn renewals or automatic renewal on or off

> Turn renewals or automatic renewal on or off: TrueProxies customer API reference with the required scope, parameters, responses and code samples.

Source: https://docs.trueproxies.com/api/operations/patch_v1_services_id/

`PATCH /v1/services/{id}`

**Fetch**

```js
const url = 'https://api.trueproxies.com/v1/services/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"auto_pay":true,"auto_pay_consent":{"disclosure_text":"example","disclosure_version":"example"},"label":"example","renewals_enabled":true}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**cURL**

```sh
curl --request PATCH \
  --url https://api.trueproxies.com/v1/services/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{ "auto_pay": true, "auto_pay_consent": { "disclosure_text": "example", "disclosure_version": "example" }, "label": "example", "renewals_enabled": true }'
```

Set renewals\_enabled or auto\_pay. Requires billing:write; reseller:purchase also permits this operation. Add customer\_id to change a managed customer’s service, which additionally requires reseller:purchase: a managed customer’s renewal is paid from the wallet automatically. Managed customers’ services start with renewals off. Turning renewals off cancels an open renewal invoice and turns automatic renewal off. Free trials and comparison passes cannot be renewed. auto\_pay charges the saved card for renewals (for automatic top-up on GB plans); turning it on needs a saved card and auto\_pay\_consent, the exact sentence the customer saw, and turning it off takes effect at once. Managed customers’ services cannot use automatic renewal.

## Authorizations

- **[customerAPIKey](https://docs.trueproxies.com/api/#customerapikey)**

## Parameters

### Path Parameters

- **id**

  required

  string format: uuid

### Query Parameters

- **customer\_id**

  string format: uuid

  Owned sub-customer UUID. Resellers only; reads require reseller:read and writes reseller:purchase in addition to the operation scope. X-Customer-Id header is an alternative. Not allowed for me, wallet, trial, API keys, or reseller-management routes.

## Request Body (required)

Media type: `application/json`

object

- **auto\_pay**

  Turns automatic renewal (automatic top-up on GB plans) on or off for this service. Off takes effect at once. On needs a saved card and auto\_pay\_consent, and cannot be sent with renewals\_enabled false on a plan that renews.

  boolean

- **auto\_pay\_consent**

  Required when auto\_pay is true.

  object

  - **disclosure\_text**

    required

    Refused when blank or longer than 1000 characters, so the stored sentence is exactly what was shown.

    string

    \>= 1 characters <= 1000 characters

  - **disclosure\_version**

    required

    string

    \>= 1 characters <= 64 characters

- **label**

  Your own name for this service, shown instead of the plan name. Leading and trailing spaces are trimmed; an empty string clears it. No line breaks or control characters.

  string

  <= 40 characters

- **renewals\_enabled**

  boolean

##### Example (generated)

```json
{
  "auto_pay": true,
  "auto_pay_consent": {
    "disclosure_text": "example",
    "disclosure_version": "example"
  },
  "label": "example",
  "renewals_enabled": true
}
```

## Responses

### 200

Ok

Media type: `application/json`

object

- **auto\_pay**

  required

  Automatic renewal is on (automatic top-up on GB plans). The saved card is charged without the customer paying the invoice.

  boolean

- **auto\_pay\_available**

  required

  Automatic renewal can be turned on for this service now.

  boolean

- **auto\_pay\_last\_failure**

  required

  Any of:

  **object**

  object

  - **at**

    required

    string format: date-time

  - **reason**

    required

    string

  **null**

  null

- **billing\_read\_only**

  required

  Existing access remains available, but this service cannot be topped up or renewed. New plan purchases are separate.

  boolean

- **capabilities**

  required

  Array\<string>

- **city**

  string

- **comparison\_pass**

  Free private comparison with fixed speed and expiry; cannot be purchased, topped up or renewed.

  boolean

- **connects\_per\_second**

  required

  Effective limit for this service.

  integer

- **created\_at**

  required

  string format: date-time

- **depleted**

  boolean

- **display\_name**

  required

  Unlimited service names reflect their actual speed and term; offer\_key retains the original billing plan.

  string

- **expires\_at**

  string format: date-time

- **grace\_until**

  string format: date-time

- **host**

  required

  string

- **id**

  required

  Internal API identifier. Use reference for customer-facing display.

  string format: uuid

- **ips**

  The service’s IPs in order, for isp\_dedicated; empty until they are set up.

  Array\<object>

  One IP of an isp\_dedicated service and the gateway port that reaches it.

  object

  - **exit\_ip**

    required

    The IP traffic leaves from; null until it is known.

    string | null

  - **host**

    required

    string

  - **index**

    required

    integer

  - **port**

    required

    integer

- **label**

  The customer’s own name for this service. Absent when not set; show display\_name then.

  string

  <= 40 characters

- **max\_connections**

  required

  Effective limit for this service.

  integer

- **offer\_key**

  required

  string

- **pool**

  A carrier sold as isp\_dedicated, a country and the provider its IPs are registered to.

  object

  - **carrier**

    required

    string

  - **country**

    required

    string

  - **in\_stock**

    required

    boolean

  - **key**

    required

    string

  - **terms**

    required

    Array\<string>

    Allowed values: day week month

- **ports**

  required

  object

  - **http**

    required

    integer

  - **https**

    required

    integer

  - **socks5**

    required

    integer

- **product**

  required

  string

  Allowed values: residential\_ipv4\_gb residential\_ipv4\_unlimited datacenter\_ipv6 trial residential\_ipv6 isp\_dedicated residential\_ipv4\_premium residential\_ipv4\_lite residential\_ipv4\_unlimited\_pro

- **quantity**

  IPs bought, for isp\_dedicated.

  integer

  \>= 1

- **reference**

  required

  Stable, unique customer-facing reference.

  string

  /^SVC-\[0-9]{6,}$/

- **renewal\_price\_cents**

  What the next renewal, or a top-up with the same pack, charges. A service keeps the price it was bought or last changed plan at when the catalog price changes. Absent when the service does not renew.

  integer format: int64

- **renewals\_enabled**

  required

  boolean

- **speed\_bps**

  0 for paid residential\_ipv4\_gb means no additional TrueProxies speed cap. Private comparison passes have a fixed 50000000 bps cap. residential\_ipv4\_unlimited retains its positive plan speed. Upstream capacity and availability still apply. Trials and datacenter plans retain their speed limits.

  integer format: int64

- **starts\_at**

  string format: date-time

- **status**

  required

  string

  Allowed values: pending active expired closed suspended failed

- **term**

  string

  Allowed values: hour day week month

- **term\_label**

  Actual fixed duration for a free Unlimited grant, such as 3 hours. Overrides the recurring term label in customer views.

  string

- **trial\_product**

  The Unlimited product a free trial (offer\_key ipv4\_unlimited\_trial\_1h) runs as, or will start as before its first request. Upgrade plan moves the trial within this product. Absent on other services.

  string

  Allowed values: residential\_ipv4\_unlimited residential\_ipv4\_unlimited\_pro

- **trial\_started\_at**

  First recorded trial traffic; absent until the first request starts the 30-minute window.

  string format: date-time

- **udp\_ports**

  The only destination ports UDP over SOCKS5 reaches on this service (443 and 19302 on Unlimited Pro and on a free trial that runs as Unlimited Pro). Absent when any port the gateway allows works.

  Array\<integer>

- **usage\_source**

  required

  string

  Allowed values: node

- **username\_base**

  required

  string

- **whitelist\_entries**

  integer

##### Example

```json
{
  "pool": {
    "terms": [
      "day"
    ]
  },
  "product": "residential_ipv4_gb",
  "reference": "SVC-001001",
  "status": "pending",
  "term": "hour",
  "trial_product": "residential_ipv4_unlimited",
  "usage_source": "node"
}
```

### 400

Error

Media type: `application/json`

object

- **code**

  required

  string

  Allowed values: BAD\_REQUEST UNAUTHENTICATED FORBIDDEN NOT\_FOUND CONFLICT RATE\_LIMITED SERVICE\_UNAVAILABLE OFFER\_UNAVAILABLE CITY\_UNAVAILABLE CAPACITY\_UNAVAILABLE INVOICE\_NOT\_PAYABLE PROVIDER\_ERROR PIPE\_UNAVAILABLE TRIAL\_NOT\_ELIGIBLE EMAIL\_UNVERIFIED INTERNAL

- **details**

  What a client needs to act on the error (ids, flags), never display text.

  object

  - ***key***

    additional properties

    any

- **message**

  required

  string

##### Example

```json
{
  "code": "BAD_REQUEST"
}
```

### 401

Error

Media type: `application/json`

object

- **code**

  required

  string

  Allowed values: BAD\_REQUEST UNAUTHENTICATED FORBIDDEN NOT\_FOUND CONFLICT RATE\_LIMITED SERVICE\_UNAVAILABLE OFFER\_UNAVAILABLE CITY\_UNAVAILABLE CAPACITY\_UNAVAILABLE INVOICE\_NOT\_PAYABLE PROVIDER\_ERROR PIPE\_UNAVAILABLE TRIAL\_NOT\_ELIGIBLE EMAIL\_UNVERIFIED INTERNAL

- **details**

  What a client needs to act on the error (ids, flags), never display text.

  object

  - ***key***

    additional properties

    any

- **message**

  required

  string

##### Example

```json
{
  "code": "BAD_REQUEST"
}
```

### 403

Error

Media type: `application/json`

object

- **code**

  required

  string

  Allowed values: BAD\_REQUEST UNAUTHENTICATED FORBIDDEN NOT\_FOUND CONFLICT RATE\_LIMITED SERVICE\_UNAVAILABLE OFFER\_UNAVAILABLE CITY\_UNAVAILABLE CAPACITY\_UNAVAILABLE INVOICE\_NOT\_PAYABLE PROVIDER\_ERROR PIPE\_UNAVAILABLE TRIAL\_NOT\_ELIGIBLE EMAIL\_UNVERIFIED INTERNAL

- **details**

  What a client needs to act on the error (ids, flags), never display text.

  object

  - ***key***

    additional properties

    any

- **message**

  required

  string

##### Example

```json
{
  "code": "BAD_REQUEST"
}
```

### 404

Error

Media type: `application/json`

object

- **code**

  required

  string

  Allowed values: BAD\_REQUEST UNAUTHENTICATED FORBIDDEN NOT\_FOUND CONFLICT RATE\_LIMITED SERVICE\_UNAVAILABLE OFFER\_UNAVAILABLE CITY\_UNAVAILABLE CAPACITY\_UNAVAILABLE INVOICE\_NOT\_PAYABLE PROVIDER\_ERROR PIPE\_UNAVAILABLE TRIAL\_NOT\_ELIGIBLE EMAIL\_UNVERIFIED INTERNAL

- **details**

  What a client needs to act on the error (ids, flags), never display text.

  object

  - ***key***

    additional properties

    any

- **message**

  required

  string

##### Example

```json
{
  "code": "BAD_REQUEST"
}
```

### 409

Error

Media type: `application/json`

object

- **code**

  required

  string

  Allowed values: BAD\_REQUEST UNAUTHENTICATED FORBIDDEN NOT\_FOUND CONFLICT RATE\_LIMITED SERVICE\_UNAVAILABLE OFFER\_UNAVAILABLE CITY\_UNAVAILABLE CAPACITY\_UNAVAILABLE INVOICE\_NOT\_PAYABLE PROVIDER\_ERROR PIPE\_UNAVAILABLE TRIAL\_NOT\_ELIGIBLE EMAIL\_UNVERIFIED INTERNAL

- **details**

  What a client needs to act on the error (ids, flags), never display text.

  object

  - ***key***

    additional properties

    any

- **message**

  required

  string

##### Example

```json
{
  "code": "BAD_REQUEST"
}
```

### 429

Error

Media type: `application/json`

object

- **code**

  required

  string

  Allowed values: BAD\_REQUEST UNAUTHENTICATED FORBIDDEN NOT\_FOUND CONFLICT RATE\_LIMITED SERVICE\_UNAVAILABLE OFFER\_UNAVAILABLE CITY\_UNAVAILABLE CAPACITY\_UNAVAILABLE INVOICE\_NOT\_PAYABLE PROVIDER\_ERROR PIPE\_UNAVAILABLE TRIAL\_NOT\_ELIGIBLE EMAIL\_UNVERIFIED INTERNAL

- **details**

  What a client needs to act on the error (ids, flags), never display text.

  object

  - ***key***

    additional properties

    any

- **message**

  required

  string

##### Example

```json
{
  "code": "BAD_REQUEST"
}
```

### 500

Error

Media type: `application/json`

object

- **code**

  required

  string

  Allowed values: BAD\_REQUEST UNAUTHENTICATED FORBIDDEN NOT\_FOUND CONFLICT RATE\_LIMITED SERVICE\_UNAVAILABLE OFFER\_UNAVAILABLE CITY\_UNAVAILABLE CAPACITY\_UNAVAILABLE INVOICE\_NOT\_PAYABLE PROVIDER\_ERROR PIPE\_UNAVAILABLE TRIAL\_NOT\_ELIGIBLE EMAIL\_UNVERIFIED INTERNAL

- **details**

  What a client needs to act on the error (ids, flags), never display text.

  object

  - ***key***

    additional properties

    any

- **message**

  required

  string

##### Example

```json
{
  "code": "BAD_REQUEST"
}
```

### 503

Error

Media type: `application/json`

object

- **code**

  required

  string

  Allowed values: BAD\_REQUEST UNAUTHENTICATED FORBIDDEN NOT\_FOUND CONFLICT RATE\_LIMITED SERVICE\_UNAVAILABLE OFFER\_UNAVAILABLE CITY\_UNAVAILABLE CAPACITY\_UNAVAILABLE INVOICE\_NOT\_PAYABLE PROVIDER\_ERROR PIPE\_UNAVAILABLE TRIAL\_NOT\_ELIGIBLE EMAIL\_UNVERIFIED INTERNAL

- **details**

  What a client needs to act on the error (ids, flags), never display text.

  object

  - ***key***

    additional properties

    any

- **message**

  required

  string

##### Example

```json
{
  "code": "BAD_REQUEST"
}
```
