Skip to content

Retrieves calculations for an invoice

Request

GET {{baseURL}}/pay-int-api/invoices/{{invoiceId}}/calculations

This endpoint retrieves the calculated totals for the specified invoice.

It returns the breakdown behind the invoice's final amount, not just the total itself. This includes the subtotal, shipping, tax, fees, discounts, and any surcharge applied. It's useful for previewing exactly how an invoice's total was derived before showing it to a customer.

The following is an example request.

GET {{baseURL}}/pay-int-api/invoices/{{invoiceId}}/calculations HTTP/1.1
Authorization: Bearer {{merchantApiToken}}
x-api-version: 1.0

See Also:
To retrieve an invoice by ID, see GET /pay-int-api/invoices/{invoiceId}.
To list invoices, see GET /pay-int-api/invoices.
To update an invoice, see PUT /pay-int-api/invoices/{invoiceId}.

Security
Bearer
Path
invoiceIdstring, (uuid)required

Specifies the invoice identifier.

Example:9be2f3a4-5b6c-4d7e-8f9a-0b1c2d3e4f70
Headers
x-api-versionstring

Specifies the API version to use for the request.

Example: 1.0

Example:1.0
curl -i -X GET \
  https://developer.flute.com/_mock/api-reference/pay-int-api/invoices/9be2f3a4-5b6c-4d7e-8f9a-0b1c2d3e4f70/calculations \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'x-api-version: 1.0'

Responses

OK

Bodyapplication/json
idstring, (uuid)

Indicates the invoice identifier.

Example: 9be2f3a4-5b6c-4d7e-8f9a-0b1c2d3e4f70

Example:"9be2f3a4-5b6c-4d7e-8f9a-0b1c2d3e4f70"
subTotalAmountnumber, (double)

Indicates the transaction's subtotal amount.

This includes the base amount, tips, taxes, and discounts.

Example: 3219.45

Example:3219.45
shippingAmountnumber, (double)

Indicates the shipping amount (in USD).

Example: 129.99

Example:129.99
taxPercentagenumber, (double)

Indicates the tax percentage.

Example: 8.50 (as 8.50%)

Example:8.5
taxAmountnumber, (double)

Indicates the tax amount (in USD).

Example: 273.65

Example:273.65
feesPercentagenumber, (double)

Indicates the fees percentage.

Example: 10.25 (as 10.25%)

Example:10.25
feesAmountnumber, (double)

Indicates the fees amount (in USD).

Example: 35.00

Example:35
discountPercentagenumber, (double)

Indicates the discount percentage.

Example: 1.5 (as 1.5%)

Example:1.5
discountAmountnumber, (double)

Indicates the discount amount (in USD).

Example: 48.29

Example:48.29
surchargeAmountnumber, (double)

Indicates the amount (in USD) when a surcharge is applicable.

This is a surcharge on the base amount. This surcharge was calculated using the preset percentage from surchargePercentage.

Example: 6.45 (as $6.45)

Example:6.45
surchargePercentagenumber or null, (double)

Indicates the surcharge percentage.

This is a surcharge on the base amount. This value is surcharge percentage rate. This surcharge percentage calculates the surcharge amount for surchargeAmount.

Example: 1.5 (as 1.5%)

Example:1.5
totalAmountnumber, (double)

Indicates the transaction's total amount (in USD).

This includes the base amount, tips, taxes, shipping, discounts, and other charges.

Example: 3219.45 (as $3219.45)

Example:3219.45
Response
{ "id": "9be2f3a4-5b6c-4d7e-8f9a-0b1c2d3e4f70", "subTotalAmount": 3219.45, "shippingAmount": 129.99, "taxPercentage": 8.5, "taxAmount": 273.65, "feesPercentage": 10.25, "feesAmount": 35, "discountPercentage": 1.5, "discountAmount": 48.29, "surchargeAmount": 6.45, "surchargePercentage": 1.5, "totalAmount": 3219.45 }