Skip to main content

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}

ItemValue
Base URLhttps://app.papi.mg/engine/api
Path/v1/payments/fees
MethodGET
Request bodyNone
Response bodyJSON

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​

HeaderRequiredValueDescription
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​

ParameterTypeRequiredConstraintsDescription
paymentMethodstring✓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.
amountinteger✓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​

FieldTypeDescription
paymentMethodstringThe payment method of the request.
amountnumberThe amount of the request.
payerFeenumberPapi 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.
totalAmountnumberAmount debited from the payer's account: amount + payerFee.
currencystringCurrency of the amounts (MGA).

Errors​

Error body format:

{
"error": {
"code": "<ERROR_CODE>",
"message": "<Human-readable message, in French>"
}
}
HTTP statusError codeMeaning
400CORE_INPUT_400A query parameter is missing or not valid (for example, amount lower than 300), or paymentMethod is not one of MVOLA, AIRTEL_MONEY, ORANGE_MONEY.
400PAYMENT_METHOD_NOT_ENABLEDThe payment method exists but is not enabled on your shop.
401CORE_PERM_0001The Token header is missing, or the API key is invalid (message: API key invalide).

Practical notes​

  • You send amounts as whole numbers in MGA: MGA has no fraction. Papi returns every amount and fee as a number (5000.0), never rounded, like the payment-link API. Only MGA is supported today.
  • The payerFee and totalAmount of 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.