> ## 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.

# Record Usage

> This method records uses Stripe's metered billing to record usage for a certain subscription. In order to use this mehtod, you need to have set up...

This method records uses [Stripe's metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) to record usage for a certain subscription.
In order to use this mehtod, you need to have set up [recurring billing](https://help.cryptolens.io/recurring-payments/index). A record will be created using
[Stripe's API](https://stripe.com/docs/api/usage_records) with action set to 'increment'.

This method is accessed by [https://api.cryptolens.io/api/subscription/RecordUsage](https://api.cryptolens.io/api/subscription/RecordUsage)

### Parameters

| **Parameter** | **Description** | **Remarks** |
| - | - | - |
| ProductId | the product id (=\*\*\[ProductId] \*\*) | required |
| Key | the serial key string | required |
| Amount | The amount to increment the usage counter with. | optional. 0 by default. |
| v | Method version. | optional. by default, it's 1. |

### Results

| **Parameter** | **Description** | **Remarks** |
| - | - | - |
| Result | This is either **0**(=success) or **1**(=error). | always returned |
| Message | The message that provides additional information about the result. | always returned. |

### Example result

```text theme={null}
{"result":0,"message":""}
```

### Errors

| **Error** |
| - |
| Access denied. |
| The input parameters were incorrect. |
| Could not find the product. |
| Could not find the key. |
| No Stripe payment processor was set up. |
| The subscription item id could not be found. |
| Could not increment the usage counter. |
