Chapa
Payments

Inline Charge

Initialize and validate browser checkout charges using a public key.

The production collection exposes public-key inline charge and validation endpoints. It does not define a JavaScript SDK, script URL, or widget callback API. Use the requests below for the documented API flow.

Initialize an inline charge

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

JSON and multipart form bodies are accepted.

FieldRequiredDescription
payment_methodYesEnabled wallet method
amountYesInteger cents, minimum 100
currencyYesSupported currency
mobileYesCustomer phone number
merchant_referenceNoUnique reference, maximum 20 characters
first_nameNoCustomer first name
last_nameNoCustomer last name
emailNoCustomer email
callback_urlNoCallback URL
return_urlNoReturn URL
metaNoCustom metadata

Inline charge uses top-level customer fields, including mobile. Direct charge uses a nested customer object and metadata.

Example Request

For cURL, set PUBLIC_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
{
  "payment_method": "telebirr",
  "amount": 10000,
  "currency": "ETB",
  "merchant_reference": "ref-1791192600",
  "mobile": "251911000000",
  "first_name": "Abebe",
  "last_name": "Kebede",
  "email": "abebe.kebede@example.com",
  "callback_url": "https://example.com/chapa/callback",
  "return_url": "https://example.com/chapa/return",
  "meta": {
    "order_id": "ORD-1001"
  }
}
cURL
curl -X POST 'https://api.chapa.global/v2/payments/inline' \
  -H "Authorization: Bearer $PUBLIC_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "payment_method": "telebirr",
  "amount": 10000,
  "currency": "ETB",
  "merchant_reference": "ref-1791192600",
  "mobile": "251911000000",
  "first_name": "Abebe",
  "last_name": "Kebede",
  "email": "abebe.kebede@example.com",
  "callback_url": "https://example.com/chapa/callback",
  "return_url": "https://example.com/chapa/return",
  "meta": {
    "order_id": "ORD-1001"
  }
}'
JavaScript
const response = await fetch("https://api.chapa.global/v2/payments/inline", {
  method: "POST",
  headers: {
  "Authorization": "Bearer <PUBLIC_KEY>",
  "Idempotency-Key": "<IDEMPOTENCY_KEY>",
  "Content-Type": "application/json"
},
  body: JSON.stringify({
  "payment_method": "telebirr",
  "amount": 10000,
  "currency": "ETB",
  "merchant_reference": "ref-1791192600",
  "mobile": "251911000000",
  "first_name": "Abebe",
  "last_name": "Kebede",
  "email": "abebe.kebede@example.com",
  "callback_url": "https://example.com/chapa/callback",
  "return_url": "https://example.com/chapa/return",
  "meta": {
    "order_id": "ORD-1001"
  }
})
});
const data = await response.json();

console.log(data);
Example Response
200 Success
{
  "status": "success",
  "message": "Inline charge initiated",
  "data": {
    "auth_type": "USSD",
    "chapa_reference": "CH0Vn2VASWCi",
    "payment_status": "PENDING",
    "request_id": "req_8f3a1c",
    "created_at": "2026-10-05T09:30:00Z",
    "expires_at": "2026-10-05T09:35:00Z"
  }
}
400 Error
{
  "status": "error",
  "message": "invalid phone number format",
  "error": {
    "code": "INVALID_FORMAT",
    "details": null
  }
}
401 Error
{
  "status": "error",
  "message": "Invalid API key or User does not exist",
  "error": {
    "code": "UNAUTHORIZED",
    "details": null
  }
}

Validate the charge

POST /v2/payments/inline/validate
Authorization: Bearer <PUBLIC_KEY>
Content-Type: application/json

Send the returned chapa_reference as reference, the same payment_method, and otp for OTP methods. USSD methods use this endpoint for polling. Validation is not idempotency-cached.

Example Request

For cURL, set PUBLIC_KEY in your shell. Replace the placeholders in the JavaScript example before running it.

JSON
{
  "reference": "CH0Vn2VASWCi",
  "payment_method": "telebirr",
  "otp": "123456"
}
cURL
curl -X POST 'https://api.chapa.global/v2/payments/inline/validate' \
  -H "Authorization: Bearer $PUBLIC_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "reference": "CH0Vn2VASWCi",
  "payment_method": "telebirr",
  "otp": "123456"
}'
JavaScript
const response = await fetch("https://api.chapa.global/v2/payments/inline/validate", {
  method: "POST",
  headers: {
  "Authorization": "Bearer <PUBLIC_KEY>",
  "Content-Type": "application/json"
},
  body: JSON.stringify({
  "reference": "CH0Vn2VASWCi",
  "payment_method": "telebirr",
  "otp": "123456"
})
});
const data = await response.json();

console.log(data);
Example Response
200 Success
{
  "status": "success",
  "message": "Inline charge validation result",
  "data": {
    "chapa_reference": "CH0Vn2VASWCi",
    "merchant_reference": "ref-1759656600",
    "amount": 10000,
    "currency": "ETB",
    "status": "SUCCESS",
    "payment_method": "telebirr",
    "processor_reference": "TB123456789",
    "callback_url": "https://example.com/chapa/callback",
    "return_url": "https://example.com/chapa/return",
    "created_at": "2026-10-05T09:30:00Z",
    "updated_at": "2026-10-05T09:30:00Z"
  }
}
400 Error
{
  "status": "error",
  "message": "Reference is required",
  "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
  }
}
404 Error
{
  "status": "error",
  "message": "Payment not found",
  "error": {
    "code": "NOT_FOUND",
    "details": null
  }
}

Your backend must verify the payment with its private key before fulfillment. Confirm data.status === "SUCCESS", amount, currency, and merchant reference. Never expose your private key in browser code.

See Verify Payments and Hosted Checkout.

On this page