Invoices API
Retrieve paid and unpaid invoices for your currently selected organization.
The Invoice Object
- Name
id
- Type
- string
- Description
Unique identifier for the invoice. This property is always present unless the invoice is an upcoming invoice.
- Name
number
- Type
- string
- Description
A unique, identifying string that appears on emails sent for this invoice.
- Name
description
- Type
- string
- Description
An arbitrary string attached to the object. Often useful for displaying to users.
- Name
amount_due
- Type
- float
- Description
Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the
amount_due
may be 0. If there is a positive starting balance for the invoice (the customer owes money), theamount_due
will also take that into account. The charge that gets generated for the invoice will be for the amount specified inamount_due
.
- Name
amount_paid
- Type
- float
- Description
The amount, in the invoice's
currency
, that was paid.
- Name
amount_remaining
- Type
- float
- Description
The delta between
amount_due
andamount_paid
.
- Name
subtotal
- Type
- float
- Description
Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated
- Name
subtotal_excluding_tax
- Type
- float
- Description
The float amount representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated
- Name
total
- Type
- float
- Description
Total after discounts and taxes.
- Name
tax
- Type
- float
- Description
The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice.
- Name
total_excluding_tax
- Type
- float
- Description
The float amount representing the total amount of the invoice including all discounts but excluding all tax.
- Name
currency
- Type
- string
- Description
Three-letter ISO currency code, in uppercase. Must be a supported currency.
- Name
currency_symbol
- Type
- string
- Description
The UTF-8 symbol of the currency.
- Name
due_date
- Type
- date
- Description
The date on which payment for this invoice is due. This value will be null for invoices that are collected automatically.
- Name
invoice_pdf
- Type
- string
- Description
The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.
- Name
status
- Type
- enum
- Description
The status of the invoice, one of
draft
,open
,paid
,uncollectible
, orvoid
.
- Name
period_start
- Type
- date
- Description
Start of the usage period during which invoice items were added to this invoice.
- Name
period_end
- Type
- date
- Description
End of the usage period during which invoice items were added to this invoice.
- Name
paid
- Type
- boolean
- Description
Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the billing account's balance.
- Name
attempt_count
- Type
- positive integer or zero
- Description
Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule.
- Name
attempted
- Type
- boolean
- Description
Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the invoice is created, for example, so you might not want to display that invoice as unpaid to your user until at least an hour has passed.
- Name
created_at
- Type
- datetime
- Description
Time at which the object was created. Returns a datetime string in the format
YYYY-MM-DD HH:MM:SS
using thetimezone
claim of the JWT access token. Defaults to UTC.
The Invoice Object
{
"id": "in_1NqnbYCVnXOZCtu9Ctwc7i8m",
"number": "SINV-0079",
"description": null,
"amount_due": 608,
"amount_paid": 608,
"amount_remaining": 0,
"subtotal": 608,
"subtotal_excluding_tax": 608,
"total": 608,
"tax": 0,
"total_excluding_tax": 608,
"currency": "EUR",
"currency_symbol": "€",
"due_date": null,
"invoice_pdf": "https://pay.mikrocloud.com/inv...",
"status": "paid",
"period_start": "16 Sep 2023",
"period_end": "16 Sep 2023",
"paid": true,
"attempt_count": 1,
"attempted": true,
"created_at": "2023-09-16 01:47:28"
}
Retrieve Invoices
Requires the account:read
scope.
This is a collection of all the invoices that have been created for the currently selected organization. The invoices are returned sorted by creation date, with the most recently created invoices appearing first.
Parameters
No parameters are required for this endpoint.
This endpoint does not support pagination at this time. It will return the most recent 100 invoices. Please contact support if you need to retrieve older invoices.
Example request
curl -G https://api.mikrocloud.com/v1/account/invoices \
-H "Authorization: Bearer {token}"
Example response
[
{
"id": "in_1NqnbYCVnXOZCtu9Ctwc7i8m",
"number": "SINV-0079",
"description": null,
"amount_due": 608,
"amount_paid": 608,
"amount_remaining": 0,
"subtotal": 608,
"subtotal_excluding_tax": 608,
"total": 608,
"tax": 0,
"total_excluding_tax": 608,
"currency": "EUR",
"currency_symbol": "€",
"due_date": null,
"invoice_pdf": "https://pay.mikrocloud.com/inv...",
"status": "paid",
"period_start": "16 Sep 2023",
"period_end": "16 Sep 2023",
"paid": true,
"attempt_count": 1,
"attempted": true,
"created_at": "2023-09-16 01:47:28"
}
//...
]