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
POST /calculate-fees: get the processing fee for the payment amount and method- Display the fee breakdown to the customer
POST /payments/realtimeorPOST /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
}| Field | Meaning |
|---|---|
amount | The gross payment amount in cents |
feeAmount | The total processing fee in cents (includes GST) |
taxAmount | The GST component of the fee, in cents |
netAmount | What 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
amountis always the gross amount in cents. The fee figure fromcalculate-feesis informational; pass the sameamountto 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
sourceTypeto get an accurate preview. - Always call
calculate-feesimmediately before displaying the breakdown. Fee schedules can change and a cached value may be stale.
What to do next
- Create Realtime Payment: charge a credit card immediately
- Create or Update Payment: schedule a payment for a future date
- Surcharging Fees in Pinch: background on how processing fees work
Got feedback on this feature?
Send an email to [email protected] or book in a chat with our API team.
Updated about 10 hours ago
