> ## Documentation Index
> Fetch the complete documentation index at: https://exsited.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Accounts

> List, create, change, cancel and delete accounts, with their contacts, addresses, payment methods, notes and related records.

Accounts are the customers and suppliers you bill and buy from. Here you create, read, change, cancel and delete accounts, manage their contacts, addresses, payment methods, billing preferences, notes, image and emails, and list the orders, invoices, payments and other records that belong to an account. This area has 65 endpoints, and every SDK supports all of them.

> [!WARNING]
>
> **Purging an account removes it and its records permanently, and cannot be undone.**

## At a glance

| Endpoint | Method | Path | What it does |
| - | - | - | - |
| [List accounts](https://exsited.mintlify.site/api-reference/accounts/list-accounts.md) | GET | `/accounts` | Lists your accounts a page at a time, with optional filters and sorting. |
| [Retrieve an account](https://exsited.mintlify.site/api-reference/accounts/retrieve-an-account.md) | GET | `/accounts/{account_id}` | Returns one account with its contacts, addresses, payment methods and billing preferences. |
| [Retrieve an account's information](https://exsited.mintlify.site/api-reference/accounts/retrieve-an-accounts-information.md) | GET | `/accounts/{account_id}/information` | Returns the account under `account`, the same body as Retrieve an account. |
| [Retrieve an account's image](https://exsited.mintlify.site/api-reference/accounts/retrieve-an-accounts-image.md) | GET | `/accounts/{account_id}/image` | Returns a link to the account's image, not the image itself. |
| [List an account's contacts](https://exsited.mintlify.site/api-reference/accounts/list-an-accounts-contacts.md) | GET | `/accounts/{account_id}/contacts` | Returns the account with its contacts under `contacts`. |
| [Retrieve a contact by slot](https://exsited.mintlify.site/api-reference/accounts/retrieve-a-contact-by-slot.md) | GET | `/accounts/{account_id}/contacts/{contact_type}` | Returns one of the account's contacts, chosen by its slot. |
| [List an account's addresses](https://exsited.mintlify.site/api-reference/accounts/list-an-accounts-addresses.md) | GET | `/accounts/{account_id}/addresses` | Returns the account with its addresses under `addresses`. |
| [Retrieve an address](https://exsited.mintlify.site/api-reference/accounts/retrieve-an-address.md) | GET | `/accounts/{account_id}/addresses/{address_id}` | Returns one of the account's addresses, by its `addr_` id. |
| [Retrieve an account's billing preferences](https://exsited.mintlify.site/api-reference/accounts/retrieve-an-accounts-billing-preferences.md) | GET | `/accounts/{account_id}/billing_preferences` | Returns the account with its `billing_preferences`. |
| [List an account's payment methods](https://exsited.mintlify.site/api-reference/accounts/list-an-accounts-payment-methods.md) | GET | `/accounts/{account_id}/payment_methods` | Returns the account with its payment methods under `payment_methods`. |
| [Retrieve a payment method](https://exsited.mintlify.site/api-reference/accounts/retrieve-a-payment-method.md) | GET | `/accounts/{account_id}/payment_methods/{payment_method_id}` | Returns one of the account's payment methods, under `account.payment_method`. |
| [List an account's notes](https://exsited.mintlify.site/api-reference/accounts/list-an-accounts-notes.md) | GET | `/accounts/{account_id}/notes` | Lists the notes on an account, a page at a time. |
| [Retrieve a note](https://exsited.mintlify.site/api-reference/accounts/retrieve-a-note.md) | GET | `/accounts/{account_id}/notes/{note_id}` | Returns one note on an account, under `note`. |
| [List an account note's files](https://exsited.mintlify.site/api-reference/accounts/list-an-account-notes-files.md) | GET | `/accounts/{account_id}/notes/{note_id}/files` | Lists the files attached to one note. |
| [Retrieve an account note file](https://exsited.mintlify.site/api-reference/accounts/retrieve-an-account-note-file.md) | GET | `/accounts/{account_id}/notes/{note_id}/files/{file_id}` | Returns a description of one attached file, under `file`. |
| [List an account's emails](https://exsited.mintlify.site/api-reference/accounts/list-an-accounts-emails.md) | GET | `/accounts/{account_id}/communications/emails` | Lists the emails sent to or from an account, a page at a time. |
| [Retrieve an email](https://exsited.mintlify.site/api-reference/accounts/retrieve-an-email.md) | GET | `/accounts/{account_id}/communications/emails/{email_id}` | Returns one email on an account, under `email`. |
| [List an account's orders](https://exsited.mintlify.site/api-reference/accounts/list-an-accounts-orders.md) | GET | `/accounts/{account_id}/orders` | Lists the orders that belong to one account, a page at a time. |
| [List an account's invoices](https://exsited.mintlify.site/api-reference/accounts/list-an-accounts-invoices.md) | GET | `/accounts/{account_id}/invoices` | Lists the invoices that belong to one account, a page at a time. |
| [List an account's payments](https://exsited.mintlify.site/api-reference/accounts/list-an-accounts-payments.md) | GET | `/accounts/{account_id}/payments` | Lists the payments that belong to one account, a page at a time. |
| [List an account's refunds](https://exsited.mintlify.site/api-reference/accounts/list-an-accounts-refunds.md) | GET | `/accounts/{account_id}/refunds` | Lists the refunds that belong to one account, a page at a time. |
| [List an account's credit notes](https://exsited.mintlify.site/api-reference/accounts/list-an-accounts-credit-notes.md) | GET | `/accounts/{account_id}/credit_notes` | Lists the credit notes that belong to one account, a page at a time. |
| [List an account's purchase orders](https://exsited.mintlify.site/api-reference/accounts/list-an-accounts-purchase-orders.md) | GET | `/accounts/{account_id}/purchase_orders` | Lists the purchase orders that belong to one account, a page at a time. |
| [List an account's purchase invoices](https://exsited.mintlify.site/api-reference/accounts/list-an-accounts-purchase-invoices.md) | GET | `/accounts/{account_id}/purchase_invoices` | Lists the purchase invoices that belong to one account, a page at a time. |
| [List an account's purchase payments](https://exsited.mintlify.site/api-reference/accounts/list-an-accounts-purchase-payments.md) | GET | `/accounts/{account_id}/purchase_payments` | Lists the purchase payments that belong to one account, a page at a time. |
| [List an account's purchase refunds](https://exsited.mintlify.site/api-reference/accounts/list-an-accounts-purchase-refunds.md) | GET | `/accounts/{account_id}/purchase_refunds` | Lists the purchase refunds that belong to one account, a page at a time. |
| [List custom objects for accounts](https://exsited.mintlify.site/api-reference/accounts/list-custom-objects-for-accounts.md) | GET | `/accounts/{account_id}/custom_objects` | Lists the custom objects defined for accounts, a page at a time. |
| [List an account's inventories](https://exsited.mintlify.site/api-reference/accounts/list-an-accounts-inventories.md) | GET | `/accounts/{account_id}/inventories` | Returns the account with its inventories under `account.inventories`. |
| [List an account's partial invoices from quotes](https://exsited.mintlify.site/api-reference/accounts/list-an-accounts-partial-invoices-from-quotes.md) | GET | `/accounts/{account_id}/quote_partial_invoices` | Returns the account with its partial invoices under `account.partial_invoices`. |
| [Create an account](https://exsited.mintlify.site/api-reference/accounts/create-an-account.md) | POST | `/accounts` | Creates an account and returns it under `account`. |
| [Replace an account](https://exsited.mintlify.site/api-reference/accounts/replace-an-account.md) | PUT | `/accounts/{account_id}` | Rewrites an account's fields and returns the account. |
| [Cancel an account](https://exsited.mintlify.site/api-reference/accounts/cancel-an-account.md) | POST | `/accounts/{account_id}/cancel` | Cancels an account from a date and returns it. |
| [Reactivate an account](https://exsited.mintlify.site/api-reference/accounts/reactivate-an-account.md) | POST | `/accounts/{account_id}/reactivate` | Reactivates a cancelled account and returns it. |
| [Set an account's portal password](https://exsited.mintlify.site/api-reference/accounts/set-an-accounts-portal-password.md) | POST | `/accounts/{account_id}/set-password` | Sets the password the account uses to sign in to the portal. |
| [Update an account's information](https://exsited.mintlify.site/api-reference/accounts/update-an-accounts-information.md) | PATCH | `/accounts/{account_id}/information` | Changes an account's core fields and returns the account. |
| [Add contacts to an account](https://exsited.mintlify.site/api-reference/accounts/add-contacts-to-an-account.md) | POST | `/accounts/{account_id}/contacts` | Adds one or more contacts to an account and returns the account. |
| [Add addresses to an account](https://exsited.mintlify.site/api-reference/accounts/add-addresses-to-an-account.md) | POST | `/accounts/{account_id}/addresses` | Adds one or more addresses to an account and returns the account. |
| [Update an address](https://exsited.mintlify.site/api-reference/accounts/update-an-address.md) | PATCH | `/accounts/{account_id}/addresses/{address_id}` | Changes some fields of one address and returns the account. |
| [Replace an address](https://exsited.mintlify.site/api-reference/accounts/replace-an-address.md) | PUT | `/accounts/{account_id}/addresses/{address_id}` | Rewrites one address and returns the account. |
| [Update a contact](https://exsited.mintlify.site/api-reference/accounts/update-a-contact.md) | PATCH | `/accounts/{account_id}/contacts/{contact_id}` | Changes some fields of one contact and returns the account. |
| [Replace a contact](https://exsited.mintlify.site/api-reference/accounts/replace-a-contact.md) | PUT | `/accounts/{account_id}/contacts/{contact_id}` | Rewrites one contact and returns the account. |
| [Replace an account's billing preferences](https://exsited.mintlify.site/api-reference/accounts/replace-an-accounts-billing-preferences.md) | PUT | `/accounts/{account_id}/billing_preferences` | Sets an account's billing preferences and returns the account. |
| [Add a payment method](https://exsited.mintlify.site/api-reference/accounts/add-a-payment-method.md) | POST | `/accounts/{account_id}/payment_methods` | Adds one payment method to an account and returns the account. |
| [Update a payment method](https://exsited.mintlify.site/api-reference/accounts/update-a-payment-method.md) | PATCH | `/accounts/{account_id}/payment_methods/{payment_method_id}` | Changes some fields of one payment method and returns the account. |
| [Replace a payment method](https://exsited.mintlify.site/api-reference/accounts/replace-a-payment-method.md) | PUT | `/accounts/{account_id}/payment_methods/{payment_method_id}` | Rewrites one payment method and returns the account. |
| [Create a note](https://exsited.mintlify.site/api-reference/accounts/create-a-note.md) | POST | `/accounts/{account_id}/notes` | Adds a note to an account, with optional file attachments, and returns it. |
| [Update a note](https://exsited.mintlify.site/api-reference/accounts/update-a-note.md) | PATCH | `/accounts/{account_id}/notes/{note_id}` | Changes a note's text and returns it. |
| [Upload an account's image](https://exsited.mintlify.site/api-reference/accounts/upload-an-accounts-image.md) | POST | `/accounts/{account_id}/image` | Sets the account's image from base64 data and returns the account. |
| [Create a custom object instance](https://exsited.mintlify.site/api-reference/accounts/create-a-custom-object-instance.md) | POST | `/accounts/{account_id}/custom_objects/{custom_object_id}` | Creates an instance of a custom object on an account. |
| [Update a custom object instance](https://exsited.mintlify.site/api-reference/accounts/update-a-custom-object-instance.md) | PATCH | `/accounts/{account_id}/custom_objects_instances/{custom_object_instance_id}` | Changes an instance's values and returns the account. |
| [Send and log an email](https://exsited.mintlify.site/api-reference/accounts/send-and-log-an-email.md) | POST | `/accounts/{account_id}/communications/emails` | Sends an email and records it on the account. |
| [Purge an account](https://exsited.mintlify.site/api-reference/accounts/purge-an-account.md) | POST | `/accounts/{account_id}/purge` | Permanently removes an account and its records. |
| [Delete an account](https://exsited.mintlify.site/api-reference/accounts/delete-an-account.md) | DELETE | `/accounts/{account_id}` | Deletes an account. |
| [Delete a contact](https://exsited.mintlify.site/api-reference/accounts/delete-a-contact.md) | DELETE | `/accounts/{account_id}/contacts/{contact_id}` | Removes one contact from an account. |
| [Delete an address](https://exsited.mintlify.site/api-reference/accounts/delete-an-address.md) | DELETE | `/accounts/{account_id}/addresses/{address_id}` | Removes one address from an account. |
| [Delete a payment method](https://exsited.mintlify.site/api-reference/accounts/delete-a-payment-method.md) | DELETE | `/accounts/{account_id}/payment_methods/{payment_method_id}` | Removes one payment method from an account. |
| [Delete a note](https://exsited.mintlify.site/api-reference/accounts/delete-a-note.md) | DELETE | `/accounts/{account_id}/notes/{note_id}` | Removes one note from an account. |
| [Delete an account's image](https://exsited.mintlify.site/api-reference/accounts/delete-an-accounts-image.md) | DELETE | `/accounts/{account_id}/image` | Removes the account's image. |
| [Retrieve an account's KPIs](https://exsited.mintlify.site/api-reference/accounts/retrieve-an-accounts-kpis.md) | GET | `/accounts/{account_id}/kpis` | Returns the account's revenue and order counters, under `account_kpis`. |
| [Retrieve an account's financial summary](https://exsited.mintlify.site/api-reference/accounts/retrieve-an-accounts-financial-summary.md) | GET | `/accounts/{account_id}/financial_summary` | Returns the account's invoice totals, under `account.financial_summary`. |
| [Retrieve a custom object with its instances](https://exsited.mintlify.site/api-reference/accounts/retrieve-a-custom-object-with-its-instances.md) | GET | `/accounts/{account_id}/custom_objects/{custom_object_id}` | Returns one custom object with this account's instances of it, under `custom_object`. |
| [Retrieve a custom object instance](https://exsited.mintlify.site/api-reference/accounts/retrieve-a-custom-object-instance.md) | GET | `/accounts/{account_id}/custom_objects/{custom_object_id}/instances/{custom_object_instance_id}` | Returns one custom object instance on an account, under `custom_object_instance`. |
| [List an account's component objects](https://exsited.mintlify.site/api-reference/accounts/list-an-accounts-component-objects.md) | GET | `/accounts/{account_id}/component/{component_id}` | Lists one component's objects under an account and its child accounts, a page at a time. |
| [Retrieve an account's component object](https://exsited.mintlify.site/api-reference/accounts/retrieve-an-accounts-component-object.md) | GET | `/accounts/{account_id}/component/{component_id}/{component_object_id}` | Returns one component object under an account, under `custom_component_object`. |
| [Delete an account note file](https://exsited.mintlify.site/api-reference/accounts/delete-an-account-note-file.md) | DELETE | `/accounts/{account_id}/notes/{note_id}/files/{file_id}` | Removes one attachment from a note. |

## Before you call

Register your API credentials once when your app starts, as shown in
[Authentication](https://exsited.mintlify.site/authentication.md). Every SDK sample on these pages then gets its client in one line.
With cURL, send the access token in an `Authorization` header: `Authorization: Bearer $ACCESS_TOKEN`.

## Things to know

* **Paths take the account's `id`, not its `uuid`.** The `id` is a short code such as `ACC0001`; passing the `uuid` returns `404`.
* **Most writes wrap their fields in one key.** Account writes use `account`, a single address `address`, a contact `contact`, a payment method `payment_method` and billing preferences `billing_preferences`. Adding contacts takes a top-level `contacts` list and adding addresses a top-level `addresses` list. Setting a password, sending an email and uploading an image take their fields at the top level. Custom object instance writes use `custom_object_instances`, and notes are sent as a multipart form.
* **Contacts and payment methods are read by one value and written by another.** Retrieve a contact with its slot, `CONTACT_1` to `CONTACT_5`, and update, replace or delete it with its `con_` id; a contact created as `CONTACT_1` reads back with `type` `billing`. Retrieve a payment method with its `reference`, and update, replace or delete it with its `id`, as listed under `payment_methods`.
* **Writes are flatter than reads.** `currency` and `time_zone` go in as a code and a name and read back as objects, an address is written with `post_code` and reads back with `postal_code`, and a contact's name is written as `first_name` and `last_name` and reads back under `name`.
* **Many reads and most writes return the whole account under `account`.** Note writes return the note, sending an email returns the email, and deletes return `204` with no body. The contacts, addresses, payment methods, billing preferences, inventories and partial invoice reads return the account, carrying the part asked for, rather than a paged listing.
* **Paged listings use a cursor.** Records come under `data` with a `pagination` object; while `has_more` is `true`, pass `pagination.next_cursor` as `cursor` to get the next page.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.