# Customers
source: https://developer.mastercard.com/open-finance-au/documentation/access-and-config/customers/index.md

## Customer Records {#customer-records}

In order for you to use Open Finance with your customers, you will need to create customer records. These records allow you to view customers' account information and other types of data from the Financial Institutions (FIs) that they connect. When a customer logs into their bank and permissions their accounts, the financial data is associated with their `customerId`. If you delete the `customerId` field, the link to their account gets deleted as well.

Customer records always have a category of `INDIVIDUAL` or `BUSINESS` which indicates whether the service will be provided to the customer as an individual or a business entity. The category of customer record can be specified on creation using the `category` parameter and otherwise defaults to `INDIVIDUAL`. The customer category affects which other fields are required to create the customer record.

For customers of category `BUSINESS` and partners using a [Business Consumer Disclosure Consent (BCDC) model](https://developer.mastercard.com/open-finance-au/documentation/access-and-config/access-models/index.md#cdr-access-models) the `abn` field parameter is mandatory. This field must contain the Australian Business Number for the business. The ABN is validated against the Australian Business Register and must be valid and active to create a customer record or to generate a Connect URL. An invalid or inactive ABN results in an error. The ABN is not validated for customers using an Outsourced Service Provider (OSP) or CDR representative model.
Warning: Partners using the BCDC model who are unaccredited are not permitted to create customers of type `INDIVIDUAL`. You **must** set the customer `category` to `BUSINESS` when creating a customer record. Note: In the Sandbox environment, test customers only require a `username` to create. The `applicationId`, `abn`, and other fields required for active customers in Production do not apply to test customer records. Tip: The `username` parameter used when creating a customer record must be unique, and consist of between 6 and 255 characters in any mix of the following:

* Upper case, lower case, or numeric characters
* The following non-alphanumeric special characters: `! @ . # $ % & * _ - +`

Use of other special characters (such as `í` or `ü`) may result in an error.

We recommend avoiding the use of email addresses for usernames.

## Test Customers {#test-customers}

Create a customer record to use with our mocked Financial Institution, FinBank. Note, you may have already completed this step if you followed the [Quick Start Guide](https://developer.mastercard.com/open-finance-au/documentation/quick-start-guide/index.md).

API Reference: `POST /aggregation/v2/customers/testing`

```sh
curl --location --request POST 'https://api.openbanking.mastercard.com.au/aggregation/v2/customers/testing' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'App-Key: {{appKey}}' \
--header 'App-Token: {{appToken}}' \
--data-raw '{
    "username": "{{username}}",
    "firstName": "{{firstName}}",
    "lastName": "{{lastName}}",
    "phone": "{{phone}}",
    "email": "{{email}}"
}'
```

* Expected response:

```json
{
  "id": "{{customerId}}",
  "username": "{{username}}",
  "createdDate": 1607450357
}
```

## Active Customers {#active-customers}

Upgraded paid accounts can also add active customers to use at live FIs. Creating customers requires [registering applications](https://developer.mastercard.com/open-finance-au/documentation/access-and-config/applications/index.md) in order to access live data. You can use either active or testing customers with the Finbank [test profiles](https://developer.mastercard.com/open-finance-au/documentation/integration-and-testing/test-the-apis/index.md).

###### Creating an Active Customer {#creating-an-active-customer}


API Reference: `POST /aggregation/v2/customers/active`

```sh
curl --location --request POST 'https://api.openbanking.mastercard.com.au/aggregation/v2/customers/active' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'App-Key: {{appKey}}' \
--header 'App-Token: {{appToken}}' \
--data-raw '{
  "username": "{{username}}",
  "firstName": "{{firstname}}",
  "lastName": "{{lastname}}",
  "phone": "{{phone}}",
  "email": "{{email}}",
  "applicationId": "{{applicationId}}"
}'
```

* Expected response:

```json
{
 "id": "1035061235",
 "username": "{{username}}",
 "createdDate": 1607450357
}
```

###### Operations for Retrieving and Managing Active Customers {#operations-for-retrieving-and-managing-active-customers}


API Reference: `GET /aggregation/v1/customers/{customerId}`


API Reference: `GET /aggregation/v1/customers`

## Next Steps {#next-steps}

* To learn more about applications and how you can register an application, refer to the [Applications](https://developer.mastercard.com/open-finance-au/documentation/access-and-config/applications/index.md).
* If you wish to use any of the reporting products, you will need to create a consumer. Refer to [Consumers](https://developer.mastercard.com/open-finance-au/documentation/access-and-config/consumers/index.md).
* To learn more about Consent, which allows you to access your customer's accounts, refer to [Consent](https://developer.mastercard.com/open-finance-au/documentation/consent/index.md).
* To learn more about Connect, which enables your customers to connect their bank accounts and grant consent, refer to [Connect Application](https://developer.mastercard.com/open-finance-au/documentation/connect/index.md).
* For the full list of testing profiles available, refer to [Test Profiles](https://developer.mastercard.com/open-finance-au/documentation/integration-and-testing/test-the-apis/index.md).
