# Get transaction by ID

Endpoint: GET /people/{personId}/loans/{loanId}/transactions/{transactionId}
Version: 2023-11-29
Security: oauth2, bearerAuth, apiKeyHeader

## Path parameters:

  - `personId` (string, required)
    A Borrower's unique identifier, tied to a person or a business. Can be Peach or a lender's external identifier.

  - `loanId` (string, required)
    The unique identifier of the Loan we wish to retrieve. Can be
Peach or lender's external identifier.

  - `transactionId` (string, required)
    Transaction ID. Can be Peach or lender's external identifier.

## Response 200 fields (application/json):

  - `message` (string)
    Description of the server action or error.

  - `status` (integer)
    HTTP status code.

  - `data` (object)

  - `data.createdAt` (string)

  - `data.deletedAt` (string,null)

  - `data.id` (string)

  - `data.updatedAt` (string,null)

  - `data.externalId` (string,null)
    A lender's identifier for an object.

After the object is successfully created, a lender can use ID or externalId identifiers to fetch the object.

To fetch the object using externalId you need to add ext- to the URL.

Note: Don't add ext- to the identifier value. For example: if the external identifier is ABCDE, then pass externalId=ABCDE and NOT ext-ABCDE when creating the object.

  - `data.achConfirmed` (boolean,null)
    Applies to ACH transactions processed by Peach. Set to true when the originating bank has confirmed receipt of the transaction.

  - `data.achProcessedSameDay` (boolean,null)
    The transaction was processed with ACH Same Day.

  - `data.achReturnCode` (string)
    The ACH return code indicating the reason the transaction failed.

  - `data.achSameDay` (boolean,null)
    Attempt to process this transaction with ACH Same Day processing.

  - `data.actualAmount` (number)
    The actual amount that was processed. The system never debits
more than the loan outstanding balance.

  - `data.avsResult` (string)

  - `data.cancelLongDescription` (string)
    More detailed reason why the transaction was canceled.

  - `data.cancelReason` (string,null)
    Why the transaction was canceled.
    Enum: "invalidPaymentMethod", "paymentMethodRemoved", "tooManyFailedAttempts", "loanFrozen", "loanAccelerated", "loanChargedOff", "loanPaidOff", "canceledByUser", "loanTermsChanged", "balanceCheckThresholdExceeded"

  - `data.cancelShortDescription` (string)
    Brief reason why the transaction was canceled.

  - `data.createdBy` (object,null)

  - `data.createdBy.descriptor` (string,null)
    Short description of the user who performed the action.
Different systems may have different data available for a given user. The descriptor
gives the best available short description of the user. It prefers names, then email addresses,
then related IDs.

e.g.,
- "Borrower Tim Jones"
- "Borrower BO-ABCD-1234"
- "Peach Service User"
- "Agent Abigail Smith"
- "Agent bob@acme.com"
- "Agent EM-ABCD-1234"
    Example: "Agent bob@acme.com"

  - `data.createdBy.employee` (object,null)

  - `data.createdBy.employee.id` (string)
    The employee's ID

  - `data.createdBy.id` (string)
    The unique identifier of the user who performed the action.

  - `data.createdBy.name` (string,null)
    The name of the user who performed the action.

  - `data.createdBy.userType` (string)
    The type of the user.
    Enum: "agent", "borrower", "service"

  - `data.currency` (string)
    Currency of the transaction.

  - `data.customDisplayName` (string,null)
    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.

  - `data.failureDescriptionLong` (string)
    Detailed text describing the failure reason and any appropriate actions the user may take to fix the issue.

  - `data.failureDescriptionShort` (string)
    Short text describing the failure reason. Normally displayed in UI.

  - `data.failureReason` (string)
    The transaction failure reason.
    Enum: "insufficientFunds", "chargeback", "accountClosed", "invalidAccount", "unknownReason", "invalidCvv", "invalidExpirationDate", "avsFailed", "networkError", "cardDeclined", "accountFrozen", "deceased", "invalidRouting", "paymentStopped", "incorrectNumber", "fraudulent", "unauthorizedDebit"

  - `data.holdDaysEndDate` (string,null)
    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)

  - `data.metaData` (object,null)
    Store any type of key/value pairs in the form of a JSON dictionary.

  - `data.parentTransactionId` (string)
    The ID of the real transactions that created this virtual transaction. Only relevant for virtual transactions.

  - `data.paymentDetails` (object)
    Payment details.

  - `data.paymentDetails.fromInstrument` (any)

  - `data.paymentDetails.fromInstrumentId` (string)
    The identifier of the payment instrument that was charged.

  - `data.paymentDetails.reason` (string)
    The reason why the payment was created.
    Enum: "autoPay", "oneTimePayment", "settlement", "reversal", "reimbursement"

  - `data.paymentDetails.toInstrument` (any)

  - `data.paymentDetails.toInstrumentId` (string)
    The identifier of the payment instrument that was credited.

  - `data.paymentDetails.type` (string)
    The payment type.
    Enum: "ach", "debitCard", "creditCard", "check", "cash", "payroll", "paymentNetwork", "moneyOrder", "wire"

  - `data.processingFeeAmount` (number)
    Transaction processing fees that are charged by a payment processor.

  - `data.processingFeeType` (string)
    Describes whether the processing fees are net or gross.
