## Fees without manual integration updates
Do not hardcode percentages or network fees in merchant code. Payteez calculates amounts on the server. Documentation examples are illustrative, not current tariffs.

## Accepting payments
In invoice creation and status responses, amount always means the original order amount. fee is the commission; feePayer is merchant or client; payerAmount is the amount due in the invoice currency; merchantAmount is the net merchant credit. The fee and its payer are fixed when the invoice is created. Later tariff or shop setting changes do not change existing invoices.

For example, with an illustrative 0.50 USD fee and a 100.00 USD order: merchant-paid means payerAmount = 100.00 and merchantAmount = 99.50; client-paid means payerAmount = 100.50 and merchantAmount = 100.00. When the customer converts currencies, the debit in the other currency is displayed separately at checkout.

The webhook format is unchanged: amount is the original order amount, not the net credit. Match it against the order and verify signature, currency, merchantId, id, orderId, status=paid and test=false. Fulfil once. Read merchantAmount from /api/merchant/v1/status to reconcile merchant proceeds. A customer redirect is not proof of payment.

## Calculate a payout before debiting
POST /api/payout/v1/quote is signed with the payout key. For an internal transfer send {"action":"transfer","currency":"RUB","amount":"100.00"}; for crypto send {"action":"withdraw","ticker":"USDTTRC","amount":"10"}. The corresponding permission and an allowed IP are required. A calculation neither debits nor reserves funds and does not guarantee sufficient balance, API limits or recipient address validity.

The response contains currency, recipientAmount, fee and total as decimal strings. Show the total to the customer and save the approved amount. Include that total in transfer or withdraw. Request amount still means the amount for the recipient. Do not subtract the fee from amount yourself.

Payteez checks the fee again before debiting. If total differs, it returns HTTP 409 without a debit. Obtain a new calculation and customer approval; never automatically approve an increased total. A calculation does not lock the tariff or guarantee a future fee.

## Results and safe retries
In payout responses, amount and total mean the full debit; recipientAmount is the recipient amount and fee is the commission. /api/payout/v1/status returns the same saved amounts. Older operations without a saved breakdown may omit fee and recipientAmount: do not reconstruct them using current tariffs. For cancelled operations, amount/total describe the original debit; the payout did not complete and funds were returned.

Save requestId and the exact payout body before sending. On timeout or HTTP 500, check /api/payout/v1/status first; retry the original payout with the same requestId and parameters, but a fresh nonce, time and signature. Accepted payouts return saved amounts even after tariff changes. Do not create a new requestId while the outcome is unknown. pending and sending are not success; done means completed and cancelled means cancelled.

## Existing integrations
API v1, keys, signatures, original fields and webhook format are preserved. Response fields are additive. Request total is optional: older clients continue using the tariff at operation acceptance. To protect against unexpected fee changes, update once: quote → approve total → payout. Ignore unknown response fields and never reprice completed operations. These features do not automatically change a third-party merchant's business terms.
