Creating a payment

In this section, you will learn how to create a payment associated with a Smart Transfer Preauthorization

To create a payment, you need to do the following request:

curl --location 'https://api.pluggy.ai/smart-transfers/payments' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: ••••••' \
--data '{
  "preauthorizationId": "7e3e1dbb-8009-4966-9254-1eaab05ad18b",
  "recipientId": "ded2e966-bd40-4e82-b467-d32fe4b4f40e",
  "amount": 100,
  "description": "My automatic payment"
}'

Let's analyze the fields we need to send:

  • preauthorizationId: It is the id of the preauthorization we created in the previous section.
  • recipientId: It is one of the recipients we authorized for the given preauthorization. Other recipients will be rejected.
  • amount: The amount you want to send.
  • description: An optional description to send with the transfer

For more details about this endpoint, check the API docs

This will return the following:

{
    "id": "b2b132f7-4c17-4707-bd5d-197d71d01385",
    "preauthorizationId": "7e3e1dbb-8009-4966-9254-1eaab05ad18b",
    "status": "CONSENT_AUTHORIZED",
    "amount": 100,
    "description": "My automatic payment",
    "recipient": {
        "type": "BANK_ACCOUNT",
        "id": "ded2e966-bd40-4e82-b467-d32fe4b4f40e",
        "name": "John Doe",
        "taxNumber": "11111111111",
        "isDefault": false,
        "paymentInstitution": {
          "id": "abfd2a88-bc7b-407f-9fcc-395548ee6840",
          "name": "Banco XP S.A.",
          "tradeName": "BCO XP S.A.",
          "ispb": "33264668",
          "compe": "348",
          "createdAt": "2023-12-08T17:52:21.001Z",
          "updatedAt": "2023-12-08T17:52:21.001Z"
        },
        "account": {
          "type": "CHECKING_ACCOUNT",
          "number": "1111111",
          "branch": "0001"
        },
        "pixKey": null,
        "createdAt": "2024-07-31T15:56:03.938Z",
        "updatedAt": "2024-07-31T15:56:23.123Z"
      },
    "createdAt": "2024-08-01T17:03:12.278Z",
    "updatedAt": "2024-08-01T17:03:15.419Z",
    "clientPaymentId": null
}

You can use this endpoint to know when the payment is completed (it generally takes a few seconds). If everything is ok, the payment status will be PAYMENT_COMPLETED.


📘

About transfer limits

Smart Transfers are categorized as an Immediate Pix between different accounts of the same holder. Therefore, the limits defined in the consent for this product should be treated the same way the institution applies the limits of the Pix arrangement.

The calculation of the periodic limit available to the customer should follow the guidelines below, considering different scenarios and examples:

Daily Limit (e.g., R$ 100.00): This limit controls transfers made within a single day, considering the period from 00:00 to 23:59. For example, if a user transfers R$ 50.00 at 10:00, they will still have R$ 50.00 available for transfers until midnight of the same day;

Weekly Limit (e.g., R$ 1,000.00): The weekly limit covers the period of an entire week, starting at 00:00 on Sunday and ending at 23:59 on Saturday. For example, if a user transfers R$ 200.00 on Tuesday and R$ 500.00 on Thursday, they will still have R$ 300.00 available for transfers until the end of Saturday;

Monthly Limit (e.g., R$ 10,000.00): This monthly limit is calculated from the first to the last day of each month. For example, in a month, if the user transfers R$ 2,000.00 in the first week and R$ 3,000.00 in the second week, they will still have R$ 5,000.00 available for transfers for the rest of the month;

Annual Limit (e.g., R$ 50,000.00): The annual limit counts from the first day of January to the last day of December. For example, if a user transfers R$ 10,000.00 by March, another R$ 15,000.00 by June, and another R$ 20,000.00 by September, they will only be able to transfer another R$ 5,000.00 until the end of the year.

These limits help manage fund transfers, ensuring they do not exceed the amounts set for each period. Each limit is independent and is recalculated as its respective time window resets.