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.

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>

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 purchase. The date is used mainly for visuals and normally shown in Borrower Portal and on statements. If the purchase date is not passed, the system will use the timestamp in UTC of the 'Create purchase' call, covert to the product timezone (e.g. Eastern or Pacific), take the date portion and store it as purchaseDate. The purchase is recorded in the ledger with effective timestamp of the 'Create purchase' call. The purchaseDate cannot be before the Draw activation date (Get draw timestamps.activatedAt).

object

The details of purchase.

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": {
    },
  • "originalPurchaseId": "string",
  • "declineReason": {
    },
  • "metadata": { }
}
Response samples
application/json
{
  • "status": 0,
  • "message": "string",
  • "processingComplete": true,
  • "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.

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

The amount of the purchase.

externalId
string

The lender's identifier for the purchase.

object

The details of purchase.

object

The reason the purchase was declined

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,
  • "externalId": "string",
  • "purchaseDetails": {
    },
  • "declineReason": {
    }
}
Response samples
application/json
{
  • "status": 0,
  • "message": "string",
  • "processingComplete": true,
  • "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",
  • "processingComplete": true,
  • "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",
  • "processingComplete": true,
  • "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",
  • "processingComplete": true,
  • "data": {
    }
}