Skip to content

Preview Payment Schedule

POST
/quotes/payment-schedule

What a set of line items would bill, and when. Arithmetic over the body.

Authorizations

Parameters

Header Parameters

X-Target-Org-Id
Any of:
string

Request Body required

Compute the payment schedule a set of line items WOULD produce.

Reads nothing and writes nothing - it is arithmetic over the body, which is why it is POST but tiered read.

object
contract_duration_unit
Any of:
string
Allowed values: months weeks days
contract_duration_value
Any of:
number
>= 0.1 <= 3650
contract_end_date
Any of:
string
contract_months
Any of:
number
>= 0.1 <= 120
contract_start_date
required

ISO date the contract starts.

string
line_items
required
Array<object>
>= 1 items <= 500 items

One priced line, mirroring the app’s LineItemDTO.

The two REQUIRED fields are required here too, and that is the point: the app model is built inside the handler, so a missing product_name or unit_amount would raise a bare pydantic.ValidationError there - not the RequestValidationError error_handlers.py registers - and escape as a 500 instead of a 422.

unit_amount is in CENTS, like the app. An API that took dollars here while the app took cents would be wrong by a factor of a hundred on every quote, silently.

CLOSED (extra="forbid"), which makes this stricter than the app on purpose. LineItemDTO uses pydantic’s default behaviour and DROPS an unrecognised field, so an open model here would accept a pricing field, lose it on the way in, and return a schedule computed without it. On a money surface a 422 naming the field is worth more than a 200 that quietly priced something else. Nothing existing is affected - this route is new.

object
billing_frequency
Any of:
string
billing_start_date
Any of:
string
description
Any of:
string
<= 2000 characters
discount_pct
number
<= 100
manual_product_id
Any of:
string
product_name
required
string
>= 1 characters <= 255 characters
quantity
integer
default: 1 >= 1 <= 10000
sort_order
integer
start_month
integer
default: 1 >= 1 <= 120
stripe_price_id
Any of:
string
stripe_product_id
Any of:
string
unit_amount
required

CENTS, not dollars.

integer
<= 1000000000
tax_amount
integer
<= 1000000000

Responses

200

Successful Response

object
data
required

An open envelope for a quote, template, contact or job result.

object
key
additional properties
any
pagination
Any of:
object
has_next
required

Whether there are more pages

boolean
limit
required

Items per page

integer
next_cursor
Any of:
string
page
required

Current page number (1-indexed)

integer
total
required

Total number of items

integer

422

Validation Error

object
detail
Array<object>
object
loc
required
Array
msg
required
string
type
required
string