Services and amounts
What a service is, what goes into the service list and how money is written in the API.
A service is one way to accept a payment: a payment method, a currency and the way the payment goes. Every service has a code, for example pix_brl_requisite. The service list answers the question every integration starts with: what can the merchant accept money with right now, and what payer data is needed for it.
The request, all fields and an example response: list of services in the reference.
What goes into the list
Only services that are fully ready to work in your key's environment. A service that is missing something on our side is absent from the list rather than marked as unavailable. So:
- an empty list is not an error: nothing has been enabled for the merchant yet;
- the test and live keys may get different lists;
- the list changes when an administrator enables or disables a service. Request it before showing payment methods to the payer, and do not keep it for longer than a few minutes.
If a service you expect is missing from the list, that is a question for your Plutera administrator, not for your code.
Amounts
There is one rule for the whole API: an amount is an integer of minor currency units, written as a string.
"10000"withminorUnitequal to100is 100.00.minorUnitis the number of minor units in one unit of the currency: 100 for the Brazilian real, 1 for the yen. Take it from the response, not from your own currency table.- Amounts come as strings because some clients lose precision on large integers in JSON numbers.
To show an amount to a person, divide it by minorUnit as integers and append the remainder after the decimal point. Never pass amounts through floating-point numbers at any step: in them 0.1 + 0.2 is already not 0.3.
Payer fields
Each service has its own set of payer data. Check the value on your side before sending it, so the payer sees the error right away. The regular expression in pattern applies to the whole value, from the first character to the last.