The Invoice resource represents an invoice that has been generated for a customer. Invoices are generated when a customer's billing interval has elapsed, and are updated when a customer's invoice is paid.
- create - Create invoice line item
- fetch - Retrieve an Invoice
- fetch_upcoming - Retrieve upcoming invoice
- list - List invoices
- void - Void an invoice
This creates a one-off fixed fee invoice line item on an Invoice. This can only be done for invoices that are in a draft
status.
import orb
import dateutil.parser
from orb.models import shared
s = orb.Orb(
security=shared.Security(
api_key_auth="",
),
)
req = shared.NewInvoiceLineItem(
amount='amet',
end_date=dateutil.parser.parse('2021-03-29').date(),
invoice_id='4khy3nwzktxv7',
name='Darlene Effertz',
quantity=47hhsws4z2i13,
start_date=dateutil.parser.parse('2022-12-22').date(),
)
res = s.invoice.create(req)
if res.invoice_line_item is not None:
# handle response
This endpoint is used to fetch an Invoice
given an identifier.
import orb
from orb.models import operations
s = orb.Orb(
security=shared.Security(
api_key_auth="",
),
)
res = s.invoice.fetch('expedita')
if res.invoice is not None:
# handle response
This endpoint can be used to fetch the upcoming invoice for the current billing period given a subscription.
import orb
from orb.models import operations
s = orb.Orb(
security=shared.Security(
api_key_auth="",
),
)
res = s.invoice.fetch_upcoming('neque')
if res.upcoming_invoice is not None:
# handle response
This endpoint returns a list of all Invoice
s for an account in a list format.
The list of invoices is ordered starting from the most recently issued invoice date. The response also includes pagination_metadata
, which lets the caller retrieve the next page of results if they exist.
By default, this only returns invoices that are issued
, paid
, or synced
.
import orb
from orb.models import operations
s = orb.Orb(
security=shared.Security(
api_key_auth="",
),
)
res = s.invoice.list('sed', 'vel', 'libero', 'voluptas')
if res.invoices is not None:
# handle response
This endpoint allows an invoice's status to be set the void
status. This can only be done to invoices that are in the issued
status.
If the associated invoice has used the customer balance to change the amount due, the customer balance operation will be reverted. For example, if the invoice used $10 of customer balance, that amount will be added back to the customer balance upon voiding.
import orb
from orb.models import operations
s = orb.Orb(
security=shared.Security(
api_key_auth="",
),
)
res = s.invoice.void('deserunt')
if res.invoice is not None:
# handle response