Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > Getting Started >

Post Invoices with minus Amount

Started by Simon Barney -   in Getting Started

Hi All,
I am trying to Post some invoices with negative amount eg. (-20.00). but xero deos not accept invoices with less than zero amount. every time i try to Post invoice it come up with error message give below.

<Message>The Total for this document must be greater than or equal to zero.</Message>

Any ideas how can i post invoices with less than zero amount.

Thanks
@Simon - Xero does not support invoices with an overall invoice total less than zero. Consider using a credit note to get the result you're after.
 

Tony Rule (Xero Staff)  

@Tony-Thanks for your reply, I have some questions regarding Credit notes, I managed to create notes but having some issues. If i create credit note with Allocation invoice which is unpaid at all or some payment outstanding, it create credit note with that invoice without any problem and i can see credit note on that invoice as well. but if i try to create credit note with Allocation invoice which is fully paid. it create credit note but not show on invoice as it show with unpaid invoice. how can i refund full invoice or some amount of any fully paid invoices. Please see below xml for crediting credit notes. Thanks

<CreditNotes>
<CreditNote>
<Type>ACCRECCREDIT</Type>
<Contact>
<Name>XXXXXXXX</Name>
</Contact>
<Date>2014-07-14T00:00:00</Date>
<Allocations>
<Allocation>
<AppliedAmount>1030.10</AppliedAmount>
<Invoice>
<InvoiceNumber>XXXXXXXX</InvoiceNumber>
</Invoice>
</Allocation>
</Allocations>
<LineAmountTypes>Exclusive</LineAmountTypes>
<LineItems>
<LineItem>
<Description>Refunded 2 x 24 packs (CLR-445 @ 2.95 each)</Description>
<Quantity>2.0000</Quantity>
<UnitAmount>70.80</UnitAmount>
<AccountCode>200</AccountCode>
</LineItem>
</LineItems>
</CreditNote>
</CreditNotes>
 

Simon Barney  

You can only allocate the exact outstanding amount or less to an invoice.
Invoice A = 200
Credit Note 1 = 150
Credit Note 2 = 100

I allocate Credit Note 1 -> Invoice A

Now outstanding on Invoice A = 50 from Credit note 2 I can only allocate 50 not 100
 

Henzard Kruger  

@Henzards- Thanks for Reply- but what if i need to refund 200 from invoice "A". if invoice A is already fully paid by customer. and i need to refund full amount from paid invoice. and create allocation credit note.
 

Simon Barney  

Make a Credit Note. When the money leave your bank you pay the credit note just like you did the invoice. They are linked by the customer and you can add the invoice number in the reference field of the creditnote
 

Henzard Kruger  

@Henzard- Great , Thanks for reply. I appreciate
 

Simon Barney  

I need to ask one more thing. For example invoice A=200 and customer paid for invoice A=250 but Xero doesn’t accept because 50 exceeding in invoice A, Is there any way in Xero I can add 50 as a credit, so when same customer comes again I can Add that 50 to new invoice.

Thanks
 

Simon Barney  

, I am trying to create credit note with allocate invoice but unfortunately by some reason I could not manage to allocate credit note to that invoice, using API preview.
Please see blow XML Code. Thanks

<CreditNotes>
<CreditNote>
<Type>ACCRECCREDIT</Type>
<Contact>
<Name>XXXX</Name>
</Contact>
<Date>2014-07-14T00:00:00</Date>
<Allocations>
<Allocation>
<AppliedAmount>1030.10</AppliedAmount>
<Invoice>
<InvoiceNumber>Test_xxx</InvoiceNumber>
</Invoice>
</Allocation>
</Allocations>
<LineAmountTypes>Exclusive</LineAmountTypes>
<LineItems>
<LineItem>
<Description>Refunded 2 x 24 packs (CLR-445 @ 2.95 each)</Description>
<Quantity>2.0000</Quantity>
<UnitAmount>70.80</UnitAmount>
<AccountCode>200</AccountCode>
</LineItem>
</LineItems>
</CreditNote>
</CreditNotes>
 

Simon Barney  

When linking your code to a demo company you can see the xml and errors here https://api.xero.com/Application/History that should give you an Idea of what went wrong. I usually create the credit note on it's own and only after the successful creation I allocate the invoice
 

Henzard Kruger  

could you please tell me what body you have sent in invoices because when iam sending body it is showing data processing exception.and my content type and accept type is both json.
 

pallavi tripathi