Laravel Developer
David Carr
Web Developer
All Posts Archives Categories Authors
About Books Packages Templates Contact
Blog
All Posts Archives Categories Authors
About Books Packages Templates Contact
Laravel Xero
Laravel Packages
Laravel Microsoft Graph Laravel Xero Laravel Sent Emails Laravel Dropbox Laravel Box Laravel Companies House Laravel Countries Laravel Eventbrite Laravel Blade Components
PHP Packages
PDO Wrapper PHP find and replace JSON SQL Import IMAP Export CSV Pagination
v1
Navigation
  • Introduction
  • Install
  • Commands
  • Middleware
  • Is Connected
  • Disconnect
  • Tenant
  • Helpers
  • DTOs
  • Enums
  • Contacts
  • Credit Notes
  • Invoices
  • Webhooks
Navigation
  • Introduction
  • Install
  • Commands
  • Middleware
  • Is Connected
  • Disconnect
  • Tenant
  • Helpers
  • DTOs
  • Enums
  • Contacts
  • Credit Notes
  • Invoices
  • Webhooks

Credit Notes

Xero provides a clean way of working with Xero credit notes.

To work with credit notes, first call ->creditNotes() followed by a method.

Xero::creditNotes();

To list credit notes, call the creditNotes()->get() method.

Xero docs for listing credid notes - https://developer.xero.com/documentation/api/accounting/creditnotes

Filtering Credit Notes

You can filter credit notes using the filter method:

The filter can be chained to the get method, or you can use the filter method directly.

$query = Xero::creditNotes();

if ($searchTerm) {
    $query->filter('searchTerm', $searchTerm);
}

if ($status) {
    $query->filter('where', 'Status=="'.$status.'"');
}

$query->filter('order', 'Date DESC')
->get();

View credit note

To view a single credit note, a find method can be called passing in the id

Xero::creditNotes()->find(string $id);

Create Credit Note

To create a credit note, call a store method passing in an array of data:

See https://developer.xero.com/documentation/api/accounting/creditnotes/#post-creditnotes for the array contents specifications

Xero::creditNotes()->store($data);

Update Credit Note

To update a credit note, 2 params are required the Id and an array of data to be updated:

See https://developer.xero.com/documentation/api/accounting/creditnotes/#put-creditnotes for details on the fields that can be updated.

Xero::creditNotes()->update($invoiceId, $data);
Table of Contents
    • Filtering Credit Notes
  • View credit note
  • Create Credit Note
  • Update Credit Note

DCBlog

Practical tutorials, code snippets, and in-depth guides for modern web development. Helping developers build better applications since 2009.

Subscribe to my newsletter for the latest updates on my books and digital products.

© 2009 - 2025 DC Blog. All rights reserved.

Privacy Policy • Terms of Service