POST {{baseURL}}/v2/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.
See Also:
To list transactions, see GET /v2/transactions.
To retrieve a transaction by ID, see GET /v2/transactions/{transactionId}.
To create a new transaction, see POST /v2/transactions.
To share a transaction receipt by SMS, see POST /v2/transactions/{transactionId}/share-receipt.
Specifies the base transaction amount before adjustments.
Examples:
125
125.5
125.50
Identifies the transaction's currency code (in uppercase ISO 4217 currency code).
Example: USD
Identifies the type of pricing.
This value is required only when Dual Pricing is enabled.
Valid values are:
| Status | Explanation |
|---|---|
| Card | The transaction uses the card price, which may include a surcharge. |
| Cash | The transaction uses the cash price, which may include a cash discount. |
Example: Card
Specifies the absolute tip amount (in USD) to add.
Care must be taken that a value other than zero can be provided to either tipAmount or tipRate. A non-zero value cannot be provided to both.
Example: 10.5 (as $10.5)
Specifies the tip rate to apply.
Encoded as raw percentage. For example: 18.5 for 18.5%.
Care must be taken that a value other than zero can be provided to either tipAmount or tipRate. A non-zero value cannot be provided to both.
Example: 18.5 (as 18.5%)
Indicates the absolute amount (in USD) of discount to be applied.
If this value is provided, it must be greater than zero.
Care must be taken that a value other than zero can be provided to either discountAmount or discountRate. A non-zero value cannot be provided to both.
Example: 25 (for $25)
Indicates a percentage of a discount to be applied.
If this value is provided, it must be greater than zero.
Care must be taken that a value other than zero can be provided to either discountAmount or discountRate. A non-zero value cannot be provided to both.
Example: 5.5 (for 5.5%)
- Sandbox environmenthttps://sandbox.api.flute.com/v2/transactions/calculate-amount
- Production environmenthttps://api.flute.com/v2/transactions/calculate-amount
curl -i -X POST \
https://sandbox.api.flute.com/v2/transactions/calculate-amount \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"baseAmount": 100,
"currencyCode": "USD",
"pricingType": "Card",
"discountAmount": 0,
"discountRate": 5,
"surchargeRate": 2.5,
"tipAmount": 15,
"tipRate": 0
}'OK
Identifies the transaction's currency code (in uppercase ISO 4217 currency code).
Example: USD
Indicates the ZCP (zero cost processing) options.
Valid values are:
| Type | Description |
|---|---|
| CashDiscount | Listed price includes a discount for cash payment. |
| DualPricing | Displays a separate price for cash and card. |
| None | No zero cost processing program applied. |
| Surcharge | Adds a fee to the card price at checkout. |
Example: CashDiscount
Identifies the type of pricing.
This value is required only when Dual Pricing is enabled.
Valid values are:
| Status | Explanation |
|---|---|
| Card | The transaction uses the card price, which may include a surcharge. |
| Cash | The transaction uses the cash price, which may include a cash discount. |
Example: Card
{ "currencyCode": "USD", "zeroCostProcessingOption": "Surcharge", "pricingType": "Card", "cash": { "baseAmount": 100, "discountAmount": 15, "discountRate": 0, "surchargeAmount": 0, "surchargeRate": 0, "tipAmount": 15, "tipRate": 0, "totalAmount": 110 }, "creditCard": { "baseAmount": 100, "discountAmount": 15, "discountRate": 0, "surchargeAmount": 3.5, "surchargeRate": 0, "tipAmount": 15, "tipRate": 0, "totalAmount": 113.5 }, "debitCard": { "baseAmount": 100, "discountAmount": 5, "discountRate": 0, "surchargeAmount": 0, "surchargeRate": 0, "tipAmount": 15, "tipRate": 0, "totalAmount": 110 }, "ach": { "baseAmount": 100, "discountAmount": 5, "discountRate": 0, "surchargeAmount": 0, "surchargeRate": 0, "tipAmount": 15, "tipRate": 0, "totalAmount": 110 } }