Line of Credit Purchases

This object represents a line of credit purchase. Purchases can be made on Draw objects only. Purchases of type regular increase principal balance of a Draw. Some purchase types, such as cashBack or refund are actually reduce the principal balance of a Draw. Each purchase has a unique identifier.

Get line of credit purchases

Securityoauth2 or bearerAuth or apiKeyHeader
Request
path Parameters
personId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

loanId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

query Parameters
types
Array of strings

The statuses of the purchases to fetch

Items Enum: "regular" "refund" "cashback"
statuses
Array of strings

The statuses of the purchases to fetch

Items Enum: "pending" "settled" "canceled" "declined" "disputed"
limit
integer [ 1 .. 100 ]
Default: 25

The maximum count of results to retrieve.

startingAfter
string

Return results starting after the provided object identifier.

endingBefore
string

Return results ending before the provided object identifier.

fromEffectiveAt
string <date-time>

Used for filtering objects such that fromEffectiveAt less than or equal to effectiveAt

toEffectiveAt
string <date-time>

Used for filtering objects such that effectiveAt less than or equal to toEffectiveAt

Responses
200

Success

get/people/{personId}/loans/{loanId}/purchases
Response samples
application/json
{
  • "count": 0,
  • "data": [
    ]
}

Create purchase

Securityoauth2 or bearerAuth or apiKeyHeader
Request
path Parameters
personId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

loanId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

drawId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

The draw identifier.

query Parameters
force
boolean
Default: false

Allows creation of purchases, even if is above the credit limit for the line of credit.

sync
boolean
Default: false

Make the process synchronous.

Request Body schema: application/json
externalId
string or null

A lender's identifier for a resource.

After the resource is successfully created, a lender can use the Peach assigned ID OR the externalId identifiers to fetch the resource.

Fetching with externalId:

To fetch a resource using an externalId, you MUST use the prefix ext- in the URL.

For example, a loan with an external identifier of ABCDE would be referenced like /api/people/BO-FAKE-IDNT/loans/ext-ABCDE.

Creating with externalId:

To create a resource with an external identifer, you MUST NOT use the prefix ext-.

For example, if the external identifier should be ABCDE, then pass { externalId: "ACBCE", ... } in the request body.

type
string
  • regular - a regular purchase made by the borrower. Increases draw's balance.
  • refund - a refund of the purchase made in the past. Decreases draw's balance.
  • cashBack - cash back given to the borrower by the issuing institution.
Enum: "regular" "refund" "cashBack"
status
string
Default: "settled"
  • settled - the purchase was settled.
  • pending - the purchase is pending. pending purchases increases the draw balance similar to settled. Pending status is used mainly for visuals and normally shown in Borrower Portal and on statements.
  • canceled - the purchase was canceled. canceled purchases reduce the draw balance. A new purchase cannot be created in canceled status.
  • declined - the purchase was declined. declined purchases reduce the draw balance if the status changes from pending to declined. A new purchase can be created in declinedstatus for record purposes (it will not impact the draw balance).
  • disputed - The purchase was disputed for full or partial amount. disputed status is a terminal state and once set cannot be changed to another status. This status can not be set manually. Submitting a purchase dispute will set the purchase's status to disputed.
Enum: "settled" "pending" "canceled" "declined" "disputed"
amount
required
number <float> >= 0

The amount of the purchase. The amount can be updated only if the purchase status is currently pending. You can change the amount and status of a purchase on the same call.

purchaseDate
string <date>

The date of the purchase. The value is equal to the date part of the effectiveAt converted to the product timezone (e.g. Eastern or Pacific).

This attribute is deprecated on purchase creation and will not be used by the system.

object

The details of purchase.

object

The details of how a refund was applied:

  • The system will first deplete any non-due principal. This amount will be stored as refundNonDuePrincipalAmount.
  • If any refund amount is left to apply, the system will create a transaction of type serviceCredit and serviceCreditType=refund. This transaction will be applied on the Draw level first and any leftover amount will be applied on the LOC level (based on the loan type waterfall configuration for payments). This amount will be stored as refundTransactionAmount.
  • Any unapplied refund amount will be recorded as credit to the borrower (also called reimbursementAmount.)
originalPurchaseId
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

Peach's unique or lender's external identifier.

object

The reason the purchase was declined

metadata
object

Store any type of key/value pairs in the form of a JSON dictionary.

Responses
200

Created

408

Request Timeout

post/people/{personId}/loans/{loanId}/draws/{drawId}/purchases
Request samples
application/json
{
  • "externalId": "string",
  • "type": "regular",
  • "status": "settled",
  • "amount": 0,
  • "purchaseDate": "2019-08-24",
  • "purchaseDetails": {
    },
  • "refundDetails": {
    },
  • "originalPurchaseId": "string",
  • "declineReason": {
    },
  • "metadata": { }
}
Response samples
application/json
{
  • "status": 0,
  • "message": "string",
  • "data": {
    }
}

