Preview Payment Fees Before Charging

Show customers an accurate fee breakdown before submitting a charge.

Persona: SaaS billing platform, e-commerce integrator, any merchant who wants to show customers a cost breakdown before a charge is confirmed.

Scenario: Before submitting a charge, call POST /calculate-fees to retrieve the exact processing fee Pinch will deduct. Display the base amount, fee, and net-to-merchant figure in your UI so the customer sees a transparent breakdown before confirming.


Endpoint sequence

  1. POST /calculate-fees: get the processing fee for the payment amount and method
  2. Display the fee breakdown to the customer
  3. POST /payments/realtime or POST /payments: submit the charge using the same amount

Step 1: Calculate the fee

Call POST /calculate-fees with the payment amount in cents and the expected payment method.

POST https://api.getpinch.com.au/test/calculate-fees
Authorization: ******
pinch-version: 2020.1
Content-Type: application/json

{
  "amount": 10000,
  "sourceType": "credit-card"
}

Example response:

{
  "amount": 10000,
  "feeAmount": 220,
  "taxAmount": 20,
  "netAmount": 9780
}
FieldMeaning
amountThe gross payment amount in cents
feeAmountThe total processing fee in cents (includes GST)
taxAmountThe GST component of the fee, in cents
netAmountWhat will be settled to your account after fees

Step 2: Display the breakdown

Use the response to render a confirmation screen before the customer commits:

Payment amount:   $100.00
Processing fee:   $2.20
You will receive: $97.80

Step 3: Submit the charge

Once the customer confirms, submit the payment using the same amount. For an immediate credit card charge:

POST https://api.getpinch.com.au/test/payments/realtime
Authorization: ******
pinch-version: 2020.1
Content-Type: application/json

{
  "payerId": "pyr_XXXXXXXX",
  "amount": 10000,
  "description": "Invoice #123",
  "creditCardToken": "{card_token}"
}

Or to schedule for a future date:

POST https://api.getpinch.com.au/test/payments
Authorization: ******
pinch-version: 2020.1
Content-Type: application/json

{
  "payerId": "pyr_XXXXXXXX",
  "amount": 10000,
  "description": "Invoice #123",
  "sourceId": "src_XXXXXXXX",
  "transactionDate": "2026-08-01"
}

Key caveats

  • amount is always the gross amount in cents. The fee figure from calculate-fees is informational; pass the same amount to the payment endpoint unchanged.
  • The fee returned reflects your current fee schedule. Credit card and bank account payment methods have different fee rates, so pass the correct sourceType to get an accurate preview.
  • Always call calculate-fees immediately before displaying the breakdown. Fee schedules can change and a cached value may be stale.

What to do next

📘

Got feedback on this feature?

Send an email to [email protected] or book in a chat with our API team.


Did this page help you?