Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Boleto

This endpoint allows you to submit a payin by Boleto in Brazil.

POST https://gateway-test.pagsmile.com/trade/pay

The generated Boleto is valid for 3 days.

Headers

Name
Type
Required
Description

Content-Type

string

Yes

Fixed value: application/json; charset=UTF-8.

Authorization

string

Yes

Basic authentication using Base64(app_id:security_key).

Request Body

Name
Type
Required
Constraints
Description

app_id

string

Yes

Use the App ID assigned by Pagsmile.

Merchant application ID.

region

string

Conditional

Fixed value: BRA. Required when using a Global app.

ISO 3166-1 alpha-3 country code for Brazil.

out_trade_no

string

Yes

Maximum length: 64 characters. Must be unique for the merchant application.

Merchant order number.

method

string

Yes

Fixed value: Boleto.

Payment method.

order_amount

decimal

Yes

Minimum amount: 20 BRL in the sandbox environment and 2 BRL in the production environment. Supports up to 2 decimal places.

Payment amount in BRL.

order_currency

string

Yes

Fixed value: BRL.

Payment currency.

subject

string

Yes

Maximum length: 128 characters.

Payment subject or order title.

content

string

Yes

Maximum length: 255 characters.

Payment description displayed on the Boleto.

notify_url

string

Yes

Must be a valid URL. HTTPS is recommended.

Merchant endpoint that receives asynchronous payment notifications.

return_url

string

No

Must be a valid URL. HTTPS is recommended.

URL to which the customer is redirected after the payment flow.

buyer_id

string

Yes

Maximum length: 128 characters.

Merchant-side customer ID.

timestamp

string

Yes

Format: yyyy-MM-dd HH:mm:ss. Maximum length: 19 characters.

Time at which the request is sent.

timeout_express

string

No

Supported formats: <number>m (minutes), <number>h (hours), <number>d (days), or 1c (end of the current day). A number without a unit is treated as minutes. Default: 90m. Minimum: 1m. Maximum: 15d.

Controls how long the order may remain in the initial stage before it is submitted for processing. It does not change the 3-day validity period of the generated Boleto.

customer.identify.type

string

Yes

One of: CPF, CNPJ.

Customer identification type.

customer.identify.number

string

Yes

CPF: 11 digits. CNPJ: 14 digits. Maximum API length: 64 characters.

Customer identification number.

customer.name

string

Yes

—

Customer's full name.

customer.email

string

Yes

Maximum length: 64 characters. Must be a valid email address.

Customer's email address.

customer.phone

string

No

—

Customer's phone number.

address.zip_code

string

Yes

8 digits.

Customer's Brazilian postal code (CEP).

Responses

User payment tips

  • Present the returned bank_code to the customer as the numeric payment code.

  • Use barcode to generate a scannable barcode and make payment easier.

  • Redirect the customer to the complete pay_url returned for the transaction. Providing a downloadable copy of the Boleto can help mobile customers complete the payment later without keeping the browser open.

Example

Third-party CPF/CNPJ validators

Last updated