Skip to content

Cancel loan

Request

The cancel loan endpoint will change the status of a loan to canceled, and trigger any cancellation-related logic, such as removing a loan from active monitoring and handling the accounting treatment for canceled loans.

An installment loan must be in originated or pending status to be canceled.

A line of credit loan can be canceled if it has no draws with active purchases.

Special permission is required to cancel active loans.

The metro2 details may optionally be sent with the accountStatusCode to indicate what should be reported to credit agencies.

Security
oauth2(Required scopes: loan:cancel) or bearerAuth or apiKeyHeader
Path
personIdstring(AnyId)^ext-|^[A-Z][A-Z0-9]-[A-Z0-9]+-[A-Z0-9]+|^\d+$write-onlyrequired

A Borrower's unique identifier, tied to a person or a business. Can be Peach or a lender's external identifier.

loanIdstring(AnyId)^ext-|^[A-Z][A-Z0-9]-[A-Z0-9]+-[A-Z0-9]+|^\d+$write-onlyrequired

The unique identifier of the Loan we wish to retrieve. Can be Peach or lender's external identifier.

Query
forceboolean

Override that enables the cancellation of active loans not managed by Peach. Requires the loan:cancel.force permission. Forced cancellation should only be used for testing purposes.

Default:false
clearAllExternalIdsboolean

If true, will clear all related loan, draws (if LOC), purchases (if LOC), transactions, and dynamic fees external IDs. This will emit a externalid.changed event for all impacted objects.

NOTE: If sync=true, there is a max limit of 1000 external IDs that can be cleared synchronously. If there are more than 1000, the request will fail with a HTTP 408 status code. You should instead set clearAllExternalIds=false and call the individual endpoints to clear external IDs.

Default:false
syncboolean

Today, sync only controls the clearing of external IDs when cancelling a loan when clearAllExternalIds is true.

true - Clears the external IDs of the loan, draws, purchases, transactions, and dynamic fees up to the max limit of 1000. If there are more than 1000, the request will fail with a HTTP 408 status code.

false - will clear all external IDs asynchronously. This is not yet supported.

Default:true
Bodyapplication/jsonrequired
cancellationReasonstring(CancellationReason)

The cancellation reason:

technicalIssue - loan was created due to a technical issue.

wrongLoanTerms - loan was created with the wrong terms.

wrongBorrower - loan was created on the wrong borrower.

other - for any other reason requiring cancellation.

Enum:"technicalIssue""wrongLoanTerms""wrongBorrower""other"
metro2object(LoanCancelMetro2RequestBody)
sendCancellationNoticeboolean

When set to true, the system will send loanCanceled notice to the borrower.

Default:false
caseIdstring

An identifier for an existing case.

POST
/people/{personId}/loans/{loanId}/cancel
curl -i -X POST \
  'https://sandboxapi.peach.finance/api/people/{personId}/loans/{loanId}/cancel?force=false&clearAllExternalIds=false&sync=true' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "cancellationReason": "technicalIssue",
    "metro2": {
      "accountStatusCode": "13"
    },
    "sendCancellationNotice": false,
    "caseId": "string"
  }'

Responses

Success no content