Get payment fees
Returns the Papi fee that the payer pays for a given payment method and amount, and the total amount debited from the payer's account. Call it to show the fees in your own checkout before the payer confirms.
For the concepts and the whole flow, see the Payment API guide.
Endpoint
GET https://app.papi.mg/engine/api/v1/payments/fees?paymentMethod={paymentMethod}&amount={amount}
| Item | Value |
|---|---|
| Base URL | https://app.papi.mg/engine/api |
| Path | /v1/payments/fees |
| Method | GET |
| Request body | None |
| Response body | JSON |
The same path is available in the sandbox environment.
Authentication
Every request must carry your shop API key in the Token header. You find the API key in the dashboard: Avatar icon → Boutiques → select shop → Developer tab. It is the same key as for the payment link API.
The fees are computed with the settings of the shop that the API key belongs to.
Request headers
| Header | Required | Value | Description |
|---|---|---|---|
Token | ✓ | <YOUR_API_KEY> | API key of your shop. |
The LinkToken header used by the payment page is not accepted as an authentication method.
Query parameters
| Parameter | Type | Required | Constraints | Description |
|---|---|---|---|---|
paymentMethod | string | ✓ | One of MVOLA, AIRTEL_MONEY, ORANGE_MONEY. Card methods are refused. | Payment method chosen by the payer, among the payment methods enabled on your shop. |
amount | integer | ✓ | Whole number in MGA. Minimum 300. | Amount of the payment, without the payer fee. |
Request example
curl -X GET "https://app.papi.mg/engine/api/v1/payments/fees?paymentMethod=MVOLA&amount=10000" \
-H "Token: <YOUR_API_KEY>"
Success response
Status: 200 OK
{
"data": {
"paymentMethod": "MVOLA",
"amount": 10000.0,
"payerFee": 380.0,
"totalAmount": 10380.0,
"currency": "MGA"
}
}
Response fields
| Field | Type | Description |
|---|---|---|
paymentMethod | string | The payment method of the request. |
amount | number | The amount of the request. |
payerFee | number | Papi fee charged to the payer on top of amount. It depends on the share of the fee that your shop assigns to the payer. It can be 0. |
totalAmount | number | Amount debited from the payer's account: amount + payerFee. |
currency | string | Currency of the amounts (MGA). |
Errors
Error body format:
{
"error": {
"code": "<ERROR_CODE>",
"message": "<Human-readable message, in French>"
}
}
| HTTP status | Error code | Meaning |
|---|---|---|
400 | CORE_INPUT_400 | A query parameter is missing or not valid (for example, amount lower than 300), or paymentMethod is not one of MVOLA, AIRTEL_MONEY, ORANGE_MONEY. |
400 | PAYMENT_METHOD_NOT_ENABLED | The payment method exists but is not enabled on your shop. |
401 | CORE_PERM_0001 | The Token header is missing, or the API key is invalid (message: API key invalide). |
Practical notes
- You send amounts as whole numbers in
MGA:MGAhas no fraction. Papi returns every amount and fee as a number (5000.0), never rounded, like the payment-link API. OnlyMGAis supported today. - The
payerFeeandtotalAmountof the payment itself are returned when you initiate the payment. Use this endpoint to inform the payer before the initiation. - Calling this endpoint is optional. You can initiate a payment without it.