Skip to main content
POST
Duplicate contract

Authorizations

X-API-KEY
string
header
required

API Key Authentication.

Path Parameters

id
string<uuid>
required

Unique identifier for the contract.

Response

An agreement with an individual or an organization that bills plans, each through at most one active plan instance. It holds the term, the billing schedule, the usage scope, the payment accounts and the payment conditions.

id
string<uuid>
required

Unique identifier for the contract.

contractNumber
string
required

The number of the contract, which Aira gives it on creation from the prefix of its customer and the sequence of the contracts of that customer.

Example:

"MERCA-CTR-01"

customerId
string<uuid>
required

ID of the customer associated with this contract.

startDate
string<date>
required

The first day of the term of the contract.

endDate
string<date> | null
required

The last day of the term of the contract, or null when the contract has no end date.

retroactiveDate
string<date> | null
required

The date since which the contract was served before it reached Aira, or null. Aira records invoices for the billing cycles since that date but does not collect them, because they were charged elsewhere.

invoicingStartDate
string<date> | null
required

Read-only. Start date of the first billing cycle Aira invoices for this contract, recorded when it is activated: the cycle containing the retroactive date when one is set, otherwise the cycle running on the activation day, or the contract start when that is still ahead. Null while the contract is a draft.

status
enum<string>
required

Current status of the contract.

Available options:
active,
canceled,
completed,
draft
rateAdjustmentIndex
null | enum<string>
required

Reference index (e.g. IPCA) used to filter contracts when applying a mass adjustment on contracts.

Available options:
none,
igpm,
ipca,
other,
null
customFields
object
required

Custom fields that can be associated with the entity. The fields must be previously created in the system before they can be used.

Example:
invoiceAllocationStrategy
enum<string>
required

How each billing act of the contract becomes invoices: single makes one invoice, percent_split makes one per payment account by fixed percentages, and subsidiary_usage_split makes one per payment account by the share of the usage of its customer.

Available options:
single,
percent_split,
subsidiary_usage_split
includeNewSubsidiariesOnUsageScope
boolean
required

Whether future subsidiaries are automatically included in usage scope.

usageScopes
object[]
required

The usage scope of the contract: the customers whose usage and license balances it bills, which are the individual alone, or a set of the organization and its subsidiaries.

Minimum array length: 1
allocations
object[]
required

The contract allocation: the payment accounts that receive the invoices of the contract.

Minimum array length: 1
billingSchedule
object
required

How the billing cycles of the contract repeat: every month or every week, from the billing day of the contract.

planInstances
object[]
required

The plan instances attached to the contract. While the contract is draft or active only its active plan instances are listed; once the contract is completed or canceled, all of them are.

ID of the legal entity associated with this contract. Optional on create; defaults to the tenant's default legal entity when absent.

The legal entity that issues the invoices of the contract: a registered company of the tenant.

taxRegimeId
string<uuid> | null

ID of the tax regime applied to invoices generated from this contract. Null when no regime is attached.

autoIssue
boolean

When true, invoices produced at billing-cycle close are issued automatically instead of waiting in review. Defaults to false when omitted; omitting it on update leaves the current value unchanged.

billingSettings
object | null

The contract minimum: the least that the contract bills in a billing cycle, across all its plans. When its plans total less, the closing invoice adds the difference.

paymentGatewaySettings
object | null

The payment conditions of the contract: how its invoices are paid, with the payment method, and the due date as a number of days after the issue or a fixed day of the month.