API Reference

Overview

The Connector Service exposes a unified gRPC API that serves as the primary entry point for processing payments across 110+ payment connectors. This API abstracts away the complexity of individual payment processor implementations, providing a single, consistent interface for all payment operations.

Key Benefits:

  • Unified Schema: One API for 110+ connectors (Stripe, Adyen, Braintree, PayPal, etc.)

  • Type Safety: Protocol Buffer definitions ensure compile-time type checking

  • Multi-Step Flow Support: Handle complex operations like 3DS authentication and redirects

  • Webhook Integration: Unified event handling for asynchronous notifications

  • Zero Lock-in: Switch providers by changing one parameter

Architecture

The API is organized into domain-specific services, each handling a particular aspect of payment processing:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Your Application                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Connector Service gRPC API                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚  β”‚   Payment    β”‚ β”‚   Recurring  β”‚ β”‚   Merchant   β”‚        β”‚
β”‚  β”‚   Service    β”‚ β”‚   Payment    β”‚ β”‚     Auth     β”‚        β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚  β”‚   Refund     β”‚ β”‚   Dispute    β”‚ β”‚    Event     β”‚        β”‚
β”‚  β”‚   Service    β”‚ β”‚   Service    β”‚ β”‚   Service    β”‚        β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚  β”‚Payment Methodβ”‚ β”‚   Customer   β”‚ β”‚     3DS      β”‚        β”‚
β”‚  β”‚   Service    β”‚ β”‚   Service    β”‚ β”‚     Auth     β”‚        β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Services

Core Payment Services

1. PaymentService

Purpose: Process payments from authorization to settlement across all connectors.

File: backend/grpc-api-types/proto/services.proto

Operation
RPC Method
Description

Authorize

Authorize

Reserve funds on a payment method without capturing

Capture

Capture

Finalize an authorized payment and transfer funds

Get

Get

Retrieve current payment status from the processor

Void

Void

Cancel an authorized payment before capture

Reverse

Reverse

Reverse a captured payment before settlement

Refund

Refund

Initiate a refund to customer's payment method

Create Order

CreateOrder

Initialize an order before payment collection

Setup Recurring

SetupRecurring

Create a recurring payment mandate

Incremental Auth

IncrementalAuthorization

Increase authorized amount

Verify Redirect

VerifyRedirectResponse

Validate redirect-based payment responses

Handle Event

HandleEvent

Process payment-related webhook events

Usage Pattern:

β†’ Payment Service Documentation


2. RecurringPaymentService

Purpose: Manage recurring payments and subscription billing.

File: backend/grpc-api-types/proto/services.proto

Operation
RPC Method
Description

Charge

Charge

Process a recurring payment using stored mandate

Revoke

Revoke

Cancel an existing recurring payment mandate

Usage Pattern:

β†’ Recurring Payment Service Documentation


3. RefundService

Purpose: Retrieve and synchronize refund statuses.

File: backend/grpc-api-types/proto/services.proto

Operation
RPC Method
Description

Get

Get

Retrieve refund status from processor

Handle Event

HandleEvent

Process refund-related webhook events

Usage Pattern:

β†’ Refund Service Documentation


4. DisputeService

Purpose: Manage chargeback disputes and evidence submission.

File: backend/grpc-api-types/proto/services.proto

Operation
RPC Method
Description

Submit Evidence

SubmitEvidence

Upload evidence to dispute chargeback

Get

Get

Retrieve dispute status and evidence state

Defend

Defend

Submit defense with reason code

Accept

Accept

Concede dispute and accept liability

Handle Event

HandleEvent

Process dispute-related webhook events

Usage Pattern:

β†’ Dispute Service Documentation


Authentication & Security Services

5. MerchantAuthenticationService

Purpose: Generate access tokens and session credentials for secure payment processing.

File: backend/grpc-api-types/proto/services.proto

Operation
RPC Method
Description

Create Access Token

CreateAccessToken

Generate short-lived connector authentication token

Create Session Token

CreateSessionToken

Create session token for payment processing

Create SDK Session Token

CreateSdkSessionToken

Initialize wallet payment sessions (Apple Pay, Google Pay)

Usage Pattern:

β†’ Merchant Authentication Service Documentation


6. PaymentMethodAuthenticationService

Purpose: Execute 3D Secure authentication flows for fraud prevention.

File: backend/grpc-api-types/proto/services.proto

Operation
RPC Method
Description

Pre-Authenticate

PreAuthenticate

Initiate 3DS flow before payment authorization

Authenticate

Authenticate

Execute 3DS challenge or frictionless verification

Post-Authenticate

PostAuthenticate

Validate authentication results with issuing bank

Usage Pattern:

β†’ Payment Method Authentication Service Documentation


Support Services

7. PaymentMethodService

Purpose: Tokenize and retrieve payment methods securely.

File: backend/grpc-api-types/proto/services.proto

Operation
RPC Method
Description

Tokenize

Tokenize

Tokenize payment method for secure storage

Usage Pattern:

β†’ Payment Method Service Documentation


8. CustomerService

