Skip to main content

Domain Schema

Overview

Domain types are the foundational data structures and enumerations defined in the Protocol Buffer (protobuf) files that form the core data model of the Universal Connector Service (Connector Service) API. These types represent the building blocks used across all services to model payments, refunds, disputes, payment methods, and related entities.

Relationship to Services

The domain schema are used by the gRPC services defined in services.proto as:

  • Request/Response Messages: Service methods accept and return structured messages documented in the API Reference section for each service
  • Enums: Status codes, payment methods, and categorical values ensure type safety (e.g., PaymentStatus, Currency)
  • Nested Types: Complex types like Money, Address, and Customer are reused across multiple service operations

What's Included

This Domain Schema includes:

  • Core data structures: Money, Customer, Address, PaymentMethod - reusable types that appear as fields across multiple services
  • Enumerations: PaymentStatus, Currency, Connector, CardNetwork - categorical values for type safety
  • Connector responses: ConnectorResponseData, CardConnectorResponse - additional data returned by connectors

What's Not Included

Service request and response types (e.g., PaymentServiceAuthorizeRequest, RefundResponse) are documented in the API Reference section for each service. These types are specific to individual RPC operations and are covered alongside their corresponding operation documentation.

Key Design Principles

The design principles translate directly to reliable, extensible and compliant integrations for developers.

  1. Type Safety: Type safety prevents rounding errors and currency confusion that can cause financial discrepancies. Example: All monetary amounts use the Money message with amounts in minor units (e.g., 1000 = $10.00)
  2. Secret Handling: Secret handling ensures PCI compliance by automatically masking sensitive data in your logs, reducing audit risk. Sensitive data uses SecretString types that are masked in logs and traces
  3. Extensibility: Extensibility means your integration won't break when new payment methods are added—your existing code handles new variants through the same interfaces. oneof fields allow polymorphic data structures (e.g., PaymentMethod can be card, wallet, or bank transfer)
  4. Versioning: Stable versioning guarantees that updating your API client won't require rewrites; new fields are additive, preserving backward compatibility. Field numbers are stable; enum zero values follow the *_UNSPECIFIED convention

Index of Domain Types

Core Data Types

Basic building blocks used across all Connector Service services. These fundamental types handle monetary amounts, error information, customer data, identifiers, and metadata that form the foundation of payment processing.

Domain TypeDescriptionExampleRelated Types
MoneyMonetary amount with currency. Amounts are in minor units (e.g., 1000 = $10.00).{"minor_amount": 1000, "currency": "USD"}Currency
ErrorInfoStructured error information for API responses. Includes error code and human-readable message.{"code": "CARD_DECLINED", "message": "Card was declined", "reason": "INSUFFICIENT_FUNDS"}PaymentStatus
CustomerCustomer information including name, email, and unique identifier.{"id": "cus_123", "name": "John Doe", "email": "[email protected]", "phone": "+1-555-0123"}Address, PaymentMethod
MetadataKey-value metadata for connectors. Stores additional context about transactions.{"order_id": "ORD-123", "source": "mobile_app", "campaign": "spring_sale"}SecretString
SecretStringSensitive data masked in logs and traces for PCI compliance."***MASKED***"Metadata, CardDetails

Address and Contact Types

Location and contact information for billing, shipping, and customer records. These types standardize address formats across different regions and payment connectors.

Domain TypeDescriptionExampleRelated Types
AddressPhysical address with street, city, country, and postal code.{"line1": "123 Main St", "city": "San Francisco", "state": "CA", "country": "US", "zip": "94105", "phone": "+1-555-0123"}PaymentAddress, Customer
PaymentAddressContainer for billing and shipping addresses in a single payment context.{"billing": {"line1": "123 Main St", ...}, "shipping": {"line1": "456 Oak Ave", ...}}Address, ShippingDetails
CustomerInfoSimplified customer information for specific payment scenarios.{"name": "John Smith", "email": "[email protected]"}PaymentMethod, Upi

Payment Method Types

Payment instruments supported by Connector Service including cards, wallets, bank transfers, and local payment methods. The PaymentMethod type is polymorphic, supporting various payment instruments through a oneof field.

