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.
| Field | Required | Description |
|---|---|---|
payment_method | Yes | Enabled wallet method |
amount | Yes | Integer cents, minimum 100 |
currency | Yes | Supported currency |
mobile | Yes | Customer phone number |
merchant_reference | No | Unique reference, maximum 20 characters |
first_name | No | Customer first name |
last_name | No | Customer last name |
email | No | Customer email |
callback_url | No | Callback URL |
return_url | No | Return URL |
meta | No | Custom metadata |
Inline charge uses top-level customer fields, including mobile. Direct charge uses a nested customer object and metadata.
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.
{
"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 -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"
}
}'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);{
"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"
}
}{
"status": "error",
"message": "invalid phone number format",
"error": {
"code": "INVALID_FORMAT",
"details": null
}
}{
"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/jsonSend 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.
For cURL, set PUBLIC_KEY in your shell. Replace the placeholders in the JavaScript example before running it.
{
"reference": "CH0Vn2VASWCi",
"payment_method": "telebirr",
"otp": "123456"
}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"
}'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);{
"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"
}
}{
"status": "error",
"message": "Reference is required",
"error": {
"code": "MISSING_REQUIRED_FIELD",
"details": null
}
}{
"status": "error",
"message": "Invalid API key or User does not exist",
"error": {
"code": "UNAUTHORIZED",
"details": null
}
}{
"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.