---
title: "Cancel all loans by account"
method: POST
path: "/v2/accounts/{accountId}/loans/cancel"
tags: ["Loans"]
---

# Cancel all loans by account

`POST /v2/accounts/{accountId}/loans/cancel`

## Request

- Base URL: `https://sandbox.pismolabs.io/lending`
- URL: `https://sandbox.pismolabs.io/lending/v2/accounts/{accountId}/loans/cancel`
- Auth: HTTP bearer

Cancels all active loans for the specified account

**Note**: This endpoint requires an [account-specific access token](ref:get-an-account-specific-token-basic-authentication).

This endpoint generates [Loan updated](https://developers.pismo.io/events/docs/lending-lending-loan-update-1) events for each canceled loan.

## Path parameters

- `accountId` string, required

## Headers

- `Idempotency-Key` string, uuid, required

## Request body

- CancelAllLoansV2Request: Request body for cancelling all loans of an account
  - `bring_to_present_value` boolean: Calculate loan balances to present value before cancellation? When true, the system calculates interest and charges up to the cancellation date.

## Response `202`

Cancellation accepted

- CancelAllLoansV2Response
  - `to_be_canceled_loans` ToBeCanceledLoanV2Summary[], required: List of loan summaries whose cancellation was accepted and is tracked by tracking_id
    - `loan_id` string, required: Loan ID
    - `tracking_id` string, required: Authorization tracking ID for the cancellation
  - `total_to_be_canceled` integer, required: Total number of loans to be canceled

## Other responses

- `400`: A validation error occurred.
- `403`: Unauthorized access — header account ID does not match path account ID.
- `500`: Internal Server Error

---

[API](https://skmtc.dev/pismo/apis/lending.md) - [All operations](https://skmtc.dev/pismo/apis/lending/llms.txt) - [OpenAPI document](https://skmtc.dev/pismo/apis/lending/revisions/a288022e3d8b?raw)
