Invoices

Invoices represent a request for payment from a customer. Use them to bill for products and services, track amounts due and paid, and manage the invoice lifecycle from draft through finalization, delivery, and payment.

Each invoice includes one or more line items that describe the products and charges being billed. Use credit notes to reduce the amount owed on a draft or open invoice.

The Invoice object

Name
object
Type
"invoice",
Description
Literal representing the object’s type.
Name
id
Type
string,
Description
Unique identifier for the object.
Name
live
Type
boolean,
Description
Has the value true if the object exists in a production environment or the value false if the object exists in a sandbox environment.
Name
created_at
Type
integer,
Description
Time at which the object was created. Measured in milliseconds since the Unix epoch.
Name
amount_due
Type
integer,
Description
The amount owed on the invoice, net of any issued credit notes. Set when the invoice is finalized and does not decrease as payments are made; use amount_paid to track payments.
Name
amount_paid
Type
integer,
Description
The amount that has been paid on this invoice.
Name
attachments
Type
array of Files or null,
Description
Expandable. Files related to the invoice that are shown to the customer.
Name
billing_address
Type
object or null,
Description
The billing address for the invoice.
Properties
Name
credit_notes
Type
array of CreditNotes or null or null,
Description
Expandable. The credit notes issued against this invoice.
Name
custom_fields
Type
object or null,
Description
Custom fields for the invoice.
Name
customer
Type
string or Customer,
Description
Expandable. The customer associated with the invoice.
Name
days_until_due
Type
integer or null,
Description
The number of days until the invoice is due. When the invoice is finalized, this will be used to calculate the due_date if set.
Name
default_taxes
Type
array of objects or null,
Description
The default taxes used for line items without their own taxes.
Properties
Name
due_date
Type
integer or null,
Description
The due date for the invoice as a Unix timestamp in milliseconds.
Name
external_sync
Type
object or null,
Description
The external system record linked to this invoice, if any.
Properties
Name
footer
Type
string or null,
Description
Footer text displayed on the invoice.
Name
line_items
Type
array of LineItems or null,
Description
Expandable. The line items included in this invoice.
Name
memo
Type
string or null,
Description
Internal memo for the invoice.
Name
metadata
Type
object,
Description
A key-value store that is attached to the object. Useful for storing miscellaneous structured data for your integration’s internal use.
Name
number
Type
string,
Description
The invoice number.
Name
payment_link
Type
string or null,
Description
A link to a payment page for this invoice.
Name
payments
Type
array of Payments or null or null,
Description
Expandable. The payments associated with the invoice.
Name
shipping_details
Type
object,
Properties
Name
status
Type
enum,
Description
The status of the invoice.
Name
subtotal
Type
integer,
Description
The amount of the invoice after discounts and before taxes.
Name
total
Type
integer,
Description
The total amount of the invoice after discounts and taxes.
Name
total_taxes
Type
integer,
Description
The total amount of taxes on the invoice.
Name
updated_at
Type
integer,
Description
Time at which the object was last updated. Measured in milliseconds since the Unix epoch.

The Invoice object

{
  "object": "invoice",
  "live": false,
  "id": "inv_2bA3FSNtE8Qmpg2ufwPmC2",
  "created_at": 1750000000000,
  "updated_at": 1750000000000,
  "billing_address": null,
  "customer": "cus_aB4DEXqbFGOlpEOxwp0Fx1",
  "due_date": 1750086400000,
  "days_until_due": null,
  "payments": [],
  "line_items": [],
  "metadata": {},
  "number": "INV-001",
  "shipping_details": {
    "name": "John Doe",
    "phone": "+1 (555) 123-4567",
    "address": {
      "line1": "123 Hope St",
      "line2": null,
      "city": "Los Angeles",
      "state": "CA",
      "postal_code": "94111",
      "country": "US"
    }
  },
  "status": "open",
  "default_taxes": [],
  "subtotal": 2000,
  "total_taxes": 0,
  "total": 2000,
  "amount_due": 2000,
  "amount_paid": 0,
  "external_sync": null,
  "attachments": [],
  "credit_notes": null,
  "memo": null,
  "footer": null,
  "custom_fields": null,
  "payment_link": null
}

