githubEdit

Migrate to V2

A comprehensive guide to help you transition from V1 to V2 of the Request Network API

The Request Network API V2 introduces significant improvements while maintaining backward compatibility. This guide provides a comprehensive overview of the breaking changes between V1 and V2, along with a step-by-step migration guide.

circle-exclamation
circle-info

Important: V2 is designed to coexist with V1. You can migrate incrementally and don't need to migrate all endpoints at once. See the Full API Referencearrow-up-right for documentation of the V1 endpoints.

Breaking Changes from V1 to V2

Core Architectural Changes

Path Parameter Changes

  • V1: Uses paymentReference as the path parameter

  • V2: Uses requestId as the path parameter

Response Schema Standardization

  • V1: Returns requestID (uppercase D) in create responses

  • V2: Returns requestId (lowercase d) in create responses

Enhanced Validation

  • V2: Stricter type checking and validation schemas

  • V1: More permissive validation

API Interface Differences

Endpoint Structure Changes

Request Endpoints

Feature
V1 Endpoint
V2 Endpoint

Create Request

POST /v1/request

POST /v2/request

Get Request

GET /v1/request/{paymentReference}

GET /v2/request/{requestId}

Get Request Status

GET /v1/request/{paymentReference}/status

GET /v2/request/{requestId}/status

Payment Endpoints

Feature
V1 Endpoint
V2 Endpoint

Get Payment Calldata

GET /v1/request/{paymentReference}/pay

GET /v2/request/{requestId}/pay

Get Payment Routes

GET /v1/request/{paymentReference}/routes

GET /v2/request/{requestId}/routes

Request Schema Differences

Create Request Schema

V1 Schema:

V2 Schema:

Create Response Schema

V1 Response:

V2 Response:

Payment Query Parameter Differences

Pay Request Query Parameters

V1 Query Parameters:

V2 Query Parameters:

Step-by-Step Migration Guide

Phase 1: Assessment and Planning

  1. Audit Your Current Integration

    • List all V1 endpoints you're currently using

    • Identify which features you need (basic payments vs advanced features)

  2. Choose Migration Strategy

    • Incremental: Migrate endpoints one by one (recommended)

    • Full Migration: Switch all endpoints at once

    • Parallel: Run V1 and V2 side by side

Phase 2: Update Path Parameters

Before (V1):

After (V2):

Phase 3: Update Response Handling

Before (V1):

After (V2):

Phase 4: Update Error Handling

V2 has enhanced error responses with more specific error codes:

Phase 5: Testing and Validation

  1. Test Core Functionality

    • Create requests using V2 endpoints

    • Verify payment flows work correctly

    • Check response formats match expectations

  2. Enhanced Validation Testing

    • Test stricter type checking

    • Verify improved error responses

  3. Performance Testing

    • Compare response times between V1 and V2

    • Test with realistic data volumes

Support and Resources

  • Migration Support: Book a callarrow-up-right with our team for migration assistance

  • GitHub Examples: Check the easy-invoice repository for V2 implementation examples

Backward Compatibility

V1 endpoints will continue to work during the migration period. However, we recommend migrating to V2 to access improvements and future features:

  • Enhanced security and validation

  • Better error handling and debugging

  • Improved webhook events

  • Access to new features as they are released

V2 is the foundation for all future Request Network API features and improvements.

Last updated

Was this helpful?