Skip to main content

CreateSdkSessionToken RPC

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?

WalletPurpose
Apple PayInitialize PKPaymentSession with merchant validation
Google PayConfigure PaymentDataRequest with merchant info
PayPal SDKSet up checkout context

Key outcomes:

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

Request Fields

FieldTypeRequiredDescription
merchant_sdk_session_idstringYesYour unique SDK session reference
amountMoneyYesPayment amount
order_tax_amountint64NoTax amount in minor units
shipping_costint64NoShipping cost in minor units
payment_method_typePaymentMethodTypeNoTarget wallet type (APPLE_PAY, GOOGLE_PAY)
country_alpha2_codeCountryAlpha2NoISO country code for localization
customerCustomerNoCustomer information
metadataSecretStringNoAdditional metadata
connector_feature_dataSecretStringNoConnector-specific metadata

Response Fields

FieldTypeDescription
session_tokenSessionTokenWallet-specific session data
errorErrorInfoError details if creation failed
status_codeuint32HTTP-style status code
raw_connector_responseSecretStringRaw response for debugging
raw_connector_requestSecretStringRaw request for debugging

Example

Request (grpcurl)

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": "[email protected]"
}
}' \
localhost:8080 \
types.MerchantAuthenticationService/CreateSdkSessionToken

Response

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

Next Steps