Fetch invoice
curl --request GET \
--url https://api.useaira.com/v1/invoices/{id} \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.useaira.com/v1/invoices/{id}"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.useaira.com/v1/invoices/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.useaira.com/v1/invoices/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.useaira.com/v1/invoices/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.useaira.com/v1/invoices/{id}")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useaira.com/v1/invoices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"invoice": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotencyKey": "<string>",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issuingAccount": {
"tradeName": "<string>",
"businessName": "<string>",
"emails": [
"jsmith@example.com"
],
"taxId": "<string>",
"zipCode": "<string>",
"street": "<string>",
"number": "<string>",
"neighborhood": "<string>",
"city": "<string>",
"complement": "<string>"
},
"billingAccount": {
"tradeName": "<string>",
"businessName": "<string>",
"emails": [
"jsmith@example.com"
],
"taxId": "<string>",
"zipCode": "<string>",
"street": "<string>",
"number": "<string>",
"neighborhood": "<string>",
"city": "<string>",
"complement": "<string>"
},
"lastCalculatedAt": "2023-11-07T05:31:56Z",
"invoiceNumber": "<string>",
"invoiceDate": "2023-12-25",
"memo": "<string>",
"subtotalAmount": 123,
"adjustmentAmount": 123,
"totalAmount": 123,
"discountAmount": 123,
"isLocked": true,
"autoIssue": true,
"amountDue": 123,
"dueDate": "2023-12-25",
"lineItemGroups": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotencyKey": "<string>",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planInstanceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"subtotalAmount": 123,
"adjustmentAmount": 123,
"totalAmount": 123,
"discountAmount": 123,
"lineItems": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotencyKey": "<string>",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lineItemGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"totalUsage": 123,
"subtotalAmount": 123,
"adjustmentAmount": 123,
"totalAmount": 123,
"discountAmount": 123,
"metadata": {
"type": "metric"
},
"subLineItems": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"usage": 123,
"amount": 123,
"metadata": {
"type": "fixed_price",
"fixedPrice": 123
}
}
],
"adjustments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"amount": 123
}
],
"itemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}
],
"standaloneLineItems": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotencyKey": "<string>",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lineItemGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"totalUsage": 123,
"subtotalAmount": 123,
"adjustmentAmount": 123,
"totalAmount": 123,
"discountAmount": 123,
"metadata": {
"type": "metric"
},
"subLineItems": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"usage": 123,
"amount": 123,
"metadata": {
"type": "fixed_price",
"fixedPrice": 123
}
}
],
"adjustments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"amount": 123
}
],
"itemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
},
"payments": [
{
"id": "<string>",
"amount": 123,
"dueDate": "2023-12-25"
}
],
"statusHistory": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"occurredAt": "2023-11-07T05:31:56Z",
"metadata": {}
}
],
"customer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "705faf65-9c8b-4053-8c0b-2021281ce83f",
"name": "Acme Inc.",
"type": "individual",
"invoicePrefix": "ACMEI",
"parentCustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"archivedAt": "2023-11-07T05:31:56Z",
"customFields": {
"customField1": "value1",
"customField2": [
"value2",
"value3"
]
}
},
"contract": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"customFields": {
"customField1": "value1",
"customField2": [
"value2",
"value3"
]
}
},
"artifacts": [
{
"id": "<string>",
"artifactType": "<string>",
"generatedAt": "2023-11-07T05:31:56Z"
}
]
}{
"message": "<string>"
}Invoices
Fetch invoice
This endpoint allows fetching an invoice by id.
GET
/
v1
/
invoices
/
{id}
Fetch invoice
curl --request GET \
--url https://api.useaira.com/v1/invoices/{id} \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.useaira.com/v1/invoices/{id}"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.useaira.com/v1/invoices/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.useaira.com/v1/invoices/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.useaira.com/v1/invoices/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.useaira.com/v1/invoices/{id}")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useaira.com/v1/invoices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"invoice": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotencyKey": "<string>",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issuingAccount": {
"tradeName": "<string>",
"businessName": "<string>",
"emails": [
"jsmith@example.com"
],
"taxId": "<string>",
"zipCode": "<string>",
"street": "<string>",
"number": "<string>",
"neighborhood": "<string>",
"city": "<string>",
"complement": "<string>"
},
"billingAccount": {
"tradeName": "<string>",
"businessName": "<string>",
"emails": [
"jsmith@example.com"
],
"taxId": "<string>",
"zipCode": "<string>",
"street": "<string>",
"number": "<string>",
"neighborhood": "<string>",
"city": "<string>",
"complement": "<string>"
},
"lastCalculatedAt": "2023-11-07T05:31:56Z",
"invoiceNumber": "<string>",
"invoiceDate": "2023-12-25",
"memo": "<string>",
"subtotalAmount": 123,
"adjustmentAmount": 123,
"totalAmount": 123,
"discountAmount": 123,
"isLocked": true,
"autoIssue": true,
"amountDue": 123,
"dueDate": "2023-12-25",
"lineItemGroups": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotencyKey": "<string>",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planInstanceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"subtotalAmount": 123,
"adjustmentAmount": 123,
"totalAmount": 123,
"discountAmount": 123,
"lineItems": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotencyKey": "<string>",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lineItemGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"totalUsage": 123,
"subtotalAmount": 123,
"adjustmentAmount": 123,
"totalAmount": 123,
"discountAmount": 123,
"metadata": {
"type": "metric"
},
"subLineItems": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"usage": 123,
"amount": 123,
"metadata": {
"type": "fixed_price",
"fixedPrice": 123
}
}
],
"adjustments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"amount": 123
}
],
"itemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}
],
"standaloneLineItems": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotencyKey": "<string>",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lineItemGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"totalUsage": 123,
"subtotalAmount": 123,
"adjustmentAmount": 123,
"totalAmount": 123,
"discountAmount": 123,
"metadata": {
"type": "metric"
},
"subLineItems": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"usage": 123,
"amount": 123,
"metadata": {
"type": "fixed_price",
"fixedPrice": 123
}
}
],
"adjustments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"amount": 123
}
],
"itemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
},
"payments": [
{
"id": "<string>",
"amount": 123,
"dueDate": "2023-12-25"
}
],
"statusHistory": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"occurredAt": "2023-11-07T05:31:56Z",
"metadata": {}
}
],
"customer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "705faf65-9c8b-4053-8c0b-2021281ce83f",
"name": "Acme Inc.",
"type": "individual",
"invoicePrefix": "ACMEI",
"parentCustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"archivedAt": "2023-11-07T05:31:56Z",
"customFields": {
"customField1": "value1",
"customField2": [
"value2",
"value3"
]
}
},
"contract": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"customFields": {
"customField1": "value1",
"customField2": [
"value2",
"value3"
]
}
},
"artifacts": [
{
"id": "<string>",
"artifactType": "<string>",
"generatedAt": "2023-11-07T05:31:56Z"
}
]
}{
"message": "<string>"
}Authorizations
API Key Authentication.
Path Parameters
Response
Default Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Schema representing a customer.
Show child attributes
Show child attributes
Schema representing a contract summary.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I