Contracts
Preview the invoice schedule for a contract
Changed onComputes and returns the invoice schedule the given contract would produce, without creating the contract or persisting anything.
post/contracts/preview-invoice-schedule
Request
- Base URLhttps://api.rillet.com
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"name": "New API Contract",
"items": [
{
"price": {
"amount": {
"amount": "1.01",
"currency": "USD"
},
"interval_months": 1
},
"quantity": 1,
"progress_plan": {
"milestones": [
{
"key": "design-approved",
"name": "Design approved",
"sequence": 1,
"percentage": "30",
"amount": {
"amount": "1.01",
"currency": "USD"
}
}
]
},
"discount": {
"amount_off": {
"amount": "1.01",
"currency": "USD"
}
},
"tax_rate": {
"percentage": "0",
"tax_amount": {
"amount": "1.01",
"currency": "USD"
},
"country": "US"
},
"external_reference": {
"type": "xyzSystemId",
"id": "234",
"url": "https://xyzsystempage.com/ids/234"
},
"usage_minimum_commitment": {
"amount": {
"amount": "1.01",
"currency": "USD"
},
"revenue_account": "11112"
},
"declared_ssp": {
"amount": "1.01",
"currency": "USD"
}
}
],
"invoicing": {
"day": 1
},
"usage_configuration": {
"contract_level_minimum_commitment": {
"amount": {
"amount": "1.01",
"currency": "USD"
},
"revenue_account": "11112"
}
},
"external_references": [
{
"type": "xyzSystemId",
"id": "234",
"url": "https://xyzsystempage.com/ids/234"
}
],
"exchange_rate": {
"base": "USD",
"target": "USD"
},
"invoice_schedule": {
"invoices": [
{
"currency": "USD",
"total": {
"amount": "1.01",
"currency": "USD"
},
"items": [
{
"unit_amount": {
"amount": "1.01",
"currency": "USD"
},
"total_amount": {
"amount": "1.01",
"currency": "USD"
}
}
]
}
]
}
}Response
The computed invoice schedule
Example response
{
"invoices": [
{
"currency": "USD",
"total": {
"amount": "1.01",
"currency": "USD"
},
"items": [
{
"unit_amount": {
"amount": "1.01",
"currency": "USD"
},
"total_amount": {
"amount": "1.01",
"currency": "USD"
}
}
]
}
]
}Changes
- info
endpoint added
- info