> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.resemble.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.resemble.ai/_mcp/server.

# Update subscription product quantities

PATCH https://app.resemble.ai/billing/api/v1/subscription/products
Content-Type: application/json

Updates one or more adjustable subscription products atomically. Each `new_quantity` is the desired absolute total, not an increment. A product is adjustable when its category is `subscription` and its `plan_product.allow_additional_usage` value is true. Quantities must remain within the plan's minimum and maximum and cannot be reduced below `consumed_quantity`.

Reference: https://docs.resemble.ai/api-reference/billing-subscriptions/update-billing-subscription-products

## Authentication

- `Authorization` header (bearer token, required) — API key from https://app.resemble.ai/hub/api

## Request

### Body (application/json)

This endpoint expects a BillingUpdateProductsRequest.

- `changes` (list of BillingProductQuantityChange, required)

## Response

### 200

Subscription with updated product quantities.

- `subscription` (BillingSubscription, required, nullable)

## Errors

### 400 Bad Request Error

The request could not be parsed or contains invalid parameters.

- `error` (string, required) — Human-readable error message.

### 401 Unauthorized Error

A valid API key was not provided.

- `error` (string, required) — Human-readable error message.

### 402 Payment Required Error

Additional customer authentication is required before the billing change can complete.

- `requires_action` (boolean, required)
- `client_secret` (string, required) — Client secret used to complete the required payment authentication.

### 403 Forbidden Error

The API key owner cannot manage billing, or the Billing API is unavailable for the customer's billing arrangement.

- `error` (string, required) — Human-readable authorization or eligibility error.
- `error_code` (string, optional, nullable) — Machine-readable error code when one is available.

### 404 Not Found Error

The requested billing resource does not exist for the current team.

- `error` (string, required) — Human-readable error message.

### 422 Unprocessable Entity Error

The request was understood but violates a billing rule.

- `UpdateBillingSubscriptionProductsRequestUnprocessableEntityError`

### 500 Internal Server Error

An unexpected billing error occurred.

- `error` (string, required) — Human-readable error message.

## Types

### BillingProductQuantityChange

- `product_slug` (string, required) — Product slug returned by the subscription response.
- `new_quantity` (double, required) — Desired absolute total, not an increment or decrement.

### BillingSubscription

- `id` (long, optional)
- `plan` (BillingPlan, optional)
- `status` (enum, optional)
  - Allowed values: `pending_payment`, `active_pending_payment`, `active`, `trialing`, `cancelled`, `expired`, `past_due`, `delinquent`
- `current_period_start` (datetime, optional)
- `current_period_end` (datetime, optional)
- `cancel_at_period_end` (boolean, optional)
- `cancel_at` (datetime, optional, nullable)
- `activated_at` (datetime, optional, nullable)
- `invoice_due_date` (date, optional, nullable)
- `delinquent_at` (datetime, optional, nullable)
- `subscription_items` (list of BillingSubscriptionItem, optional)
- `created_at` (datetime, optional)
- `updated_at` (datetime, optional)

### BillingError

- `error` (string, required) — Human-readable error message.

### BillingValidationErrors

- `errors` (list of string, required)

### BillingPlan

- `id` (long, optional)
- `name` (string, optional)
- `slug` (string, optional) — Stable plan identifier used when creating or changing a subscription.
- `plan_type` (enum, optional)
  - Allowed values: `self_serve`, `custom`, `default`
- `base_fee_cents` (integer, optional)
- `base_fee_dollars` (double, optional)
- `total_base_cost_cents` (integer, optional)
- `total_base_cost_dollars` (double, optional)
- `included_dollar_balance_cents` (integer, optional)
- `included_dollar_balance_dollars` (double, optional)
- `billing_interval` (enum, optional)
  - Allowed values: `monthly`, `quarterly`, `annual`
- `plan_family` (BillingPlanFamily, optional, nullable)
- `active` (boolean, optional)
- `products` (list of BillingPlanProduct, optional)
- `created_at` (datetime, optional)
- `updated_at` (datetime, optional)

### BillingSubscriptionItem