If it is a net fee, the amount of the fee is deducted from the amount of the transaction 'en route'.
If it is a gross fee, the amount of the fee is charged by the processor at the end the month.
    Enum: "net", "gross"

  - `data.processorFailureDetails` (any)
    The error details returned by the payment processor.

  - `data.processorFailureReason` (string)
    The raw failure reason returned by the payment processor.

  - `data.processorMerchantId` (string,null)
    Applies to card transactions processed by Peach. The merchant ID used for processing a card transaction.

  - `data.processorReconciliationId` (string)

  - `data.processorReversalId` (string)

  - `data.processorTransactionId` (string)

  - `data.retryAttempt` (integer,null)
    Number of attempts to retry processing a failed transaction.

  - `data.retryOriginalTransactionId` (string,null)
    The Peach identifier for the original transaction for which this is a retry.

  - `data.reversedAmount` (number)
    The total amount of reversals associated with this transaction. See reversedByTransactionIds for reversal transaction details.
This amount is calculated by Peach and cannot be set or updated via API.

  - `data.reversedByTransactionExternalId` (string)
    DEPRECATED ATTRIBUTE Use reversedByTransactionIds to obtain external IDs of all reversing transactions

Lender's external identifier of the transaction that reverses this one.

  - `data.reversedByTransactionId` (string)
    DEPRECATED ATTRIBUTE Use reversedByTransactionIds to obtain IDs of all reversing transactions.

Peach identifier of the transaction that reverses this one.

  - `data.reversedByTransactionIds` (array)
    Identifier(s) of the transaction(s) that reverse this one

  - `data.reversedByTransactionIds.externalId` (string)
    Lender's external identifier of the transaction that reverses this one.

  - `data.reversedByTransactionIds.id` (string)
    Peach identifier of the transaction that reverses this one

  - `data.reversesTransactionExternalId` (string)
    The externalId of the original transaction that is being fully or partially reversed by this transaction.

  - `data.reversesTransactionId` (string)
    The id of the original transaction that is being fully or partially reversed by this transaction.

  - `data.scheduledAmount` (number)
    The scheduled amount. The actual amount charged can be lower from the
scheduled amount. It cannot be higher.

  - `data.status` (string)
    The transaction status.

 - 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.

In order to create or update transactions to have status inDispute or chargeback, the Create transaction chargeback and Update chargeback endpoints should be used.
    Enum: "scheduled", "initiated", "pending", "succeeded", "failed", "canceled"

  - `data.timestamps` (object)
    Timestamps of the transaction statuses.

  - `data.timestamps.appliedAt` (string)
    The effective date and time the transaction was applied to the loan.
This matches the effective date and time of the ledger entries resulting from applying the transaction.
If this value is null, the transaction has not been applied.

  - `data.timestamps.canceledAt` (string)
    The date and time the transaction transitioned to the canceled status.
See status for more information.

  - `data.timestamps.chargebackAt` (string)
    The date and time the transaction transitioned to the chargeback status.
See status for more information.

  - `data.timestamps.createdAt` (string)
    The date and time the transaction was created.

  - `data.timestamps.deletedAt` (string,null)
    If this field is not null, the transaction is considered deleted. The date and time the transaction was deleted.

  - `data.timestamps.displayDate` (string)
    The display date of the transaction in the product timezone.
This determines the placement of the transaction on the timeline displayed in the borrower portal.
In some instances, this will differ from the effectiveDate of the transaction. For example, when a reversal transaction is created,
the effectiveDate of the reversal matches the original transaction, but the displayDate of the reversal is the date on which the reversal was processed.

  - `data.timestamps.effectiveDate` (string)
    The effective date of the transaction in the product timezone. Updated when a transaction is backdated.

  - `data.timestamps.failedAt` (string)
    The date and time the transaction transitioned to the failed status.
See status for more information.

  - `data.timestamps.inDisputeAt` (string)
    The date and time the transaction transitioned to the inDispute status.
See status for more information.

  - `data.timestamps.initiatedAt` (string)
    The date and time the transaction transitioned to the initiated status.
See status for more information.

  - `data.timestamps.originalDisplayDate` (string)

  - `data.timestamps.originalEffectiveDate` (string)
    The original effective date of the transaction in the product timezone, prior to any backdating of the transaction.

  - `data.timestamps.pendingAt` (string)
    The date and time the transaction transitioned to the pending status.
