Aira - Documentação API (1.0)

Download OpenAPI specification:Download

Aira Billing API

Events

Record Events

This endpoint allows for the batch recording of events related to customer interactions with resources. Each event captures a unique interaction at a specific point in time, including the involved resource and customer, the nature of the interaction (value), and when it occurred.

Authorizations:
ApiKey
Request Body schema: application/json

An array of event objects. Each event includes a resourceExternalId, customerExternalId, value, and occurredAt timestamp, alongside an optional idempotencyKey for ensuring uniqueness. Requires at least one event object to proceed.

Array (non-empty)
resourceExternalId
required
string non-empty
customerExternalId
required
string non-empty
value
required
number
idempotencyKey
required
string non-empty
occurredAt
required
string <date-time>

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
null

Contracts

Create a Contract

This endpoint allows the creation of a new contract. If needed, it also permits the creation of a new customer and a new payment account or the provision of existing customer and payment account IDs to sync the new contract with them.

Authorizations:
ApiKey
Request Body schema: application/json
required
One of
required
object

New Customer details.

required
object

New Payment Account details.

customerId
string <uuid>

Existing customer ID. If provided, a new customer will not be created. Note: You cannot provide both a customerId and a new customer object at the same time.

paymentAccountId
string <uuid>

Existing payment account ID. If provided, a new payment account will not be created. Note: You cannot provide both a paymentAccountId and a new paymentAccount object at the same time.

required
object

New Contract details.

Responses

Request samples

Content type
application/json
Example
{
  • "customer": {
    },
  • "paymentAccount": {
    },
  • "customerId": "87d8e330-2878-4742-a86f-dbbb3bf522ac",
  • "paymentAccountId": "97c1cadf-0c39-4120-b34f-8e6621ad3d02",
  • "contract": {
    }
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "customerId": "87d8e330-2878-4742-a86f-dbbb3bf522ac",
  • "tenantId": "f97df110-f4de-492e-8849-4a6af68026b0",
  • "paymentAccountId": "97c1cadf-0c39-4120-b34f-8e6621ad3d02",
  • "startDate": "2019-08-24",
  • "endDate": "2019-08-24",
  • "billingEndDay": 1,
  • "dueDateDay": 1,
  • "status": "active",
  • "contractNonBusinessDayHandling": "antecipate",
  • "isAutoRenewalEnabled": true,
  • "plans": [
    ],
  • "paymentAccount": {
    }
}