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

# Record payment

> Records a payment or agreement on a contract or one installment

# Record payment

Records a payment (or an agreement) on the whole contract or on one installment, without waiting for the next portfolio send. When nothing is left open, the contract leaves collection **immediately** and the cadence stops acting on it. Available only to debt-collection workspaces in Brazil (see [Debt collection portfolio](https://docs.talkover.ai/en/api-reference/portfolio/overview.md)).

## Endpoint

```
POST /api/v1/portfolio/debts/{external_debt_id}/payments
```

## Path parameters

**external\_debt\_id** `string` *required*

The contract id in your system. URL-encode special characters (`CT/2026/0001` → `CT%2F2026%2F0001`).

## Request headers

**Authorization** `string` *required*

Bearer token. Format: `Bearer talq_your_environment_token_here`

**Content-Type** `string` *required*

`application/json`

## Request body

**paid\_at** `string` *required*

Payment date: `2026-11-09` or `09/11/2026`. Cannot be in the future.

**amount** `string` *required*

Amount paid, greater than zero: `350.00`, `350,00` or `350`.

**partial** `boolean` *required*

`false`: the installment, or the whole contract, is paid off. `true`: part of it was paid.

**remaining\_amount** `string`

Required when `partial` is `true`: the balance left open, greater than zero. Do not send it with `partial` set to `false`.

**installment\_number** `integer`

Number of the paid installment. Without it, the payment applies to the whole contract.

**kind** `string` (default: payment)

`payment` or `agreement` (the creditor closed an agreement).

**method** `string`

Payment method, free text up to 50 characters (`pix`, `boleto`, `card`).

## How the cadence reads a payment

* **Contract with installments:** each paid installment stops counting, and delinquency is counted from the oldest open installment. When none is left, the contract leaves collection.
* **Contract without installments, or payment without `installment_number`:** `partial: false` settles the contract; `partial: true` keeps it in collection with `remaining_amount` as the amount to collect.
* **The next portfolio send does not undo a payment.** If your system still sends the settled contract, it stays settled. A **new** installment (another number) in a later send is collected again.
* There is no undo: a payment recorded by mistake stays recorded. Contact your Talkover representative.

## Examples

```bash theme={null}
curl -X POST "https://app.talkover.ai/api/v1/portfolio/debts/C-10/payments" \
  -H "Authorization: Bearer talq_your_environment_token_here" \
  -H "Content-Type: application/json" \
  -d '{"installment_number": 2, "paid_at": "2026-11-09", "amount": "175.00", "partial": false, "method": "pix"}'
```

## Response

`201 Created` when the payment was just recorded. `200 OK` when **the same payment had already arrived** (same fields): nothing is written again and `created` is `false`. Resending after a timeout is therefore safe.

```json theme={null}
{
  "success": true,
  "message": "Payment recorded.",
  "data": {
    "payment": {
      "id": "019a…",
      "installment_number": 2,
      "kind": "payment",
      "paid_at": "2026-11-09",
      "amount": "175.00",
      "method": "pix",
      "partial": false,
      "remaining_amount": null,
      "source": "api",
      "actor_name": null,
      "recorded_at": "2026-11-09T14:02:11+00:00"
    },
    "created": true,
    "debt": {
      "external_debt_id": "C-10",
      "status": "open",
      "effective_due_date": "2026-10-10",
      "open_amount": "175.00"
    }
  }
}
```

**payment** `object`

The recorded payment.

**created** `boolean`

`true` if it was just recorded; `false` if the same payment already existed.

**debt** `object`

The contract after the payment, in the [Get contract](https://docs.talkover.ai/en/api-reference/portfolio/get-debt.md) format (shortened in the example).

## Error responses

| Status | When |
| - | - |
| `401` | missing or invalid token |
| `403` | the API is not enabled for the workspace |
| `404` | no contract with this id in your workspace |
| `422` | invalid field (`errors` says which), or an installment the contract does not have (`"reason": "installment_not_found"`). Nothing is written |
| `500` | unexpected failure: resend the same payment (no duplicate) |

```json theme={null}
{
  "success": false,
  "message": "This contract has no installment 7.",
  "errors": { "installment_number": ["This contract has no installment 7."] },
  "reason": "installment_not_found"
}
```


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