See status for more information.

  - `data.timestamps.scheduledDate` (string)
    The scheduled date of the transaction in the product timezone.
Transactions to be processed by peach will be processed on this date.

  - `data.timestamps.succeededAt` (string)
    The date and time the transaction transitioned to the succeeded status.
See status for more information.

  - `data.timestamps.updatedAt` (string,null)
    The date and time the transaction was last updated.

  - `data.transactionType` (string)
    The transaction type.

payment - payment made by the borrower or by a service agent per borrower request.
Can be one-time payment, future payment or Autopay.
Successful payments reduce loan balance.

serviceCredit - service credit issued by a service agent or supervisor. Successful service
credits reduce loan balance.
    Enum: "payment", "serviceCredit"

  - `data.chargebackAmount` (number,null)
    The total amount of all Open and Closed chargebacks on this transaction.

  - `data.chargebackDetails` (array)

  - `data.chargebackDetails.amount` (number)
    The amount of the chargeback. Defaults to the actualAmount of the transaction.

  - `data.chargebackDetails.caseId` (string)
    The identifier of an existing case.

  - `data.chargebackDetails.category` (string)
    The chargeback category as received from the payment processor.

  - `data.chargebackDetails.description` (string)
    The description of the chargeback as received from the payment processor.

  - `data.chargebackDetails.externalCaseNumber` (string)
    The external case number of the chargeback in the payment processor system.

  - `data.chargebackDetails.externalId` (string)
    The lender's identifier of the chargeback.

  - `data.chargebackDetails.id` (string)
    The identifier of the chargeback.

  - `data.chargebackDetails.reasonCode` (string)
    The reason code as received from the payment processor.

  - `data.chargebackDetails.status` (string)
    The status of the chargeback.
  - open -  the chargeback was opened and is currently in dispute. The system assumes that the chargeback amount is temporarily taken and the
    effectiveAmount of the transaction is reduced by the chargeback amount. This might trigger a replay.
  - closed - the chargeback dispute period has closed, and the chargeback has been upheld. This is a terminal state and the chargeback cannot
    be reopened. The system assumes that the chargeback amount is permanently taken and the effectiveAmount of the transaction is reduced.
  - reversed - the chargeback dispute period has closed, and the chargeback has been reversed. The system assumes that the chargeback amount
    is permanently returned and the effectiveAmount of the transaction is increased back. This might trigger a replay.

The chargeback status impacts the transaction status is the following way:

For a transaction with a single chargeback, the chargeback status dictates the transaction status:
  - chargebackstatus:open → transaction status:inDispute
  - chargebackstatus:closed → transaction status:chargeback
  - chargebackstatus:reversed → transaction status:succeeded

For a transaction with multiple chargebacks, the following logic applied:
  - Any of the chargebacks in status:open → transaction status:inDispute
  - No chargebacks are in status:open, and any chargebacks are in status:closed → transaction status:chargeback
  - All chargebacks are in status:reversed→ transaction status:succeeded
    Enum: "open", "closed", "reversed"

  - `data.effectiveAmount` (number)
    The net/effective amount of the transaction after taking into account chargebacks, reversals, and disputes. The amount is calculated as:
effectiveAmount = actualAmount - reversedAmount - chargebackAmount
This amount is calculated by Peach and cannot be set or updated via API.

  - `data.isExternal` (boolean)
    A transaction marked isExternal=true is for record purposes only. A transaction with
an external paymentInstrument is automatically marked external.

  - `data.isVirtual` (boolean)
    A transaction marked isVirtual=true is not a real transaction, but represents a part of another transaction.
This is used to store the principal/interest split on draws in Line of Credits as well as splits between multiple
installment loans that were applied as a single payment.

  - `data.paidFeesAmount` (number)
    The paid rounded amount allocated to fees

  - `data.paidInterestAmount` (number)
    The paid rounded amount allocated to interest

  - `data.paidOverAmount` (number)
    Stores any excess rounded amount that was not allocated to principal, interest or fees.

  - `data.paidPrincipalAmount` (number)
    The paid rounded amount allocated to principal

  - `data.serviceCreditDetails` (object)
    Information about credit.

  - `data.serviceCreditDetails.reason` (string)
    The reason why the payment was created.
    Enum: "oneTimePayment", "reversal"

  - `data.serviceCreditDetails.sponsor` (string)
    Sponsor of the credit. Mainly used for ledger/accounting.

If loanOwner, the credit is recorded as expense in ledger/accounting.

If loanServicer, the credit is recorded as liability from the servicer.

If merchant, the credit is recorded as liability from the merchant.
    Enum: "loanOwner", "loanServicer", "merchant"

  - `data.serviceCreditDetails.type` (string)
    The type of service credit.

