# Calculates transaction amounts

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.
This endpoint requires a merchant API token.
A partner API token will result in a permissions error including possibly a 403 response.
See Also:
To list transactions, see GET /v2/transactions.
To retrieve a transaction by ID, see GET /v2/transactions/{transactionId}.
To create a transaction, see POST /v2/transactions.
To share a transaction receipt by SMS or email, see POST /v2/transactions/{transactionId}/share-receipt.

  [ Request body ]
  [ Response body ]

Endpoint: POST /v2/transactions/calculate-amount
Version: V2
Security: Bearer

## Security:

  - `Bearer` (unknown)
    http bearer JWT

## Request fields (application/json):

  - `baseAmount` (number, required)
    Specifies the base transaction amount (in USD) before adjustments.
Examples:
125
125.5
125.50
    Example: 125.5

  - `currencyCode` (string)
    Specifies the transaction's currency code (in uppercase ISO 4217 currency code).

Example: USD
    Enum: "USD"

  - `pricingType` (string)
    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
    Enum: "Card", "Cash"

  - `tipAmount` (number)
    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)
    Example: 10.5

  - `tipRate` (number)
    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%)
    Example: 18.5

  - `discountAmount` (number)
    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)
    Example: 25

  - `discountRate` (number)
    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%)
    Example: 5.5

  - `surchargeRate` (number)
    Specifies the credit Card surcharge rate override.
Example: 2.5 (for 2.5%)
    Example: 2.5

  - `taxRate` (number)
    Specifies the tax rate percentage to apply to the base amount.
Valid values range from 0 to 100, with up to three decimal places.
A `taxMode` value must be used with exactly one of `taxRate` or `taxAmount`, or none of the three.
When all three are omitted, the payment session has no tax configured.
Example: 8.25 (for 8.25%)
    Example: 8.25

  - `taxAmount` (number)
    Specifies a fixed tax amount (in USD) to apply to the base amount.
This value has up to two decimal places and cannot be negative.
This value requires a fixed `baseAmount`.
A `taxMode` value must be used with exactly one of `taxRate` or `taxAmount`, or none of the three.
When all three are omitted, the payment session has no tax configured.
A response carries this value only when the tax was configured as an amount.
Otherwise, it is `null`.
Examples:
3.75 (for $3.75)
null
    Example: 3.75

  - `taxMode` (string)
    Specifies how `taxRate` and `taxAmount` is applied to `amount`.
| Name | Description |
|  --- | --- |
| Exclusive | Adds the tax on top of `amount`. The payer is charged `amount` plus the tax. |
| Inclusive | Treats `amount` as already including the tax. No extra amount is added. |

A `taxMode` value must be used with exactly one of `taxRate` or `taxAmount`, or none of the three.
When all three are omitted, the payment session has no tax configured.
Example: Exclusive
    Enum: "Exclusive", "Inclusive"

## Response 200:

  - `200` (unknown)
    OK

## Response 200 fields (application/json):

  - `currencyCode` (string)
    Specifies the transaction's currency code (in uppercase ISO 4217 currency code).

Example: USD
    Enum: "USD"

  - `zeroCostProcessingOption` (string)
    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
    Enum: "None", "CashDiscount", "DualPricing", "Surcharge"

  - `zeroCostProcessingRate` (number)
    Indicates the rate, as a raw percentage, that the merchant's zero cost processing option applied to this quote.
This value is `null` when `zeroCostProcessingOption` is `None`.
Example: 2.5
    Example: 2.5

  - `pricingType` (string)
    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
    Enum: "Card", "Cash"

  - `cash` (object)
    Amount breakdown for a specific payment method.

  - `cash.baseAmount` (number)
    Identifies the base transaction amount (in USD) before adjustments.
Examples:
125
125.5
125.50
    Example: 125.5

  - `cash.discountAmount` (number)
    Indicates the discount amount (in USD) applied.
Example: 22.5 (for $22.5)
    Example: 22.5

  - `cash.discountRate` (number)
    Indicates the discount percent applied.
Example: 18.5 (for 18.5%)
    Example: 18.5

  - `cash.surchargeAmount` (number)
    Indicates the surcharge amount (in USD) applied.
Example: 12.75 (for $12.75)
    Example: 12.75

  - `cash.surchargeRate` (number)
    Indicates the surcharge percent applied.