Domain TypeDescriptionExampleRelated Types
PaymentMethodPolymorphic payment instrument. Supports card, wallet, or bank transfer via oneof.{"card": {"card_number": "4242424242424242", "expiry_month": "12", "expiry_year": "2027", "cvv": "123"}}CardDetails, AppleWallet, GooglePay, Paypal, BankDebit, BankRedirect, BankTransfer, Upi, Wallet
CardDetailsComplete card payment details including number, expiry, and optional CVV.{"card_number": "4242424242424242", "expiry_month": "12", "expiry_year": "2027", "card_holder_name": "John Doe", "card_network": "VISA"}PaymentMethod, CardNetwork
AppleWalletApple Pay payment method with encrypted payment token.{"pk_payment_token": {"payment_data": "encrypted_data", "transaction_id": "txn_123"}}PaymentMethod, SessionToken
GooglePayGoogle Pay payment method with tokenized card data.{"gp_payment_token": {"signature": "sig_123", "protocol_version": "ECv2"}}PaymentMethod, GpaySessionTokenResponse
PaypalPayPal wallet payment using email or PayPal ID.{"email": "[email protected]", "paypal_id": "PAYER_123"}PaymentMethod, Wallet
BankDebitBank debit payment via ACH (US) or SEPA (Europe) using IBAN/account numbers.{"iban": "DE89370400440532013000", "bank_name": "Deutsche Bank", "country": "DE"}PaymentMethod, MandateReference
BankRedirectBank redirect methods like Sofort, iDEAL requiring customer redirection.{"bank_name": "Deutsche Bank", "bank_redirect_type": "SOFORT", "country": "DE"}PaymentMethod, RedirectForm
BankTransferDirect bank transfer using account and routing details.{"account_number": "123456789", "routing_number": "011000015", "bank_name": "Bank of America"}PaymentMethod
UpiUPI (Unified Payments Interface) payment for India using VPA.{"vpa": "john@upi", "customer_info": {"name": "John", "email": "[email protected]"}}PaymentMethod, CustomerInfo
WalletGeneric wallet container for wallet-type payments (PayPal, Venmo, etc.).{"wallet_type": "PAYPAL", "wallet_details": {...}}PaymentMethod, Paypal

Card Network Enums

Card networks supported for card payments. This enum identifies the card scheme when processing card transactions and handling network-specific logic.

Domain TypeValuesDescription
CardNetworkVISA, MASTERCARD, AMEX, DISCOVER, JCB, DINERS, UNIONPAY, MAESTRO, CARTES_BANCAIRES, RUPAY, INTERAC_CARDCard networks supported for card payments. Used to identify the card scheme and apply network-specific logic.

Authentication Types

3D Secure and Strong Customer Authentication data structures. These types support frictionless authentication, challenge flows, and SCA exemption handling for regulatory compliance.

Domain TypeDescriptionExampleRelated Types
AuthenticationData3DS authentication data including ECI, CAVV, and transaction status for verified payments.{"eci": "05", "cavv": "AAABBIIFmAAAAAAAAAAAAAAAAAA=", "transaction_status": "SUCCESS", "authentication_type": "THREE_DS"}CardConnectorResponse, CardNetwork
BrowserInformationBrowser details required for 3DS authentication and SCA compliance.{"accept_header": "text/html", "user_agent": "Mozilla/5.0", "ip_address": "192.168.1.1", "language": "en-US"}ThreeDsCompletionIndicator, ExemptionIndicator
CustomerAcceptanceMandate acceptance details for recurring payment authorization.{"acceptance_type": "ONLINE", "accepted_at": "2024-01-15T10:30:00Z", "online": {"ip_address": "192.168.1.1", "user_agent": "Mozilla/5.0"}}MandateReference, SetupMandateDetails

Authentication Enums

Enumerations for authentication flows and 3DS status tracking. These define the authentication methods, transaction outcomes, and exemption categories for SCA compliance.

Domain TypeValuesDescription
AuthenticationTypeTHREE_DS, NO_THREE_DSWhether 3D Secure authentication is performed. THREE_DS for authenticated, NO_THREE_DS for frictionless flow.
TransactionStatusSUCCESS, FAILURE, CHALLENGE_REQUIRED, REJECTEDResult of 3DS authentication. CHALLENGE_REQUIRED means additional customer verification needed.
ExemptionIndicatorLOW_VALUE, SECURE_CORPORATE_PAYMENT, TRUSTED_LISTINGSCA exemption categories for skipping 3DS. Must meet specific regulatory criteria.
CavvAlgorithmCAVV_ALGORITHM_ZERO through CAVV_ALGORITHM_AAlgorithm used to generate CAVV cryptogram. Indicates authentication method strength.
ThreeDsCompletionIndicatorSUCCESS, FAILURE, NOT_AVAILABLEWhether 3DS challenge was completed. Used in subsequent authorization requests.

Mandate Types

Recurring payment mandate data structures. These types manage stored payment credentials for subscription billing, allowing merchants to charge customers on a recurring basis with prior consent.

