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

# Create Authorization

> Create an Automatic Pix authorization

# Create Authorization

Create an Automatic Pix authorization using the payin creation endpoint.

## Request Body

<ParamField body="merchant_id" type="integer">
  Merchant id of the account that is creating the payin. Mandatory if there is more than one account under your umbrella (sellers).
</ParamField>

<ParamField body="invoice" type="string" required>
  Your identification number, it must be unique on our database.
</ParamField>

<ParamField body="notification_url" type="string">
  The url where we will submit the callbacks.
</ParamField>

<ParamField body="payment_method" type="string" required>
  Payment method that will be used in payin.

  Allowed value: `pix`
</ParamField>

<ParamField body="amount" type="integer" required>
  The charge total amount in the smallest currency unit.

  Min: `1`
</ParamField>

<ParamField body="currency" type="string" required>
  Currency code of the amount (ISO 4217). Example: `BRL`
</ParamField>

<ParamField body="country" type="string" required>
  Country code (ISO 3166-1 alpha-2). Example: `BR`
</ParamField>

<ParamField body="buyer" type="object" required>
  The person you are charging object.
</ParamField>

<ParamField body="pix" type="object" required>
  Pix QRCode specific instructions.

  <Expandable title="Pix Object">
    <ParamField body="expire_date" type="string" required>
      The charge expiration date. Format: `YYYY-MM-DDTHH:MM:SS`
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="automatic_pix" type="object" required>
  Automatic Pix configuration object.

  <Expandable title="Automatic Pix Object">
    <ParamField body="frequency" type="string" required>
      Recurrence frequency.

      Allowed values: `weekly`, `monthly`, `quarterly`, `semiannual`, `annual`
    </ParamField>

    <ParamField body="amount" type="integer">
      The fixed amount to be charged in each cycle. Required if `minimum_authorization_amount` is not provided.
    </ParamField>

    <ParamField body="minimum_authorization_amount" type="integer">
      The minimum amount for authorization. Required if `amount` is not provided.
    </ParamField>

    <ParamField body="authorization_amount" type="integer">
      The amount to be authorized. Required when `minimum_authorization_amount` is provided.
    </ParamField>

    <ParamField body="type" type="string" required>
      The type of the automatic pix.

      Allowed values: `immediate`, `optional`
    </ParamField>

    <ParamField body="contract_id" type="string" required>
      Unique identifier for the contract (invoice ID).
    </ParamField>

    <ParamField body="contract_name" type="string" required>
      Name of the contract (invoice name).
    </ParamField>

    <ParamField body="authorization_notification_url" type="string">
      URL to receive authorization notifications.
    </ParamField>

    <ParamField body="start_date" type="string" required>
      The start date of the automatic pix. Format: `YYYY-MM-DD`
    </ParamField>

    <ParamField body="number_of_cycles" type="integer">
      Number of cycles for the automatic pix.
    </ParamField>
  </Expandable>
</ParamField>

## Request Example

```bash Automatic Pix theme={null}
curl --location 'https://api.sandbox.wepayout.co/v2/payin/payments' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_TOKEN_HERE' \
--data-raw '{
  "payment_method": "pix",
  "invoice": "INV-AUTOPIX-2026-0001",
  "currency": "BRL",
  "amount": 3000,
  "country": "BR",
  "buyer": {
    "name": "Lucas Almeida",
    "email": "lucas.almeida@example.com",
    "document": {
      "type": "CPF",
      "number": "12345678909"
    }
  },
  "pix": {
    "expire_date": "2026-12-31T23:59:59"
  },
  "automatic_pix": {
    "frequency": "monthly",
    "amount": 3000,
    "type": "immediate",
    "contract_id": "CONTRACT-1234",
    "contract_name": "Monthly Service",
    "start_date": "2026-05-01"
  }
}'
```

## Response Example

```json 201 theme={null}
{
  "id": 54822,
  "merchant": {
    "id": 512,
    "name": "Acme Sandbox Store"
  },
  "hash": "a7d6c5f4e3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2f8b4d3c2e1a9",
  "payment_page": "https://pagar.sandbox.goboleto.com/?hash=a7d6c5f4e3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2f8b4d3c2e1a9",
  "our_number": "33046",
  "notification_url": null,
  "payment_method": "pix",
  "amount": 3000,
  "invoice": "INV-AUTOPIX-2026-0001",
  "paid_amount": null,
  "refunded_amount": null,
  "currency": {
    "id": 19,
    "name": "Reais",
    "code": "BRL",
    "symbol": "R$"
  },
  "description": "",
  "created_at": "2026-04-30T12:15:10.000000Z",
  "updated_at": "2026-04-30T12:15:13.000000Z",
  "buyer": {
    "name": "Lucas Almeida",
    "email": "lucas.almeida@example.com",
    "document": {
      "type": "cpf",
      "number": "12345678909"
    },
    "address": {
      "country": "BR",
      "city": null,
      "street": null,
      "number": null,
      "complement": null,
      "zipcode": null,
      "district": null,
      "state_code": null
    }
  },
  "originator_legal_entity": {
    "name": null,
    "document": null,
    "helpdesk": null
  },
  "splits": [],
  "pix": {
    "expire_date": "2025-12-31T23:59:59",
    "refund_mode": "FULL_REFUND_MERCHANT",
    "qr_code": "00020126910014BR.GOV.BCB.PIX2569api-pix-h.bancobs2.com.br/spi/v2/11111111-2222-3333-4444-555555555555520400005303986540530.005802BR5908Wepayout6014Belo Horizonte61083038040362070503***63041234",
    "end_to_end": null,
    "fine": {
      "percent": null,
      "amount": null,
      "date": null
    },
    "discount": {
      "percent": null,
      "amount": null,
      "date": null
    }
  },
  "automatic_pix": {
    "authorization_id": "auth_123456",
    "schedule_id": "sch_123456",
    "contract_id": "CONTRACT-1234"
  },
  "status": {
    "id": 1,
    "name": "Created"
  },
  "status_history": [
    {
      "status": {
        "id": 1,
        "name": "Created"
      },
      "updated_at": "2026-04-30T12:15:13.000000Z"
    }
  ],
  "substatus": null,
  "refunds": []
}
```
