---
updatedAt: 2026-03-24T12:14:29.000Z
agentTools:
  projectIndex: https://docs.clover.com/dev/llms.txt
---

# Accept a pre-authorization

Android Payments API

<meta name="description" content="Learn how to use the `PreAuthRequestIntentBuilder` class to create an Intent for initiating a pre-auth payment process, including card entry methods and tokenization settings, with code examples in Kotlin and Java.">

[block:html]
{
  "html": "<div class=\"container-top\">\n  <!-- North America -->\n  <div class=\"container-reg\">\n    <div class=\"pill-reg\">\n      <div class=\"label-reg\">North America</div>\n    </div>\n  </div>\n\n  <!-- Europe -->\n  <div class=\"container-reg\">\n    <div class=\"pill-reg\">\n      <div class=\"label-reg\">Europe</div>\n    </div>\n  </div>\n\n  <!-- Latin America -->\n  <div class=\"container-reg\">\n    <div class=\"pill-reg\">\n      <div class=\"label-reg\">Latin America</div>\n    </div>\n  </div>\n</div>\n\n<!-- CSS moved to global stylesheet-->\n"
}
[/block]

Use the `PreAuthRequestIntentBuilder` class to build an Intent to start an Activity that will guide a user through a pre-auth payment steps. The resulting pre-auth payment needs to be captured with a CapturePreAuth Request. The steps may include payment confirmation and receipt selection. These options can be customized through the merchant settings or by using options that can be configured on the `PreAuthRequestIntentBuilder`.

# Prerequisites