Domain TypeDescriptionExampleRelated Types
MandateReferenceReference to stored mandate for recurring payments. Contains connector-specific mandate ID.{"connector_mandate_id": "mandate_123", "payment_method_id": "pm_456", "mandate_metadata": {...}}BankDebit, CustomerAcceptance
SetupMandateDetailsMandate setup details including type (single/multi-use) and amount constraints.{"mandate_type": {"multi_use": {"amount": 5000, "currency": "USD"}}, "customer_acceptance": {...}}CustomerAcceptance, MandateType
MandateAmountDataMandate amount constraints with currency, frequency, and validity period.{"amount": 1000, "currency": "USD", "start_date": "2024-01-01", "end_date": "2025-01-01", "frequency": "MONTHLY"}SetupMandateDetails, Money

Mandate Enums

Status and type enumerations for recurring payment mandates. These track mandate lifecycle states and define whether a mandate can be used once or multiple times.

Domain TypeValuesDescription
MandateTypesingle_use, multi_useWhether mandate can be used once (single_use) or multiple times (multi_use) for recurring charges.
MandateStatusPENDING, ACTIVE, INACTIVE, REVOKEDLifecycle state of mandate. ACTIVE means ready for recurring charges, REVOKED means cancelled by customer.

Payment Status Enums

State machines for payment lifecycle tracking. These enums represent the complete payment journey from initiation through completion, failure, or refund.

Domain TypeValuesDescription
PaymentStatusSTARTED, AUTHORIZED, CAPTURED, VOIDED, REFUNDED, FAILED, EXPIREDComplete payment lifecycle states. AUTHORIZED = funds held, CAPTURED = funds transferred, VOIDED = authorization cancelled.
AuthorizationStatusSUCCESS, FAILURE, PROCESSING, UNRESOLVEDResult of authorization attempt. UNRESOLVED typically indicates 3DS challenge or async processing.
CaptureMethodAUTOMATIC, MANUAL, MANUAL_MULTIPLE, SCHEDULEDWhen to capture funds. AUTOMATIC = immediate, MANUAL = merchant-initiated, SCHEDULED = delayed capture.
RefundStatusPENDING, SUCCESS, FAILURE, MANUAL_REVIEWState of refund processing. MANUAL_REVIEW requires merchant intervention for compliance or risk reasons.
DisputeStatusOPENED, EXPIRED, ACCEPTED, CHALLENGED, WON, LOSTChargeback lifecycle. CHALLENGED = merchant submitted evidence, WON/LOST = final resolution.

Payment Configuration Types

Configuration enums for payment processing. These define how payments should be captured, when payment methods can be reused, and the customer experience preferences.

Domain TypeValuesDescription
FutureUsageOFF_SESSION, ON_SESSIONIntent for storing payment method. OFF_SESSION allows recurring charges without customer present.
PaymentExperienceREDIRECT_TO_URL, INVOKE_SDK_CLIENT, DISPLAY_QR_CODE, ONE_CLICKCustomer experience for payment. REDIRECT_TO_URL for 3DS/bank auth, INVOKE_SDK_CLIENT for Apple/Google Pay.
PaymentChannelECOMMERCE, MAIL_ORDER, TELEPHONE_ORDERHow the payment was initiated. Affects fraud scoring and SCA requirements.
PaymentMethodTypeCARD, APPLE_PAY, GOOGLE_PAY, SEPA, ACHSpecific payment instrument category. Used for routing and processing logic.
MitCategoryINSTALLMENT_MIT, UNSCHEDULED_MIT, RECURRING_MITMerchant-initiated transaction type for exemption requests. Required for off-session recurring charges.
TokenizationTOKENIZE_AT_PSP, TOKENIZE_SKIP_PSPWhether to tokenize card at payment service provider. SKIP when using existing network tokens.

Currency and Connector Enums

Currency codes and supported payment processor connectors. These enums standardize currency representation across 170+ currencies and identify which connector is handling a transaction.

Domain TypeValuesDescription
CurrencyUSD, EUR, GBP, INR, JPY (ISO 4217)Three-letter currency codes. Used with Money type to specify transaction currency. Supports 170+ currencies.
ConnectorADYEN, STRIPE, PAYPAL, BRAINTREE, CHECKOUTPayment processor handling the transaction. Determines API endpoint and authentication method.
CountryAlpha2US, GB, DE, IN, JP (ISO 3166-1)Two-letter country codes for billing/shipping addresses. Required for fraud detection and regulatory compliance.

Order and Billing Types

Order details and billing descriptor configurations. These types support itemized order information and statement descriptors that appear on customer card statements.