- `id` (long, optional)
- `quantity` (double, optional) — Current absolute quantity on the subscription.
- `consumed_quantity` (double, optional) — Quantity currently in use. A product cannot be reduced below this value.
- `product` (BillingSubscriptionProduct, optional)
- `plan_product` (BillingSubscriptionPlanProduct, optional, nullable) — Quantity rules inherited from the subscription's current plan.
- `rate_per_unit_cents` (double, optional) — Locked-in unit rate for this subscription item.
- `current_rate_per_unit_cents` (double, optional) — Current catalog unit rate for comparison.
- `is_grandfathered` (boolean, optional)
- `rate_locked_at` (datetime, optional, nullable)
- `ui_visible` (boolean, optional)

### BillingPlanFamily

- `key` (string, optional)
- `name` (string, optional)
- `description` (string, optional, nullable)
- `position` (integer, optional, nullable)

### BillingPlanProduct

A product and its pricing and quantity rules on a plan.

- `id` (long, optional)
- `name` (string, optional)
- `slug` (string, optional) — Stable product identifier used in product_quantities and changes requests.
- `description` (string, optional, nullable)
- `unit_type` (string, optional)
- `category` (enum, optional)
  - Allowed values: `metered`, `subscription`, `base_fee`, `included_credits`
- `rate_per_unit_cents` (integer, optional)
- `rate_per_unit_dollars` (double, optional)
- `has_tiers` (boolean, optional)
- `tiers` (list of BillingProductRateTier, optional)
- `included_quantity` (double, optional, nullable)
- `allow_additional_usage` (boolean, optional) — Whether the plan permits the product quantity to be changed.
- `min_usage_per_period` (double, optional, nullable) — Minimum allowed quantity for this product on the plan.
- `max_usage_per_period` (double, optional, nullable) — Maximum allowed quantity for this product on the plan. Null means no plan-specific maximum.
- `ui_visible` (boolean, optional) — Whether the product is displayed in Resemble billing interfaces.
- `product_family` (BillingProductFamily, optional, nullable)

### BillingSubscriptionProduct

- `id` (long, optional)
- `name` (string, optional)
- `slug` (string, optional) — Product identifier to send as product_slug when updating quantities.
- `unit_type` (string, optional)
- `category` (enum, optional)
  - Allowed values: `metered`, `subscription`, `base_fee`, `included_credits`
- `description` (string, optional, nullable)
- `active` (boolean, optional)
- `min_purchase_quantity` (double, optional, nullable)
- `max_purchase_quantity` (double, optional, nullable)

### BillingSubscriptionPlanProduct

Quantity rules inherited from the subscription's current plan.

- `included_quantity` (double, optional, nullable)
- `allow_additional_usage` (boolean, optional)
- `min_usage_per_period` (double, optional, nullable)
- `max_usage_per_period` (double, optional, nullable)

### BillingProductRateTier

- `tier_order` (integer, optional)
- `min_quantity` (double, optional)
- `max_quantity` (double, optional, nullable)
- `rate_per_unit_cents` (integer, optional)
- `rate_per_unit_dollars` (double, optional)

### BillingProductFamily

- `key` (string, optional)
- `name` (string, optional)
- `description` (string, optional, nullable)
- `position` (integer, optional, nullable)

## Examples

**Request**

```json
{
  "changes": [
    {
      "product_slug": "voice_clone",
      "new_quantity": 5
    },
    {
      "product_slug": "another_adjustable_product",
      "new_quantity": 10
    }
  ]
}
```

**Response**

