Skip to content

Create refund

Request

The refund endpoint will execute a full or partial refund according to the refundAmount specified. A full refund is equal to the amountFinancedAtOrigination. An atFaultParty must also be specified, in order to trigger the corresponding accounting entries related to billing for the refund.

Security
oauth2(Required scopes: loan.refund:create) 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.

Bodyapplication/jsonrequired
atFaultPartystringrequired

The party at fault for the refund. Mainly used for ledger/accounting.

If loanOwner, the lender is billed for the entire refund, and paid interest and fees are refunded to the borrower.

If loanServicer, the servicer is billed for the entire refund, and paid interest and fees are refunded to the borrower.

If merchant, the merchant is billed for the entire refund, and paid interest and fees are refunded to the borrower.

If borrower, the merchant is billed for the entire refund, and the borrower receives no refund for paid interest and fees.

Enum:"loanOwner""loanServicer""merchant""borrower"
caseIdstring

The case identifier.

refundAmountnumber, (float), > 0required

The refund amount. The maximum eligible refund amount is the amountFinancedAtOrigination of the loan. The refund is applied against the principal of the loan.

refundDatestring, (date)

This attribute can be set only during the migration process of loans from another system to Peach. Any value passed for active loans will be ignored.

The refund effective date in the product timezone. If not provided, the refund will be recorded in the ledger with an effective timestamp of the Create refund call.

refundDetailsobject(RefundDetails)

The details of refund.

sendNoticebooleanwrite-only

When set to false, the system will NOT send a loanRefundProcessed notice to the borrower.

Default:true
POST
/people/{personId}/loans/{loanId}/refunds
curl -i -X POST \
  'https://sandboxapi.peach.finance/api/people/{personId}/loans/{loanId}/refunds' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "atFaultParty": "loanOwner",
    "caseId": "string",
    "refundAmount": 1,
    "refundDate": "2019-08-24",
    "refundDetails": {
      "categoryId": "string",
      "description": "Refund",
      "merchantId": "string",
      "merchantName": "string",
      "metadata": {},
      "pointOfSaleType": "online"
    },
    "sendNotice": true
  }'

Responses

Loan Refund

Bodyapplication/json
messagestring

Description of the server action or error.

statusinteger

HTTP status code.

dataobject(LoanRefund)
Response
{ "message": "string", "status": 0, "data": { "atFaultParty": "loanOwner", "caseId": "string", "isFullRefund": true, "originalAmount": 0.1, "refundAmount": 1, "refundDate": "2019-08-24", "refundDetails": { … }, "timestamps": { … } } }