Quickstart Setup

Get started with Redpin’s B2B API integration quickly and easily. This guide provides complete setup instructions for both API integration and Hosted UI integration approaches.

This quickstart guide provides production-ready examples that demonstrate the full B2B payment flow, from authentication to payment execution. Choose the integration approach that best fits your needs.

Prerequisites

Before you begin, ensure you have:

  • API Credentials: Your Redpin client ID and client secret
  • Customer ID: Your assigned customer identifier
  • Development Environment: Choose your preferred platform below

Integration Options

Redpin offers two main integration approaches:

API Integration

For backend applications and custom integrations

Direct API access for complete control over the payment flow:

  • Full API control and customization
  • Backend-only integration
  • Multiple language support (Java, Python)
  • Production-ready examples with error handling
Hosted UI Integration

Reference implementations for third-party applications

Complete example applications demonstrating hosted payment flow integration:

  • React.js web application reference
  • React Native mobile app reference
  • Embedded Redpin payment interface
  • Real-world integration patterns and best practices

API Integration

Complete backend integration examples in Java and Python that demonstrate the full B2B payment flow.

Choose Your Language

Java Integration

Prerequisites

  • Java 11 or higher
  • Maven 3.6 or higher

Step 1: Clone and Setup

$# Clone the quickstart repository
>git clone https://gitlab.com/Redpin.Opensource/quickstart.git
>cd quickstart/api-integration/java
>
># Build the project
>mvn clean install

Step 2: Configure Environment

$# Copy the configuration template
>cp src/main/resources/application.properties.example src/main/resources/application.properties
>
># Edit with your actual credentials

Step 3: Run the Integration

Complete Flow:

$mvn exec:java -Dexec.mainClass="com.b2b.integration.B2BIntegrationApplication"

Individual Components:

$# Authentication
>mvn exec:java -Dexec.mainClass="com.b2b.integration.auth.AuthManager"
>
># Webhook management
>mvn exec:java -Dexec.mainClass="com.b2b.integration.webhook.WebhookManager"
>
># Customer management
>mvn exec:java -Dexec.mainClass="com.b2b.integration.customer.CustomerManager"
>
># Recipient management
>mvn exec:java -Dexec.mainClass="com.b2b.integration.recipient.RecipientManager"
>
># Quote management
>mvn exec:java -Dexec.mainClass="com.b2b.integration.quote.QuoteManager"
>
># Payment management
>mvn exec:java -Dexec.mainClass="com.b2b.integration.payment.PaymentManager"

API Integration Flow

The complete integration follows this sequence:

  1. πŸ” Authentication - Create access token using client credentials
  2. πŸ”” Webhook Subscription - Set up real-time payment status notifications
  3. πŸ‘€ Customer Creation - Register third-party customer information
  4. πŸ‘₯ Recipient Creation - Add payment recipient details
  5. πŸ’± Quote Creation - Get exchange rate quotes
  6. πŸ’³ Payment Creation - Execute the international payment

The API integration examples include comprehensive error handling, logging, validation, and testing to ensure production readiness.

Hosted UI Integration

Reference implementations demonstrating how to integrate Redpin’s hosted payment flow into third-party applications. These example apps show the complete integration flow, from user interaction to payment completion.

Choose Your Platform

React.js Reference Application

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • Modern web browser

This is a reference implementation that demonstrates how to integrate Redpin’s hosted payment flow into a React.js application. Use this as a guide for implementing similar functionality in your own applications.

Step 1: Clone and Setup

$# Clone the quickstart repository
>git clone https://gitlab.com/Redpin.Opensource/quickstart.git
>cd quickstart/hosted-ui-integration/ReactJs
>
># Install dependencies
>npm install

Step 2: Configure Environment

$# Copy environment template
>cp .env.example .env
>
># Edit with your actual credentials

Step 3: Start the Backend Server

$# Start the API server (required for Redpin integration)
>npm run server
># or
>node server.js

The server will start on http://localhost:8080

Step 4: Start the React App

$# In a new terminal, start the React development server
>npm start
># or
>npm run dev

The app will open at http://localhost:3000

Available Scripts

CommandDescription
npm startStart React development server
npm run devStart both server and React app
npm run serverStart API server only
npm run buildBuild for production
npm run lintRun ESLint

Key Integration Features Demonstrated

These reference applications demonstrate essential integration patterns:

  • Payment Flow Integration - How to embed Redpin payment options in your app
  • API Call Flow - Complete flow from user click to payment completion
  • Session Management - Handling payment sessions and user state
  • Compliance Checks - Alert handling for incomplete compliance requirements
  • Error Handling - Managing payment failures and edge cases
  • Success Flow - Seamless user experience after successful payments
  • WebView Integration - Embedding hosted payment interface
  • Theme Customization - How to customize hosted UI with basic theme parameters

The reference apps include examples of theme customization, showing how to modify the hosted payment interface appearance using basic theme parameters to match your application’s branding.

Hosted UI Integration Flow

The hosted UI integration follows this user journey:

Payment Process:

What Happens Behind the Scenes:

The reference apps automatically handle:

  • Customer Management - Creating or updating customer information
  • Compliance Checks - Ensuring all required information is complete
  • Session Optimization - Reusing existing sessions for faster payments
  • Payment Processing - Secure payment flow through hosted interface
  • Status Updates - Real-time payment status notifications
  • Theme Customization - Matching the payment interface to your app’s branding

These reference applications include a backend server (server.js/server.mjs) that demonstrates how to proxy API calls and handle authentication securely. Study the server implementation to understand the required backend integration patterns. The apps also showcase theme customization capabilities for the hosted payment interface.

What You Can Expect

Backend Integration Examples

  • Authentication Flow - Secure token-based authentication
  • Customer Management - Create and manage third-party customers
  • Recipient Management - Add and manage payment recipients
  • Quote Management - Get real-time exchange rate quotes
  • Payment Processing - Execute international payments
  • Webhook Handling - Real-time payment status updates

Reference Application Features

  • Payment Flow Integration - Complete example of embedding Redpin payments
  • API Call Patterns - Demonstrates proper API calling sequence
  • Session Management - Shows how to handle payment sessions
  • Compliance Handling - Examples of compliance check alerts and flows
  • Error Scenarios - Comprehensive error handling examples
  • Success Flows - Complete user journey after successful payment
  • WebView Integration - How to embed hosted payment interface
  • Theme Customization - Examples of customizing hosted UI themes with basic parameters
  • Real-time Status - Live payment status updates and notifications

Need Help?

If you encounter any issues during setup:

  1. Study the Reference Code - Review the React.js and React Native implementations
  2. Check API Documentation - Refer to the complete API reference
  3. Verify Configuration - Ensure all environment variables are set correctly
  4. Test Connectivity - Verify API endpoints are accessible
  5. Review Integration Patterns - Study how the reference apps handle payment flows
  6. Contact Support - Reach out to our support team for assistance

Make sure to use sandbox credentials for testing and development. Production credentials should only be used in production environments.