Get an invoice

Retrieve an invoice by its ID.

Optional parameters

Name
expand
Type
object,
Properties

Returns

Returns the invoice object.

Get an invoice

const invoice = await bias.invoices.get("id");

Response example

{
  "object": "invoice",
  "live": false,
  "id": "inv_2bA3FSNtE8Qmpg2ufwPmC2",
  "created_at": 1750000000000,
  "updated_at": 1750000000000,
  "billing_address": null,
  "customer": "cus_aB4DEXqbFGOlpEOxwp0Fx1",
  "due_date": 1750086400000,
  "days_until_due": null,
  "payments": [],
  "line_items": [],
  "metadata": {},
  "number": "INV-001",
  "shipping_details": {
    "name": "John Doe",
    "phone": "+1 (555) 123-4567",
    "address": {
      "line1": "123 Hope St",
      "line2": null,
      "city": "Los Angeles",
      "state": "CA",
      "postal_code": "94111",
      "country": "US"
    }
  },
  "status": "open",
  "default_taxes": [],
  "subtotal": 2000,
  "total_taxes": 0,
  "total": 2000,
  "amount_due": 2000,
  "amount_paid": 0,
  "external_sync": null,
  "attachments": [],
  "credit_notes": null,
  "memo": null,
  "footer": null,
  "custom_fields": null,
  "payment_link": null
}

List all invoices

Retrieve a paginated list of invoices.

Optional parameters

Name
expand
Type
object,
Properties
Name
ending_before
Type
string,
Description
A cursor for use in pagination. ending_before is an object ID that results will end before. Used to move backward through the list.
Name
starting_after
Type
string,
Description
A cursor for use in pagination. starting_after is an object ID that results will start after. Used to move forward through the list.
Name
limit
Type
number, at least 1, at most 1000, default is 50
Description
Maximum number of objects to return.
Name
filters
Type
object, object, or object,
Description
Filters to apply to the list. Combine multiple conditions with and and or.
Properties

Returns

Returns a list of invoice objects.

List all invoices

const invoice = await bias.invoices.list();

Response example

{
  "object": "list",
  "items": {
    "object": "invoice",
    "live": false,
    "id": "inv_2bA3FSNtE8Qmpg2ufwPmC2",
    "created_at": 1750000000000,
    "updated_at": 1750000000000,
    "billing_address": null,
    "customer": "cus_aB4DEXqbFGOlpEOxwp0Fx1",
    "due_date": 1750086400000,
    "days_until_due": null,
    "payments": [],
    "line_items": [],
    "metadata": {},
    "number": "INV-001",
    "shipping_details": {
      "name": "John Doe",
      "phone": "+1 (555) 123-4567",
      "address": {
        "line1": "123 Hope St",
        "line2": null,
        "city": "Los Angeles",
        "state": "CA",
        "postal_code": "94111",
        "country": "US"
      }
    },
    "status": "open",
    "default_taxes": [],
    "subtotal": 2000,
    "total_taxes": 0,
    "total": 2000,
    "amount_due": 2000,
    "amount_paid": 0,
    "external_sync": null,
    "attachments": [],
    "credit_notes": null,
    "memo": null,
    "footer": null,
    "custom_fields": null,
    "payment_link": null
  },
  "has_more": false
}

Create an invoice

Create a new invoice in draft status. Add line items, set billing details, and finalize the invoice when ready to send or collect payment.

Required parameters

Name
customer
Type
string,
Description
The customer who this invoice is for.
Name
line_items
Type
array of object or object,
Description
The line items for this invoice.

Optional parameters