* Read [overview of the Clover platform](https://docs.clover.com/docs/clover-architecture).
* [Create a global developer account](https://sandbox.dev.clover.com/developer-home/create-account) with a default test merchant account.
* Order a [Clover Developer Kit (Dev Kit)](https://cloverdevkit.com/) and [set it up](https://www.clover.com/en-US/help/set-up-hardware).
* [Use the required Android SDK versions](https://docs.clover.com/docs/setting-android-sdk-versions).

# Build a simple pre-auth request

You can build a pre-auth payment request with a few lines of code.

```kotlin Kotlin
val externalPaymentId = "<posPaymentId>" // should be unique for each request
val amount = 5000L
val context = this

val builder = PreAuthRequestIntentBuilder(externalPaymentId, amount)
val intent = builder.build(context)
```
```java Java
Context context = this;
String externalPaymentId = "<posPaymentId>"; // should be unique for each request
Long amount = 5000L;
 
PreAuthRequestIntentBuilder builder = new PreAuthRequestIntentBuilder(externalPaymentId, amount);
Intent intent = builder.build(context);
```

The Intent can then be used to start the activity to process the pre-auth request.

There are a few options that can be set on the builder to provide additional processing instructions:

* [CardOptions](https://docs.clover.com/dev/docs/creating-a-request-to-accept-a-pre-auth-on-clover-android-devices#cardoptions) - settings for supported card entry methods and card confirmations
* [TokenizeOptions](https://docs.clover.com/dev/docs/creating-a-request-to-accept-a-pre-auth-on-clover-android-devices#tokenize-options) - settings for pay+tokenize card for use in e-commerce services

# CardOptions

The `CardOptions` class provides a static method to optionally set the supported card entry methods, options to auto-accept duplicate payment challenges, and a cardNotPresent flag.

| Static Method                                                                                                                                                                                                                                          | Description                                                                                                                                          |
| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Instance(<br>  <span style="white-space: nowrap;">cardEntryMethods : Set<CardEntryMethod>,</span><br>  <span style="white-space: nowrap;"> cardNotPresent : Boolean,</span><br>  <span style="white-space: nowrap;"> autoAcceptDuplicates : Boolean)` | This sets  any of these flags to create a `CardOptions` instance. If null is passed, the default settings for the merchant will be used, optionally. |

## Example—Set the card entry method to Manual only and auto-accept duplicate challenges

```kotlin Kotlin
val builder = PreAuthRequestIntentBuilder("<posPaymentId>", 5000)

builder.cardOptions(
   PreAuthRequestIntentBuilder.CardOptions.Instance(
       CardEntryMethod.Manual(), // manual only
       null, // card not present
       true)) // auto-accept duplicates

val intent = builder.build(context)
```
```java Java
PreAuthRequestIntentBuilder builder = new PreAuthRequestIntentBuilder("<posPaymentId>", 5000);
builder.cardOptions(
     PreAuthRequestIntentBuilder.CardOptions.Instance(
           CardEntryMethod.Manual(), // manual only
           null, // card not present
           true)); // auto-accept duplicates
 
Intent intent = builder.build(context);
```

# Tokenize Options

The `TokenizeOptions` class contains a single property, suppressConfirmation. However, the presence of TokenizeOptions, regardless of the suppressConfirmation value, indicates that a token for the payment card used should be generated. The tokenize option is secondary to the payment, so, a failed tokenization could still result in a successful payment but a failed payment will not result in a successful tokenization.

> 📘 Note
>
> To utilize this feature, you must have core-payments installed in your device. Contact <developer-relations@devrel.clover.com> for further queries.

| Value                                    | Description                                                                                                                                        |
| :--------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Instance(suppressConfirmation:boolean)` | Used to create a TokenizeOptions instance with the confirmation being required or not. By default, confirmation is required and will be requested. |

## Example—Request a payment token with a payment

```kotlin Kotlin
val builder = PreAuthRequestIntentBuilder("<posPaymentId>", 5000)

builder.tokenizeOptions(PreAuthRequestIntentBuilder.TokenizeOptions.Instance(
   false // suppressConfirmation
));

val intent = builder.build(context)
```
```java Java
PreAuthRequestIntentBuilder builder = new PreAuthRequestIntentBuilder("<posPaymentId>", 5000);
builder.tokenizeOptions(PreAuthRequestIntentBuilder.TokenizeOptions.Instance(
            false // suppressConfirmation
    ));
 
Intent intent = builder.build(context);
```

## Additional Fields

You can set additional fields on the `PreAuthRequestIntentBuilder`:

| Field                         | Description                                                                                                                           |
| :---------------------------- | :------------------------------------------------------------------------------------------------------------------------------------ |
| `externalPaymentId: String`   | Custom external payment ID that will be persisted with the transaction.                                                               |
| `amount: Long`                | Total amount paid.                                                                                                                    |
| `externalReferenceId: String` | ID that can be passed to the merchant's gateway, and ultimately appear in settlement records.  This ID translates to 'Invoice Number. |

## Examples—Custom card entry methods

These examples set the card entry methods to manual, swipe, and NFC only.

```kotlin Kotlin
val builder = PreAuthRequestIntentBuilder("<posPaymentId>", 5000)

var cardEntryMethods = setOf<CardEntryMethod>(
   CardEntryMethod.MANUAL,
   CardEntryMethod.MAG_STRIPE, 
   CardEntryMethod.NFC)

var cardOptions = PreAuthRequestIntentBuilder.CardOptions.Instance(
   cardEntryMethods,
   null, // card not present
   null) // auto accept duplicates

builder.cardOptions(cardOptions)

val intent = builder.build(context)
```
```java Java
PreAuthRequestIntentBuilder builder = new PreAuthRequestIntentBuilder("<posPaymentId>", 5000);
 
Set<CardEntryMethod> cardEntryMethods = new HashSet<>();
cardEntryMethods.add(CardEntryMethod.MANUAL);
cardEntryMethods.add(CardEntryMethod.NFC);
PreAuthRequestIntentBuilder.CardOptions cardOptions = PreAuthRequestIntentBuilder.CardOptions.Instance(
            cardEntryMethods,
            null,                   //card not present
            null);                  //auto accept duplicates
builder.cardOptions(cardOptions);
Intent intent = builder.build(context);
```