Purpose: Create and manage customer profiles at connectors.

File: backend/grpc-api-types/proto/services.proto

Operation
RPC Method
Description

Create

Create

Create customer record in payment processor

Usage Pattern:

β†’ Customer Service Documentation


9. EventService

Purpose: Process asynchronous webhook events from payment processors.

File: backend/grpc-api-types/proto/services.proto

Operation
RPC Method
Description

Handle Event

HandleEvent

Process webhook notifications and translate to unified responses

Usage Pattern:

β†’ Event Service Documentation


10. CompositePaymentService

Purpose: Execute composite flows combining multiple operations.

File: backend/grpc-api-types/proto/composite_service.proto

Operation
RPC Method
Description

Composite Authorize

CompositeAuthorize

Runs composite authorize flow (token + customer + authorize)

Composite Get

CompositeGet

Runs composite get flow (token + sync)

Usage Pattern:


11. Health Service

Purpose: Health check endpoint for service monitoring.

File: backend/grpc-api-types/proto/health_check.proto

Operation
RPC Method
Description

Check

Check

Check service health status

Usage Pattern:


Protocol Buffer Files

Core Definition Files

File
Path
Description

services.proto

backend/grpc-api-types/proto/services.proto

Main service definitions for all payment operations

payment.proto

backend/grpc-api-types/proto/payment.proto

Core data types, enums, request/response messages

payment_methods.proto

backend/grpc-api-types/proto/payment_methods.proto

Payment method definitions (cards, wallets, etc.)

composite_payment.proto

backend/grpc-api-types/proto/composite_payment.proto

Composite operation request/response messages

composite_service.proto

backend/grpc-api-types/proto/composite_service.proto

Composite service definition

sdk_config.proto

backend/grpc-api-types/proto/sdk_config.proto

SDK configuration options

health_check.proto

backend/grpc-api-types/proto/health_check.proto

Health check service definition

Example Proto Files

File
Path
Description

payment.proto

examples/example-hs-grpc/proto/payment.proto

Example Haskell gRPC client proto


Key Data Types

Core Types (payment.proto)

Money

PaymentStatus

RefundStatus

DisputeStatus

Payment Methods (payment_methods.proto)

Supported Payment Methods

  • Card Methods: Credit, Debit, Card Redirect

  • Digital Wallets: Apple Pay, Google Pay, PayPal, Samsung Pay, WeChat Pay, AliPay

  • UPI: UPI Collect, UPI Intent, UPI QR

  • Online Banking: iDEAL, Sofort, Trustly, Giropay, EPS, Blik

  • Bank Transfers: ACH, SEPA, BACS, PIX, Instant Bank Transfer

  • Direct Debit: SEPA Direct Debit, BECS, ACH

  • Buy Now Pay Later: Affirm, Afterpay/Clearpay, Klarna

  • Cash/Voucher: Boleto, OXXO, 7-Eleven, Alfamart, Indomaret

  • Cryptocurrency: Generic crypto payments

Connectors (payment.proto)

The API supports 110+ connectors including:

Category
Connectors

Global

Stripe, Adyen, Braintree, PayPal, Worldpay, Checkout.com, Cybersource

Regional

Alipay, WeChat Pay, UPI, PIX, Klarna, Trustly, iDEAL

Enterprise

JPMorgan, Bank of America, Wells Fargo, Elavon, TSYS

Emerging

Rapyd, dLocal, Xendit, Volt, Gigadat


Common Workflows

1. E-commerce Checkout (Two-Step Payment)

spinner

Operations Used:

  • PaymentService.CreateOrder

  • PaymentService.Authorize

  • PaymentService.Capture


2. Subscription Setup with Recurring Payments

spinner

Operations Used:

  • PaymentService.SetupRecurring

  • PaymentService.Authorize

  • PaymentService.Capture

  • RecurringPaymentService.Charge


3. 3D Secure Authentication Flow

spinner

Operations Used:

  • PaymentMethodAuthenticationService.PreAuthenticate

  • PaymentMethodAuthenticationService.Authenticate

  • PaymentMethodAuthenticationService.PostAuthenticate

  • PaymentService.Authorize


4. Webhook Event Handling

spinner

Operations Used:

  • EventService.HandleEvent


Error Handling

All services return structured error information:

Error Categories:

  • Unified Errors: Standardized error codes across all connectors

  • Issuer Errors: Card issuer/network specific errors (Visa, Mastercard, etc.)

  • Connector Errors: Payment processor specific error codes


State Management

Multi-step flows use ConnectorState to maintain session continuity:

Pass the state from each response to the next request to maintain session context.


Getting Started

  1. Define Your Proto: Import the proto files from backend/grpc-api-types/proto/

  2. Generate Client Code:

  3. Connect to Service:

  4. Make Your First Call:



Proto File Locations


Version Information

  • Package: types

  • Syntax: proto3

  • Go Package: github.com/juspay/connector-service/backend/grpc-api-types/proto;proto


Generated from protocol buffer definitions. For the most up-to-date API reference, consult the proto files directly.

Last updated

Was this helpful?