# Create Stripe Product for allmetrics
Stripe uses to create plans for user subscriptions. I assume that the stripe account has been created. If it's for developing mode, select "viewing test data" on the sidebar menu.
## Create Product
We need to create products for the plans. Go to "Products", then add product.
### For the free plan
Please follow the image instruction

Click Save Product to finish the process and Go to the product's detail to add a new price. We need to create a Monthly or Annual price.
Monthly

Annual

Create Metadata price as the feature plan on the user subscriptions page. Metadata is also used to limit the user based on the feature plan.
### Default Price ID on .env

We use free plan as the default price id for user registration. Click on the copy icon and copy the API ID for each price. Open .env and set the default price id for an example:
```
DEFAULT_PRICE_ID_YEARLY=price_1IFH7KJbyakvW8WRfyco7qvN
DEFAULT_PRICE_ID_MONTHLY=price_1IFH7LJbyakvW8WRT3ateERo
```
### Metadata Free Plan

Please follow the image carefully because the code will use the metadata as conditional on the statement.
Note: the value of 0 (zero) is defined as unlimited no limit.
### For the Unlimited Plan
Please follow the image instruction.

Click Save Product to finish the process and Go to the product's detail to add a new price. We need to create a Monthly or Annual price.
Create monthly price

Create annual price

The result is in the image below.

### Metadata
Create Metadata price as the feature plan on the user subscriptions page. Metadata is also used to limit the user based on the feature plan.

Please follow the image carefully because the code will use the metadata as conditional on the statement.
Note: the value of 0 (zero) is defined as unlimited no limit.
## Public and secret key
To get the public and secret API key goes to the sidebar menu Developer -> API Key. Click Reveal Key for the secret key and copy both of the keys then open .env and paste on these settings below:
For production or live site:
```
STRIPE_LIVE_PUBLIC_KEY=
STRIPE_LIVE_SECRET_KEY=
```
For development or test site:
```
STRIPE_TEST_PUBLIC_KEY=
STRIPE_TEST_SECRET_KEY=
```
## WEBHOOK
The currently project not use webhook. So we just set the webhook settings to:
```
DJSTRIPE_WEBHOOK_SECRET=whsec_x
```