Example: 8.25 (for 8.25%)
    Example: 8.25

  - `cash.tipAmount` (number)
    Indicates the absolute amount (in USD) of the tip to be added.
If this value is provided, it must be greater than zero.
This amount adds to the base amount of the original transaction.
That transaction must be created with a manual capture method first (POST /v2/transactions, with `transactionDetails.cardData.captureMethod` set to `Manual`).
Example: 14.50 (for $14.50)
    Example: 14.5

  - `cash.tipRate` (number)
    Indicates the tip percent applied.
Example: 15.25 (for 15.25%)
    Example: 15.25

  - `cash.taxRate` (number)
    Indicates the tax rate applied, as a raw percentage.
This value is derived from `taxAmount` when a fixed tax was sent. It is `0` when no tax was sent.
Example: 8.25 (for 8.25%)
    Example: 8.25

  - `cash.taxAmount` (number)
    Indicates the tax (in USD) for this payment method.
This value is added to the total when the tax mode is `Exclusive`. It is included in it when `Inclusive`. It is `0` when no tax was sent.
Example: 7.84 (for $7.84)
    Example: 7.84

  - `cash.totalAmount` (number)
    Indicates the final total amount  (in USD).
Example: 124.99 (for $124.99)
    Example: 124.99

## Response 400:

  - `400` (unknown)
    Bad Request

## Response 400 fields (application/json):

  - `details` (string)
    Indicates details about the error.

Example: Unauthorized
    Example: Unauthorized

  - `statusCode` (integer)
    Specifies the HTTP response status code.
This is the HTTP status code returned by the attempted delivery.
The following is a list of HTTP response status codes that include but are not limited to:
| HTTP Response | Meaning |
|  --- | --- |
| 200 | Delivery succeeded |
| 400 | Bad request |
| 401 | Unauthorized |
| 404 | Endpoint not found |
| 429 | Rate limited |

Example: 401
    Example: 401

  - `source` (string)
    Indicates the source of the error.
Example: <Service>
    Example: <Service>

  - `exceptionType` (string)
    Indicates the error's exception type.

Example: FluentValidation.ValidationException
    Example: FluentValidation.ValidationException

  - `correlationId` (string)
    Indicates the correlation identifier.

This is a unique identifier, a trace identifier, Flute attaches to a request/response pair so a single transaction can be traced end-to-end across systems and logs. 

Its intent is to support troubleshooting.
We recommend including this value when contacting support.

Example: aa6cfcd0-0295-4a4c-b074-8c901f114fef
    Example: aa6cfcd0-0295-4a4c-b074-8c901f114fef

  - `entityId` (string)
    Indicates the entity identifier.
This is a field on Flute's standard error response object, alongside values such as `correlationId`, `errorCode`, or `statusCode`.
It's the identifier of the specific resource the failed request was about.
Error messages may specify "Entity with identifier b31fbe9f-eebb-45ce-9cae-92265389f47f does not exist or has been deleted."
When a 404 (or similar entity-specific error, like a conflict) comes back,
check `entityId` to get the exact identifier of the record that couldn't be found or matched.
This is useful for confirming which resource reference was wrong, especially if the request touched multiple identifiers at once.
Example: null

  - `errorCode` (string)
    Indicates the error code.
Example:
null

  - `title` (string)
    Indicates a short, human-readable summary of the error category.

Example: Resource not found
    Example: Resource not found

  - `cause` (string)
    Indicates the reason the error occurred.

Example: The requested resource does not exist or has been deleted.
    Example: The requested resource does not exist or has been deleted.

  - `resolution` (string)
    Indicates the recommended action for resolving the error.

Example: Verify the resource identifier is correct or retrieve a list of available resources.
    Example: Verify the resource identifier is correct or retrieve a list of available resources.

  - `documentationUrl` (string)
    https://developer.flute.com/

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `details` (string)
    Indicates details about the error.

Example: Unauthorized
    Example: Unauthorized

  - `statusCode` (integer)
    Specifies the HTTP response status code.
This is the HTTP status code returned by the attempted delivery.
The following is a list of HTTP response status codes that include but are not limited to:
| HTTP Response | Meaning |
|  --- | --- |
| 200 | Delivery succeeded |
| 400 | Bad request |
| 401 | Unauthorized |
| 404 | Endpoint not found |
| 429 | Rate limited |

