> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streamlinedpayments.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Customer groups

> Group a business's locations so one HQ can get the invoices, pay for everyone, and see one statement.

Many B2B customers buy from several locations but pay from one HQ. In Streamlined, each location is its own customer, and a customer group ties them together so the HQ can get the invoices, pay for every location, and receive one statement.

## How groups work

A customer group is a named set of your customers. A customer is in one group or none. Each member keeps its own invoices, addresses, and balance, and the group adds settings that apply to all of them:

| Group setting | What it does |
| - | - |
| Billing address | Where new invoices for every member are addressed. |
| Billing account | The member whose saved card or bank account pays for everyone (centralized billing). |
| Email delivery | On Enterprise, where each kind of email goes for every member. See [Who gets which email](https://docs.streamlinedpayments.com/guides/who-gets-which-email.md). |
| Net terms | Copied onto every member in the group when you save them. Members added later keep their own terms. |

A group also gives you the group's totals: open balance, invoice count, aging across every member, and a group statement for the HQ.

A Shopify B2B company is a customer group in Streamlined, and each of its contacts is a member customer.

## Create a group and add members

1. Create the group with [Create customer group](https://docs.streamlinedpayments.com/api-reference/customer-groups/create-customer-group.md):

   ```bash theme={null}
   curl https://api.staging.streamlinedpayments.com/api/v1/customer_groups \
     -X POST \
     -H "X-App-Id: $STREAMLINED_APP_ID" \
     -H "X-Api-Key: $STREAMLINED_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{ "customer_group": { "company_name": "Northwind Traders" } }'
   ```

2. Add the locations with [Add members to group](https://docs.streamlinedpayments.com/api-reference/customer-groups/add-members-to-group.md), using the `uuid` from the response:

   ```bash theme={null}
   curl https://api.staging.streamlinedpayments.com/api/v1/customer_groups/5a7d2e90-1c3b-4f6a-8e2d-9b0c4d7e1f23/members \
     -X POST \
     -H "X-App-Id: $STREAMLINED_APP_ID" \
     -H "X-Api-Key: $STREAMLINED_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{
       "customer_uuids": [
         "c1f0a92b-4d63-4e88-b0a7-2f9e4c6d1b35",
         "e4b7c2d1-8f3a-4a6e-9c0b-2d5f7a1e3b84"
       ]
     }'
   ```

   Adding only touches the customers you name. A customer already in another group moves to this one. To take customers out, call [Remove members from group](https://docs.streamlinedpayments.com/api-reference/customer-groups/remove-members-from-group.md).

3. Set the group's net terms with [Update customer group](https://docs.streamlinedpayments.com/api-reference/customer-groups/update-customer-group.md). Do this after adding members: saving terms copies them onto the members in the group at that moment.

   ```bash theme={null}
   curl https://api.staging.streamlinedpayments.com/api/v1/customer_groups/5a7d2e90-1c3b-4f6a-8e2d-9b0c4d7e1f23 \
     -X PUT \
     -H "X-App-Id: $STREAMLINED_APP_ID" \
     -H "X-Api-Key: $STREAMLINED_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{ "customer_group": { "net_terms": 30 } }'
   ```

4. In the Streamlined app, open the group and set its billing address and, if the HQ pays for everyone, its billing account.

## Which address an invoice uses

When you issue an invoice, Streamlined addresses it to the first of these that's set:

1. The customer's group's billing address.
2. The customer's preferred billing address, set with [Set address as default billing](https://docs.streamlinedpayments.com/api-reference/customer-addresses/set-address-as-default-billing.md).
3. The customer's first address, if it has no preferred billing address.

So for a customer in a group, the group's billing address wins over the customer's own. Every invoice keeps a copy of the address it was issued to, so changing an address later doesn't change what's printed on invoices you've already issued.

## Centralized billing

The billing account is one of the group's members, usually the HQ. When a member's invoice is paid at checkout or charged through QuickPay, Streamlined uses the billing account's saved card or bank account instead of the member's own. Centralized billing is available on Scale and up.

The billing account decides who pays. It doesn't change where invoices are addressed or who gets the emails: those come from the billing address and email delivery settings.

One payment from the HQ can cover invoices across every member of the group, and credit on one member's invoice can be applied to another member's invoice.

## Find a customer's group

[Get customer details](https://docs.streamlinedpayments.com/api-reference/customers/get-customer-details.md) returns the customer's `customer_group`. To filter invoices or transactions to a whole group, pass `customer_group_uuid` to [List invoices](https://docs.streamlinedpayments.com/api-reference/invoices/list-invoices.md) or [List transactions](https://docs.streamlinedpayments.com/api-reference/transactions/list-transactions.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.