Skip to main content
POST
Create a client payment schedule

Authorizations

Authorization
string
header
required

Body

application/json
externalId
string
required

Id of the schedule outside LeanPay, chosen by the integrator. Not blank, and unique among the schedules.

Required string length: 1 - 80
Pattern: \S
client
object
required
dueDates
object[]
required

Due dates of the payment. Their amounts add up to the amount of the invoices minus the amount of the credit notes. A date may be in the past. The amount already paid on the documents settles the earliest due dates first.

Required array length: 1 - 100 elements
name
string

Name of the schedule. Not blank. When left out, LeanPay generates one, such as EC-002.

Required string length: 1 - 40
Pattern: \S
invoices
object[]

Invoices settled by the schedule. Give at least one invoice or credit note.

creditNotes
object[]

Credit notes deducted from the invoices.

Response

The created client payment schedule.

id
string<uuid>
required

Id of the client payment schedule.

externalId
string | null
required

Id of the schedule outside LeanPay, chosen by the integrator. null for a schedule created in the LeanPay app.

clientId
string<uuid>
required

Id of the client.

name
string
required

Name of the schedule.

currency
string
required

ISO 4217 code of the currency of the schedule, the currency of its documents.

amount
integer
required

Total of the due dates.

remainingAmount
integer
required

Amount still to pay on the due dates.

invoices
object[]
required

Invoices of the schedule.

creditNotes
object[]
required

Credit notes of the schedule.

dueDates
object[]
required

Due dates of the schedule, sorted by ascending date.

createdAt
string<date-time>
required

Date the schedule was created.

updatedAt
string<date-time>
required

Date the schedule was last changed, a recalculation of its due dates after a payment included.