Skip to main content

H2H Request Structure

Host-to-Host API requests use a standardized JSON structure with specific parameters for different payment methods. This guide covers all request components, authentication, and parameter requirements.

API Specification

Request Details

  • API Endpoint: Custom URL obtained from dashboard (varies by provider)
  • HTTP Method: POST
  • Content Type: application/json
  • Authentication: X-API-Key header with your API key

Authentication Header

Core Request Parameters

Browser Info Object

The browserInfo object is used for 3D Secure verification and contains browser-specific information:

Browser Info Example

Wallet Object

The wallet object contains digital wallet information for Google Pay and Apple Pay payments. All values should be obtained from Google Pay or Apple Pay wallets:

Wallet Object Example

Complete Request Examples

Credit Card Payment

Alternative Payment

UPI Payment

Google Pay Payment

Apple Pay Payment

Wallet Payment (Apple Pay Example)

Best Practices

Request Construction

  1. Parameter Validation: Validate all required parameters before sending requests
  2. Data Sanitization: Sanitize input data to prevent injection attacks
  3. Currency Formatting: Use proper decimal formatting for amounts
  4. Country Codes: Use ISO-3166-1 alpha-2 country codes

Security

  1. HTTPS Only: Always use HTTPS for API requests
  2. API Key Protection: Never expose API keys in client-side code
  3. Data Encryption: Encrypt sensitive data before transmission
  4. Request Signing: Consider implementing request signing for additional security

Error Prevention

  1. Required Fields: Ensure all required fields are included based on payment method
  2. Format Validation: Validate data formats (dates, phone numbers, emails)
  3. Length Limits: Respect field length limitations
  4. Character Encoding: Use UTF-8 encoding for all text fields

Next Steps

Response Structure

Learn about H2H API response format and handling

Payment Methods

Explore available payment methods and implementations

Notifications

Set up webhook notifications for payment status updates