# White-labeled billing

Set up a branded billing dashboard with custom pricing for your customers.
> Source: https://docs.viam.com/organization/white-labeled-billing/


You can use Viam to bill your customers using your own logo.
This guide shows you how to set up white-labeled billing.
Once set up:

- You will have a branded billing dashboard for each org
- Invoices will be sent from your provided support email address and will contain your provided logo
- You can set custom pricing






    
    
    
<picture>

  
  
<source srcset="/operate/wlbilling_hu_7ec388d1eb2199f1.webp" type="image/webp" width="1000" height="778">
<img src="/operate/wlbilling.png" width="1000" height="778" alt="Example billing dashboard" class="imgzoom shadow" id="" style="width:600px" loading="lazy">
  

</picture>




## Prerequisites


### Step 1

**Navigate to the organization settings page** through the menu in the upper right corner of the page. Create a **Public namespace**.

### Step 2

**A logo** to be displayed on the login screen for your organization.
Your logo can be up to 200KB in size and must be in PNG format.

```sh
viam organization logo set --logo-path logo.png --org-id <org-id>
Successfully set the logo for organization <org-id> to logo at file-path: logo.png
```
You must have [owner permissions](/organization/rbac/) on the organization.

### Step 3

**The support email** that will be shown when Viam sends emails to users on your behalf for email verification, password recovery, and other account-related emails.

```sh
viam organization support-email set --support-email support@logoipsum.com --org-id <org-id>
Successfully set support email for organization "<org-id>" to "support@logoipsum.com"
```



## Set up custom billing


### Step 1

**Enable the billing service** for your organization:

```sh
viam organizations billing-service enable --org-id <org-id> --address "100 Center Street, New York, NY, 10001, USA"
Successfully enabled billing service for organization "<org-id>"
```

### Step 2

**Get billing dashboard URL** from the billing service config:

```sh
viam organizations billing-service get-config --org-id <org-id>
Billing config for organization: <org-id>
Support Email: support.person@email.com
Billing Dashboard URL: https://app.viam.com/billing/logoipsum
Logo URL: https://storage.googleapis.com/viam-self-service-<org-id>/primary_logo.png

 --- Billing Address ---
Address Line 1: 123 Test Street
City: New York
State: Ny
Postal Code: 10001
Country: USA
```
You can update any value after setup using `viam organizations billing-service update`.

### Step 3

**Check the billing dashboard** by navigating to the billing dashboard URL:

It will be of the form `https://app.viam.com/billing/<public-namespace>`.

To see the billing dashboard for a specific organization, navigate to:

```sh
https://app.viam.com/billing/<public-namespace>?id=<org-id>
```
<picture>
<source srcset="/operate/wlbilling_hu_7ec388d1eb2199f1.webp" type="image/webp" width="1000" height="778">
<img src="/operate/wlbilling.png" width="1000" height="778" alt="Example billing dashboard" class="imgzoom shadow" id="" style="width:600px" loading="lazy">
</picture>



## Set custom pricing

To use custom billing, add a billing configuration to a fragment.