Name
expand
Type
object,
Properties
Name
billing_address
Type
object or null,
Description
The billing address for this invoice.
Properties
Name
shipping_details
Type
object or null,
Description
Shipping details for this invoice.
Properties
Name
due_date
Type
integer or null,
Description
The due date for this invoice as a Unix timestamp in milliseconds.
Name
days_until_due
Type
integer or null,
Description
The number of days until the invoice is due. When the invoice is finalized, this will be used to calculate the due_date if set.
Name
metadata
Type
object or null,
Description
A key-value store that is attached to the object. Useful for storing miscellaneous structured data for your integration’s internal use.
Name
attachments
Type
array of string or null,
Description
The IDs of files to attach to this invoice.
Name
memo
Type
string or null,
Description
Internal memo for the invoice.
Name
footer
Type
string or null,
Description
Footer text displayed on the invoice.
Name
custom_fields
Type
object or null,
Description
Custom fields for the invoice.
Name
default_taxes
Type
array of objects,
Description
Default taxes to apply to all line items that don't specify their own taxes.
Properties

Returns

Returns the invoice object.

Create an invoice

const invoice = await bias.invoices.create({
  customer: "cus_abc123",
  line_items: [
    {
      type: "catalog",
      price: "price_abc123",
      quantity: 2
    },
    {
      type: "custom",
      name: "Custom service",
      unit_amount: 1500,
      quantity: 1
    }
  ],
  due_date: 1750086400000
});

Response example

{
  "object": "invoice",
  "live": false,
  "id": "inv_2bA3FSNtE8Qmpg2ufwPmC2",
  "created_at": 1750000000000,
  "updated_at": 1750000000000,
  "billing_address": null,
  "customer": "cus_aB4DEXqbFGOlpEOxwp0Fx1",
  "due_date": 1750086400000,
  "days_until_due": null,
  "payments": [],
  "line_items": [],
  "metadata": {},
  "number": "INV-001",
  "shipping_details": {
    "name": "John Doe",
    "phone": "+1 (555) 123-4567",
    "address": {
      "line1": "123 Hope St",
      "line2": null,
      "city": "Los Angeles",
      "state": "CA",
      "postal_code": "94111",
      "country": "US"
    }
  },
  "status": "open",
  "default_taxes": [],
  "subtotal": 2000,
  "total_taxes": 0,
  "total": 2000,
  "amount_due": 2000,
  "amount_paid": 0,
  "external_sync": null,
  "attachments": [],
  "credit_notes": null,
  "memo": null,
  "footer": null,
  "custom_fields": null,
  "payment_link": null
}

Update an invoice

Update an invoice’s customer, line items, billing details, or metadata. Only draft invoices can be fully updated.

Optional parameters

Name
expand
Type
object,
Properties
Name
customer
Type
string,
Description
The ID of the customer for this invoice.
Name
billing_address
Type
object or null,
Description
The billing address for this invoice.
Properties
Name
shipping_details
Type
object or null,
Description
Shipping details for this invoice.
Properties
Name
line_items
Type
array of object or object,
Description
The line items for this invoice. Replaces all existing line items.
Name
due_date
Type
integer or null,
Description
The due date for this invoice as a Unix timestamp in milliseconds.
Name
days_until_due
Type
integer or null,
Description
The number of days until the invoice is due. When the invoice is finalized, this will be used to calculate the due_date if set.
Name
metadata
Type
object or null,
Description
A key-value store that is attached to the object. Useful for storing miscellaneous structured data for your integration’s internal use.
Name
attachments
Type
array of string or null,
Description
The IDs of files to attach to this invoice. Replaces all existing attachments.
Name
memo
Type
string or null,
Description
Internal memo for the invoice.
Name
footer
Type
string or null,
Description
Footer text displayed on the invoice.
Name
custom_fields
Type
object or null,
Description
Custom fields for the invoice.
Name
default_taxes
Type
array of objects,
Description
Default taxes to apply to all line items that don't specify their own taxes. Only updateable on draft invoices.
Properties

Returns

Returns the invoice object.

Update an invoice

const invoice = await bias.invoices.update("id", {
  customer: "cus_aB4DEXqbFGOlpEOxwp0Fx1",
  due_date: 1750172800000
});

Response example

