5. Payment Link
5.1. Introduction
This section explains how to request the initial payment and obtain consent for recurring charges using our Payment Link solution.
This feature is disabled by default. If you want to use our Payment Link solution please contact PagBrasil for further information.
5.2. Sending the request
Your POST must be sent to https://sandbox.pagbrasil.com/api/checkout/add setting the content-type of the request header and body as "x-www-form-urlencoded".
Please note that this URL shall only be used for integration and testing procedures. Once the Payment Service Agreement is signed, you will receive the production environment's URL when you request your account to go live.
Request parameters:
Field | Description | Required | Length |
|---|---|---|---|
secret | Secret phrase as defined in the PagBrasil Dashboard | Yes | 128 |
pbtoken | Token assigned to your merchant account. Your token is displayed at the PagBrasil Dashboard, menu Account > Settings. | Yes | 32 |
order | Order number. See note "c" | Yes | 64 |
payment_link | Set "1" to create the Payment Link. | Yes | 1 |
payment_option | Defines the payment methods to be included in the Payment Link. If not present all payment methods available will be included. C = Credit card Separate multiple payment methods by comma (e.g. "C,B,P"). | No | Unlimited |
payment_link_expiration | Number of days (0 - 999) the Payment Link is valid for. If you don't use this parameter, our system will use the default value set at the PagBrasil Dashboard, menu Account > Settings. | No | 3.0 |
url_return | URL you want the customer to be redirected to after they complete the payment. You may include any parameters in the URL (i.e. order number) so that you can display the proper page when the customer is redirected to "url_return". | No | 254 |
product_name | Product name. See note "d" | Yes | 254 |
products | JSON structure with the list of products or service in the subscription. See note “l“ | Yes | Unlimited |
customer_name | Customer's full name if an individual, or "razão social" if the customer is a company. See note "e" | Yes | 128 |
customer_taxid | CPF if an individual, or CNPJ if the customer is a company. See note "f" | Yes | 14 |
customer_email | Customer's e-mail address | Yes | 128 |
customer_phone | Customer's phone number (including the 2-digit area code) | Yes | 40 |
address_street | Customer's street address | Yes | 200 |
address_number | Customer's street address number | No | 10 |
address_number_complement | Customer's street address complement (e.g. suite) | No | 40 |
address_neighborhood | Customer's neighborhood | No | 40 |
address_zip | Customer's postal code (in Brazil called CEP). | Yes | 8 |
address_city | Customer's city | Yes | 40 |
address_state | Customer's state. See note "g" | Yes | 2 |
amount_brl | Amount in Brazilian Real | Yes | 7.2 |
param_url | A string that can be concatenated to the URL our server posts the response to. See note "h" | No | 254 |
pix_rec | Set "1" to indicate that it is an Automatic Pix consent request. | Yes | 1 |
pix_rec_description | Text that identifies the subscription within the customer's banking app. | No | 19 |
pix_rec_cycle | Define the recurrence cycle as one the following values: “weekly”, “monthly”, “quarterly”, “semiannual”, “annually”. | Yes | 10 |
pix_rec_expiration | Recurrence end date. | No | 10 |
pix_rec_first_recurrence | Estimated date of the first future recurring charge. | Yes | 10 |
pix_rec_minimum_amount | Minimum amount for recurring charges. This prevents the customer from setting a lower payment limit, but it may also make the customer hesitant to give their consent. Therefore, it should be used cautiously and aligned with the subscription the customer is signing up for. | No | 7.2 |
pix_rec_retry | Set “1” to indicate it’s a recurring charge retry. We strongly recommend setting the parameter “pix_rec_retry” to 1 to enable retry attempts in case of failure. See note “k” | No | 1 |
CONFIDENTIAL