Zum Hauptinhalt springen
POST
/
api
/
payment-plans
Create a payment plan
curl --request POST \
  --url https://coreapi.io/api/payment-plans \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "invoiceId": "10000000-0000-0000-0003-000000000001",
  "paymentMethodId": null,
  "installments": [
    {
      "dueAt": "2026-08-05",
      "amount": 595
    }
  ]
}
'
{
  "id": "10000000-0000-0000-00e0-000000000001",
  "invoiceId": "10000000-0000-0000-0003-000000000001",
  "totalAmount": 1190,
  "currencyCode": "EUR",
  "paymentMethodId": "10000000-0000-0000-004f-000000000001",
  "createdAt": "2026-07-05T16:20:00+00:00",
  "completedAt": null,
  "brokenAt": null,
  "canceledAt": null,
  "brokenReason": null,
  "installments": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "position": 1,
      "dueAt": "2026-08-05",
      "amount": 595,
      "paidAt": null
    }
  ]
}

Autorisierungen

Authorization
string
header
erforderlich

Organisation API token. Send it as Authorization: Bearer api_... The token is scoped to a single Organisation. Reading a plan needs the invoice read permission, creating, canceling and extending need the invoice write permission.

Body

application/json

Send EITHER installments OR split, never both and never neither.

invoiceId
string<uuid>
erforderlich

The open, finalized invoice to split.

Beispiel:

"10000000-0000-0000-0003-000000000001"

paymentMethodId
string<uuid> | null

Payment method used for direct-debit collection. Defaults to the invoice payment method, with the customer default as fallback. Must belong to the invoice customer.

Beispiel:

null

installments
object[]

Manual mode. Explicit installments with due dates and amounts, in ascending order, summing to the open amount in cents.

split
object

Even split of the open amount into a number of installments.

Antwort

The created payment plan.

id
string<uuid>
erforderlich
Beispiel:

"10000000-0000-0000-00e0-000000000001"

invoiceId
string<uuid>
erforderlich
Beispiel:

"10000000-0000-0000-0003-000000000001"

status
enum<string>
erforderlich

Lifecycle status of a payment plan.

Verfügbare Optionen:
active,
completed,
broken,
canceled
totalAmount
integer
erforderlich

Sum of all installments in cents. Equals the open amount at creation.

Beispiel:

1190

currencyCode
string
erforderlich
Beispiel:

"EUR"

paymentMethodId
string<uuid> | null
erforderlich
Beispiel:

"10000000-0000-0000-004f-000000000001"

createdAt
string<date-time>
erforderlich
Beispiel:

"2026-07-05T16:20:00+00:00"

completedAt
string<date-time> | null
erforderlich

Timestamp the plan completed (all installments paid), or null.

Beispiel:

null

brokenAt
string<date-time> | null
erforderlich

Timestamp the plan broke, or null.

Beispiel:

null

canceledAt
string<date-time> | null
erforderlich

Timestamp the plan was canceled, or null.

Beispiel:

null

brokenReason
string | null
erforderlich

Reason the plan broke, or null while active.

Beispiel:

null

installments
object[]
erforderlich