- Calculates transaction amounts
GET {{baseURL}}/pay-api/v1/transactions/calculate-amount
This endpoint calculates transaction amounts.
The amounts are based on the merchant's ZCP (zero cost processing) mode. This includes dual pricing, cash discounts, or credit card surcharges. Applications, such as payment terminals or point of service devices, can then display the appropriate amounts.
The calculated amounts are for information only. Applications, such as payment terminals or point of service devices, can display the appropriate values. For example, clients could review the suggestions before submitting the payment.
ZCP (zero cost processing) affects the parameter usage.
ZCP = None
Only amount, percentageOffRate (if the merchant has IsPercentageOffEnabled), and tipAmount/tipRate are applied. All other values are ignored, even if present.
ZCP = CashDiscount
The discount rate always comes from the merchant's DefaultCashDiscountRate. Applies only to cash and ACH transactions. All other values are ignored, even if present.
ZCP = DualPricing
The useCardPrice is required. The surchargeRate is ignored.
- Mock serverhttps://developer.flute.com/_mock/api-reference/pay-api/v1/transactions/calculate-amount
- Sandbox environmenthttps://sandbox.api.flute.com/pay-api/v1/transactions/calculate-amount
- Production environmenthttps://api.flute.com/pay-api/v1/transactions/calculate-amount
curl -i -X GET \
'https://developer.flute.com/_mock/api-reference/pay-api/v1/transactions/calculate-amount?amount=29.49¤cyId=1&useCardPrice=true&percentageOffRate=25&surchargeRate=15&tipAmount=62.38&tipRate=18' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'OK
Indicates the currency code (in ISO 4217 currency code).
Example: USD
Identifies the zero cost processing option.
Possible values:
| Id | Type |
|---|---|
| 1 | None |
| 2 | CashDiscount |
| 3 | DualPricing |
| 4 | Surcharge |
Example: 3
Zero Cost Processing Option name.
Possible values:
| Type | Id |
|---|---|
| None | 1 |
| CashDiscount | 2 |
| DualPricing | 3 |
| Surcharge | 4 |
Example: DualPricing
{ "currencyId": 1, "currency": "USD", "zeroCostProcessingOptionId": 3, "zeroCostProcessingOption": "DualPricing", "useCardPrice": true, "cash": { "baseAmount": 129.99, "percentageOffAmount": 12.5, "percentageOffRate": 3.5, "cashDiscountAmount": 0.1, "cashDiscountRate": 1.5, "cashDiscountPercentage": 1.5, "surchargeAmount": 6.45, "surchargeRate": 1.5, "tipAmount": 14.5, "tipRate": 15, "taxAmount": 0.1, "taxRate": 0.1, "totalAmount": 3219.45 }, "creditCard": { "baseAmount": 129.99, "percentageOffAmount": 12.5, "percentageOffRate": 3.5, "cashDiscountAmount": 0.1, "cashDiscountRate": 1.5, "cashDiscountPercentage": 1.5, "surchargeAmount": 6.45, "surchargeRate": 1.5, "tipAmount": 14.5, "tipRate": 15, "taxAmount": 0.1, "taxRate": 0.1, "totalAmount": 3219.45 }, "debitCard": { "baseAmount": 129.99, "percentageOffAmount": 12.5, "percentageOffRate": 3.5, "cashDiscountAmount": 0.1, "cashDiscountRate": 1.5, "cashDiscountPercentage": 1.5, "surchargeAmount": 6.45, "surchargeRate": 1.5, "tipAmount": 14.5, "tipRate": 15, "taxAmount": 0.1, "taxRate": 0.1, "totalAmount": 3219.45 }, "ach": { "baseAmount": 129.99, "percentageOffAmount": 12.5, "percentageOffRate": 3.5, "cashDiscountAmount": 0.1, "cashDiscountRate": 1.5, "cashDiscountPercentage": 1.5, "surchargeAmount": 6.45, "surchargeRate": 1.5, "tipAmount": 14.5, "tipRate": 15, "taxAmount": 0.1, "taxRate": 0.1, "totalAmount": 3219.45 } }