Chapa
Payments

Hosted Checkout

Create a checkout session, redirect the customer, and verify the payment.

Hosted checkout lets customers complete payment on Chapa's checkout page. Your backend initializes the payment and receives a checkout_url.

Initialize checkout

POST /v2/payments/hosted
Host: api.chapa.global
Authorization: Bearer <PRIVATE_KEY>
Content-Type: application/json
Idempotency-Key: <UNIQUE_OPERATION_KEY>

Reuse the same idempotency key when retrying an operation. Use a new key for a new payment.

Request fields

FieldRequiredDescription
amountYesInteger cents, minimum 100
currencyYesCurrency enabled for the payment method
merchant_referenceNoUnique merchant reference, maximum 20 characters
preferred_payment_methodsNoArray of preferred payment method slugs
customerNoCustomer details
callback_urlNoHTTPS callback URL
return_urlNoHTTPS URL to return the customer to
subaccountsNoArray of payment split rules
metaNoCustom metadata
customizationNotitle, description, and logo

The customer object accepts first_name, last_name, email, phone_number, and card_number.

10000 represents 100 ETB when the currency is ETB. Retrieve Payment Methods to check enabled methods and currency limits.

Example Request

For cURL, set PRIVATE_KEY in your shell. Set IDEMPOTENCY_KEY for this operation and reuse it on retries. Replace the placeholders in the JavaScript example before running it.

JSON
{
  "amount": 10000,
  "currency": "ETB",
  "merchant_reference": "ref-1791192600",
  "preferred_payment_methods": [
    "telebirr"
  ],
  "customer": {
    "first_name": "Abebe",
    "last_name": "Kebede",
    "email": "abebe.kebede@example.com",
    "phone_number": "251911000000"
  },
  "callback_url": "https://example.com/chapa/callback",
  "return_url": "https://example.com/chapa/return",
  "meta": {
    "order_id": "ORD-1001"
  },
  "customization": {
    "title": "Order #1001",
    "description": "Payment for order 1001",
    "logo": "https://example.com/logo.png"
  }
}
cURL
curl -X POST 'https://api.chapa.global/v2/payments/hosted' \
  -H "Authorization: Bearer $PRIVATE_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "amount": 10000,
  "currency": "ETB",
  "merchant_reference": "ref-1791192600",
  "preferred_payment_methods": [
    "telebirr"
  ],
  "customer": {
    "first_name": "Abebe",
    "last_name": "Kebede",
    "email": "abebe.kebede@example.com",
    "phone_number": "251911000000"
  },
  "callback_url": "https://example.com/chapa/callback",
  "return_url": "https://example.com/chapa/return",
  "meta": {
    "order_id": "ORD-1001"
  },
  "customization": {
    "title": "Order #1001",
    "description": "Payment for order 1001",
    "logo": "https://example.com/logo.png"
  }
}'
JavaScript
const response = await fetch("https://api.chapa.global/v2/payments/hosted", {
  method: "POST",
  headers: {
  "Authorization": "Bearer <PRIVATE_KEY>",
  "Idempotency-Key": "<IDEMPOTENCY_KEY>",
  "Content-Type": "application/json"
},
  body: JSON.stringify({
  "amount": 10000,
  "currency": "ETB",
  "merchant_reference": "ref-1791192600",
  "preferred_payment_methods": [
    "telebirr"
  ],
  "customer": {
    "first_name": "Abebe",
    "last_name": "Kebede",
    "email": "abebe.kebede@example.com",
    "phone_number": "251911000000"
  },
  "callback_url": "https://example.com/chapa/callback",
  "return_url": "https://example.com/chapa/return",
  "meta": {
    "order_id": "ORD-1001"
  },
  "customization": {
    "title": "Order #1001",
    "description": "Payment for order 1001",
    "logo": "https://example.com/logo.png"
  }
})
});
const data = await response.json();

console.log(data);
Example Response
200 Success
{
  "status": "success",
  "message": "Payment initiated successfully",
  "data": {
    "checkout_url": "https://checkout.chapa.global/CH0Vn2VASWCi",
    "created_at": "2026-10-05T09:30:00Z",
    "expires_at": "2026-10-06T09:30:00Z"
  }
}
400 Error
{
  "status": "error",
  "message": "Idempotency-Key header is required for payment operations",
  "error": {
    "code": "MISSING_REQUIRED_FIELD",
    "details": null
  }
}
401 Error
{
  "status": "error",
  "message": "Invalid API key or User does not exist",
  "error": {
    "code": "UNAUTHORIZED",
    "details": null
  }
}
403 Error
{
  "status": "error",
  "message": "API key environment does not match business environment.",
  "error": {
    "code": "INVALID_VALUE",
    "details": null
  }
}
409 Error
{
  "status": "error",
  "message": "Merchant reference has been used before",
  "error": {
    "code": "INVALID_STATE",
    "details": null
  }
}
500 Error
{
  "status": "error",
  "message": "Failed to marshal subaccounts",
  "error": {
    "code": "PROCESSING_FAILED",
    "details": null
  }
}

Redirect and store the reference

Redirect the customer to the returned data.checkout_url. Store that URL and your merchant_reference. The final path segment of the checkout URL is the Chapa payment reference. Store created_at and expires_at if you need to track checkout validity.

Use the returned URL directly; do not construct a checkout URL from a hardcoded host.

Verify before fulfillment

After a redirect or notification, your server calls:

GET /v2/payments/{paymentReference}/verify
Authorization: Bearer <PRIVATE_KEY>

The path accepts either the Chapa reference or your merchant reference. Fulfill only when data.status === "SUCCESS", the amount and currency match the order, and the reference belongs to the expected payment attempt. Top-level status: "success" means the API operation succeeded, not that the customer paid.

Continue the integration

On this page