Skip to content

Create advance

Request

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

Query
syncboolean

Make the process synchronous.

Default:false
Bodyapplication/json
advanceDatestring, (date)required

The date of the advance in the product timezone. The date cannot be in the past or greater than the last due date.

  • If the advance is created in pending or settled status, the advance will be recorded in the ledger with an effective timestamp of the Create advance call.
  • If the advance is created in scheduled status, the advance will be recorded in the ledger only when the status changes to pending or settled.
advanceDetailsobject or null(AdvanceDetails)

The details of advance.

advanceTimeOfDayobject(TimeOfDay)

The time of day that the advance is entered into the ledger in the product timezone.

amountnumber, (float)required

The amount of advance. The amount must be positive.

externalIdstring or null, <= 200 characters(externalId)

The external unique identifier of the purchase.

metadataobject

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

statusstringrequired
  • scheduled - the advance was scheduled in the future. If the advance status doesn't change to pending, settled or canceled on the advance due date, the system will automatically cancel the advance on the following calendar day (aka change the status to canceled).

    For example: An advance was scheduled for May 27, 2021. On May 28, 2021, the advance status was still scheduled. The system will cancel the advance.

  • settled - the advance was settled and/or funded. settled advances increase the loan balance.

  • pending - the advance is pending. pending advances increases the loan balance similar to settled. pending status is used mainly for visuals and normally shown in Borrower Portal.

  • canceled - the advance was canceled. canceled advances reduce the draw balance. A new advance cannot be created in canceled status.

Default:"settled"
Enum:"scheduled""settled""pending""canceled"
POST
/people/{personId}/loans/{loanId}/advances
curl -i -X POST \
  'https://sandboxapi.peach.finance/api/people/{personId}/loans/{loanId}/advances?sync=false' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "advanceDate": "2019-08-24",
    "advanceDetails": {
      "categoryId": "string",
      "description": "Advance",
      "merchantId": "string",
      "merchantName": "string",
      "metadata": {},
      "pointOfSaleType": "online"
    },
    "advanceTimeOfDay": {
      "hour": 0,
      "minute": 0,
      "second": 0
    },
    "amount": 0.1,
    "externalId": "string",
    "metadata": {},
    "status": "scheduled"
  }'

Responses

Created

Bodyapplication/json
messagestring

Description of the server action or error.

statusinteger

HTTP status code.

dataobject(Advance)
Response
{ "message": "string", "status": 0, "data": { "advanceDate": "2019-08-24", "advanceDetails": { … }, "advanceTimeOfDay": { … }, "amount": 0.1, "canceledBy": "string", "externalId": "string", "id": "string", "metadata": {}, "originalAmount": 0.1, "status": "scheduled", "timestamps": { … } } }