This endpoint allows fetching an invoice by processor ID. It also returns, if available, a pix and bank_slip URL for each invoice, which expires after 15 minutes.
curl --request GET \
--url https://api.useaira.com/v1/invoices/by-processor-id/{processorId} \
--header 'X-API-KEY: <api-key>'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"displayId": "<string>",
"customer": {
"id": "<string>",
"externalId": "705faf65-9c8b-4053-8c0b-2021281ce83f",
"name": "Acme Inc.",
"customFields": {
"customField1": "value1",
"customField2": [
"value2",
"value3"
]
}
},
"paymentAccount": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"businessName": "<string>",
"taxId": "<string>",
"taxIdType": "cnpj",
"tradeName": "<string>",
"email": "[email protected]",
"address": {
"zipCode": "<string>",
"number": "<string>",
"street": "<string>",
"neighborhood": "<string>",
"city": "<string>",
"state": "AC",
"country": "Brasil",
"complement": "<string>"
}
},
"contract": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"billingEndDay": 16,
"status": "active",
"paymentSettings": {
"scheduledPaymentDay": 16,
"dueOffsetDays": 6
},
"billingSettings": {
"billingCycleMinimumAmount": 1
},
"sendNotifications": true,
"rateAdjustmentIndex": "none",
"customFields": {
"customField1": "value1",
"customField2": [
"value2",
"value3"
]
}
},
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"totalAmount": 1,
"closedReason": "end_of_cycle",
"payments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"dueDate": "2023-12-25",
"createdAt": "2023-11-07T05:31:56Z",
"processedAt": "2023-11-07T05:31:56Z",
"paymentMethod": "bolepix",
"status": "created",
"pixLink": "<string>",
"bankSlipLink": "<string>"
}
],
"status": "open",
"processorId": "<string>",
"plans": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"planSettings": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fixedAmount": 1,
"minimumAmount": 1
},
"totalAmount": 1,
"product": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"customFields": {
"customField1": "value1",
"customField2": [
"value2",
"value3"
]
}
},
"metrics": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"currencyUnitId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"billingModel": "in_full",
"priceTierDivision": "unique_tier",
"fixedAmount": 1,
"minimumAmount": 1,
"resourceName": "<string>",
"resourceType": "unit",
"priceTiers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"billingType": "unit",
"from": 2,
"to": 2,
"packageSize": 2,
"price": "<string>",
"fixedPrice": "<string>",
"basisPoints": 1,
"totalAmount": 1,
"usage": 1
}
],
"totalAmount": 1,
"resourceCustomFields": {},
"currencyUnit": {
"id": "<string>",
"name": "<string>",
"code": "<string>"
}
}
]
}
],
"additionalItems": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"amount": 2,
"type": "discount"
}
]
}API Key Authentication.
Default Response
The unique identifier of the invoice.
The human-readable identifier of the invoice.
The customer associated with this invoice.
Show child attributes
The unique identifier of the customer in our system.
An optional external identifier of the customer from the external system, used throughout the system to identify the customer. This field can not be updated.
"705faf65-9c8b-4053-8c0b-2021281ce83f"
The name of the customer.
"Acme Inc."
The payment account used for this invoice.
Show child attributes
The unique identifier of the payment account.
The legal business name of the payment account holder.
1The tax identification number (CNPJ or CPF) of the payment account holder.
The type of tax identification number (CNPJ or CPF) of the payment account holder.
cnpj, cpf The trade or "doing business as" name of the payment account holder.
1The contact email address for the payment account.
The physical address associated with the payment account.
Show child attributes
The postal code (CEP) of the address.
8The street number of the address.
1The street name of the address.
1The neighborhood or district of the address.
1The city name of the address.
1The state abbreviation of the address.
AC, AL, AP, AM, BA, CE, DF, ES, GO, MA, MT, MS, MG, PA, PB, PR, PE, PI, RJ, RN, RS, RO, RR, SC, SP, SE, TO The country code of the address.
Brasil Additional address information like apartment number, floor, etc.
The contract associated with this invoice.
Show child attributes
Unique identifier for the contract.
Date when the contract becomes active.
Optional date when the contract expires. If null, the contract has no end date.
Day of the month when the billing cycle ends (1-31).
1 <= x <= 31Current status of the contract.
active, canceled, completed, draft Schema defining payment gateway settings for a contract. Required if payment gateway is enabled.
Show child attributes
The specific day of the month when the payment will be scheduled. For example, a value of 1 means the payment will be scheduled on the 1st day of the month. A value of 31 represents the last day of the month, regardless of whether the month has 28, 30, or 31 days.
1 <= x <= 31Number of days after the payment start date until payment is due (minimum of 5 days).
x >= 5Indicates whether notifications should be sent for this contract.
Reference index (e.g. IPCA) used to filter contracts when applying a mass adjustment on contracts.
none, igpm, ipca, other The start date of the billing period.
The end date of the billing period.
The total amount to be paid for this invoice.
x >= 0The reason why the billing cycle was closed.
end_of_cycle, billing_end_day_updated List of payments associated with this invoice.
Show child attributes
bolepix, bank_slip, pix created, pending, paid, failed, canceled, expired The current status of the invoice.
open, closed, canceled The identifier of the external processor used for this invoice.
List of plans associated with this invoice.
1Show child attributes
The unique identifier for this plan.
The name of the plan.
1Optional description of the plan.
Settings configuration for this plan.
The total amount for this plan.
x >= 0The product associated with this plan.
Show child attributes
The unique identifier for this product.
The name of the product.
1List of metrics associated with this plan.
1Invoice in full metric schema.
Show child attributes
The unique identifier for this metric.
The ID of the resource this metric is associated with.
The ID of the currency unit this metric is associated with.
The name of the metric.
1The billing model type, set to InFull.
in_full The price tier division method for this metric.
unique_tier, progressive The fixed cost amount for this metric.
x >= 0The minimum cost amount for this metric.
x >= 0The name of the resource.
1The resource type.
unit, currency List of price tiers for this metric.
Show child attributes
The unique identifier for this price tier.
The billing type for this price tier.
unit, package, flat, basis_points The starting value for this price tier.
x >= 1The ending value for this price tier. Null indicates no upper bound.
x >= 1The package size for package-based billing. Null if not package-based.
x >= 1The price for this tier in decimal format.
The fixed price for this tier in decimal format.
The basis points associated with this price tier in decimal format
x >= 0The total amount for this price tier.
x >= 0The usage amount for this price tier.
x >= 0The total amount for this metric.
x >= 0List of additional items charged in this invoice.
Show child attributes
The additional item id.
Name of the additional item.
1Optional description of the additional item.
1Cost amount of the additional item.
x >= 1Type of the additional billing item.
discount, additional_charge curl --request GET \
--url https://api.useaira.com/v1/invoices/by-processor-id/{processorId} \
--header 'X-API-KEY: <api-key>'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"displayId": "<string>",
"customer": {
"id": "<string>",
"externalId": "705faf65-9c8b-4053-8c0b-2021281ce83f",
"name": "Acme Inc.",
"customFields": {
"customField1": "value1",
"customField2": [
"value2",
"value3"
]
}
},
"paymentAccount": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"businessName": "<string>",
"taxId": "<string>",
"taxIdType": "cnpj",
"tradeName": "<string>",
"email": "[email protected]",
"address": {
"zipCode": "<string>",
"number": "<string>",
"street": "<string>",
"neighborhood": "<string>",
"city": "<string>",
"state": "AC",
"country": "Brasil",
"complement": "<string>"
}
},
"contract": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"billingEndDay": 16,
"status": "active",
"paymentSettings": {
"scheduledPaymentDay": 16,
"dueOffsetDays": 6
},
"billingSettings": {
"billingCycleMinimumAmount": 1
},
"sendNotifications": true,
"rateAdjustmentIndex": "none",
"customFields": {
"customField1": "value1",
"customField2": [
"value2",
"value3"
]
}
},
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"totalAmount": 1,
"closedReason": "end_of_cycle",
"payments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"dueDate": "2023-12-25",
"createdAt": "2023-11-07T05:31:56Z",
"processedAt": "2023-11-07T05:31:56Z",
"paymentMethod": "bolepix",
"status": "created",
"pixLink": "<string>",
"bankSlipLink": "<string>"
}
],
"status": "open",
"processorId": "<string>",
"plans": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"planSettings": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fixedAmount": 1,
"minimumAmount": 1
},
"totalAmount": 1,
"product": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"customFields": {
"customField1": "value1",
"customField2": [
"value2",
"value3"
]
}
},
"metrics": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"currencyUnitId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"billingModel": "in_full",
"priceTierDivision": "unique_tier",
"fixedAmount": 1,
"minimumAmount": 1,
"resourceName": "<string>",
"resourceType": "unit",
"priceTiers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"billingType": "unit",
"from": 2,
"to": 2,
"packageSize": 2,
"price": "<string>",
"fixedPrice": "<string>",
"basisPoints": 1,
"totalAmount": 1,
"usage": 1
}
],
"totalAmount": 1,
"resourceCustomFields": {},
"currencyUnit": {
"id": "<string>",
"name": "<string>",
"code": "<string>"
}
}
]
}
],
"additionalItems": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"amount": 2,
"type": "discount"
}
]
}