Example: 401
    Example: 401

  - `source` (string)
    Indicates the source of the error.
Example: <Service>
    Example: <Service>

  - `exceptionType` (string)
    Indicates the error's exception type.

Example: FluentValidation.ValidationException
    Example: FluentValidation.ValidationException

  - `correlationId` (string)
    Indicates the correlation identifier.

This is a unique identifier, a trace identifier, Flute attaches to a request/response pair so a single transaction can be traced end-to-end across systems and logs. 

Its intent is to support troubleshooting.
We recommend including this value when contacting support.

Example: aa6cfcd0-0295-4a4c-b074-8c901f114fef
    Example: aa6cfcd0-0295-4a4c-b074-8c901f114fef

  - `entityId` (string)
    Indicates the entity identifier.
This is a field on Flute's standard error response object, alongside values such as `correlationId`, `errorCode`, or `statusCode`.
It's the identifier of the specific resource the failed request was about.
Error messages may specify "Entity with identifier b31fbe9f-eebb-45ce-9cae-92265389f47f does not exist or has been deleted."
When a 404 (or similar entity-specific error, like a conflict) comes back,
check `entityId` to get the exact identifier of the record that couldn't be found or matched.
This is useful for confirming which resource reference was wrong, especially if the request touched multiple identifiers at once.
Example: null

  - `errorCode` (string)
    Indicates the error code.
Example:
null

  - `title` (string)
    Indicates a short, human-readable summary of the error category.

Example: Resource not found
    Example: Resource not found

  - `cause` (string)
    Indicates the reason the error occurred.

Example: The requested resource does not exist or has been deleted.
    Example: The requested resource does not exist or has been deleted.

  - `resolution` (string)
    Indicates the recommended action for resolving the error.

Example: Verify the resource identifier is correct or retrieve a list of available resources.
    Example: Verify the resource identifier is correct or retrieve a list of available resources.

  - `documentationUrl` (string)
    https://developer.flute.com/

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `details` (string)
    Indicates details about the error.

Example: Validation failed: -- Email: 'Email' is not a valid email address. Severity: Error
    Example: Validation failed: -- Email: 'Email' is not a valid email address. Severity: Error

  - `statusCode` (integer)
    Specifies the HTTP response status code.
This is the HTTP status code returned by the attempted delivery.
The following is a list of HTTP response status codes that include but are not limited to:
| HTTP Status | Meaning |
|  --- | --- |
| 200 | Delivery succeeded |
| 400 | Bad request |
| 401 | Unauthorized |
| 404 | Endpoint not found |
| 429 | Rate limited |

Example: 401
    Example: 401

  - `source` (string)
    Indicates the source of the error.
Example: <Service>
    Example: <Service>

  - `exceptionType` (string)
    Indicates the error's exception type.

Example: FluentValidation.ValidationException
    Example: FluentValidation.ValidationException

  - `correlationId` (string)
    Indicates the correlation identifier.

Example: aa6cfcd0-0295-4a4c-b074-8c901f114fef
    Example: aa6cfcd0-0295-4a4c-b074-8c901f114fef

  - `entityId` (string)
    Indicates the entity identifier.
Example:
null

  - `errorCode` (string)
    Indicates the error code.
Example:
null

  - `title` (string)

  - `cause` (string)

  - `resolution` (string)

  - `documentationUrl` (string)
    https://developer.flute.com/

  - `errors` (object)

## Response 429:

  - `429` (unknown)
    Too Many Requests

## Response 429 fields (application/json):

  - `details` (string)
    Indicates details about the error.

Example: Unauthorized
    Example: Unauthorized

  - `statusCode` (integer)
    Specifies the HTTP response status code.
This is the HTTP status code returned by the attempted delivery.
The following is a list of HTTP response status codes that include but are not limited to:
| HTTP Response | Meaning |
|  --- | --- |
| 200 | Delivery succeeded |
| 400 | Bad request |
| 401 | Unauthorized |
| 404 | Endpoint not found |
| 429 | Rate limited |

Example: 401
    Example: 401

  - `source` (string)
    Indicates the source of the error.
Example: <Service>
    Example: <Service>

  - `exceptionType` (string)
    Indicates the error's exception type.

