The Credit Notes resource allows credit notes to be listed and viewed. An individual credit note details can be viewed by appending its identifier (a GUID formatted as XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX) to the URI.
The full range of URIs and HTTP Verbs supported are:
Returns a single credit note with the specified credit number. If specified, it overrides all other filters.
creditStatus
Returns credits for the specified status.
endDate
Returns credits created before a specified date.
modifiedSince
Returns credits created or edited after a specified date.
pageSize
Specifies the page size for pagination. Default page size is 200 credits.
Note: Requesting large numbers of contacts can be susceptible to poor network performance. Please reduce the page size if you experience delayed requests.
startDate
Returns credits created after a specified date.
Note: Date filters should be provided in the ISO format YYYY-MM-DD.
Tip: To efficiently retrieve a count of credit notes that match a filter, specify a pageSize of 0: /CreditNotes?creditStatus=Parked&pageSize=0. The default ordering is by LastModifiedOn descending.
**Note:** *`PendingBatchNumbers` and `PendingSerialNumbers` are applicable to free entry credits notes of `Parked` status only. Unleashed does not allow batch and/or serial numbers to be hard allocated to free entry credit notes while it's in `Parked` status.*
{: #note}
Available Fields for Batch Number
Property
Type
Length
ExpiryDate
Nullable DateTime
Guid
Guid
LastModifiedOn
DateTime
Number
String
50
Quantity
Decimal
Available Fields for Pending Batch Number
Property
Type
Length
CreatedOn
DateTime
ExpiryDate
Nullable DateTime
Number
String
50
Quantity
Decimal
Available Fields for Pending Serial Numbers
Property
Type
Length
CreatedOn
DateTime
Identifier
String
50
Available Fields for Product
Property
Type
Length
Guid
Guid
ProductCode
String
100
ProductDescription
String
500
Available Fields for Serial Numbers
Property
Type
Length
Guid
Guid
Identifier
String
50
LastModifiedOn
DateTime
Examples for Response GET /CreditNotes
show xml example
<?xml version="1.0"?><CreditNotesxmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns="http://api.unleashedsoftware.com/version/1"><Pagination><NumberOfItems>1</NumberOfItems><PageSize>1</PageSize><PageNumber>1</PageNumber><NumberOfPages>1</NumberOfPages></Pagination><CreditNote><CreditNumber>CN-00000017</CreditNumber><CreditDate>2016-09-29T01:46:45.5452929/</CreditDate><SalesInvoiceDate>2016-09-29T01:46:45.5452929</SalesInvoiceDate><RequiredDeliveryDate>2016-09-29T01:46:45.5452929</RequiredDeliveryDate><Reference>Credit Note Reference</Reference><Warehouse><WarehouseCode>W1</WarehouseCode><WarehouseName>Warehouse</WarehouseName><IsDefault>true</IsDefault><StreetNo/><AddressLine1/><AddressLine2/><City/><Region/><Country/><PostCode/><PhoneNumber/><FaxNumber/><MobileNumber/><DDINumber/><ContactName></ContactName><Obsolete>false</Obsolete><Guid>79fc2520-2105-4c1f-8765-3fd8ed577130</Guid><LastModifiedOn>2016-09-29T01:46:45.5452929</LastModifiedOn></Warehouse><Customer><CustomerCode>FranckBassy</CustomerCode><CustomerName>Franck Bassy</CustomerName><CurrencyId>110</CurrencyId><Guid>2284b930-6472-4350-bd34-9967fee2b245</Guid><LastModifiedOn>2016-09-29T01:46:45.5452929</LastModifiedOn></Customer><CreditStatus>Parked</CreditStatus><Currency><CurrencyCode>NZD</CurrencyCode><Description>New Zealand, Dollars</Description><Guid>405aa117-a487-4c0c-9431-cdaf21273f04</Guid><LastModifiedOn>2016-09-29T01:46:45.5452929</LastModifiedOn></Currency><Total>12.5</Total><InvoiceNumber>SI-00000004/2</InvoiceNumber><ReferenceNumber></ReferenceNumber><CreditLines><CreditLine><LineNumber>1</LineNumber><LineTypexsi:nil="true"/><Product><Guid>e5a349d9-55d0-401b-925d-87f668c72ed1</Guid><ProductCode>CHAIRS</ProductCode><ProductDescription>These are some chairs</ProductDescription></Product><OrderQuantity>12</OrderQuantity><CreditQuantity>2</CreditQuantity><CreditPrice>1</CreditPrice><LineTotal>2</LineTotal><Comments></Comments><TaxRate>0.15</TaxRate><LineTax>0.30</LineTax><XeroTaxCode>OUTPUT2</XeroTaxCode><LineTaxCode/><XeroSalesAccount>200</XeroSalesAccount><Reason>Faulty</Reason><Return>true</Return><Disassemble>true</Disassemble><BatchNumbers><Batch><Guid>fb019d6b-aac2-48a3-bbac-e0e0e455f095</Guid><LastModifiedOn>2024-03-19T20:01:28.5016669</LastModifiedOn><BatchNumber>wer</BatchNumber><Quantity>-1.0000</Quantity><ExpiryDate>2023-03-31T00:00:00</ExpiryDate></Batch></BatchNumbers><PendingBatchNumbers><PendingBatch><BatchNumber>rew</BatchNumber><Quantity>1.0000</Quantity><ExpiryDate>2024-01-25T00:00:00</ExpiryDate><CreatedOn>2024-03-19T20:06:05.5510588</CreatedOn></PendingBatch></PendingBatchNumbers><PendingSerialNumbers><PendingSerial><SerialNumber>123</SerialNumber><CreatedOn>2024-03-19T20:05:09.3052015</CreatedOn></PendingSerial></PendingSerialNumbers><LastModifiedOn>2016-09-29T01:46:45.5452929</LastModifiedOn><SerialNumbers><Serial><Guid>75ca9de7-6688-41df-a3c5-79dd4b8a8067</Guid><LastModifiedOn>2024-03-19T20:46:56.0200211</LastModifiedOn><SerialNumber>35XRY0QFGS</SerialNumber></Serial></SerialNumbers></CreditLine></CreditLines><Comments>some comments</Comments><TaxRate>0.15</TaxRate><XeroTaxCode>OUTPUT2</XeroTaxCode><TaxTotal>2.5</TaxTotal><SubTotal>10.5</SubTotal><Tax><TaxCode>OUTPUT2</TaxCode><Description/><TaxRate>0.15</TaxRate><CanApplyToExpenses>false</CanApplyToExpenses><CanApplyToRevenue>false</CanApplyToRevenue><Obsolete>false</Obsolete><Guid>00000000-0000-0000-0000-000000000000</Guid><LastModifiedOn/></Tax><LastModifiedBy>franck@unleashedsoftware.com</LastModifiedBy><LastModifiedOn>2016-09-29T01:46:45.5452929</LastModifiedOn><CreatedBy>franck@unleashedsoftware.com</CreatedBy><CreatedOn>2016-09-29T01:46:45.5452929</CreatedOn><SalesOrder><Guid>9ba44b00-3962-4541-9da0-6dd67b3d0794</Guid><OrderNumber>SO-00000028</OrderNumber></SalesOrder></CreditNote></CreditNotes>
show json example
{"Pagination":{"NumberOfItems":1,"PageSize":1,"PageNumber":1,"NumberOfPages":1},"Items":[{"CreditNumber":"CN-00000017","CreditDate":"/Date(1464739200000)/","SalesInvoiceDate":"/Date(1464739200000)/","RequiredDeliveryDate":"/Date(1464739200000)/","Reference":"Credit Note Reference","Warehouse":{"WarehouseCode":"W1","WarehouseName":"Warehouse","IsDefault":true,"StreetNo":null,"AddressLine1":null,"AddressLine2":null,"City":null,"Region":null,"Country":null,"PostCode":null,"PhoneNumber":null,"FaxNumber":null,"MobileNumber":null,"DDINumber":null,"ContactName":"","Obsolete":false,"Guid":"79fc2520-2105-4c1f-8765-3fd8ed577130","LastModifiedOn":"/Date(1418761704657)/"},"Customer":{"CustomerCode":"FranckBassy","CustomerName":"Franck Bassy","CurrencyId":110,"Guid":"2284b930-6472-4350-bd34-9967fee2b245","LastModifiedOn":"/Date(1454970338982)/"},"CreditStatus":"Parked","Currency":{"CurrencyCode":"NZD","Description":"New Zealand, Dollars","Guid":"405aa117-a487-4c0c-9431-cdaf21273f04","LastModifiedOn":"/Date(1418761686163)/"},"Total":12.5,"InvoiceNumber":"SI-00000004/2","ReferenceNumber":"","CreditLines":[{"LineNumber":1,"LineType":null,"Product":{"Guid":"e5a349d9-55d0-401b-925d-87f668c72ed1","ProductCode":"CHAIRS","ProductDescription":"These are some chairs"},"OrderQuantity":12,"UnitPrice":0,"CreditQuantity":2,"CreditPrice":1,"LineTotal":0,"Comments":"","TaxRate":0.15,"LineTax":0,"XeroTaxCode":"OUTPUT2","LineTaxCode":null,"XeroSalesAccount":"200","Reason":"Faulty","Return":true,"Disassemble":true,"SerialNumbers":[{"Identifier":"35XRY0QFGS","Guid":"75ca9de7-6688-41df-a3c5-79dd4b8a8067","LastModifiedOn":"/Date(1710881216020)/"}],"PendingSerialNumbers":[{"Identifier":"123","CreatedOn":"/Date(1710878709305)/"}],"PendingBatchNumbers":[{"Number":"rew","Quantity":1.0000,"ExpiryDate":"/Date(1706140800000)/","CreatedOn":"/Date(1710878765551)/"}],"BatchNumbers":[{"Number":"wer","Quantity":-1.0000,"ExpiryDate":"/Date(1680220800000)/","Guid":"fb019d6b-aac2-48a3-bbac-e0e0e455f095","LastModifiedOn":"/Date(1710878488501)/"}],"Guid":"f58539b8-6afa-4fd8-864a-3bca2228066e","LastModifiedOn":"/Date(1465868787126)/"}],"Comments":"some comments","Total":12.5,"TaxRate":0.15,"XeroTaxCode":"OUTPUT2","TaxTotal":2.5,"SubTotal":10.5,"Tax":{"TaxCode":"OUTPUT2","Description":null,"TaxRate":0.15,"CanApplyToExpenses":false,"CanApplyToRevenue":false,"Obsolete":false,"Guid":"00000000-0000-0000-0000-000000000000","LastModifiedOn":null},"LastModifiedBy":"franck@unleashedsoftware.com","LastModifiedOn":"/Date(1465868787126)/","CreatedBy":"franck@unleashedsoftware.com","CreatedOn":"/Date(1465868787126)/","SalesOrder":{"Guid":"9ba44b00-3962-4541-9da0-6dd67b3d0794","OrderNumber":"SO-00000028"}}]}
POST/PUT Credit Notes
Note:Please note that only ‘FreeCredit’ Credit notes can be created or updated via the API, but any note can be completed with the POST/Complete filter.
{"Comment":null,"CreditDate":"2021-01-20","ExchangeRate":1,"Reference":null,"Warehouse":{"Guid":"3509051c-7de8-4604-9f68-a2742bd98ddb"},"Customer":{"Guid":"6c3556ca-e647-462e-a88b-ce4d88541393"},"CreditLines":[{"CreditQuantity":3,"CreditPrice":0.6,"Reason":"Credit","Return":false,"Comments":"Happy Free Credit Line Comments","Product":{"Guid":null,"ProductCode":"COUCH2"}}]}
Examples for Request PUT /CreditNotes/{CreditNoteGuid}
Note: At a minimum, a valid Guid or ProductCode is required.
Property
Type
Length
POST
PUT
Guid
Guid
Optional
N/A
ProductCode
String
100
Optional
N/A
Available Fields for Serial Number
Property
Type
Length
POST
PUT
SerialNumber (XML) / Identifier (JSON)
String
50
Required
Required
Examples for Request PUT /CreditNotes/{CreditNoteGuid}/Lines/{CreditNoteLinesGuid}
show xml example
<?xml version="1.0" encoding="UTF-8"?><CreditLinexmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns="http://api.unleashedsoftware.com/version/1"><Comments>New Free Credit Line comments</Comments><CreditPrice>0.7</CreditPrice><CreditQuantity>6</CreditQuantity><Product><ProductCode>COUCH2</ProductCode></Product><Reason>Credit</Reason><Return>false</Return><BatchNumbers><Batch><BatchNumber>HS9371</BatchNumber><Quantity>1</Quantity><ExpiryDate>2025-01-01</ExpiryDate></Batch></BatchNumbers><SerialNumbers><Serial><SerialNumber>AA0016635</SerialNumber></Serial></SerialNumbers></CreditLine>
show json example
{"CreditQuantity":6,"CreditPrice":0.7,"Reason":"Credit","Return":false,"Comments":"New Free Credit Line comments","Product":{"ProductCode":"GLUE"},"BatchNumbers":[{"Number":"HS9371","Quantity":1"ExpiryDate":"2025-01-01"}]"SerialNumbers":[{"Identifier":"HS9372"}]}
Use the API Sandbox to see how the object is rendered in JSON or XML.
Note:An Unleashed account is required before you can use the API Sandbox.
Trial accounts are also allowed to connect to the API.
You can register a new account here: Register.