Webhooks
Contract created
Aira sends this event after it creates a contract: one that a user creates or duplicates in the billing app, that a system creates through the API, or that Aira creates from a contract PDF that a user approves or from a deal of HubSpot. The event carries the contract as the action that creates it leaves it, so a contract that the same action activates, such as a deal of HubSpot whose integration activates the contracts that it creates, arrives active, and no contract.updated follows.
WEBHOOK
contract.created
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"event": "contract.created",
"payload": {
"contract": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contractNumber": "MERCA-CTR-01",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"retroactiveDate": "2023-12-25",
"invoicingStartDate": "2023-12-25",
"customFields": {
"customField1": "value1",
"customField2": [
"value2",
"value3"
]
},
"includeNewSubsidiariesOnUsageScope": true,
"usageScopes": [
{
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"allocations": [
{
"paymentAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"allocationPercentage": "50.000000"
}
],
"billingSchedule": {
"anchorDay": 16
},
"planInstances": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Plano Essencial"
}
],
"legalEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"taxRegimeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"autoIssue": true,
"billingSettings": {
"invoiceMinimumAmount": 1,
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"paymentGatewaySettings": {
"dueDateMode": "days_after_issue",
"dueOffsetDays": 1,
"dueDay": 16,
"dueMonthOffset": 0,
"rollDueDateToBusinessDay": true
}
}
}
}Headers
Body
application/json
The event, with its identifier, its name and its payload.
Response
2XX
Answer with a 2XX status to confirm the delivery. Aira retries a delivery that gets another status, a redirect or no answer.
⌘I
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"event": "contract.created",
"payload": {
"contract": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contractNumber": "MERCA-CTR-01",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"retroactiveDate": "2023-12-25",
"invoicingStartDate": "2023-12-25",
"customFields": {
"customField1": "value1",
"customField2": [
"value2",
"value3"
]
},
"includeNewSubsidiariesOnUsageScope": true,
"usageScopes": [
{
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"allocations": [
{
"paymentAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"allocationPercentage": "50.000000"
}
],
"billingSchedule": {
"anchorDay": 16
},
"planInstances": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Plano Essencial"
}
],
"legalEntityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"taxRegimeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"autoIssue": true,
"billingSettings": {
"invoiceMinimumAmount": 1,
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"paymentGatewaySettings": {
"dueDateMode": "days_after_issue",
"dueOffsetDays": 1,
"dueDay": 16,
"dueMonthOffset": 0,
"rollDueDateToBusinessDay": true
}
}
}
}