Chapa

Quick Start

Initialize checkout and verify a payment using the legacy Chapa API v1.

Use this guide when maintaining a Chapa API v1 integration. For a new v2 integration, follow the v2 Quick Start.

Step 1: Sign up for an account

Create or sign in to your merchant account on the Chapa Dashboard.

Step 2: Start in Test Mode

Select Test Mode in the dashboard while building your integration. Keep test transactions and credentials separate from live transactions and credentials. See Test Mode vs Live Mode.

Step 3: Get your API Keys

Open Settings → API Keys and copy your v1 test secret key. Keep it on your server and send it in the Authorization: Bearer <CHAPA_SECRET_KEY> header.

Step 4: Initialize a Payment on Your Server

Send POST https://api.chapa.co/v1/transaction/initialize with the payment details and a unique tx_ref for the payment attempt. V1 amounts use the currency's major unit: "10" means 10 ETB when the currency is ETB.

Replace the example credentials with your test secret key, and use your own callback and return URLs. See Accept Payment for the request fields.

Example Request
JSON
cURL
JavaScript
PHP
Python

Step 5: Redirect the Customer

Redirect the customer to data.checkout_url from the initialization response. Store the tx_ref with the expected order amount and currency on your server.

Step 6: Verify Before Fulfillment

When the customer returns or you receive a payment notification, call GET https://api.chapa.co/v1/transaction/verify/{tx_ref} from your server using the same tx_ref.

Example Request
cURL
JavaScript
Python

Confirm the payment's data.status is success, and match the returned reference, amount, and currency to your stored order before fulfilling it. Make fulfillment idempotent so repeated callbacks or webhooks cannot deliver the order twice. A successful redirect alone does not confirm payment.

Next Steps

On this page