Credit Note Integration

  • Updated

A Credit Note in Unimarket is processed as a negative invoice. It uses the same cXML structure as a standard invoice but with negative values for the quantity, subtotal, tax, gross amount, and net amount. The unit price must remain positive.

  • Crucial Note: Credits must only contain negative lines. They cannot have a mix of negative and positive lines.

 

Example Credit Note Line Item (InvoiceDetailOrder)

When creating a Credit Note, the quantity attribute is set to a negative number, and the corresponding calculated amounts (SubtotalAmount, Tax) are also negative.

 
<InvoiceDetailOrder>
    <InvoiceDetailOrderInfo>
        <OrderReference orderID="684078"/>
    </InvoiceDetailOrderInfo>
    <InvoiceDetailItem invoiceLineNumber="2" quantity="-1.00">
        <UnitOfMeasure>PACK</UnitOfMeasure>
        <UnitPrice>
            <Money currency="NZD">11.80</Money>
        </UnitPrice>
        <InvoiceDetailItemReference lineNumber="2">
            <ItemID>
                <SupplierPartID>PROD12345</SupplierPartID>
            </ItemID>
            <Description lang="en">Example Product Description</Description>
        </InvoiceDetailItemReference>
        <SubtotalAmount>
            <Money currency="NZD">-11.80</Money>
        </SubtotalAmount>
        <Tax>
            <Money currency="NZD">-1.77</Money>
            <Description lang="en">GST</Description>
        </Tax>
    </InvoiceDetailItem>
</InvoiceDetailOrder>

 

Subtotal Calculation Example

The calculation logic remains standard, resulting in a negative subtotal:

  • Quantity: $-1.00 (<InvoiceDetailItem ... quantity="-1.00">)

  • Unit Price: $11.80 (<UnitPrice><Money currency="NZD">11.80</Money></UnitPrice>)

  • Formula: Quantity x Unit Price = Subtotal

  • Result: $-1.00 x $11.80 = -11.80 (<SubtotalAmount><Money currency="NZD">-11.80</Money></SubtotalAmount>)

 

Example Credit Note Summary (InvoiceDetailSummary)

The summary section also uses negative values to reflect the overall credit amount.

 

<InvoiceDetailSummary>
    <SubtotalAmount>
        <Money currency="NZD">-11.80</Money>
    </SubtotalAmount>
    <Tax>
        <Money currency="NZD">-1.77</Money>
        <Description lang="en">GST</Description>
    </Tax>
    <GrossAmount>
        <Money currency="NZD">-13.57</Money>
    </GrossAmount>
    <NetAmount>
        <Money currency="NZD">-13.57</Money>
    </NetAmount>
</InvoiceDetailSummary>