```json
{
  "subscription": {
    "id": 1,
    "plan": {
      "id": 1,
      "name": "string",
      "slug": "string",
      "plan_type": "self_serve",
      "base_fee_cents": 1,
      "base_fee_dollars": 1.1,
      "total_base_cost_cents": 1,
      "total_base_cost_dollars": 1.1,
      "included_dollar_balance_cents": 1,
      "included_dollar_balance_dollars": 1.1,
      "billing_interval": "monthly",
      "plan_family": {
        "key": "string",
        "name": "string",
        "description": "string",
        "position": 1
      },
      "active": true,
      "products": [
        {
          "id": 1,
          "name": "string",
          "slug": "string",
          "description": "string",
          "unit_type": "string",
          "category": "metered",
          "rate_per_unit_cents": 1,
          "rate_per_unit_dollars": 1.1,
          "has_tiers": true,
          "tiers": [
            {
              "tier_order": 1,
              "min_quantity": 1.1,
              "max_quantity": 1.1,
              "rate_per_unit_cents": 1,
              "rate_per_unit_dollars": 1.1
            }
          ],
          "included_quantity": 1.1,
          "allow_additional_usage": true,
          "min_usage_per_period": 1.1,
          "max_usage_per_period": 1.1,
          "ui_visible": true,
          "product_family": {
            "key": "string",
            "name": "string",
            "description": "string",
            "position": 1
          }
        }
      ],
      "created_at": "2024-01-15T09:30:00Z",
      "updated_at": "2024-01-15T09:30:00Z"
    },
    "status": "pending_payment",
    "current_period_start": "2024-01-15T09:30:00Z",
    "current_period_end": "2024-01-15T09:30:00Z",
    "cancel_at_period_end": true,
    "cancel_at": "2024-01-15T09:30:00Z",
    "activated_at": "2024-01-15T09:30:00Z",
    "invoice_due_date": "2023-01-15",
    "delinquent_at": "2024-01-15T09:30:00Z",
    "subscription_items": [
      {
        "id": 1,
        "quantity": 1.1,
        "consumed_quantity": 1.1,
        "product": {
          "id": 1,
          "name": "string",
          "slug": "string",
          "unit_type": "string",
          "category": "metered",
          "description": "string",
          "active": true,
          "min_purchase_quantity": 1.1,
          "max_purchase_quantity": 1.1
        },
        "plan_product": {
          "included_quantity": 1.1,
          "allow_additional_usage": true,
          "min_usage_per_period": 1.1,
          "max_usage_per_period": 1.1
        },
        "rate_per_unit_cents": 1.1,
        "current_rate_per_unit_cents": 1.1,
        "is_grandfathered": true,
        "rate_locked_at": "2024-01-15T09:30:00Z",
        "ui_visible": true
      }
    ],
    "created_at": "2024-01-15T09:30:00Z",
    "updated_at": "2024-01-15T09:30:00Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://app.resemble.ai/billing/api/v1/subscription/products"

payload = { "changes": [
        {
            "product_slug": "voice_clone",
            "new_quantity": 5
        },
        {
            "product_slug": "another_adjustable_product",
            "new_quantity": 10
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://app.resemble.ai/billing/api/v1/subscription/products';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"changes":[{"product_slug":"voice_clone","new_quantity":5},{"product_slug":"another_adjustable_product","new_quantity":10}]}'
};

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

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.resemble.ai/billing/api/v1/subscription/products"

	payload := strings.NewReader("{\n  \"changes\": [\n    {\n      \"product_slug\": \"voice_clone\",\n      \"new_quantity\": 5\n    },\n    {\n      \"product_slug\": \"another_adjustable_product\",\n      \"new_quantity\": 10\n    }\n  ]\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://app.resemble.ai/billing/api/v1/subscription/products")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"changes\": [\n    {\n      \"product_slug\": \"voice_clone\",\n      \"new_quantity\": 5\n    },\n    {\n      \"product_slug\": \"another_adjustable_product\",\n      \"new_quantity\": 10\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://app.resemble.ai/billing/api/v1/subscription/products")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"changes\": [\n    {\n      \"product_slug\": \"voice_clone\",\n      \"new_quantity\": 5\n    },\n    {\n      \"product_slug\": \"another_adjustable_product\",\n      \"new_quantity\": 10\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://app.resemble.ai/billing/api/v1/subscription/products', [
  'body' => '{
  "changes": [
    {
      "product_slug": "voice_clone",
      "new_quantity": 5
    },
    {
      "product_slug": "another_adjustable_product",
      "new_quantity": 10
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://app.resemble.ai/billing/api/v1/subscription/products");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"changes\": [\n    {\n      \"product_slug\": \"voice_clone\",\n      \"new_quantity\": 5\n    },\n    {\n      \"product_slug\": \"another_adjustable_product\",\n      \"new_quantity\": 10\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["changes": [
    [
      "product_slug": "voice_clone",
      "new_quantity": 5
    ],
    [
      "product_slug": "another_adjustable_product",
      "new_quantity": 10
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.resemble.ai/billing/api/v1/subscription/products")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```