- serviceAgent, serviceSupervisor - can be used when a lender provides a service credit as a courtesy to a borrower. 
Note: this type of credit is reported to credit bureaus in Metro2 as "Actual Payment Amount" and "Date of Last Payment".

- balanceTransfer - can be used when you need to transfer balance from an existing loan or draw to a new one. 
Note: this type of credit is reported to credit bureaus in Metro2 as "Actual Payment Amount" and "Date of Last Payment".

- usuryCap - can be used by a lender in case interest or fees exceed usury caps. Note: this type of credit is reported to 
credit bureaus in Metro2 as "Actual Payment Amount" and "Date of Last Payment".

- rewards - can be used by a lender to convert rewards to a service credit to pay down outstanding balance. Note: this 
type of credit is reported to credit bureaus in Metro2 as "Actual Payment Amount" and "Date of Last Payment".

- settlementOfDebt - can be used when a lender settles outstanding balance with a borrower as part of collection efforts. 
  Please read carefully the difference between the settlementOfDebt and settlementOfDebtNoLoss descriptions.
  
  Notes:

  - This type of credit is NOT reported to credit bureaus in Metro2 as "Actual Payment Amount" and "Date of Last Payment".
  - This type of credit is considered as "loss" in Metro2 logic of "Account Status" Base Segment field. A charged off loan with
    outstanding balance of zero and settlementOfDebt service credit will be reported as Account Status=97.

- settlementOfDebtNoLoss - can be used when a lender settles outstanding balance with a borrower as part of collection efforts.
  Please read carefully the difference between the settlementOfDebt and settlementOfDebtNoLoss descriptions.
  
  Notes:
   - This type of credit is NOT reported to credit bureaus in Metro2 as "Actual Payment Amount" and "Date of Last Payment".
   - This type of credit is NOT considered as "loss" in Metro2 logic of "Account Status" Base Segment field. A charged off loan 
     with outstanding balance of zero and settlementOfDebtNoLoss service credit (assuming no service credits of type settlementOfDebt, fraud, badDebt or deceased exist) will be reported as Account Status=64.

- fraud - can be used when a lender confirms that a loan is fraudulent and wants to bring the loan balance to zero.
  
  Notes:
    - This type of credit is NOT reported to credit bureaus in Metro2 as "Actual Payment Amount" and "Date of Last Payment".
    - This type of credit is considered as "loss" in Metro2 logic of "Account Status" Base Segment field.

- badDebt - can be used after a loan is charged off and the lender wants to write off the balance and make the loan balance zero.
  
  Notes:
    - This type of credit is NOT reported to credit bureaus in Metro2 as "Actual Payment Amount" and "Date of Last Payment".
    - This type of credit is considered as "loss" in Metro2 logic of "Account Status" Base Segment field.

- deceased - can be used when a lender confirms a deceased case.
  
  Notes:
    - This type of credit is NOT reported to credit bureaus in Metro2 as "Actual Payment Amount" and "Date of Last Payment".
    - This type of credit is considered as "loss" in Metro2 logic of "Account Status" Base Segment field.

- bankruptcy - should only be used when a bankruptcy case is discharged and the lender wants to bring the loan balance to zero.
  
  Notes:
    - This type of credit is NOT reported to credit bureaus in Metro2 as "Actual Payment Amount" and "Date of Last Payment".
    - This type of credit is used in the Metro2 logic of "Account Status" Base Segment field to report Account Status=64.

- rounding - this type of service credit can be created by the Peach system only. 

- refund - this type of service credit can be created by the Peach system only. 

- interestAdjustment - this type of service credit can be created by the Peach system only.
    Enum: "serviceAgent", "serviceSupervisor", "settlementOfDebt", "settlementOfDebtNoLoss", "balanceTransfer", "rewards", "fraud", "badDebt", "bankruptcy", "deceased", "usuryCap", "refund", "interestAdjustment", "rounding"

  - `data.autopayPaymentIds` (array)
    Peach identifiers of the autopay expected payments.

  - `data.autopayPlanId` (string)
    Peach identifier of the autopay plan.

  - `data.drawId` (string)
    The draw identifier for the transaction.

  - `data.enablePrepayments` (boolean)
    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.

  - `data.initiatingBorrowerId` (string,null)
    The ID of the borrower who initiated the transaction.

  - `data.loanId` (string)
    The unique identifier of the Loan.

  - `data.mainBorrowerId` (string)
    The Peach identifier for the main borrower on the loan.

  - `data.unroundedPaidFeesAmount` (number)
    The paid unrounded amount allocated to fees

  - `data.unroundedPaidInterestAmount` (number)
    The paid unrounded amount allocated to interest

  - `data.unroundedPaidOverAmount` (number)
    Stores any excess unrounded amount that was not allocated to principal, interest or fees.

  - `data.unroundedPaidPrincipalAmount` (number)
    The paid unrounded amount allocated to principal


