> ## Documentation Index
> Fetch the complete documentation index at: https://docs.safefypay.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Automatic Pix

> Pix sales that authorize recurring charges straight from the buyer's account

With **Automatic Pix** turned on for your organization, every Pix sale (on the checkout, the payment link and the API)
asks the buyer to authorize the automatic debit in their bank app. The next charges happen by themselves, at the agreed
frequency, without a new QR code.

> [!NOTE]
>
> Automatic Pix is turned on by the Safefy team for your organization and only works when your Pix goes through Woovi.
> Contact support to enable it. **Subscription plan** links follow the plan's rules.

## What the Safefy team configures

| Option | Values |
| - | - |
| Frequency | Weekly, monthly, quarterly, semiannual or annual |
| Charge day | On the purchase day or on a fixed day of the month (1 to 28; weekly is always on the purchase day) |
| Retries | No retry, or up to 3 attempts in 7 days if the bank declines the debit |
| Number of charges | Total counting the sale (2 to 120), or until the buyer cancels |

## How the buyer authorizes

* **On the purchase day:** a single QR code pays the purchase and authorizes the next charges, which fall on the same day.
* **On a fixed day:** the buyer pays the purchase with a regular Pix and then scans a **second QR code** that only
  authorizes the next charges. The first one falls on the chosen day, at least 3 days ahead. Nothing is charged by this
  authorization.

The buyer provides a CPF or CNPJ and the full address (required by the Central Bank and Woovi) and can cancel in their bank
app at any time.

## Each charge

* **Checkout:** a new order, with the same products as the purchase (delivery and access again).
* **Payment link and API:** a new transaction, with the sale's description, customer, `callbackUrl` and `metadata`.

Each charge fires the same webhooks and emails as a paid Pix sale. If the bank declines a debit (after the retries, when
on) or the buyer cancels, the next charges do not happen.

## Through the API

In `POST /v1/transactions` with `method: "Pix"`, send the CPF or CNPJ in `customerDocument` and the full address in
`billingAddress`. Without them, the transaction is a regular Pix.

```json theme={null}
{
  "method": "Pix",
  "amount": 3990,
  "currency": "BRL",
  "description": "Monthly mentoring",
  "customerName": "Maria Silva",
  "customerEmail": "maria@example.com",
  "customerDocument": "12345678909",
  "billingAddress": {
    "zipCode": "01310100",
    "street": "Avenida Paulista",
    "number": "1000",
    "neighborhood": "Bela Vista",
    "city": "São Paulo",
    "state": "SP"
  }
}
```

The response includes the `pixAutomatic` block:

| Field | Description |
| - | - |
| `frequency` | `Weekly`, `Monthly`, `Quarterly`, `Semiannually` or `Annually` |
| `chargeDay` | `PurchaseDay` or `FixedDay` |
| `fixedDay` | Day of the month, on the fixed day |
| `maxCharges` | Number of charges counting the sale, or `null` |
| `firstChargeDate` | Date of the first automatic debit after the sale |
| `authorizationCopyPaste` | On the fixed day: the second code (copy and paste) the buyer pays to authorize |
| `status` | `Created` (waiting for authorization), `Approved`, `Rejected`, `Cancelled` or `Expired` |

On the purchase day, the transaction's `pix.copyAndPaste` already pays and authorizes. On the fixed day, show the buyer
the `pix.copyAndPaste` (the purchase) and then the `authorizationCopyPaste` (the authorization).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.