Get purchases

Securityoauth2 or bearerAuth or apiKeyHeader
Request
path Parameters
personId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

loanId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

drawId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

The draw identifier.

query Parameters
types
Array of strings

The statuses of the purchases to fetch

Items Enum: "regular" "refund" "cashback"
statuses
Array of strings

The statuses of the purchases to fetch

Items Enum: "pending" "settled" "canceled" "declined" "disputed"
limit
integer [ 1 .. 100 ]
Default: 25

The maximum count of results to retrieve.

startingAfter
string

Return results starting after the provided object identifier.

endingBefore
string

Return results ending before the provided object identifier.

fromEffectiveAt
string <date-time>

Used for filtering objects such that fromEffectiveAt less than or equal to effectiveAt

toEffectiveAt
string <date-time>

Used for filtering objects such that effectiveAt less than or equal to toEffectiveAt

Responses
200

Purchases

get/people/{personId}/loans/{loanId}/draws/{drawId}/purchases
Response samples
application/json
{
  • "status": 0,
  • "message": "string",
  • "data": [
    ]
}

Get purchase by ID

Securityoauth2 or bearerAuth or apiKeyHeader
Request
path Parameters
personId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

loanId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

drawId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

The draw identifier.

purchaseId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

The purchase identifier.

Responses
200

Updated

get/people/{personId}/loans/{loanId}/draws/{drawId}/purchases/{purchaseId}
Response samples
application/json
{
  • "status": 0,
  • "message": "string",
  • "data": {
    }
}

Update purchase

Securityoauth2 or bearerAuth or apiKeyHeader
Request
path Parameters
personId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

loanId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

drawId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

The draw identifier.

purchaseId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

The purchase identifier.

query Parameters
sync
boolean
Default: false

Make the process synchronous.

Request Body schema: application/json
status
string
Enum: "pending" "settled" "canceled" "declined" "disputed"
amount
number >= 0

The amount of the purchase.

effectiveAt
string <date-time>

The effective timestamp when the purchase was applied in the ledger. When a new purchase is created, the effectiveAt is equal to createdAt. Changing the effectiveAt will trigger a replay of the line of credit. Keep in mind that an existing statement might've included the purchase based on the existing effectiveAt value and the interest was accrued based on the existing effectiveAt. You might want/need to regenerate the statement. effectiveAt can be updated only if the purchase is in settled or pending status.

The timezone is UTC for this timestamp and the format is ISO. For example, in order to set a purchase effectiveAt to July 28th 2022, 10:44 am PDT, send 2022-07-28T17:44:00Z

externalId
string

The lender's identifier for the purchase.

originalPurchaseId
string

The identifier of the original purchase if this is a refund.

object

The details of purchase.

metadata
object
object

The reason the purchase was declined

object

The details of how a refund was applied:

  • The system will first deplete any non-due principal. This amount will be stored as refundNonDuePrincipalAmount.
  • If any refund amount is left to apply, the system will create a transaction of type serviceCredit and serviceCreditType=refund. This transaction will be applied on the Draw level first and any leftover amount will be applied on the LOC level (based on the loan type waterfall configuration for payments). This amount will be stored as refundTransactionAmount.
  • Any unapplied refund amount will be recorded as credit to the borrower (also called reimbursementAmount.)
Responses
200

Updated

408

Request Timeout

423

Locked

put/people/{personId}/loans/{loanId}/draws/{drawId}/purchases/{purchaseId}
Request samples
application/json
{
  • "status": "pending",
  • "amount": 0,
  • "effectiveAt": "2022-06-10T11:45Z",
  • "externalId": "string",
  • "originalPurchaseId": "string",
  • "purchaseDetails": {
    },
  • "metadata": { },
  • "declineReason": {
    },
  • "refundDetails": {
    }
}
Response samples
application/json
{
  • "status": 0,
  • "message": "string",
  • "data": {
    }
}

Create purchase dispute

Creates a new purchase dispute.

Securityoauth2 or bearerAuth or apiKeyHeader
Request
path Parameters
personId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

loanId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

drawId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

The draw identifier.

purchaseId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

The purchase identifier.

Request Body schema: application/json
externalId
string or null non-empty

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=ACBCE and NOT ext-ABCDE when creating the object.

caseId
string

Peach identifier of the case. The case object contains more details about the dispute, e.g. evidence information such as supporting documents.

status
string
Default: "unsubmitted"

The status of the dispute. unsubmitted is the only valid status for a new purchase dispute.

unsubmitted - The dispute is pending submission to a processor/network.

submitted - The dispute has been submitted to a processor/network.

expired - The dispute has expired.

won - The dispute is won.

