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

# Payment methods

> Control what your debtor can pay with: paymentMethods, direct debit, and the hierarchy of enabled methods.

When you create a debt or a subscription, you can narrow down **which methods** the debtor can pay with. By default, TapiPay internally resolves the methods available for your organization (cash and digital), and you decide whether you want to restrict them.

## Available methods

The `paymentMethods` field accepts one or more of these values:

| Value           | Method                          |
| --------------- | ------------------------------- |
| `CASH`          | Cash (payment points in stores) |
| `CARD`          | Credit or debit card            |
| `TRANSFER`      | Transfer                        |
| `WALLET`        | Digital wallet                  |
| `BANK_TRANSFER` | Bank transfer                   |

<Note>
  If you do not send `paymentMethods`, the debt is enabled with the methods configured at your organization level. You do not need to send this field to charge.
</Note>

## Direct debit (`autopay`)

`autopay` (default `false`) indicates that the charge is performed by direct debit, without the debtor choosing a method for each charge.

<Warning>
  `autopay` and `paymentMethods` are **mutually exclusive**. If you send `autopay: true`, you cannot send `paymentMethods` in the same request. Doing so returns `400 INVALID_REQUEST`.
</Warning>

```json Error: autopay + paymentMethods together theme={null}
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "Validation failed: autopay and paymentMethods are mutually exclusive."
  },
  "requestId": "req_3f8a1c9e2b"
}
```

## Method hierarchy

The enabled methods are resolved in a cascade, from the general to the specific:

```
Organization  ──►  Resource (debt / subscription)
   (broad)            (narrows)
```

What you define at the resource level **narrows** what the organization allows. You cannot enable at the debt level a method that your organization does not have active.

## Paying several debts at once

When a debtor pays **multiple debts in a single operation**, the system computes the **intersection** of the methods enabled on each debt and only offers the methods common to all of them.

<CodeGroup>
  ```text Intersection with a result theme={null}
  Debt A: [CASH, CARD]
  Debt B: [CARD]
  Intersection: [CARD]  → the payment proceeds with CARD
  ```

  ```text Empty intersection theme={null}
  Debt A: [CASH]
  Debt B: [CARD]
  Intersection: []  → 422 BUSINESS_RULE_VIOLATION
  ```
</CodeGroup>

If the intersection is **empty**, there is no common method to charge all the debts together, and the operation is rejected with `422 BUSINESS_RULE_VIOLATION`. In that case, the debtor must pay them separately.

<Tip>
  If you are going to allow your debtors to group payments, keep a consistent set of `paymentMethods` across the debts of the same debtor to avoid empty intersections.
</Tip>