{
  "object": "invoice",
  "live": false,
  "id": "inv_2bA3FSNtE8Qmpg2ufwPmC2",
  "created_at": 1750000000000,
  "updated_at": 1750000000000,
  "billing_address": null,
  "customer": "cus_aB4DEXqbFGOlpEOxwp0Fx1",
  "due_date": 1750086400000,
  "days_until_due": null,
  "payments": [],
  "line_items": [],
  "metadata": {},
  "number": "INV-001",
  "shipping_details": {
    "name": "John Doe",
    "phone": "+1 (555) 123-4567",
    "address": {
      "line1": "123 Hope St",
      "line2": null,
      "city": "Los Angeles",
      "state": "CA",
      "postal_code": "94111",
      "country": "US"
    }
  },
  "status": "open",
  "default_taxes": [],
  "subtotal": 2000,
  "total_taxes": 0,
  "total": 2000,
  "amount_due": 2000,
  "amount_paid": 0,
  "external_sync": null,
  "attachments": [],
  "credit_notes": null,
  "memo": null,
  "footer": null,
  "custom_fields": null,
  "payment_link": null
}

Delete an invoice

Delete a draft invoice. This action is irreversible.

Returns

A deleted object stub.

Delete an invoice

const invoice = await bias.invoices.delete("id");

Response example

{
  "object": "invoice",
  "id": "inv_2bA3FSNtE8Qmpg2ufwPmC2",
  "deleted": true
}

Finalize an invoice

Finalize a draft invoice, locking its details and making it ready to send or pay.

Returns

Returns the invoice object.

Finalize an invoice

const invoice = await bias.invoices.finalize("id");

Response example

{
  "object": "invoice",
  "live": false,
  "id": "inv_2bA3FSNtE8Qmpg2ufwPmC2",
  "created_at": 1750000000000,
  "updated_at": 1750000000000,
  "billing_address": null,
  "customer": "cus_aB4DEXqbFGOlpEOxwp0Fx1",
  "due_date": 1750086400000,
  "days_until_due": null,
  "payments": [],
  "line_items": [],
  "metadata": {},
  "number": "INV-001",
  "shipping_details": {
    "name": "John Doe",
    "phone": "+1 (555) 123-4567",
    "address": {
      "line1": "123 Hope St",
      "line2": null,
      "city": "Los Angeles",
      "state": "CA",
      "postal_code": "94111",
      "country": "US"
    }
  },
  "status": "open",
  "default_taxes": [],
  "subtotal": 2000,
  "total_taxes": 0,
  "total": 2000,
  "amount_due": 2000,
  "amount_paid": 0,
  "external_sync": null,
  "attachments": [],
  "credit_notes": null,
  "memo": null,
  "footer": null,
  "custom_fields": null,
  "payment_link": null
}

Send an invoice

Send an invoice email notification to the customer.

Optional parameters

Name
email
Type
string or null,
Description
Email address to send the invoice notification to. Overrides the invoice customer's email. Falls back to the customer's email when omitted.

Returns

Returns the invoice object.

Send an invoice

const invoice = await bias.invoices.send("id");

Response example

{
  "object": "invoice",
  "live": false,
  "id": "inv_2bA3FSNtE8Qmpg2ufwPmC2",
  "created_at": 1750000000000,
  "updated_at": 1750000000000,
  "billing_address": null,
  "customer": "cus_aB4DEXqbFGOlpEOxwp0Fx1",
  "due_date": 1750086400000,
  "days_until_due": null,
  "payments": [],
  "line_items": [],
  "metadata": {},
  "number": "INV-001",
  "shipping_details": {
    "name": "John Doe",
    "phone": "+1 (555) 123-4567",
    "address": {
      "line1": "123 Hope St",
      "line2": null,
      "city": "Los Angeles",
      "state": "CA",
      "postal_code": "94111",
      "country": "US"
    }
  },
  "status": "open",
  "default_taxes": [],
  "subtotal": 2000,
  "total_taxes": 0,
  "total": 2000,
  "amount_due": 2000,
  "amount_paid": 0,
  "external_sync": null,
  "attachments": [],
  "credit_notes": null,
  "memo": null,
  "footer": null,
  "custom_fields": null,
  "payment_link": null
}

Mark an invoice as paid

Mark an invoice as paid when payment was collected outside of Bias.

Returns

Returns the invoice object.

Mark an invoice as paid

const invoice = await bias.invoices.markPaid("id");

Response example

