Chapa
Start here

Migration Guide

Migrate from Chapa API v1 to v2 with this comprehensive step-by-step guide.

This guide helps you migrate your existing Chapa API v1 integration to v2.

v2 is the next generation of Chapa's API with enhanced features, improved performance, and better developer experience.

Overview

Migrating from v1 to v2 involves updating:

  • API endpoints
  • Request/response formats
  • Authentication headers
  • Webhook payloads

Key Changes

Base URL

VersionBase URL
v1https://api.chapa.global/v1
v2https://api.chapa.global/v2

Payment Initialization

v1 Endpoint:

POST /v1/transaction/initialize

v2 Endpoint:

POST /v2/payments/hosted

Payment Verification

v1 Endpoint:

GET /v1/transaction/verify/{tx_ref}

v2 Endpoint:

GET /v2/payments/{paymentReference}/verify

Payload and response changes

Amounts are integer cents, with a minimum of 100 for payment, payout, and partial-refund creation. 10000 represents 100 ETB when currency is ETB.

Payment, payout, and refund creation requires Idempotency-Key. Generate one key for each new operation and reuse it when retrying that operation. The same key replays the first response. Validation and subaccount operations are not idempotency-cached.

Use your private key in Authorization: Bearer <PRIVATE_KEY>, except for inline charge, inline validation, and the HTML checkout check, which use a public key. Never put private keys in frontend code.

Direct-charge validation uses POST /v2/payments/direct/validate with reference, payment_method, and optional otp. Direct charge accepts metadata; hosted and inline charges accept meta. Bulk payout uses top-level currency, not default_currency.

Payment and payout data statuses are uppercase (SUCCESS, PENDING). The response envelope still uses lowercase success or error. Lists return cursor pagination with limit (default 10), not page/per_page. Banks and payment methods return arrays in data.

Migration Steps

  1. Update API Base URL - Change from /v1 to /v2
  2. Update Endpoint Paths - Use new v2 endpoint naming
  3. Update Request Bodies - Adjust field names as needed
  4. Update Webhook Handlers - Handle new v2 webhook payload structure
  5. Test in Test Mode - Verify all flows work correctly
  6. Switch to Live Mode - Deploy to production

Best Practices

  • Test thoroughly in Test Mode before going live
  • Update webhook handlers to accept both v1 and v2 formats during transition
  • Monitor for any errors after migration
  • Keep v1 documentation handy for reference

Need Help?

Contact Chapa support if you encounter any issues during migration.

Next Steps

On this page