> This page is for Afterpay Online Developer, version Main (default).
> For other versions, use one of these documentation indexes:
> - Main (default): https://developers.afterpay.com/afterpay-online-developer/main/llms.txt
> - v1: https://developers.afterpay.com/afterpay-online-developer/v-1/llms.txt
> - Chinese: https://developers.afterpay.com/afterpay-online-developer/chinese/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.afterpay.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.afterpay.com/_mcp/server.

# Checkout V1 (Deprecated) on Android

> **Deprecated**
>
> Checkout V1 is deprecated. Use [Checkout V2](/afterpay-online-developer/guides/sdk/android-sdk/implementation-guide) for new integrations. Checkout V2 supports standard and express checkout, and it shows a loading screen while your app gets the checkout token. Checkout V1 supports standard checkout only. The SDK still includes it, so existing integrations keep working.

With Checkout V1, your server creates a checkout and returns its redirect URL to your app. The SDK loads the URL in a web view inside your app and watches for checkout to redirect to your confirm or cancel URL. The customer never leaves your app. When the customer confirms, the SDK returns the order token, and your server completes the payment.

## Step 1: Create a checkout on your server

When the customer starts checkout, your server calls [Create Checkout](/afterpay-online-developer/api-reference/reference/checkouts/create-checkout-1) and returns the `redirectCheckoutUrl` from the response to your app.

```json
{
  "amount": { "amount": "100.00", "currency": "USD" },
  "consumer": { "email": "test@example.com" },
  "merchant": {
    "redirectConfirmUrl": "https://example.com/checkout/confirm",
    "redirectCancelUrl": "https://example.com/checkout/cancel"
  },
  "merchantReference": "merchant-order-123"
}
```

> **Warning**
>
> Set both `merchant.redirectConfirmUrl` and `merchant.redirectCancelUrl`. The SDK uses them to detect the result. They can be any URLs; by default, the SDK doesn't load them.

## Step 2: Start the checkout

Register an activity result launcher, then launch the intent from `createCheckoutIntent` with the checkout URL. The SDK checks that the URL is an Afterpay checkout URL before it loads it.

```kotlin
class CartActivity : AppCompatActivity() {

  private val checkoutLauncher =
    registerForActivityResult(StartActivityForResult()) { result ->
      val data = result.data ?: return@registerForActivityResult
      when (result.resultCode) {
        RESULT_OK -> {
          val token = Afterpay.parseCheckoutSuccessResponse(data)
          // Send the token to your server to complete the order.
        }
        RESULT_CANCELED -> {
          val status = Afterpay.parseCheckoutCancellationResponse(data)
          // Handle the cancellation.
        }
      }
    }

  private fun onAfterpayButtonClicked(checkoutUrl: String) {
    checkoutLauncher.launch(
      Afterpay.createCheckoutIntent(this, checkoutUrl),
    )
  }
}
```

### Load the redirect URLs

By default, the SDK stops at the redirect and doesn't load your confirm or cancel URL. To let the redirect URL load and read the result when it starts loading, pass `loadRedirectUrls = true` to `createCheckoutIntent`.

## Step 3: Handle the result

`parseCheckoutSuccessResponse` returns the order token. `parseCheckoutCancellationResponse` returns a `CancellationStatus`:

| Status                   | Meaning                                                                                                                                   |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `USER_INITIATED`         | The customer closed or canceled checkout. This includes closing the retry dialog that the SDK shows when the checkout page fails to load. |
| `NO_CHECKOUT_URL`        | The intent didn't contain a checkout URL.                                                                                                 |
| `INVALID_CHECKOUT_URL`   | The URL you passed isn't an Afterpay checkout URL.                                                                                        |
| `LANGUAGE_NOT_SUPPORTED` | The customer's language isn't supported in your region, or you haven't set the SDK configuration.                                         |

## Step 4: Complete the order

Send the order token to your server. To capture the full amount immediately, your server calls [Capture Full Payment](/afterpay-online-developer/api-reference/reference/payments/capture-full-payment) with the token. To capture later, call [Auth](/afterpay-online-developer/api-reference/reference/payments/auth) and then [Capture Payment](/afterpay-online-developer/api-reference/reference/payments/capture-payment).

For the full server flow, see the [Mobile SDK quickstart](/afterpay-online-developer/guides/sdk/quickstart).