# Factory classes

Use the Samsung and Google factory classes to create `ResellerService` objects.
With `ResellerService` objects, a common set of [methods](https://developers.google.com/zero-touch/reseller-library/reference/methods)
is available to claim and enroll Samsung and other Android devices.

## SamsungResellerServiceFactory

Before you can use the `SamsungResellerServiceFactory` class to generate a
`ResellerService` object, you need to [onboard with KDP](https://developers.google.com/zero-touch/guides/reseller-library/get-started#knox_deployment_program).
Below is the method signature for creating a `ResellerService` object using the
`SamsungResellerServiceFactory` class:

    public static ResellerService createResellerService(String resellerId, String serviceAccountKeyFilePath, String clientIdentifier) throws CommonException;

### Input parameters

| Property name | Value | Required | Description |
|---|---|---|---|
| `resellerId` | `string` | Yes | Reseller's unique identifier, provided by the KDP system. |
| `serviceAccountKeyFilePath` | `string` | Yes | File path to the service account key. |
| `clientIdentifier` | `string` | Yes | Client identifier provided by the KDP system. |

### Error behavior

When an error occurs, the library throws a
[`CommonException`](https://developers.google.com/zero-touch/reseller-library/reference/objects#commonexception)
containing one of the following error codes:

| Error code |
|---|
| `INVALID_RESELLER_ID` |
| `AUTHORIZATION_FAIL` |

## GoogleResellerServiceFactory

Before you can use the `GoogleResellerServiceFactory` class to generate a
`ResellerService` object, you must [onboard to zero-touch enrollment](https://developers.google.com/zero-touch/guides/reseller-library/get-started#zero-touch_enrollment)
as a reseller.

Here's the method signature for creating a `ResellerService` object using the
`GoogleResellerServiceFactory` class:

    public static ResellerService createResellerService(long resellerId, String serviceAccountKeyFilePath) throws CommonException, InterruptedException;

### Input parameters

| Property name | Value | Required | Description |
|---|---|---|---|
| `resellerId` | `long` | Yes | Reseller's unique identifier, provided by the zero-touch system. |
| `serviceAccountKeyFilePath` | `string` | Yes | File path to the service account key. |

### Error behavior

When an error occurs, the library throws a
[`CommonException`](https://developers.google.com/zero-touch/reseller-library/reference/objects#commonexception)
containing one of the following error codes:

| Error code |
|---|
| `INVALID_PARAM_DEFAULT` |
| `INVALID_RESELLER_ID` |
| `INTERNAL_SERVER_ERROR` |