Domain TypeDescriptionExampleRelated Types
OrderDetailsWithAmountProduct line item details with name, quantity, and amount for itemized orders.{"product_name": "Premium Widget", "product_id": "SKU-12345", "quantity": 2, "amount": 5000, "currency": "USD"}Money, ShippingDetails
BillingDescriptorStatement descriptor shown on customer's card statement. Helps reduce chargebacks.{"name": "ACME INC*", "city": "SAN FRANCISCO", "state": "CA", "phone": "1-800-555-0123"}Address
ShippingDetailsShipping address, carrier, and tracking information for physical goods.{"address": {"line1": "123 Main St", ...}, "carrier": "FedEx", "tracking_number": "1234567890", "method": "EXPRESS"}PaymentAddress, OrderDetailsWithAmount

State and Access Types

Token and state management types. These handle authentication tokens for API access and connector-specific state for multi-step payment flows.

Domain TypeDescriptionExampleRelated Types
ConnectorStateConnector state for multi-step flows. Pass between API calls to maintain context.{"access_token": "tok_123", "connector_customer_id": "cus_456", "connector_metadata": {...}, "redirect_response": {...}}AccessToken, Connector
AccessTokenAPI access token with expiration for connector authentication.{"token": "tok_123456", "expires_at": 1704067200, "token_type": "BEARER", "scope": "payments"}ConnectorState

Redirection Types

Handling redirect flows for 3DS and bank authentication. These types manage the various redirection mechanisms required for authentication flows, including HTML forms, deep links, and SDK redirects.

Domain TypeDescriptionExampleRelated Types
RedirectFormContainer for redirect flow data including URL or form for 3DS/bank authentication.{"form": {"form_method": "POST", "form_data": {"PaReq": "abc123", "MD": "merchant_data"}}}FormData, PaymentExperience
FormDataHTML form details for POST-based redirection in 3DS flows.{"form_method": "POST", "form_url": "https://bank.com/3ds", "form_fields": {"PaReq": "abc123", "TermUrl": "https://merchant.com/callback"}}RedirectForm, PaymentExperience
RedirectionResponseData returned after customer completes redirect (3DS or bank auth).{"params": {"PaRes": "xyz789", "MD": "merchant_data"}, "payload": "base64_encoded_data", "redirect_url": "https://..."}RedirectForm, BrowserInformation

Webhook and Event Types

Handling asynchronous events from connectors. These types define webhook event categories and structures for processing connector callbacks when payment states change.

Domain TypeDescriptionExampleRelated Types
WebhookEventTypeType of webhook event received from connector (payment success, dispute opened, etc.).PAYMENT_INTENT_SUCCESSPaymentStatus, DisputeStatus
WebhookSecretsSecrets for verifying webhook authenticity from payment connectors.{"secret": "whsec_1234567890abcdef", "additional_secret": "whsec_second"}RequestDetails
RequestDetailsHTTP request details from webhook including headers, body, and method for verification.{"method": "POST", "url": "https://merchant.com/webhook", "headers": {"Stripe-Signature": "t=123,v1=abc"}, "body": "{...}"}WebhookSecrets

SDK and Session Types

Wallet SDK integration types for Apple Pay, Google Pay, and PayPal. These support client-side tokenization and native payment experiences in mobile and web applications.

Domain TypeDescriptionExampleRelated Types
SessionTokenWallet session token for Apple Pay or Google Pay SDK initialization.{"google_pay": {"merchant_info": {...}, "payment_methods": [...]}} or {"apple_pay": {"session_data": "...", "display_message": "..."}}GooglePay, AppleWallet
GpaySessionTokenResponseGoogle Pay session configuration returned from session initialization API.{"merchant_info": {"merchant_name": "Example Store", "merchant_id": "123"}, "payment_methods": [{"type": "CARD"}], "transaction_info": {...}}SessionToken, GooglePay
ApplepaySessionTokenResponseApple Pay session data including session object and display message.{"session_data": {"epochTimestamp": 1234567890, "merchantIdentifier": "merchant.com.example"}, "display_message": "Pay Example Store"}SessionToken, AppleWallet
SdkNextActionInstructions for client-side SDK action (invoke Apple Pay, Google Pay, etc.).{"next_action": "INVOKE_SDK_CLIENT", "wallet_name": "APPLE_PAY", "sdk_data": {...}}SessionToken, PaymentExperience

Connector Response Types

Additional data returned by connectors. These types provide connector-specific response details for different payment methods and extended authorization information.

Domain TypeDescriptionExampleRelated Types
ConnectorResponseDataConnector response container.{"card": {...}, "extended_authorization": {...}}CardConnectorResponse
CardConnectorResponseCard-specific response.{"authentication_data": {...}, "card_network": "VISA"}ConnectorResponseData, AuthenticationData, CardNetwork

Next Steps