{
  "object": "invoice",
  "live": false,
  "id": "inv_2bA3FSNtE8Qmpg2ufwPmC2",
  "created_at": 1750000000000,
  "updated_at": 1750000000000,
  "billing_address": null,
  "customer": "cus_aB4DEXqbFGOlpEOxwp0Fx1",
  "due_date": 1750086400000,
  "days_until_due": null,
  "payments": [],
  "line_items": [],
  "metadata": {},
  "number": "INV-001",
  "shipping_details": {
    "name": "John Doe",
    "phone": "+1 (555) 123-4567",
    "address": {
      "line1": "123 Hope St",
      "line2": null,
      "city": "Los Angeles",
      "state": "CA",
      "postal_code": "94111",
      "country": "US"
    }
  },
  "status": "open",
  "default_taxes": [],
  "subtotal": 2000,
  "total_taxes": 0,
  "total": 2000,
  "amount_due": 2000,
  "amount_paid": 0,
  "external_sync": null,
  "attachments": [],
  "credit_notes": null,
  "memo": null,
  "footer": null,
  "custom_fields": null,
  "payment_link": null
}

Mark an invoice as uncollectible

Mark an invoice as uncollectible when payment is no longer expected.

Returns

Returns the invoice object.

Mark an invoice as uncollectible

const invoice = await bias.invoices.markUncollectible("id");

Response example

{
  "object": "invoice",
  "live": false,
  "id": "inv_2bA3FSNtE8Qmpg2ufwPmC2",
  "created_at": 1750000000000,
  "updated_at": 1750000000000,
  "billing_address": null,
  "customer": "cus_aB4DEXqbFGOlpEOxwp0Fx1",
  "due_date": 1750086400000,
  "days_until_due": null,
  "payments": [],
  "line_items": [],
  "metadata": {},
  "number": "INV-001",
  "shipping_details": {
    "name": "John Doe",
    "phone": "+1 (555) 123-4567",
    "address": {
      "line1": "123 Hope St",
      "line2": null,
      "city": "Los Angeles",
      "state": "CA",
      "postal_code": "94111",
      "country": "US"
    }
  },
  "status": "open",
  "default_taxes": [],
  "subtotal": 2000,
  "total_taxes": 0,
  "total": 2000,
  "amount_due": 2000,
  "amount_paid": 0,
  "external_sync": null,
  "attachments": [],
  "credit_notes": null,
  "memo": null,
  "footer": null,
  "custom_fields": null,
  "payment_link": null
}

Void an invoice

Void a finalized invoice that should no longer be collected.

Returns

Returns the invoice object.

Void an invoice

const invoice = await bias.invoices.void("id");

Response example

{
  "object": "invoice",
  "live": false,
  "id": "inv_2bA3FSNtE8Qmpg2ufwPmC2",
  "created_at": 1750000000000,
  "updated_at": 1750000000000,
  "billing_address": null,
  "customer": "cus_aB4DEXqbFGOlpEOxwp0Fx1",
  "due_date": 1750086400000,
  "days_until_due": null,
  "payments": [],
  "line_items": [],
  "metadata": {},
  "number": "INV-001",
  "shipping_details": {
    "name": "John Doe",
    "phone": "+1 (555) 123-4567",
    "address": {
      "line1": "123 Hope St",
      "line2": null,
      "city": "Los Angeles",
      "state": "CA",
      "postal_code": "94111",
      "country": "US"
    }
  },
  "status": "open",
  "default_taxes": [],
  "subtotal": 2000,
  "total_taxes": 0,
  "total": 2000,
  "amount_due": 2000,
  "amount_paid": 0,
  "external_sync": null,
  "attachments": [],
  "credit_notes": null,
  "memo": null,
  "footer": null,
  "custom_fields": null,
  "payment_link": null
}

Retrieve an invoice PDF

Generate a PDF rendering of an invoice.

Returns

Returns the PDF file contents.

Retrieve an invoice PDF

const invoice = await bias.invoices.pdf("id");

Retrieve an invoice receipt

Generate a PDF rendering of an invoice receipt.

Returns

Returns the PDF file contents.

Retrieve an invoice receipt

const invoice = await bias.invoices.receipt("id");