> For the complete documentation index, see [llms.txt](https://docs.hyperswitch.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hyperswitch.io/integrations/prism/api-reference/merchant-authentication-service/create-sdk-session-token.md).

# Create SDK Session Token

## Overview

The `CreateSdkSessionToken` RPC initializes wallet payment sessions for Apple Pay, Google Pay, and other SDK-based payment methods. It sets up the secure context needed for tokenized wallet payments with device verification.

**Business Use Case:** When offering Apple Pay or Google Pay checkout options, you need to initialize a session with the payment processor that includes your merchant configuration, payment details, and supported payment methods. This RPC handles that initialization and returns the session data needed to present the native payment sheet.

## Purpose

**Why use SDK session tokens?**

| Wallet         | Purpose                                              |
| -------------- | ---------------------------------------------------- |
| **Apple Pay**  | Initialize PKPaymentSession with merchant validation |
| **Google Pay** | Configure PaymentDataRequest with merchant info      |
| **PayPal SDK** | Set up checkout context                              |

**Key outcomes:**

* Wallet-specific session configuration
* Merchant validation data
* Supported payment methods list
* Ready for native SDK presentation

## Request Fields

| Field                     | Type              | Required | Description                                  |
| ------------------------- | ----------------- | -------- | -------------------------------------------- |
| `merchant_sdk_session_id` | string            | Yes      | Your unique SDK session reference            |
| `amount`                  | Money             | Yes      | Payment amount                               |
| `order_tax_amount`        | int64             | No       | Tax amount in minor units                    |
| `shipping_cost`           | int64             | No       | Shipping cost in minor units                 |
| `payment_method_type`     | PaymentMethodType | No       | Target wallet type (APPLE\_PAY, GOOGLE\_PAY) |
| `country_alpha2_code`     | CountryAlpha2     | No       | ISO country code for localization            |
| `customer`                | Customer          | No       | Customer information                         |
| `metadata`                | SecretString      | No       | Additional metadata                          |
| `connector_feature_data`  | SecretString      | No       | Connector-specific metadata                  |

## Response Fields

| Field                    | Type         | Description                      |
| ------------------------ | ------------ | -------------------------------- |
| `session_token`          | SessionToken | Wallet-specific session data     |
| `error`                  | ErrorInfo    | Error details if creation failed |
| `status_code`            | uint32       | HTTP-style status code           |
| `raw_connector_response` | SecretString | Raw response for debugging       |
| `raw_connector_request`  | SecretString | Raw request for debugging        |

## Example

### Request (grpcurl)

```bash
grpcurl -H "x-connector: stripe" \
  -H "x-connector-config: {\"config\":{\"Stripe\":{\"api_key\":\"$STRIPE_API_KEY\"}}}" \
  -d '{
    "merchant_sdk_session_id": "sdk_session_001",
    "amount": {
      "minor_amount": 10000,
      "currency": "USD"
    },
    "payment_method_type": "APPLE_PAY",
    "country_alpha2_code": "US",
    "customer": {
      "name": "John Doe",
      "email": "john@example.com"
    }
  }' \
  localhost:8080 \
  types.MerchantAuthenticationService/CreateSdkSessionToken
```

### Response

```json
{
  "session_token": {
    "apple_pay": {
      "session_data": "eyJtZXJjaGFudElkZW50aWZpZXIiOi...",
      "display_message": "Example Store"
    }
  },
  "status_code": 200
}
```

## Next Steps

* [CreateAccessToken](/integrations/prism/api-reference/merchant-authentication-service/create-access-token.md) - Generate API access tokens
* [CreateSessionToken](/integrations/prism/api-reference/merchant-authentication-service/create-session-token.md) - Create standard session tokens
* [Payment Service](/integrations/prism/api-reference/payment-service.md) - Process wallet payments


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.hyperswitch.io/integrations/prism/api-reference/merchant-authentication-service/create-sdk-session-token.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
