# How it works

The Common Android Reseller Library is a Java library that interacts with the Samsung
Knox APIs and the zero-touch [Reseller API](https://developers.google.com/zero-touch/guides/how-it-works) to
provide a single integration for Samsung's [Knox Deployment Program](https://www.samsungknox.com/en/knox-deployment-program)
(KDP) and Google's zero-touch enrollment services.

[KDP](https://www.samsungknox.com/en/knox-deployment-program) enables trusted
device resellers to verify Samsung devices for their enterprise customers using
[Knox Mobile Enrollment](https://www.samsungknox.com/en/solutions/it-solutions/knox-mobile-enrollment)
(KME). Similarly, zero-touch enrollment allows enterprise customers to verify and
configure [other Android devices](https://developers.google.com/zero-touch/resources/manufacturer-names)
purchased from authorized device resellers.
![](https://developers.google.com/static/zero-touch/images/how-it-works.svg) Enroll Samsung and other Android devices through a single integration.

The reseller library contains [two factory classes](https://developers.google.com/zero-touch/reseller-library/reference/factory-classes)---one
for each enrollment service. These factory classes accept service account
keys generated from Samsung's Knox Cloud API portal and Google's API Console to
authorize calls to Knox and zero-touch reseller APIs (for more details, see [Get started](https://developers.google.com/zero-touch/guides/reseller-library/get-started)).
You use these factory classes to [create `ResellerService` objects](https://developers.google.com/zero-touch/guides/reseller-library/common-operations#create_resellerservice_objects).

A [common set of methods](https://developers.google.com/zero-touch/reseller-library/reference/methods) is
available to `ResellerService` objects that allow resellers to perform tasks
such as assigning and unassigning devices to and from customers.

After a reseller uses the library to assign devices to an enterprise customer,
the customer can use the KME portal to create and apply configs for Samsung
devices, and the zero-touch enrollment portal to create and apply configs for
other Android devices.

## Who it's for

The Common Android Reseller Library is intended for device resellers that haven't
integrated with either zero-touch enrollment or [KDP](https://www.samsungknox.com/en/knox-deployment-program).

- Resellers already integrated with zero-touch enrollment should integrate with [KDP](https://www.samsungknox.com/en/knox-deployment-program) separately to manage Samsung devices.
- Resellers already integrated with [KDP](https://www.samsungknox.com/en/knox-deployment-program) should use zero-touch's [Reseller API](https://developers.google.com/zero-touch/guides/how-it-works) to manage non-Samsung devices.

*** ** * ** ***

## Example workflow

Below is an example workflow of how a reseller might use the client library
to manage [KDP](https://www.samsungknox.com/en/knox-deployment-program) and
zero-touch device enrollments. Code samples for performing basic tasks are
available in [Get started](https://developers.google.com/zero-touch/guides/reseller-library/get-started)
and [Common operations](https://developers.google.com/zero-touch/guides/reseller-library/common-operations).

### Receive purchase order

![](https://developers.google.com/static/zero-touch/images/workflow-1.svg)

1. An enterprise customer sends you a purchase order. The purchase order contains Samsung and [other Android devices](https://developers.google.com/zero-touch/resources/manufacturer-names).

### Create customer IDs

![](https://developers.google.com/static/zero-touch/images/workflow-2.svg)

2. If this is a new customer, use the library to:
   1. Create the customer's [zero-touch account](https://developers.google.com/zero-touch/guides/reseller-library/common-operations#other_android_devices_2).
   2. Create the customer's [Samsung Knox Customer ID](https://developers.google.com/zero-touch/guides/reseller-library/common-operations#samsung_devices_2).
3. If this is an existing customer (the customer already has zero-touch enrollment and Samsung Knox Customer IDs), then continue to Step 4.

### Assign devices

![](https://developers.google.com/static/zero-touch/images/workflow-3.svg)

4. Use the reseller library to [assign
   devices to the customer](https://developers.google.com/zero-touch/guides/reseller-library/common-operations#claim_a_batch_of_devices), based on the customer's purchase order.

### Create and apply device configs

![](https://developers.google.com/static/zero-touch/images/workflow-4.svg)

5. Customers can now create configs and apply them to their devices.
   1. Samsung devices: customers use the [Knox Mobile Enrollment](https://docs.samsungknox.com/KME-Getting-Started/Content/about-kme.htm#h2_3) (KME) portal to create configs and apply them to the Samsung devices they were assigned in Step 4.
   2. Other Android devices: customers use the [Zero-touch portal](https://support.google.com/work/android/answer/7514005#devices) to create configs and apply them to the non-Samsung devices they were assigned in Step 4. If the customer's EMM supports provisioning zero-touch enrollment devices, they can also complete these tasks in their EMM console.

*** ** * ** ***

**Next steps:** [Get started](https://developers.google.com/zero-touch/guides/reseller-library/get-started)