Example: FluentValidation.ValidationException
    Example: FluentValidation.ValidationException

  - `correlationId` (string)
    Indicates the correlation identifier.

This is a unique identifier, a trace identifier, Flute attaches to a request/response pair so a single transaction can be traced end-to-end across systems and logs. 

Its intent is to support troubleshooting.
We recommend including this value when contacting support.

Example: aa6cfcd0-0295-4a4c-b074-8c901f114fef
    Example: aa6cfcd0-0295-4a4c-b074-8c901f114fef

  - `entityId` (string)
    Indicates the entity identifier.
This is a field on Flute's standard error response object, alongside values such as `correlationId`, `errorCode`, or `statusCode`.
It's the identifier of the specific resource the failed request was about.
Error messages may specify "Entity with identifier b31fbe9f-eebb-45ce-9cae-92265389f47f does not exist or has been deleted."
When a 404 (or similar entity-specific error, like a conflict) comes back,
check `entityId` to get the exact identifier of the record that couldn't be found or matched.
This is useful for confirming which resource reference was wrong, especially if the request touched multiple identifiers at once.
Example: null

  - `errorCode` (string)
    Indicates the error code.
Example:
null

  - `title` (string)
    Indicates a short, human-readable summary of the error category.

Example: Resource not found
    Example: Resource not found

  - `cause` (string)
    Indicates the reason the error occurred.

Example: The requested resource does not exist or has been deleted.
    Example: The requested resource does not exist or has been deleted.

  - `resolution` (string)
    Indicates the recommended action for resolving the error.

Example: Verify the resource identifier is correct or retrieve a list of available resources.
    Example: Verify the resource identifier is correct or retrieve a list of available resources.

  - `documentationUrl` (string)
    https://developer.flute.com/

## Response 500:

  - `500` (unknown)
    Internal Server Error

## Response 500 fields (application/json):

  - `details` (string)
    Indicates details about the error.

Example: Unauthorized
    Example: Unauthorized

  - `statusCode` (integer)
    Specifies the HTTP response status code.
This is the HTTP status code returned by the attempted delivery.
The following is a list of HTTP response status codes that include but are not limited to:
| HTTP Response | Meaning |
|  --- | --- |
| 200 | Delivery succeeded |
| 400 | Bad request |
| 401 | Unauthorized |
| 404 | Endpoint not found |
| 429 | Rate limited |

Example: 401
    Example: 401

  - `source` (string)
    Indicates the source of the error.
Example: <Service>
    Example: <Service>

  - `exceptionType` (string)
    Indicates the error's exception type.

Example: FluentValidation.ValidationException
    Example: FluentValidation.ValidationException

  - `correlationId` (string)
    Indicates the correlation identifier.

This is a unique identifier, a trace identifier, Flute attaches to a request/response pair so a single transaction can be traced end-to-end across systems and logs. 

Its intent is to support troubleshooting.
We recommend including this value when contacting support.

Example: aa6cfcd0-0295-4a4c-b074-8c901f114fef
    Example: aa6cfcd0-0295-4a4c-b074-8c901f114fef

  - `entityId` (string)
    Indicates the entity identifier.
This is a field on Flute's standard error response object, alongside values such as `correlationId`, `errorCode`, or `statusCode`.
It's the identifier of the specific resource the failed request was about.
Error messages may specify "Entity with identifier b31fbe9f-eebb-45ce-9cae-92265389f47f does not exist or has been deleted."
When a 404 (or similar entity-specific error, like a conflict) comes back,
check `entityId` to get the exact identifier of the record that couldn't be found or matched.
This is useful for confirming which resource reference was wrong, especially if the request touched multiple identifiers at once.
Example: null

  - `errorCode` (string)
    Indicates the error code.
Example:
null

  - `title` (string)
    Indicates a short, human-readable summary of the error category.

Example: Resource not found
    Example: Resource not found

  - `cause` (string)
    Indicates the reason the error occurred.

Example: The requested resource does not exist or has been deleted.
    Example: The requested resource does not exist or has been deleted.

  - `resolution` (string)
    Indicates the recommended action for resolving the error.

Example: Verify the resource identifier is correct or retrieve a list of available resources.
    Example: Verify the resource identifier is correct or retrieve a list of available resources.

  - `documentationUrl` (string)
    https://developer.flute.com/

