# Public Classes

There are mainly 2 classes used by the ReferralHero SDK  as the Kotlin Data classes for storing and accessing various related properties efficiently, allowing the SDK to easily manage and structure large sets of data.

Also, it is much easier for the developers integrating our SDK to understand data being returned or passed as part of the various methods or callbacks, making the whole integration process simple.

1. **ReferralParams**
2. **SubscriberData**

### 1. ReferralParams

This class provides various methods to set several user referral details like name, email, device, etc. This class is used mainly to pass referral details data to the SDK while accessing its public method or while updating the user information.

{% tabs %}
{% tab title="Java" %}
ReferralParams setter method for Java

| **Method**                           | **Description**                                                                       |
| ------------------------------------ | ------------------------------------------------------------------------------------- |
| setTransactionId(String value)       | The unique ID of the transaction. Useful for tracking referrals for purchases.        |
| setConversionCategory(String value)  | The type of referral. Useful for creating reports.                                    |
| settConversionValue(Int value)       | The monetary value of the referral.                                                   |
| setDevice(String value)              | The device used by the subscriber to sign up. Used for analytics.                     |
| setEmail(String value)               | The email of the subscriber.                                                          |
| setDomain(String value)              | The URL for the referral link.                                                        |
| setName(String value)                | The name of the subscriber.                                                           |
| setReferrer(String value)            | Set a referrer for the subscriber by providing the referrer's referral code or email. |
| setUuid(String value)                | The list UUID.                                                                        |
| setOsType(String value)              | The os type of device used by the subscriber.                                         |
| setSource(String value)              | The source of the subscriber. Used for analytics.                                     |
| setCryptoWalletAddress(String value) | The crypto wallet address                                                             |
| setExtraField(String value)          | The extra field of the subscriber.                                                    |
| setExtraField2(String value)         | The extra field 2 of the subscriber.                                                  |
| setIpAddress(String value)           | The ip address of the device used by the subscriber.                                  |
| setPoints(Int value)                 | The number of points for the subscriber. Only applicable for "contest" campaigns.     |
| setPhoneNumber(String value)         | The Phone Number of subscriber                                                        |
| setScreenSize(String value)          | The screen size of the device used by the subscriber.                                 |
| setSubscriber\_id(String value)      | Set Subscriber ID                                                                     |
| setSocial(String value)              | Social shares like facebook,instagram,email,whatsapp etc..                            |
| setDoubleOptIn(boolean value)        | If set to false, the subscriber will not receive a confirmation email.                |
| {% endtab %}                         |                                                                                       |

{% tab title="Kotlin" %}
ReferralParams Kotlin Code:

```kotlin
class ReferralParams {
   var transactionId: String? = null
   var conversionCategory: String? = null
   var conversionValue: Int? = null
   var device: String? = null
   var source: String? = null
   var doubleOptIn: Boolean? = null
   var points: Int? = null
   var referrer: String? = null
   var extraField2: String? = null
   var extraField: String? = null
   var name: String? = null
   var uuid: String? = null
   var subscriber_id: String? = null
   var email: String? = null
   var domain: String? = null
   var phoneNumber: String? = null
   var cryptoWalletAddress: String? = null
   var ipAddress: String? = null
   var osType: String? = null
   var screenSize: String? = null
   var social: String? = null

}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
NOTE:

The parameters need to be sent in the correct order for our system to automatically generate a referral.
{% endhint %}

### 2. Subscriber Data

This class contains various member variables, each specifying some Subscriber related data.

{% tabs %}
{% tab title="Kotlin" %}
Here is subscriber Data Class Code in Kotlin

```kotlin
data class SubscriberData(
   val id: String?,
   val name: String?,
   val email: String?,
   val phone_number: String?,
   val crypto_wallet_address: String?,
   val crypto_wallet_provider: String?,
   val extra_field: String?,
   val extra_field_2: String?,
   val option_field: String?,
   val conversion_amount: Double?,
   val code: String?,
   val position: Int?,
   val referred: Boolean?,
   val referred_by: ReferredBy?,
   val people_referred: Int?,
   val promoted: Boolean?,
   val promoted_at: Long?,
   val verified: Boolean?,
   val verified_at: Long?,
   val points: Int?,
   val risk_level: Int?,
   val host: String?,
   val source: String?,
   val device: String?,
   val referral_link: String?,
   val status: String?,
   val universal_link: String?,
   val created_at: Long,
   val last_updated_at: Long?,
   val response: String?
)

data class ReferredBy(
   val id: String?,
   val name: String?,
   val email: String?,
   val phone_number: String?,
   val people_referred: Int?,
   val points: Int?,
)
```

{% endtab %}
{% endtabs %}

### 3. List Subscriber Data

This class contains various member variables, each specifying some Subscriber related data.<br>

{% tabs %}
{% tab title="Kotlin" %}
Here is subscriber Data Class Code in Kotlin

```kotlin
data class ListSubscriberData(
   val response: String,
   val subscribers: List<SubscriberData> = emptyList(),
   val rewards: List<Reward> = emptyList(),
   val pagination: Pagination
)

data class Reward(
   val id: Long,
   val name: String,
   val status: String,
   val image_url: String?,
   val referrals: Any?,
   val createdAt: Long,
   val signupType: String,
   val referralsType: Any?,
   val recurringCount: Any?,
)

data class Pagination(
   val total_pages: Int, val current_page: Int, val per_page: Int, val total_objects: Int
)
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.referralhero.com/integrate/mobile-sdks/android-sdk/public-classes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
