Create a transaction. Permissions required depend on the object type passed:
| type | permission |
|---|---|
| One Time Payment | transaction:create.onetimepayment |
| Service Credit | transaction:create.servicecredit |
| Down Payment | transaction:create.downpayment |
Once a loan has been onboarded to Peach's platform, valid loan statuses for each transaction type are as follows:
| type | valid loan statuses |
|---|---|
| One Time Payment | active, accelerated, or chargedOff* |
| Service Credit | active, accelerated, or chargedOff* |
| Down Payment | active |
*=chargedOff is only valid when the loan type configuration paymentAllowedWhenChargedOff is true.
During migration while a loan is in prepMigration, valid loan statuses for each transaction type are as follows:
| type | valid loan statuses |
|---|---|
| One Time Payment | originated |
| Service Credit | originated |
| Down Payment | active |
A friendly description of the transaction. If provided, this value will be displayed in Peach UI/App and Statements (or can be used by lender in their App). If the value is not provided, the Peach UI/App and Statements logic will render the transaction name based on type and status. Make sure you provide value that makes sense to the borrower. This is NOT what the borrower will see in their online bank or card account.
Peach's unique or lender's external identifier.
The transaction failure reason. This value is ignored except when creating an external transaction with status=failed
Store any type of key/value pairs in the form of a JSON dictionary.
The payment instrument identifier that was charged.
Peach's unique or lender's external identifier.
The draw identifier. If provided, the system will attempt to apply the payment to the specified draw. Any excess will be applied to the rest of LOC/Draws based on the multi-waterfall that is defined for the line of credit type.
The effective date of the transaction in the product timezone.
For active loans (non-migrating), to create and backdate the transaction in one call:
- Pass
effectiveDate(today or in the past) - Pass
effectiveTimeOfDay(seeeffectiveTimeOfDayfor details) - Leave
scheduledDateempty - Set
isExternal=true - Set
statustosucceededorpending
The call triggers replay; use sync=true to wait for completion (408 on timeout)
- Note:
succeededAtwill equalcreatedAt, whileappliedAtandpendingAtwill equaleffectiveDate+effectiveTimeOfDay - The transaction will appear on the next day's loan tape (relative to the API call date in the product timezone)
For migrating loans (prepMigration), the attribute is used during migration ingest only.
The effective time of day on effectiveDate in the product timezone. Required if effectiveDate is passed. For active loans with external payments, required together with effectiveDate for single-call backdating.
Note: for migration only (prepMigration), the value must be after 2AM in the product timezone.
DEPRECATED ATTRIBUTE true if the borrower opts to apply any overpayment amount to prepayment of future obligations. false if the borrower opts to apply overpayments to the current obligation.
If this field is not passed, we reference the allowPrepayments configuration on the loan type.
Allows lenders to configure the openToBuyAmount calculation. Peach's system will not include the transaction in the openToBuyAmount calculation until this date (in the product timezone). For example, if a transaction's holdDaysEndDate is tomorrow or later, the transaction will NOT be included in the openToBuyAmount calculation. Setting this value will override loan.paymentHoldDays.numHoldDays and loanType.paymentHoldDays.numHoldDays.
If holdDaysEndDate is not set upon transaction create, the holdDaysEndDate will be calculated based on loan.paymentHoldDays.numHoldDays.
If loan.paymentHoldDays.numHoldDays is not set, holdDaysEndDate will be calculated based on loanType.paymentHoldDays.numHoldDays. This will only apply to borrower payments and is not applicable for other types of transactions (e.g. service credits)
A transaction marked isExternal=true is for record purposes only. A transaction with an external paymentInstrument is automatically marked external.
This attribute should be used only for transactions that are scheduled in the future. Transactions that should be processed now/today, leave the attribute empty and the system will set appropriate date and timestamp values based on the API call time.
Note: The maximum date you can set is the maximum of either three years after the last expected payment or three years from today.
The transaction status. May only be passed when isExternal=true.
External transactions can be created in: scheduled, initiated, pending, succeeded, or failed. External transactions are applied to the loan balance immediately when created with status initiated, pending, or succeeded. Otherwise, they will be applied the first time they are updated to one of these statuses.
scheduled - payment or credit was scheduled for a future date that has not arrived yet. The payment has not applied to a loan yet.
initiated - payment was initiated and sent to a payment processor. The payment is applied to a loan. This status is used normally for ACH.
pending - payment was acknowledged by the payment processor and is being processed. For ACH the payment can be in pending status for a few days.
succeeded - payment was completed successfully.
failed - payment failed and was removed from the loan effective as of initiated, pending or succeeded status effective date. The system replays the loan as if the payment never happened. It will also re-accrue interest since then.
inDispute - payment is in dispute (typically because of chargeback). The payment is removed from the loan effective as of initiated, pending or succeeded status effective date. The system replays the loan as if the payment never happened. It will also re-accrue interest since then. Disputed payment can be for partial amount.
canceled - payment or credit was canceled. Payment can be canceled only if the current status is scheduled.
chargeback - payment was disputed and ruled against the lender. The payment was returned to the original payment instrument. Chargeback payment can be for partial amount.
- oauth2
- bearerAuth
- apiKeyHeader
- One Time Payment
- Service Credit
- Down Payment
curl -i -X POST \
'https://sandboxapi.peach.finance/api/people/{personId}/loans/{loanId}/transactions?sync=false' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"amount": 0,
"customDisplayName": "string",
"evidenceDocumentId": "string",
"externalId": "string",
"failureReason": "insufficientFunds",
"metaData": {},
"paymentInstrumentId": "string",
"type": "oneTime",
"consentDocumentId": "string",
"drawId": "string",
"effectiveDate": "2019-08-24",
"effectiveTimeOfDay": {
"hour": 0,
"minute": 0,
"second": 0
},
"enablePrepayments": true,
"holdDaysEndDate": "2019-08-24",
"isExternal": true,
"scheduledDate": "2019-08-24",
"status": "scheduled",
"caseId": "string"
}'{ "message": "string", "status": 0, "data": { "createdAt": "2019-08-24T14:15:22Z", "deletedAt": "2019-08-24T14:15:22Z", "id": "string", "updatedAt": "2019-08-24T14:15:22Z", "externalId": "string", "achConfirmed": true, "achProcessedSameDay": true, "achReturnCode": "strin", "achSameDay": true, "actualAmount": 0.1, "avsResult": "s", "cancelLongDescription": "string", "cancelReason": "invalidPaymentMethod", "cancelShortDescription": "string", "createdBy": { … }, "currency": "string", "customDisplayName": "string", "failureDescriptionLong": "string", "failureDescriptionShort": "string", "failureReason": "insufficientFunds", "holdDaysEndDate": "2019-08-24", "metaData": {}, "parentTransactionId": "string", "paymentDetails": { … }, "processingFeeAmount": 0, "processingFeeType": "net", "processorFailureDetails": null, "processorFailureReason": "string", "processorMerchantId": "string", "processorReconciliationId": "string", "processorReversalId": "string", "processorTransactionId": "string", "retryAttempt": 0, "retryOriginalTransactionId": "string", "reversedAmount": 0.1, "reversedByTransactionExternalId": "string", "reversedByTransactionId": "string", "reversedByTransactionIds": [ … ], "reversesTransactionExternalId": "string", "reversesTransactionId": "string", "scheduledAmount": 0.1, "status": "scheduled", "timestamps": { … }, "transactionType": "payment", "chargebackAmount": 0.1, "chargebackDetails": [ … ], "effectiveAmount": 0.1, "isExternal": null, "isVirtual": null, "paidFeesAmount": null, "paidInterestAmount": null, "paidOverAmount": null, "paidPrincipalAmount": null, "serviceCreditDetails": { … }, "autopayPaymentIds": [ … ], "autopayPlanId": "string", "drawId": "string", "enablePrepayments": true, "initiatingBorrowerId": "string", "loanId": "string", "mainBorrowerId": "string", "unroundedPaidFeesAmount": 0.1, "unroundedPaidInterestAmount": 0.1, "unroundedPaidOverAmount": 0.1, "unroundedPaidPrincipalAmount": 0.1 } }