PostPay/Cash/ATM
PostPay in general are cash-based payments. This payment method gives the customer the possibility to select the product online, and pay for it later in a designated establishment. The delay between the initial order and the consumer completing their payment means that this does not always suit perishable goods and time-sensitive purchases. This is a very popular payment type throughout Latin America, with almost every country having its own version and peculiarities.
Available Payment Methods
Payment Method | Countries | Refunds | Recurring | Chargebacks | Type | Sub-Type |
---|---|---|---|---|---|---|
Boleto Bancário | BR | Yes | No | No | postpay | boleto |
Brazil
Boleto Bancário
Type: postpay
Sub-type: boleto
Boleto Bancário or just Boleto is a financial document issued by a bank that enables the customer to pay the exact specified amount to the receiving party.
Boleto always includes:
- Issuer bank information
- 44-digit ID field: it holds the same information as the bar code
- Bar code: it holds the same information as the ID field
- Payable amount value
The customer can pay a boleto at an ATM, a bank, an approved facility, or through their bank's online banking system. After the boleto is paid, the bank sends to PagSeguro a file confirming the payment. The confirmation is received in one business day. However, it may require up to 3-6 business days after the payment date in case of holidays. If a boleto has not been paid before the due date, the corresponding transaction remains open at PagSeguro MyAccount for 8 days.
When a Boleto payment is submitted, the PagSeguro payments platform returns a response with an URL in the payment-url
field. The URL points to a page with an image of the boleto that the customer needs to proceed with their payment. The merchant can redirect the customer to that URL so that they can complete the payment at an ATM, a bank or an approved facility.
The API supports registered boletos and API only provide Safra, Santander and Caixa Econômica Federal boletos.
Workflow
1 - Customer fills and submits all necessary payment information to the merchant server.
2 - The merchant submits to /transactions
to create the transaction.
3 - PagSeguro creates an order and returns the transaction code, Boleto URL and barcode number to the merchant.
4 - The merchant displays the Boleto to the customer using the PagSeguro Boleto URL or provides the digitable-line to the customer.
Creating a Boleto Payment
To create a boleto payment method, make a POST
request as the example.
Request
Production URL:
https://api.boacompra.com/transactions
Method: POST
Sandbox URL:
https://api.sandbox.boacompra.com/transactions
Method: POST
Example of a request using boleto
{
"transaction": {
"reference": "REF-XXX-1234567890",
"project-number": 1,
"country": "BR",
"currency": "BRL",
"checkout-type": "direct",
"notification-url": "https://billing.checkout.com/processing",
"language": "pt-BR"
},
"charge": [
{
"amount": 100.00,
"payment-method": {
"type": "postpay",
"sub-type": "boleto"
}
}
],
"payer": {
"name": "John Doe",
"email": "[email protected]",
"birth-date": "1988-12-25",
"phone-number": "+5511987654321",
"document": {
"type": "CPF",
"number": "00000000191"
},
"address": {
"street": "Rua Teste",
"number": "1102",
"complement": "AP 302",
"district": "Bairro dos testes",
"state": "PR",
"city": "Maringá",
"country": "BR",
"zip-code": "87030000"
},
"ip": "200.221.118.80"
},
"shipping": {
"cost": 0,
"address": {
"street": "Rua Teste",
"number": "1102",
"complement": "AP 302",
"district": "Bairro dos Testes",
"state": "PR",
"city": "Maringá",
"country": "BR",
"zip-code": "87030000"
}
},
"cart": [
{
"quantity": 1,
"description": "Calça Jeans",
"category": "Collectibles",
"type": "physical",
"unit-price": 1
}
]
}
Request Parameter List
Parameter | Description | Type | Size | Mandatory |
---|---|---|---|---|
transaction | Set of general transaction's information | Object | - | Yes |
transaction.reference | Merchant transaction identifier | String | Up to 64 | Yes |
transaction.project-number | Merchant project identifier. Default value is 1 | Integer | - | No |
transaction.country | Country of the payment. Accepts only BR | String | 2 | Yes |
transaction.checkout-type | Checkout type of the transaction. Accepts only direct | String | - | Yes |
transaction.notification-url | URL (must bind ports 80 or 443) used to send transaction statuses changes notifications by HTTP | String | Up to 200 | Yes |
transaction.language | Language used. Accepts pt-BR, en-US, es-ES, pt-PT and tr-TR | String | 5 | Yes |
charge[] | Set of payments. Currently accepting just one (1) payment | Array | 1 | Yes |
charge[].amount | Amount of the transaction. Separating cents by point, with two decimal places. Amount sum must be equal to shipping.cost plus cart items value | Number | Min of 0.01 | Yes |
charge[].payment-method.type | Payment Method type (credit-card, postpay, e-wallet or eft) | String | - | Yes |
charge[].payment-method.sub-type | Payment Method sub-type. Available payment methods (see more) | String | - | Yes |
payer | Set of customer's information | Object | - | Yes |
payer.name | Customer name | String | Up to 50 | Yes |
payer.email | Customer e-mail | String | Up to 60 | Yes |
payer.birth-date | Customer birth date. ISO-8601 Pattern (YYYY-MM-DD) | String | - | No |
payer.phone-number | Customer phone number. e.g (+5544999884455) | String | - | No |
payer.document.type | Customer document Type. accepts: cpf and cnpj | String | - | Yes |
payer.document.number | Customer identification document. No special characters allowed. | String | - | Yes |
payer.ip | Customer IP. accepts IPv4 or IPv6 | String | - | Yes |
payer.address | Customer address object | Object | - | No[1] |
payer.address.street | Customer address street | String | 1-160 | Yes |
payer.address.number | Customer address number | String | 1-20 | Yes |
payer.address.complement | Customer address complement | String | Up to 40 | No |
payer.address.district | Customer address district | String | 1-60 | Yes |
payer.address.state | Customer address state or province | String | 2 | Yes |
payer.address.city | Customer address city | String | 1-60 | Yes |
payer.address.country | Customer address country (country iso 2) | String | 2 | Yes |
payer.address.zip-code | Customer address zip code | String | 8 | Yes |
shipping | Set of information that will be used to deliver the items in cart (see more) | Object | - | No[1] |
shipping.cost | Shipping cost. Separating cents by dot, with two decimal places | Double | Min of 0.01 | Yes |
shipping.address.street | Shipping address street | String | 3-160 | Yes |
shipping.address.number | Shipping address number | String | 1-20 | Yes |
shipping.address.complement | Shipping address complement | String | 5-40 | No |
shipping.address.district | Shipping address district | String | 4-60 | Yes |
shipping.address.state | Shipping address state or Province | String | 2 | Yes |
shipping.address.city | Shipping address city | String | 3-60 | Yes |
shipping.address.country | Shipping address country (country iso 2) | String | 2 | Yes |
shipping.address.zip-code | Shipping address zip Code | String | 8 | Yes |
cart[] | Set of items (at least one Item) | Array | Min of 1 | Yes |
cart[].quantity | Item quantity | Integer | Min of 1 | Yes |
cart[].description | Item description | String | 1-200 | Yes |
cart[].unit-price | Price per unit. Separating cents by dot, with two decimal places | Double | Min of 0.01 | Yes |
cart[].type | Item type - must be one of the following: digital , physical , service , subscription | String | - | Yes |
cart[].category | Item category | String | 1-64 | No |
[1] Required when cart[].type is physical
Some considerations about the payer name:
- Maximum length of 50 characters
- Minimum two words
- Each word must be separated by ONE space
- The first and last word must have at least 2 characters long
- Middle words can have only one character
- Accepted characters: A to Z, uppercase and/or lowercase letters
- Special characters accepted: éíóúãõâêôàèìòùäëïöüçñÁÉÍÓÚÃÕÂÊÔÀÈÌÒÙÄËÏÖÜÇÑ&/'.-
Some considerations about the payer email:
- On the local-part (before the @), only alphanumeric characters and the special characters - + . _ are allowed.
Response
Example of a response using boleto
{
"transaction": {
"code": "111116875",
"reference": "REF-XXX-1234567890",
"amount": 100.00,
"status": "PENDING",
"currency": "BRL",
"country": "BR",
"payer-email": "[email protected]",
"date-created": "2018-10-09T11:13:37.54658934-03:00",
"barcode-number": "03399767800000001009853029700000167460590101",
"digitable-line": "03399853012970000016874605901011976780000000100",
"payment-url": "https://payment.boacompra.com/b/OXBJSUwzUUNwSm84aHVlbXdqaXRuQT09"
}
}
Response using boleto
The response body for this request is slighty different from others payment methods. The Merchant needs to either display the Boleto to the customer using the PagSeguro Boleto URL or provide the digitable-line given in the response body.
Response Parameter List
Property | Description | Type | Size | Format |
---|---|---|---|---|
transaction.code | PagSeguro´s reference | String | Up to 36 | e.g.: 111181153 |
transaction.reference | Merchant´s reference | String | Up to 64 | XXX-XXX-XX-XXXXXXXXXX |
transaction.amount | Transaction Amount | Number | - | e.g.: 50.0 |
transaction.status | Current status (see more) | String | - | e.g.: PAID |
transaction.currency | Currency transaction | String | 3 | e.g.: BRL |
transaction.country | Country transaction | String | 2 | e.g.: BR |
transaction.payer-email | Payer email | String | Up to 60 | e.g.: [email protected] |
transaction.date-created | Date of creation | String | - | e.g.: 2018-10-10T14:39:32.991217999-03:00 |
transaction.barcode-number | Barcode numerical representation | String | 44 | e.g.: 10496766600000101508745960000100040003898220 |
transaction.digitable-line | Digitable line | String | 47 | e.g.: 10498745956000010004400038982203676660000010150 |
transaction.payment-url | Generated Boleto Url | String | 64 | e.g.: https://payment.boacompra.com/b/clhZYUVTRGZRdUNuKzZwR1grcEZsZz09 |
About boleto
The barcode-number response parameter can be used to generate and display the barcode in the own merchant website.
It's in the Interleaved 2 of 5 (ITF) pattern, used by Brazilian Banks.
The open-source library JsBarcode. can be used to generate the barcode image.The digitable-line response parameter could be used to offer the possibility for the end user to copy the digits equivalent to the barcode to make the payment in his bank website/app, without read the barcode.
Boleto best practices
When providing an alternative payment method like Boleto Bancário, it is required to include a confirmation page on the flow. Furthermore, on this page we can include some features to increase the payment method conversion, as well as informing the particularities of the payment method chosen to the customer.
Confirmation page example
-
In Brazil we still have a large population of people without bank accounts. It is recommended always offer to the customer the print Boleto option, with this they can make the payment at an ATM, a bank or an approved facility.
INFO: To use this feature, use
transaction.payment-url
included in the response of the boleto transaction. -
Brazillian banks Apps and some mobile wallets offer their users the option to make boleto payments scanning the bar codes in their smartphones. Providing the Barcode with a good resolution is a good practice to increase conversion with these users.
INFO: To use this feature, use
transaction.barcode-number
included in the response of the boleto transaction and associate it with an open-source library like JsBarcode.
to generate the barcode image.
- It is a good practice to offer the option of copying the payment code. This allows the customer to pay directly on their bank's internet banking. This feature is mandatory if want to increase conversion for mobile users.
INFO: To use this feature, usetransaction.digitable-line
included in the response of the boleto transaction.
Updated almost 2 years ago