Invoices
Invoice object
Attributes
id string
Unique object's identifier.
customer string
The ID of the customer who will be billed. In read resources this field is expandable, returns the customer object.
expandable
number number
A unique, identifying number that appears on invoice header sent to the customer of this invoice. It's automatically assigned.
test_mode boolean
Has the value true
if the object exists in production mode or the value false
if the object exists in test mode.
date date
Closing date of the invoice. Typically this is the date on which invoice is generated.
due_date date
Due date of the invoice.
lines list
The list of line items for this invoice.
payments list
The list of transactions for this invoice.
amount decimal
Taxable subtotal of this invoice.
exempt decimal
Non taxable subtotal of this invoice.
tax decimal
Tax amount of this invoice.
tax_percent decimal
Tax rate for this invoice.
subtotal decimal
Sum of amount and exempt of this invoice.
total decimal
Sum of subtotal and taxes of this invoice.
discount decimal
Discount amount applicable to subtotal of this invoice.
discount_scheme string
Scheme of the discount, one of $
or %
.
period_start date
The time when the service period for the billing starts.
period_end date
The time when the service period for the billing ends.
collection_method string
Method to collect payments of this invoice, one of automatically
, deferred
or deferred_dues
.
local_file url
URL to local format when document type of this invoice belong to a tax agency.
note string
A note for the customer of this invoice.
fiscal_settings object
An object with key pairs for tax agency.
subscription string
The id of subscription if this invoice was created by a subscription.
status string
Status of this invoice, one of draft
, finalized
or paid
.
Learn more about invoice status.
metadata object
An object with key pairs for store custom information about this invoice.
user string
Email of the user that created this invoice.
created datetime
Date and time of the creation of this invoice.
updated datetime
Date and time of the last update of this invoice.
Create an invoice
POST
https://api.piriod.com/invoices/
This endpoint creates an invoice for a given customer with status draft. After create the invoice use finalize resource for finish invoice.
Request Body
customer
string
The id of the customer of this invoice.
document
string
The id of the document type of this invoice.
date
string
Closing date of this invoice.
due_date
string
Due date of this invoice.
collection_method
string
Method to collect payments of this invoice.
lines
array
The list of line items for this invoice.
Retrieve an invoice
GET
https://api.piriod.com/invoices/{id}/
This endpoint retrieves an invoice.
Path Parameters
id
string
The id of the invoice object.
Update an invoice
PATCH
https://api.piriod.com/invoices/{id}/
This endpoint updates an invoice. Only invoices with status draft
are updated.
Path Parameters
id
string
The id of the invoice object.
Request Body
customer
string
The id of the customer of the invoice.
test_mode
boolean
true if the object exists in test mode, false instead.
note
string
A note for the customer of this invoice.
period_start
string
The date when the service period for the billing starts.
period_end
string
The date when the service period for the billing ends.
Destroy an invoice
DELETE
https://api.piriod.com/invoices/{id}/
Destroy an invoice object. Only invoices with status draft
are updated.
Path Parameters
id
string
The id of the invoice object.
Finalize an invoice
GET
https://api.piriod.com/invoices/{id}/finalize/
This endpoint finalize an invoice. When the invoice is finalized, it is validated with the tax agency, if the invoice document type has tax regulations, you will no longer be able to update your data. The status attribute of the invoice object will become to finalized
. The local_file attribute of the invoice object will have a url to get the file that was sent to the tax agency, normally it is a file with an .xml extension.
Path Parameters
id
string
The id of invoice object.
Retrieve an invoice PDF
GET
https://api.piriod.com/invoices/{id}/pdf/
This endpoint retrieves a PDF representation of the invoice. Returns a Blob encoded in Base64.
Path Parameters
id
string
The id of invoice object.
Last updated