> ## Documentation Index
> Fetch the complete documentation index at: https://help.cryptolens.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Python 3: Subscription

> Record metered usage for customer subscriptions.

Python 3 package `licensing 0.54`. [Reviewed source revision](https://github.com/Cryptolens/cryptolens-python/tree/8f38b5a37580f2aba1c9374f581cdc85e251950f).

```python theme={null}
from licensing.methods import Subscription
```

<a id="licensing.methods.Subscription.record_usage_to_stripe" />

## record\_usage\_to\_stripe

Increment the metered usage of a customer's subscription after recurring billing has been configured.

```python theme={null}
Subscription.record_usage_to_stripe(token, product_id, key, amount='')
```

### Parameters

| Parameter | Default | Meaning |
| - | - | - |
| `token` | Required | Your access token. It needs the permission required by the linked Web API method. |
| `product_id` | Required | The numeric product ID. |
| `key` | Required | The license-key string, rather than the numeric license ID. |
| `amount` | `''` | The quantity to add to the customer's metered usage. |

### Result

Returns `(response_dict, '')`.

Returns `(None, message)` for API rejection or a handled request failure. Malformed response data can raise an exception.

### Checks

The API checks the access token's permissions. This method does not verify a signed license response.

[Web API reference](/api-reference/generated/RecordUsage).

[Python SDK Reference](/libraries/python-api)
