Rillet Contracts API
The Contracts API from Rillet — 5 operation(s) for contracts.
The Contracts API from Rillet — 5 operation(s) for contracts.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/rillet-contracts-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
openapi: 3.2.0
info:
title: Rillet Accounting Contracts API
version: v4.0
servers:
- url: https://api.rillet.com
description: Production server url
- url: https://sandbox.api.rillet.com
description: Test server url
security:
- bearerAuth: []
tags:
- name: Contracts
paths:
/contracts:
post:
tags:
- Contracts
operationId: create-a-contract
summary: Creates a contract
description: 'Rillet supports two contract scope types: FULL and REVENUE_RECOGNITION_ONLY. The selected scope determines how the invoices are created and what information the user needs to provide.
The FULL scope is used when contract invoices are generated and sent directly from Rillet. In this case, Rillet automatically assigns the invoice numbers.
The REVENUE_RECOGNITION_ONLY scope is intended for situations where contracts and invoices are issued from another system and only need to be recorded in Rillet for accounting purposes. In this workflow, users must provide the invoice numbers manually. Other fields can be populated based on the data imported from the external system.
For example, if your organization issues invoices through an external billing platform but tracks financials in Rillet, you should select REVENUE_RECOGNITION_ONLY. If Rillet handles the entire invoicing and sending process, choose the FULL scope.
'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateContractRequest'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ExpandedContract'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
parameters: []
get:
tags:
- Contracts
operationId: list-all-contracts
summary: Lists all contracts
description: 'Returns contracts with pagination and rich filters (subsidiary, customer, status, date ranges).
Use this to discover contract ids, check lifecycle state, or drive reporting extracts.
'
parameters:
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/cursor'
- $ref: '#/components/parameters/subsidiary_id'
- name: status
in: query
description: Optional status filter (allowed values depend on the resource).
required: false
schema:
$ref: '#/components/schemas/ContractStatus'
- name: start_date.gt
in: query
description: Minimum start date value to filter by (exclusive)
schema:
type: string
format: date
required: false
- name: start_date.gte
in: query
description: Minimum start date value to filter by (inclusive)
schema:
type: string
format: date
required: false
- name: start_date.lt
in: query
description: Maximum start date value to filter by (exclusive)
schema:
type: string
format: date
required: false
- name: start_date.lte
in: query
description: Maximum start date value to filter by (inclusive)
schema:
type: string
format: date
required: false
- name: end_date.gt
in: query
description: Minimum end date value to filter by (exclusive)
schema:
type: string
format: date
required: false
- name: end_date.gte
in: query
description: Minimum end date value to filter by (inclusive)
schema:
type: string
format: date
required: false
- name: end_date.lt
in: query
description: Maximum end date value to filter by (exclusive)
schema:
type: string
format: date
required: false
- name: end_date.lte
in: query
description: Maximum end date value to filter by (inclusive)
schema:
type: string
format: date
required: false
- name: customer_id
in: query
description: Optional UUID filter by customer.
schema:
type: string
format: uuid
required: false
responses:
'200':
description: OK
content:
application/json:
schema:
required:
- contracts
type: object
properties:
contracts:
type: array
items:
$ref: '#/components/schemas/Contract'
pagination:
$ref: '#/components/schemas/Pagination'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/contracts/{contract_id}:
get:
tags:
- Contracts
operationId: retrieve-a-contract
summary: Retrieves a contract
description: 'Returns the expanded contract including items, schedules, and metadata required before updates or amendments.
Always retrieve before issuing a full PUT update so you preserve fields you do not intend to clear.
'
parameters:
- name: contract_id
in: path
required: true
description: UUID of the contract to retrieve.
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ExpandedContract'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
delete:
tags:
- Contracts
operationId: delete-a-contract
summary: Deletes a contract
description: 'Permanently removes a contract when your business rules allow deletion.
Confirm downstream invoices, revenue schedules, and integrations no longer depend on this contract before deleting it.
'
parameters:
- name: contract_id
in: path
required: true
description: UUID of the contract to delete.
schema:
type: string
responses:
'204':
description: No Content
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/contracts/{contract_id}/amendments:
post:
tags:
- Contracts
operationId: amend-a-contract
summary: Amends a contract
description: 'Applies a contract amendment when you need to add items, retire items, or change pricing/invoicing after go-live.
Unlike a full PUT update, amendments model business-time changes and preserve historical billing context.
Use preview-contract-amendment to dry-run the financial impact before committing.
'
parameters:
- name: contract_id
in: path
required: true
description: UUID of the contract to amend.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AmendContractRequest'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ExpandedContract'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/contracts/{contract_id}/amendments/preview:
post:
tags:
- Contracts
operationId: preview-contract-amendment
summary: Previews contract amendment
description: Preview a contract that has been amended. This has no effect on the actual contract, only provides a preview of what a contract will look like after it is amended.
parameters:
- name: contract_id
in: path
required: true
description: UUID of the contract whose amendment you are previewing.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PreviewContractAmendmentRequest'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ExpandedContract'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/contracts/{contract_id}/end:
put:
tags:
- Contracts
operationId: end-an-open-ended-contract
summary: Ends an open-ended contract
description: 'Sets an explicit end date on a contract that previously had no close date (open-ended).
Provide the final end_date in the request body; downstream invoicing and revenue recognition honor the new boundary.
'
parameters:
- name: contract_id
in: path
required: true
description: UUID of the open-ended contract to close.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/EndOpenEndedContractRequest'
required: true
responses:
'204':
description: NO CONTENT
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
InvoiceScheduleInvoiceItem:
type: object
required:
- description
- contract_item_reference
- quantity
- total_amount
- external_references
properties:
description:
type: string
contract_item_reference:
type: string
description: Refers to the ID of the contract item's external_reference.
quantity:
type: number
minimum: 1.0e-05
total_amount:
$ref: '#/components/schemas/RoundedMonetaryAmount'
tax_amount:
$ref: '#/components/schemas/RoundedMonetaryAmount'
discount_amount:
$ref: '#/components/schemas/RoundedMonetaryAmount'
external_references:
uniqueItems: true
type: array
items:
$ref: '#/components/schemas/ExternalReference'
BillingScheme:
discriminator:
propertyName: type
mapping:
PER_UNIT: '#/components/schemas/PerUnitBilling'
TIERED: '#/components/schemas/TieredBilling'
oneOf:
- $ref: '#/components/schemas/PerUnitBilling'
- $ref: '#/components/schemas/TieredBilling'
RevenuePattern:
type: string
enum:
- DAILY
- EVEN_PERIOD
description: DAILY means that the revenue is divided equally per day in the revenue period. EVEN_PERIOD means that the revenue is divided equally for each calendar month in the revenue period.
AmendFullContractItemRequest:
type: object
required:
- price
- product_id
- quantity
- revenue_pattern
- start_date
properties:
product_id:
type: string
format: uuid
price:
$ref: '#/components/schemas/Price'
quantity:
type: number
minimum: 1
example: 1
revenue_pattern:
$ref: '#/components/schemas/RevenuePattern'
discount:
$ref: '#/components/schemas/Discount'
tax_rate:
$ref: '#/components/schemas/TaxRate'
start_date:
type: string
format: date
description: Must be on or after the amendment date.
end_date:
type: string
format: date
description: Defaults to the contract end date
effective_from:
$ref: '#/components/schemas/AmendmentEffectiveFrom'
amending:
type: string
format: uuid
description: Contract item ID that is being amended. If empty, a new item will be created.
UsageInvoiceCycle:
type: string
enum:
- CALENDAR
- SUBSCRIPTION_ANNIVERSARY
description: When does the invoicing pricing cycle reset and results in an invoice. Calendar option is only allowed when usage invoice frequency is Monthly, and contract does not start on the 1st of the Month.
RevenueRecognitionOnlyContractNewItemInAmendmentRequest:
type: object
required:
- price
- product_id
- revenue_pattern
- external_reference
properties:
product_id:
type: string
format: uuid
price:
$ref: '#/components/schemas/MonetaryAmount'
discount:
$ref: '#/components/schemas/Discount'
revenue_pattern:
$ref: '#/components/schemas/RevenuePattern'
start_date:
type: string
format: date
description: By default is the amendment date. If provided, the date has to be on or after the amendment date.
end_date:
type: string
format: date
description: End date for the new item. If omitted, defaults to the contract end date. If provided, must be on or after the item's start date.
external_reference:
$ref: '#/components/schemas/ExternalReference'
description: null
ContractScope:
type: string
enum:
- FULL
- REVENUE_RECOGNITION_ONLY
description: The "FULL" scope includes revenue recognition and invoicing handled in Rillet. With the "REVENUE_RECOGNITION_ONLY" scope, invoicing is handled outside Rillet.
ContractItem:
type: object
required:
- id
- price
- product_id
- quantity
- revenue_pattern
- start_date
- status
- total_value
- external_references
properties:
id:
type: string
format: uuid
product_id:
type: string
format: uuid
price:
$ref: '#/components/schemas/Price'
quantity:
type: number
minimum: 1
example: 1
total_value:
$ref: '#/components/schemas/RoundedMonetaryAmount'
revenue_pattern:
$ref: '#/components/schemas/RevenuePattern'
discount:
$ref: '#/components/schemas/Discount'
tax_rate:
$ref: '#/components/schemas/TaxRate'
start_date:
type: string
format: date
end_date:
type: string
format: date
status:
type: string
enum:
- AMENDED
- ACTIVE
amending:
type: string
format: uuid
description: When set, references the item this item is amending.
fields:
$ref: '#/components/schemas/FieldAssignments'
external_references:
uniqueItems: true
type: array
items:
$ref: '#/components/schemas/ExternalReference'
usage_minimum_commitment:
$ref: '#/components/schemas/UsageCommitment'
description: Usage Minimum commitment for this contract item.
OneTimePrice:
allOf:
- $ref: '#/components/schemas/FixedPrice'
- type: object
required:
- type
properties:
type:
type: string
default: ONE_TIME
MonetaryAmount:
type: object
required:
- amount
- currency
properties:
amount:
type: string
description: Monetary amount in decimal format, using a period (.) as the decimal separator. (e.g. '1.01' in $ currency represents 1$ and 1 cent.)
example: '1.01'
currency:
$ref: '#/components/schemas/CurrencyCode'
PerUnitBilling:
type: object
required:
- type
- amount
- units
properties:
type:
type: string
default: PER_UNIT
amount:
$ref: '#/components/schemas/MonetaryAmount'
units:
type: integer
format: int32
minimum: 1
example: 1
QuarterlyInvoicing:
type: object
required:
- payment_terms
- interval
- month_day
properties:
payment_terms:
type: integer
format: int32
minimum: 0
example: 0
interval:
type: string
default: QUARTERLY
month_day:
type: string
pattern: ^--\d{2}-\d{2}$
description: A string in --MM-dd format. Invoices will be created starting on that date and every 3 months.
example: --01-01
UsageInvoicingFrequency:
type: string
enum:
- MONTHLY
- QUARTERLY
- SEMI_ANNUAL
- YEARLY
ExternalReference:
type: object
required:
- type
- id
properties:
type:
type: string
example: xyzSystemId
id:
type: string
example: '234'
url:
type: string
format: uri
example: https://xyzsystempage.com/ids/234
description: For requests, only pre-defined custom IDs are accepted. In responses, an object imported through an integration (e.g. Stripe) would return the provider's object ID.
CalendarPeriod:
type: object
required:
- end
- start
properties:
start:
type: string
format: date
end:
type: string
format: date
MonthlyProratedInvoicing:
type: object
required:
- payment_terms
- interval
- day
properties:
payment_terms:
type: integer
format: int32
minimum: 0
example: 0
interval:
type: string
default: MONTHLY_PRORATED
day:
type: integer
format: int32
minimum: 1
maximum: 31
example: 1
description: 'Monthly prorated invoicing is only available for contracts with usage products and a minimum usage commitment.
'
RoundedMonetaryAmount:
type: object
description: A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
x-class-extra-annotation: '@io.rillet.common.infra.validators.IsRoundedAmount'
required:
- amount
- currency
properties:
amount:
type: string
description: Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
example: '1.01'
currency:
$ref: '#/components/schemas/CurrencyCode'
FixedPrice:
type: object
required:
- amount
properties:
amount:
$ref: '#/components/schemas/MonetaryAmount'
FieldAssignments:
type: array
items:
type: object
required:
- field_id
- field_value_id
properties:
field_id:
type: string
format: uuid
field_value_id:
type: string
format: uuid
SemiAnnualInvoicing:
type: object
required:
- payment_terms
- interval
- month_day
properties:
payment_terms:
type: integer
format: int32
minimum: 0
example: 0
interval:
type: string
default: SEMI_ANNUAL
month_day:
type: string
pattern: ^--\d{2}-\d{2}$
description: A string in --MM-dd format. Invoices will be created starting on that date and every 6 months.
example: --01-01
ExpandedContract:
allOf:
- $ref: '#/components/schemas/Contract'
- type: object
properties:
invoices:
type: array
items:
$ref: '#/components/schemas/ContractInvoice'
CurrencyCode:
type: string
description: Currency code following ISO-4217
example: USD
CreateContractRequest:
type: object
discriminator:
propertyName: scope
mapping:
FULL: '#/components/schemas/CreateFullContractRequest'
REVENUE_RECOGNITION_ONLY: '#/components/schemas/CreateRevenueRecognitionOnlyContractRequest'
oneOf:
- $ref: '#/components/schemas/CreateFullContractRequest'
- $ref: '#/components/schemas/CreateRevenueRecognitionOnlyContractRequest'
required:
- scope
properties:
scope:
$ref: '#/components/schemas/ContractScope'
PageCursor:
type: string
description: If defined, a cursor to retrieve the next page.
example: iLQvkEj3sh3UiweC
AmendRevenueRecognitionOnlyContractRequest:
type: object
required:
- items
- amendment_date
- amendment_reason
- invoice_schedule
properties:
amendment_date:
type: string
format: date
description: It cannot be earlier than the previous amendment date if the contract has already been amended.
amendment_reason:
type: string
example: Amendment requested by user
items:
type: array
minItems: 0
description: "List of new contract items and new versions of amended contract items. \nExisting contract items that do not appear in the list will remain unchanged. \nIf you want to delete a contract item from the amendment date onwards, use the `TERMINATED_ITEM`.\"\n"
items:
type: object
discriminator:
propertyName: type
mapping:
NEW_ITEM: '#/components/schemas/RevenueRecognitionOnlyContractNewItemInAmendmentRequest'
AMENDING_ITEM: '#/components/schemas/RevenueRecognitionOnlyContractAmendingItemRequest'
TERMINATED_ITEM: '#/components/schemas/RevenueRecognitionOnlyContractTerminatedItemRequest'
oneOf:
- $ref: '#/components/schemas/RevenueRecognitionOnlyContractNewItemInAmendmentRequest'
- $ref: '#/components/schemas/RevenueRecognitionOnlyContractAmendingItemRequest'
- $ref: '#/components/schemas/RevenueRecognitionOnlyContractTerminatedItemRequest'
required:
- type
properties:
type:
type: string
invoice_schedule:
$ref: '#/components/schemas/InvoiceSchedule'
AmendContractRequest:
type: object
discriminator:
propertyName: scope
mapping:
FULL: '#/components/schemas/AmendFullContractRequest'
REVENUE_RECOGNITION_ONLY: '#/components/schemas/AmendRevenueRecognitionOnlyContractRequest'
oneOf:
- $ref: '#/components/schemas/AmendFullContractRequest'
- $ref: '#/components/schemas/AmendRevenueRecognitionOnlyContractRequest'
required:
- scope
properties:
scope:
$ref: '#/components/schemas/ContractScope'
PaymentTerms:
type: integer
format: int32
minimum: 0
example: 0
AmendFullContractRequest:
type: object
required:
- items
- amendment_date
- amendment_reason
- invoicing
properties:
amendment_date:
type: string
format: date
description: It cannot be earlier than the previous amendment date if the contract has already been amended.
amendment_reason:
type: string
example: Amendment requested by user
items:
type: array
minItems: 0
description: List of new contract items and new versions of amended contract items. Existing contract items that do not appear in the list will remain unchanged.
items:
$ref: '#/components/schemas/AmendFullContractItemRequest'
invoicing:
$ref: '#/components/schemas/Invoicing'
description: Mandatory for contracts with scope different than REVENUE_RECOGNITION_ONLY.
ContractItemRequest:
type: object
required:
- price
- product_id
- quantity
- revenue_pattern
properties:
product_id:
type: string
format: uuid
price:
$ref: '#/components/schemas/Price'
quantity:
type: number
minimum: 1
example: 1
revenue_pattern:
$ref: '#/components/schemas/RevenuePattern'
discount:
$ref: '#/components/schemas/Discount'
description: Optional discount for contracts that do not have REVENUE_RECOGNITION_ONLY scope.
tax_rate:
$ref: '#/components/schemas/TaxRateWithOptionalAmount'
start_date:
type: string
format: date
description: Defaults to the contract start date.
end_date:
type: string
format: date
description: Defaults to the contract end date.
external_reference:
$ref: '#/components/schemas/ExternalReference'
description: A unique ID per contract item, used on the invoice schedule to refer to the contract item.
fields:
$ref: '#/components/schemas/FieldAssignments'
usage_minimum_commitment:
$ref: '#/components/schemas/UsageCommitment'
description: Usage Minimum commitment for this contract item. Should be skipped if price is not USAGE or minimum commitment is defined at contract level.
InvoiceStatus:
type: string
enum:
- UNPAID
- PAID
- PARTIALLY_PAID
- UNBILLED
- CREDITED
- PARTIALLY_CREDITED
UsageInvoiceDate:
type: string
enum:
- FIRST_DAY_OF_NEXT_CYCLE
- LAST_DAY_OF_CURRENT_CYCLE
description: When the usage invoice is created in relation to the usage cycle.
ExchangeRate:
type: object
required:
- base
- date
- rate
- target
properties:
base:
$ref: '#/components/schemas/CurrencyCode'
target:
$ref: '#/components/schemas/CurrencyCode'
rate:
type: string
date:
type: string
format: date
Invoicing:
oneOf:
- $ref: '#/components/schemas/MonthlyInvoicing'
- $ref: '#/components/schemas/MonthlyProratedInvoicing'
- $ref: '#/components/schemas/QuarterlyInvoicing'
- $ref: '#/components/schemas/SemiAnnualInvoicing'
- $ref: '#/components/schemas/YearlyInvoicing'
discriminator:
propertyName: interval
mapping:
MONTHLY: '#/components/schemas/MonthlyInvoicing'
MONTHLY_PRORATED: '#/components/schemas/MonthlyProratedInvoicing'
QUARTERLY: '#/components/schemas/QuarterlyInvoicing'
SEMI_ANNUAL: '#/components/schemas/SemiAnnualInvoicing'
YEARLY: '#/components/schemas/YearlyInvoicing'
RevenueRecognitionOnlyContractItemRequest:
type: object
required:
- price
- product_id
- revenue_pattern
- external_reference
properties:
product_id:
type: string
format: uuid
price:
$ref: '#/components/schemas/MonetaryAmount'
discount:
$ref: '#/components/schemas/Discount'
revenue_pattern:
$ref: '#/components/schemas/RevenuePattern'
start_date:
type: string
format: date
description: Defaults to the contract start date.
end_date:
type: string
format: date
description: Defaults to the contract end date.
external_reference:
$ref: '#/components/schemas/ExternalReference'
description: A unique ID per contract item, used on the invoice schedule to refer to the contract item.
RevenueRecognitionOnlyContractAmendingItemRequest:
type: object
required:
- price
- amending_reference
properties:
price:
$ref: '#/components/schemas/MonetaryAmount'
discount:
$ref: '#/components/schemas/Discount'
revenue_pattern:
$ref: '#/components/schemas/RevenuePattern'
amending_reference:
type: string
description: External Reference of the contract item being amended.
end_date:
type: string
format: date
description: New end date for the amended (continuing) item. If omitted, the item keeps its current end date. Must be on or after the amendment date.
TieredBilling:
type: object
required:
- type
- mode
- tiers
properties:
type:
type: string
default: TIERED
mode:
type: string
enum:
- GRADUATED
- METERED
description: In metered tiering, the maximum quantity within a period determines the price. In graduated tiering, pricing changes as the quantity grows – the price from each tier up to the reported quantity is accumulated.
tiers:
type: array
minItems: 1
items:
$ref: '#/components/schemas/Tier'
description: All tiers except for the highest have to define a value for upTo. There cannot be more than one tier with the same upTo value.
UsageCommitment:
type: object
required:
- amount
- revenue_account
properties:
amount:
$ref: '#/components/schemas/RoundedMonetaryAmount'
revenue_account:
$ref: '#/components/schemas/AccountCode'
Error:
type: object
required:
- type
- title
properties:
type:
type: string
format: uri
description: A URI reference that identifies the error type.
example: https://rillet.io/forbidden
title:
type: string
description: Summary of the problem.
example: Forbidden
status:
type: integer
description: The HTTP status code generated by the origin server for this occurrence of the error.
example: 403
detail:
type: string
description: Explanation specific to this occurrence of the error.
example: User does not have rights to perform this operation.
FixedRecurringPrice:
allOf:
- $ref: '#/components/schemas/FixedPrice'
- $ref: '#/components/schemas/RecurringPrice'
- type: object
required:
- type
properties:
type:
type: string
default: FIXED_RECURRING
PageLimit:
type: integer
minimum: 1
maximum: 100
default: 25
CreateRevenueRecognitionOnlyContractRequest:
type: object
required:
- items
- name
- start_date
- customer_id
- invoice_schedule
- external_references
- scope
properties:
name:
type: string
example: New API Contract
close_date:
type: string
format: date
description: Defaults to the start date if not provided.
start_date:
type: string
format: date
end_date:
type: string
format: date
items:
type: array
minItems: 1
items:
$ref: '#/components/schemas/RevenueRecognitionOnlyContractItemRequest'
invoice_schedule:
$ref: '#/components/schemas/InvoiceSchedule'
external_references:
uniqueItems: true
type: array
items:
$ref: '#/components/schemas/ExternalReference'
customer_id:
type: string
format: uuid
subsidiary_id:
type: string
format: uuid
AmountDiscount:
type: object
required:
- amount_off
properties:
amount_off:
$ref: '#/components/schemas/RoundedMone
# --- truncated at 32 KB (47 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/rillet/refs/heads/main/openapi/rillet-contracts-api-openapi.yml