1. Navigate to the [**Fragments** page](https://app.viam.com/fragments).
1. Select the fragment you use for your machines.
1. Click **+** and add **Billing**.
1. Adjust attributes as needed.
1. Mark the fragment as public or unlisted.
1. Save the fragment.
1. Add the fragment to the machines that you want to bill for.




### Full Template (monthly)

```json
{
  "billing": {
    "cost_per_month": {
      "per_machine": 0,
      "binary_data_upload_bytes": 0.0,
      "binary_data_egress_bytes": 0.0,
      "binary_data_cloud_storage_bytes": 0.0,
      "tabular_data_upload_bytes": 0.0,
      "tabular_data_egress_bytes": 0.0,
      "tabular_data_cloud_storage_bytes": 0.0,
      "history_cloud_storage_bytes": 0.0,
      "logs_cloud_storage_bytes": 0.0,
      "logs_data_upload_bytes": 0.0,
      "logs_data_egress_bytes": 0.0
    },
    "tier_name": "example-tier",
    "description": "",
    "tier_credit": 0.0,
    "in_arrears": true
  }
}
```

### Full Template (yearly)

```json
{
  "billing": {
    "cost_per_year": {
      "per_machine": 0
    },
    "tier_name": "example-tier",
    "description": "",
    "tier_credit": 0.0,
    "in_arrears": false
  }
}
```

### Example (monthly)

This configuration charges customers every month in arrears, which means after usage:

```json
{
  "billing": {
    "cost_per_month": {
      "per_machine": 10,
      "binary_data_upload_bytes": 0.01
    },
    "tier_name": "monthly-tier",
    "in_arrears": true
  }
}
```
By setting `"in_arrears": false` you can change the configuration to charge customers upfront.

### Example (yearly)

This configuration charges customers every 12 months, with upfront payment:

```json
{
  "billing": {
    "cost_per_year": {
      "per_machine": 100
    },
    "tier_name": "annual-tier",
    "in_arrears": false
  }
}
```



**Click to view billing attributes**



<!-- prettier-ignore -->
| Name | Type | Required? | Description |
| ---- | ---- | --------- | ----------- |
| `cost_per_month` | object | Optional | See [cost per month attributes](/organization/white-labeled-billing/#click-to-view-cost-per-month-attributes). If specified, you cannot also specify `cost_per_year`. Default: `{}` (all machines cost `0`). |
| `cost_per_year` | object | Optional | See [cost per year attributes](/organization/white-labeled-billing/#click-to-view-cost-per-year-attributes). If specified, you cannot also specify `cost_per_month`. Default: `{}` (all machines cost `0`). |
| `tier_name` | string | **Required** | The name of the billing tier. |
| `description` | string | Optional | Description for the billing tier. Default: `""`. |
| `tier_credit` | number | Optional | Credit that should be applied to final total for the org. Default: `0`. |
| `in_arrears` | boolean | Optional | Whether billing is charged in arrears (after usage) or upfront. For monthly billing, set to `true` for billing after usage and `false` for upfront billing. If set to `false` you can only set the `per_machine` attribute in `cost_per_month`. For annual billing, `in_arrears` must be set to `false`. Default: `false`. |




**Click to view cost per month attributes**



<!-- prettier-ignore -->
| Name | Type | Required? | Description |
| ---- | ---- | --------- | ----------- |
| `per_machine` | number | Optional | Charge a flat fee per machine. Default: `0`. |
| `binary_data_upload_bytes` | float | Optional | Cost per byte for binary data upload. Default: `0`. |
| `binary_data_egress_bytes` | float | Optional | Cost per byte for binary data download. Default: `0`. |
| `binary_data_cloud_storage_bytes` | float | Optional | Cost per byte per month for binary data stored. Default: `0`. |
| `tabular_data_upload_bytes` | float | Optional | Cost per byte per month for tabular data upload. Default: `0`. |
| `tabular_data_egress_bytes` | float | Optional | Cost per byte per month for tabular data egress. Default: `0`. |
| `tabular_data_cloud_storage_bytes` | float | Optional | Cost per byte per month for tabular data cloud storage. Default: `0`. |
| `history_cloud_storage_bytes` | float | Optional | Cost per byte per month for config history stored. Default: `0`. |
| `logs_cloud_storage_bytes` | float | Optional | Cost per byte per month for logs cloud storage. Default: `0`. |
| `logs_data_upload_bytes` | float | Optional | Cost per byte per month for logs data upload. Default: `0`. |
| `logs_data_egress_bytes` | float | Optional | Cost per byte per month for logs data egress. Default: `0`. |




**Click to view cost per year attributes**



<!-- prettier-ignore -->
| Name | Type | Required? | Description |
| ---- | ---- | --------- | ----------- |
| `per_machine` | number | Optional | Charge a flat fee per machine. Default: `0`. |




## FAQ

### How does reimbursement work for white-labeled billing?

Payments for white-labeled billing go directly to Viam. To arrange reimbursement, [contact us](mailto:support@viam.com).

### Can I customize the billing page further?

If you need further customization, [contact us](mailto:support@viam.com).

### How does renewal work?

Renewal is automatic for upfront annual billing and for upfront monthly billing.
For monthly billing after usage, if there is no usage, there is no charge.
If the `per_machine` field is set, then a machine existing is considered usage.

### When are invoices generated?

- **Monthly billing (`in_arrears: true`)**: Invoices are generated on the first day of the month and customers are charged at the end of each month for the per machine cost and usage during that month.
  For example, if you set up a machine on June 20, you get an invoice on July 1 for 10 days of usage. Then you get the next invoice on August 1 for the usage in July.
- **Monthly billing (`in_arrears: false`)**: Invoices are generated shortly after the billing fragment is added to the machine and customers are charged at the beginning of each new month of usage for the per machine cost.
  For example, if you set up a monthly upfront machine on June 20, you get an invoice shortly after on the same day.
  Then you get the next invoice on July 20, then August 20, and so on.
- **Annual billing (`in_arrears: false`)**: Invoices are generated shortly after the billing fragment is added to the machine and customers are charged at the beginning of each new year of usage for the per machine cost.
  For example, if you set up an annual upfront machine on June 20, you get an invoice shortly after on the same day.
  Then you get the next invoice on June 20 the following year.

### Can customers switch between monthly and annual billing?

Yes. However, switching billing fragments will result in the new charge immediately taking effect.
Wait until the end of the current billing cycle to remove the old billing fragment and assign the new billing fragment.

