Skip to content

Fail multiple transactions

Request

This endpoint allows you to fail multiple transactions in one call. The system will mark applicable transactions as failed and replay the loan once (starting from the earliest effective date of the provided transactions).

Security
oauth2(Required scopes: transaction:update) 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
syncboolean

Make the process synchronous.

Default:false
Bodyapplication/jsonrequired
Array [
achReturnCodestring, <= 5 characters

The ACH return code indicating the reason the transaction failed.

Example:"R01"
failureReasonstring(TransactionFailureReason)required

The transaction failure reason.

Enum:"insufficientFunds""chargeback""accountClosed""invalidAccount""unknownReason""invalidCvv""invalidExpirationDate""avsFailed""networkError""cardDeclined"
processorFailureDetailsany

The error details returned by the payment processor. Can be any valid JSON object.

Example:
{ "code": "INSUFFICIENT_FUNDS" }
processorFailureReasonstring

The raw failure reason returned by the payment processor.

Example:"Insufficient Funds. Retry after 24 hours."
transactionIdstringrequired

ID of the transaction to fail.

]
POST
/people/{personId}/loans/{loanId}/transactions/fail
curl -i -X POST \
  'https://sandboxapi.peach.finance/api/people/{personId}/loans/{loanId}/transactions/fail?sync=false' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '[
    {
      "achReturnCode": "R01",
      "failureReason": "insufficientFunds",
      "processorFailureDetails": {
        "code": "INSUFFICIENT_FUNDS"
      },
      "processorFailureReason": "Insufficient Funds. Retry after 24 hours.",
      "transactionId": "string"
    }
  ]'

Responses

Succeeded

Bodyapplication/json
messagestring

Description of the server action or error.

statusinteger

HTTP status code.

Response
{ "message": "string", "status": 0 }