lost - The dispute is lost.

canceled - The dispute was canceled. Only unsubmitted disputes can be canceled.

Enum: "unsubmitted" "submitted" "expired" "won" "lost" "canceled"
disputedAmount
required
number <float>

The disputed amount. Can be less than the original purchase amount. Sum of disputed amounts cannot exceed the original purchase amounts (regardless of disputes outcomes).

object
repostedPurchaseId
string

The identifier of the reposted purchase. When a borrower loses a dispute, the lender normally creates a new purchase in the amount of the dispute.

createDisputeCase
boolean
Default: true

If true, the system will automatically create a Purchase Dispute case object and return the case identifier in caseId attribute. Alternatively, you can create the case object, pass createDisputeCase=false and the case identifier in the caseId attribute.

Responses
200

Success

423

Locked

post/people/{personId}/loans/{loanId}/draws/{drawId}/purchases/{purchaseId}/disputes
Request samples
application/json
{
  • "externalId": "string",
  • "caseId": "string",
  • "status": "unsubmitted",
  • "disputedAmount": 0,
  • "metadata": { },
  • "repostedPurchaseId": "string",
  • "createDisputeCase": true
}
Response samples
application/json
{
  • "status": 0,
  • "message": "string",
  • "data": {
    }
}

Get purchase disputes

Securityoauth2 or bearerAuth or apiKeyHeader
Request
path Parameters
personId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

loanId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

drawId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

The draw identifier.

purchaseId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

The purchase identifier.

Responses
200

Success

get/people/{personId}/loans/{loanId}/draws/{drawId}/purchases/{purchaseId}/disputes
Response samples
application/json
{
  • "count": 0,
  • "data": [
    ]
}

Get draw purchase disputes

Securityoauth2 or bearerAuth or apiKeyHeader
Request
path Parameters
personId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

loanId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

drawId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

The draw identifier.

Responses
200

Success

get/people/{personId}/loans/{loanId}/draws/{drawId}/disputes
Response samples
application/json
{
  • "count": 0,
  • "data": [
    ]
}

Get line of credit purchase disputes

Securityoauth2 or bearerAuth or apiKeyHeader
Request
path Parameters
personId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

loanId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

Responses
200

Success

get/people/{personId}/loans/{loanId}/disputes
Response samples
application/json
{
  • "count": 0,
  • "data": [
    ]
}

Get purchase dispute by ID

Securityoauth2 or bearerAuth or apiKeyHeader
Request
path Parameters
personId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

loanId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

drawId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

The draw identifier.

purchaseId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

The purchase identifier.

purchaseDisputeId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

The ID of the purchase dispute

Responses
200

Success

get/people/{personId}/loans/{loanId}/draws/{drawId}/purchases/{purchaseId}/disputes/{purchaseDisputeId}
Response samples
application/json
{
  • "status": 0,
  • "message": "string",
  • "data": {
    }
}

Update purchase dispute

Securityoauth2 or bearerAuth or apiKeyHeader
Request
path Parameters
personId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

loanId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

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

drawId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

The draw identifier.

purchaseId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

The purchase identifier.

purchaseDisputeId
required
string^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$

The ID of the purchase dispute

query Parameters
sync
boolean
Default: false

Make the process synchronous.

Request Body schema: application/json
externalId
string or null non-empty

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=ACBCE and NOT ext-ABCDE when creating the object.

caseId
string

Peach identifier of the case. The case object contains more details about the dispute, e.g. evidence information such as supporting documents.

status
string
Default: "unsubmitted"

The status of the dispute. unsubmitted is the only valid status for a new purchase dispute.

unsubmitted - The dispute is pending submission to a processor/network.

submitted - The dispute has been submitted to a processor/network.

expired - The dispute has expired.

won - The dispute is won.

lost - The dispute is lost.

canceled - The dispute was canceled. Only unsubmitted disputes can be canceled.

Enum: "unsubmitted" "submitted" "expired" "won" "lost" "canceled"
disputedAmount
number <float>

The disputed amount. Can be less than the original purchase amount. Sum of disputed amounts cannot exceed the original purchase amounts (regardless of disputes outcomes).

object
repostedPurchaseId
string

The identifier of the reposted purchase. When a borrower loses a dispute, the lender normally creates a new purchase in the amount of the dispute.

Responses
200

Success

408

Request Timeout

put/people/{personId}/loans/{loanId}/draws/{drawId}/purchases/{purchaseId}/disputes/{purchaseDisputeId}
Request samples
application/json
{
  • "externalId": "string",
  • "caseId": "string",
  • "status": "unsubmitted",
  • "disputedAmount": 0,
  • "metadata": { },
  • "repostedPurchaseId": "string"
}
Response samples
application/json
{
  • "status": 0,
  • "message": "string",
  • "data": {
    }
}