> This page is for Developer.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bigcommerce.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bigcommerce.com/_mcp/server.

# REST API - Company Settings

Plan: B2B Developer

Lesson 10 of 19 · 30 min

## Roles and Permissions

### GET All Roles

To get a list of all available company roles for your store, run the following request.

**Example Request:**

```http showLineNumbers={false}
GET https://api-b2b.bigcommerce.com/api/v3/io/companies/roles
```

The request will return a list of all the roles available for your store, including predefined and custom roles as the `roleType`. A value of 1 defines the role as a predefined role, and the value of 2 defines the role as a custom role.

> **Info**
>
> `roleLevel` tells you that the role is a store-level role or another specified level. Right now, the only custom roles you can create are at the store level. There might be more levels in future releases of B2B Edition.

### Create a Custom Role

You can use the API to create custom roles when needed with the following request URL.

**Example Request:**

```http showLineNumbers={false}
POST https://api-b2b.bigcommerce.com/api/v3/io/companies/roles
```

The required fields for this request include the following:

* `name` - the role name
* `permissions` - submitted as an array if there are multiple permissions to be assigned to the new custom role
* `code` - the permission code (for each permission submitted)
* `permissionLevel` - this field defines scope of the permission. 1 = user level permission, 2 = company level permission

> **Info**
>
> **Permission Levels**
>
> *User level* permissions allow the buyer to only view or manage records associated with their own user account.
> *Company level* permissions allow the buyer to view or manage all permission-specific records in the account.

To get the information for permission fields, you might need to run a request to get all permissions (discussed later in this lesson).

**Example Body:**

```json showLineNumbers={false}
{
  "name": "Custom test 2",
  "permissions": [
    {
      "code": "get_addresses",
      "permissionLevel": 2
    },
    {
        "code": "get_orders",
        "permissionLevel": 1
    },
    {
        "code": "get_quotes",
        "permissionLevel": 2
    }
  ]
}
```

### GET Company Role Details

This request will return a list of permissions assigned to a specific company role. You will need the `roleId` of a specific role for this request.

**Example Request:**

```http showLineNumbers={false}
GET https://api-b2b.bigcommerce.com/api/v3/io/companies/roles/{roleId}
```

### GET All Permissions

This request will return a list of all company permissions that exist on your storefront. This list is not associated with roles.

**Example Request:**

```http showLineNumbers={false}
GET https://api-b2b.bigcommerce.com/api/v3/io/companies/permissions
```

## Company Credit and Payment Terms

### GET Company Credit

The request URL below will return a list of credit configurations for the company specified in the URL.

**Example Request:**

```http showLineNumbers={false}
GET https://api-b2b.bigcommerce.com/api/v3/io/companies/{company_id}/credit
```

The response will tell you whether credit has been enabled for the company, the credit currency, the company's available credit, if purchases are limited to the available credit, and whether there is a credit hold enabled for the company.

### Updating Company Credit

The request URL below allows you to edit the credit configurations for a company account.

**Example Request:**

```http showLineNumbers={false}
PUT https://api-b2b.bigcommerce.com/api/v3/io/companies/{company_id}/credit
```

There are no required fields for the request body, but there needs to be at least one field of information in order for the request to be successful. If a company does not have credit enabled, other fields cannot be updated.

The request body below is an example of all the possible fields you can update.

**Example Body:**

```json showLineNumbers={false}
{
        "creditEnabled": true,
        "creditCurrency": "USD",
        "availableCredit": 1000.0,
        "limitPurchases": false,
        "creditHold": false
}
```

### GET Company Payment Terms

The request URL below will return a list of the payment term configurations for a company account.

**Example Request:**

```http showLineNumbers={false}
GET https://api-b2b.bigcommerce.com/api/v3/io/companies/{companyId}/payment-terms
```

The response will tell you if payment terms have been enabled for the company account and how many days the company will have to pay an invoice. If payment terms are disabled for a company account, the `paymentTerms` field will show the store default payment terms.

### Update Company Payment Terms

The request URL below allows you to change a company's payment terms.

**Example Request:**

```http showLineNumbers={false}
PUT https://api-b2b.bigcommerce.com/api/v3/io/companies/{companyId}/payment-terms
```

There are only two fields for this request body: `isEnabled` tells you if payment terms are enabled for the specified company account, and `paymentTerms` is how many days a company has to pay an invoice.

**Example Body:**

```json showLineNumbers={false}
{
  "isEnabled": true,
  "paymentTerms": 30
}
```

## Resources

* [Company Roles and Permissions](/developer/api-reference/rest/b2b/management/company/company-roles-and-permissions)
* [Get Company Credit](/developer/api-reference/rest/b2b/management/payment/get-companies-company-id-credit)
* [Update Company Credit](/developer/api-reference/rest/b2b/management/payment/put-companies-company-id-credit)
* [Get Company Payment Terms](/developer/api-reference/rest/b2b/management/payment/get-companies-company-id-payment-terms)
* [Update Company Payment Terms](/developer/api-reference/rest/b2b/management/payment/put-companies-company-id-payment-terms)