Calculations: tax, tip and fee pass-through
8.1 Sales tax
Computed on the subtotal only.
{ "amount": 100, "sales_tax_type": "percentage", "sales_tax_value": 15 }
-> subtotal 100, sales_tax_amount 15, total 115
fixed adds an amount instead of a percentage. A percentage cannot exceed 100.
8.2 Tip
tip_enabled: true forces a choice between two modes; omitting both returns 422
("Seleccione un tipo de propina o permita la seleccion del cliente en el checkout.").
Fixed tip - set by the merchant, reflected in the total at creation:
{ "amount": 100, "tip_enabled": true, "tip_type": "percentage", "tip_value": 10 }
-> total 110
Customer-selected - the total at creation does not include a tip; the customer adds it at checkout:
{
"amount": 100, "tip_enabled": true,
"tip_customer_selectable": true,
"tip_preset_percentages": [10, 15, 20],
"tip_allow_custom": true,
"tip_min_amount": 0, "tip_max_amount": 50
}
-> total 100 at creation; the customer decides when paying
tip_max_amount cannot exceed amount - doing so returns 422.
8.3 Passing costs to the customer (service_fee_enabled)
When enabled, ROKI's commission, the 3-D Secure charge and the tax on that commission are passed on
to the customer. ROKI recomputes the total by reverse calculation so the merchant nets the
requested amount.
{ "amount": 100, "service_fee_enabled": true }
-> subtotal 100, service_fee_amount 5.52, total 105.52
Never replicate this calculation on the integrator side. The rates, the fixed charge and the
threshold are per-merchant configuration and they change. Read service_fee_amount and total
from the response - that is the only correct source. The fee is computed on the full base (amount
plus tax plus fixed tip).
The field name is exactly service_fee_enabled. The variants service_fee,
service_fee_type/service_fee_value and pass_fees_to_customer are silently ignored: the API
returns 201 and the payment is created without fee pass-through. See 12.1.
8.4 Reusable links (reusable)
By default a link is consumed once paid: afterwards it shows "Enlace no disponible". With
reusable: true the link accepts more than one charge - useful for fixed links shared on social
media.
