# Update or create billing

```
PUT 
https://api.freemius.com/v1/products/{product_id}/users/{user_id}/billing.json
```

#### Auth:Bearer TokenSCOPE: <!-- -->PRODUCT

Product-scoped API tokens allow you to operate on the product itself. This token usually allows read-only access to the product configuration and write access to several operations on subscriptions, customers, payments, and more. For most SaaS or app integrations, this is the token you will need.

1. Go to the [Freemius Developer Dashboard](https://dashboard.freemius.com/).
2. Open the Settings page of the relevant product.
3. Click the API & Keys tab.
4. Copy the API Bearer Authorization Token from the UI.

***

Update or create the billing information for a user.

## Request[​](#request "Direct link to request")

### Path Parameters

* **product\_id**
  <!-- -->
  integer\<int64>[](#param-property-users-update-or-create-billing-param-path-product-id "Direct link to product_id")required

  The ID of the product.

  **Possible values:** `>= 1`

  **Example:<!-- -->&#x20;**`1234`

  **user\_id**
  <!-- -->
  integer\<int64>[](#param-property-users-update-or-create-billing-param-path-user-id "Direct link to user_id")required

  The ID of the User.

  **Possible values:** `>= 1`

  **Example:<!-- -->&#x20;**`1234`

application/json

### Body**required**

* **business\_name**string[](#schema-property-users-update-or-create-billing-request-body-business-name-string "Direct link to business_name")

  The name of the business.

  **Example:<!-- -->&#x20;**`Freemius, Inc.`

  **first**string[](#schema-property-users-update-or-create-billing-request-body-first-string "Direct link to first")

  The first name used in the billing.

  **Example:<!-- -->&#x20;**`John`

  **last**string[](#schema-property-users-update-or-create-billing-request-body-last-string "Direct link to last")

  The last name used in the billing.

  **Example:<!-- -->&#x20;**`Doe`

  **email**string[](#schema-property-users-update-or-create-billing-request-body-email-string "Direct link to email")

  The email used in the billing.

  **Example:<!-- -->&#x20;**`foo@freemius.com`

  **phone**string[](#schema-property-users-update-or-create-billing-request-body-phone-string "Direct link to phone")

  The phone number used in the billing.

  **Example:<!-- -->&#x20;**`555-555-5555`

  **website**string[](#schema-property-users-update-or-create-billing-request-body-website-string "Direct link to website")

  The website used in the billing.

  **Example:<!-- -->&#x20;**`https://freemius.com`

  **tax\_id**string[](#schema-property-users-update-or-create-billing-request-body-tax-id-string "Direct link to tax_id")

  The business VAT number (EU or UK territories) or other tax ID (for example Sales Tax ID for the US).

  **Example:<!-- -->&#x20;**`GB123456789`

  **address\_street**string[](#schema-property-users-update-or-create-billing-request-body-address-street-string "Direct link to address_street")

  The street address used in the billing.

  **Example:<!-- -->&#x20;**`21st Jump Street`

  **address\_apt**string[](#schema-property-users-update-or-create-billing-request-body-address-apt-string "Direct link to address_apt")

  The street address 2 used in the billing.

  **Example:<!-- -->&#x20;**`Block II`

  **address\_city**string[](#schema-property-users-update-or-create-billing-request-body-address-city-string "Direct link to address_city")

  The city used in the billing.

  **Example:<!-- -->&#x20;**`Atlanta`

  **address\_country**string[](#schema-property-users-update-or-create-billing-request-body-address-country-string "Direct link to address_country")

  The country used in the billing.

  **Example:<!-- -->&#x20;**`United States`

  **address\_country\_code**string[](#schema-property-users-update-or-create-billing-request-body-address-country-code-string "Direct link to address_country_code")

  The [ISO 3166-1 alpha 2](http://www.wikiwand.com/en/ISO_3166-1_alpha-2) two-letter country code associated with the entity.

  **Example:<!-- -->&#x20;**`us`

  **address\_state**string[](#schema-property-users-update-or-create-billing-request-body-address-state-string "Direct link to address_state")

  The state of the location.

  **Example:<!-- -->&#x20;**`New York`

  **address\_zip**string[](#schema-property-users-update-or-create-billing-request-body-address-zip-string "Direct link to address_zip")

  ZIP or postal code.

  **Example:<!-- -->&#x20;**`00001`

## Responses[​](#responses "Direct link to Responses")

* 200
* 401
* 402
* 404

Billing information updated.

application/json

**Schema**

**id**string\<int64>[](#schema-property-users-update-or-create-billing-response-schema-id-string-int64 "Direct link to id")

The unique identifier of the entity.

**Possible values:** `>= 1`

**Example:<!-- -->&#x20;**`123456`

**created**string\<date-time>[](#schema-property-users-update-or-create-billing-response-schema-created-string-date-time "Direct link to created")

The date and time the entity was created, under UTC timezone.

**Example:<!-- -->&#x20;**`2025-01-01 00:00:00`

**updated**string\<date-time>[](#schema-property-users-update-or-create-billing-response-schema-updated-string-date-time "Direct link to updated")nullable

The date and time the entity was updated, under UTC timezone. If `null` then the entity was never updated since its creation.

**Example:<!-- -->&#x20;**`2025-01-01 00:00:00`

**business\_name**string[](#schema-property-users-update-or-create-billing-response-schema-business-name-string "Direct link to business_name")

The name of the business.

**Example:<!-- -->&#x20;**`Freemius, Inc.`

**first**string[](#schema-property-users-update-or-create-billing-response-schema-first-string "Direct link to first")

The first name used in the billing.

**Example:<!-- -->&#x20;**`John`

**last**string[](#schema-property-users-update-or-create-billing-response-schema-last-string "Direct link to last")

The last name used in the billing.

**Example:<!-- -->&#x20;**`Doe`

**email**string[](#schema-property-users-update-or-create-billing-response-schema-email-string "Direct link to email")

The email used in the billing.

**Example:<!-- -->&#x20;**`foo@freemius.com`

**phone**string[](#schema-property-users-update-or-create-billing-response-schema-phone-string "Direct link to phone")

The phone number used in the billing.

**Example:<!-- -->&#x20;**`555-555-5555`

**website**string[](#schema-property-users-update-or-create-billing-response-schema-website-string "Direct link to website")

The website used in the billing.

**Example:<!-- -->&#x20;**`https://freemius.com`

**tax\_id**string[](#schema-property-users-update-or-create-billing-response-schema-tax-id-string "Direct link to tax_id")

The business VAT number (EU or UK territories) or other tax ID (for example Sales Tax ID for the US).

**Example:<!-- -->&#x20;**`GB123456789`

**address\_street**string[](#schema-property-users-update-or-create-billing-response-schema-address-street-string "Direct link to address_street")

The street address used in the billing.

**Example:<!-- -->&#x20;**`21st Jump Street`

**address\_apt**string[](#schema-property-users-update-or-create-billing-response-schema-address-apt-string "Direct link to address_apt")

The street address 2 used in the billing.

**Example:<!-- -->&#x20;**`Block II`

**address\_city**string[](#schema-property-users-update-or-create-billing-response-schema-address-city-string "Direct link to address_city")

The city used in the billing.

**Example:<!-- -->&#x20;**`Atlanta`

**address\_country**string[](#schema-property-users-update-or-create-billing-response-schema-address-country-string "Direct link to address_country")

The country used in the billing.

**Example:<!-- -->&#x20;**`United States`

**address\_country\_code**string[](#schema-property-users-update-or-create-billing-response-schema-address-country-code-string "Direct link to address_country_code")

The [ISO 3166-1 alpha 2](http://www.wikiwand.com/en/ISO_3166-1_alpha-2) two-letter country code associated with the entity.

**Example:<!-- -->&#x20;**`us`

**address\_state**string[](#schema-property-users-update-or-create-billing-response-schema-address-state-string "Direct link to address_state")

The state of the location.

**Example:<!-- -->&#x20;**`New York`

**address\_zip**string[](#schema-property-users-update-or-create-billing-response-schema-address-zip-string "Direct link to address_zip")

ZIP or postal code.

**Example:<!-- -->&#x20;**`00001`

Unauthorized access error. The request requires [authentication](https://freemius.com/help/api/#bearer-token-authentication) but was not provided or the provided authentication does not satisfy the required permissions.

application/json

**Schema**

**path**string[](#schema-property-users-update-or-create-billing-response-schema-path-string "Direct link to path")

The API request path.

**Example:<!-- -->&#x20;**`:/products/product_id/users.json`

**error** <!-- -->object

This object contains the error details.

**type**string[](#schema-property-users-update-or-create-billing-response-schema-type-string "Direct link to type")

The type of the error encountered by the server.

**Example:<!-- -->&#x20;**`UnauthorizedAccess`

**message**string[](#schema-property-users-update-or-create-billing-response-schema-message-string "Direct link to message")

The descriptive error message.

**Example:<!-- -->&#x20;**`Some error has occured.`

**code**string[](#schema-property-users-update-or-create-billing-response-schema-code-string "Direct link to code")

The error code.

**Example:<!-- -->&#x20;**`unauthorized_access`

**http**integer[](#schema-property-users-update-or-create-billing-response-schema-http-integer "Direct link to http")

The HTTP status code returned by the server.

**Example:<!-- -->&#x20;**`401`

**timestamp**string[](#schema-property-users-update-or-create-billing-response-schema-timestamp-string "Direct link to timestamp")

Current timestamp.

**Example:<!-- -->&#x20;**`Thu, 11 May 2023 11:45:30 +0000`

**request** <!-- -->object

This object sends back the request payload as received by the server (both from path and from body or query).

**property name\***&#x61;ny[](#schema-property-users-update-or-create-billing-response-schema-property-name-any "Direct link to property name*")

This object sends back the request payload as received by the server (both from path and from body or query).

**Example:<!-- -->&#x20;**`{"beautify":true,"format":"json"}`

The request is missing the specified argument.

application/json

**Schema**

**path**string[](#schema-property-users-update-or-create-billing-response-schema-path-string "Direct link to path")

The API request path.

**Example:<!-- -->&#x20;**`:/products/product_id/users.json`

**error** <!-- -->object

This object contains the error details.

**type**string[](#schema-property-users-update-or-create-billing-response-schema-type-string "Direct link to type")

The type of the error encountered by the server.

**Example:<!-- -->&#x20;**`UnauthorizedAccess`

**message**string[](#schema-property-users-update-or-create-billing-response-schema-message-string "Direct link to message")

The descriptive error message.

**Example:<!-- -->&#x20;**`Some error has occured.`

**code**string[](#schema-property-users-update-or-create-billing-response-schema-code-string "Direct link to code")

The error code.

**Example:<!-- -->&#x20;**`unauthorized_access`

**http**integer[](#schema-property-users-update-or-create-billing-response-schema-http-integer "Direct link to http")

The HTTP status code returned by the server.

**Example:<!-- -->&#x20;**`401`

**timestamp**string[](#schema-property-users-update-or-create-billing-response-schema-timestamp-string "Direct link to timestamp")

Current timestamp.

**Example:<!-- -->&#x20;**`Thu, 11 May 2023 11:45:30 +0000`

**request** <!-- -->object

This object sends back the request payload as received by the server (both from path and from body or query).

**property name\***&#x61;ny[](#schema-property-users-update-or-create-billing-response-schema-property-name-any "Direct link to property name*")

This object sends back the request payload as received by the server (both from path and from body or query).

**Example:<!-- -->&#x20;**`{"beautify":true,"format":"json"}`

The requested resource was not found.

application/json

**Schema**

**path**string[](#schema-property-users-update-or-create-billing-response-schema-path-string "Direct link to path")

The API request path.

**Example:<!-- -->&#x20;**`:/products/product_id/users.json`

**error** <!-- -->object

This object contains the error details.

**type**string[](#schema-property-users-update-or-create-billing-response-schema-type-string "Direct link to type")

The type of the error encountered by the server.

**Example:<!-- -->&#x20;**`UnauthorizedAccess`

**message**string[](#schema-property-users-update-or-create-billing-response-schema-message-string "Direct link to message")

The descriptive error message.

**Example:<!-- -->&#x20;**`Some error has occured.`

**code**string[](#schema-property-users-update-or-create-billing-response-schema-code-string "Direct link to code")

The error code.

**Example:<!-- -->&#x20;**`unauthorized_access`

**http**integer[](#schema-property-users-update-or-create-billing-response-schema-http-integer "Direct link to http")

The HTTP status code returned by the server.

**Example:<!-- -->&#x20;**`401`

**timestamp**string[](#schema-property-users-update-or-create-billing-response-schema-timestamp-string "Direct link to timestamp")

Current timestamp.

**Example:<!-- -->&#x20;**`Thu, 11 May 2023 11:45:30 +0000`

**request** <!-- -->object

This object sends back the request payload as received by the server (both from path and from body or query).

**property name\***&#x61;ny[](#schema-property-users-update-or-create-billing-response-schema-property-name-any "Direct link to property name*")

This object sends back the request payload as received by the server (both from path and from body or query).

**Example:<!-- -->&#x20;**`{"beautify":true,"format":"json"}`
