# Class Invoice

- [TopLevel.Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - [dw.object.Extensible](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.object.Extensible.md)
    - [dw.order.AbstractItemCtnr](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItemCtnr.md)
      - [dw.order.Invoice](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md)

The Invoice can be a debit or credit invoice, and is created
from custom scripts using one of the methods
[ShippingOrder.createInvoice(String)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ShippingOrder.md#createinvoicestring),
[Appeasement.createInvoice(String)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Appeasement.md#createinvoicestring),
[ReturnCase.createInvoice(String)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnCase.md#createinvoicestring) or
[Return.createInvoice(String)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Return.md#createinvoicestring).

Order post-processing APIs (gillian) are now inactive by default and will throw
an exception if accessed. Activation needs preliminary approval by Product Management.
Please contact support in this case. Existing customers using these APIs are not
affected by this change and can use the APIs until further notice.

## Constant Summary

| Constant                                                                                                                                  | Description                                                                                                                                                          |
| ----------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [ORDERBY_CREATION_DATE](#orderby_creation_date): [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)       | Sorting by creation date.                                                                                                                                            |
| [ORDERBY_ITEMID](#orderby_itemid): [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)                     | Sorting by item id.                                                                                                                                                  |
| [ORDERBY_ITEMPOSITION](#orderby_itemposition): [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)         | Sorting by the position of the related oder item.                                                                                                                    |
| [ORDERBY_REVERSE](#orderby_reverse): [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)                   | Reverse orders.                                                                                                                                                      |
| [ORDERBY_UNSORTED](#orderby_unsorted): [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)                 | Unsorted , as it is.                                                                                                                                                 |
| [QUALIFIER_CAPTURE](#qualifier_capture): [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)               | Selects the capture transactions.                                                                                                                                    |
| [QUALIFIER_PRODUCTITEMS](#qualifier_productitems): [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)     | Selects the product items.                                                                                                                                           |
| [QUALIFIER_REFUND](#qualifier_refund): [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)                 | Selects the refund transactions.                                                                                                                                     |
| [QUALIFIER_SERVICEITEMS](#qualifier_serviceitems): [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)     | Selects for the service items.                                                                                                                                       |
| [STATUS_FAILED](#status_failed): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "FAILED"            | Constant for Invoice Status Failed.  The invoice handling failed.                                                                                                    |
| [STATUS_MANUAL](#status_manual): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "MANUAL"            | Constant for Invoice Status Manual.  The invoice is not paid but will **not** be handled automatically.  A manual invoice handling (capture or refund) is necessary. |
| [STATUS_NOT_PAID](#status_not_paid): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "NOT_PAID"      | Constant for Invoice Status Not Paid.  The invoice is not paid and will be handled automatically.                                                                    |
| [STATUS_PAID](#status_paid): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "PAID"                  | Constant for Invoice Status Paid.  The invoice was successfully paid.                                                                                                |
| [TYPE_APPEASEMENT](#type_appeasement): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "APPEASEMENT" | Constant for Invoice Type Appeasement.  The invoice was created for an appeasement.  The invoice amount needs to be refunded.                                        |
| [TYPE_RETURN](#type_return): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "RETURN"                | Constant for Invoice Type Return.  The invoice was created for a return.  The invoice amount needs to be refunded.                                                   |
| [TYPE_RETURN_CASE](#type_return_case): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "RETURN_CASE" | Constant for Invoice Type Return Case.  The invoice was created for a return case.  The invoice amount needs to be refunded.                                         |
| [TYPE_SHIPPING](#type_shipping): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "SHIPPING"          | Constant for Invoice Type Shipping.  The invoice was created for a shipping order.  The invoice amount needs to be captured.                                         |

## Property Summary

| Property                                                                                                                                                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [capturedAmount](#capturedamount): [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md) `(read-only)`                                      | Returns the sum of the captured amounts.                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [invoiceNumber](#invoicenumber): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`                                      | Returns the invoice number.                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [items](#items): [FilteringCollection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md) `(read-only)`                             | Access the collection of [InvoiceItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.InvoiceItem.md)s.                                                                                                                                                                                                                                                                                                                                                                             |
| [paymentTransactions](#paymenttransactions): [FilteringCollection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md) `(read-only)` | Returns the payment transactions belonging to this Invoice.                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [refundedAmount](#refundedamount): [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md) `(read-only)`                                      | Returns the sum of the refunded amounts.                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [status](#status): [EnumValue](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.EnumValue.md)                                                            | Returns the invoice status.  The possible values are [STATUS_NOT_PAID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_not_paid), [STATUS_MANUAL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_manual),  [STATUS_PAID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_paid), [STATUS_FAILED](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_failed).       |
| [type](#type): [EnumValue](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.EnumValue.md) `(read-only)`                                                  | Returns the invoice type.  The possible values are [TYPE_SHIPPING](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#type_shipping), [TYPE_RETURN](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#type_return),  [TYPE_RETURN_CASE](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#type_return_case), [TYPE_APPEASEMENT](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#type_appeasement). |

## Constructor Summary

This class does not have a constructor, so you cannot create it directly.

## Method Summary

| Method                                                                                                                                                                                                                                                                                                                                                     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [account](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#account)()                                                                                                                                                                                                                                                             | <p>  The invoice will be accounted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [addCaptureTransaction](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#addcapturetransactionorderpaymentinstrument-money)([OrderPaymentInstrument](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderPaymentInstrument.md), [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md)) | Calling this method registers an amount captured for a given  order payment instrument.                                                                                                                                                                                                                                                                                                                                                                                                             |
| [addRefundTransaction](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#addrefundtransactionorderpaymentinstrument-money)([OrderPaymentInstrument](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderPaymentInstrument.md), [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md))   | Calling this method registers an amount refunded for a given  order payment instrument.                                                                                                                                                                                                                                                                                                                                                                                                             |
| [getCapturedAmount](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#getcapturedamount)()                                                                                                                                                                                                                                         | Returns the sum of the captured amounts.                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [getInvoiceNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#getinvoicenumber)()                                                                                                                                                                                                                                           | Returns the invoice number.                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [getItems](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#getitems)()                                                                                                                                                                                                                                                           | Access the collection of [InvoiceItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.InvoiceItem.md)s.                                                                                                                                                                                                                                                                                                                                                                             |
| [getPaymentTransactions](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#getpaymenttransactions)()                                                                                                                                                                                                                               | Returns the payment transactions belonging to this Invoice.                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [getRefundedAmount](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#getrefundedamount)()                                                                                                                                                                                                                                         | Returns the sum of the refunded amounts.                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [getStatus](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#getstatus)()                                                                                                                                                                                                                                                         | Returns the invoice status.  The possible values are [STATUS_NOT_PAID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_not_paid), [STATUS_MANUAL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_manual),  [STATUS_PAID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_paid), [STATUS_FAILED](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_failed).       |
| [getType](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#gettype)()                                                                                                                                                                                                                                                             | Returns the invoice type.  The possible values are [TYPE_SHIPPING](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#type_shipping), [TYPE_RETURN](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#type_return),  [TYPE_RETURN_CASE](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#type_return_case), [TYPE_APPEASEMENT](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#type_appeasement). |
| [setStatus](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#setstatusstring)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                                                                                                                                                 | Sets the invoice status.  The possible values are [STATUS_NOT_PAID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_not_paid), [STATUS_MANUAL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_manual),  [STATUS_PAID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_paid), [STATUS_FAILED](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_failed).          |

### Methods inherited from class AbstractItemCtnr

[getCreatedBy](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItemCtnr.md#getcreatedby), [getCreationDate](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItemCtnr.md#getcreationdate), [getGrandTotal](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItemCtnr.md#getgrandtotal), [getItems](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItemCtnr.md#getitems), [getLastModified](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItemCtnr.md#getlastmodified), [getModifiedBy](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItemCtnr.md#getmodifiedby), [getOrder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItemCtnr.md#getorder), [getProductSubtotal](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItemCtnr.md#getproductsubtotal), [getServiceSubtotal](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItemCtnr.md#getservicesubtotal)

### Methods inherited from class Extensible

[describe](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.object.Extensible.md#describe), [getCustom](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.object.Extensible.md#getcustom)

### Methods inherited from class Object

[assign](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#assignobject-object), [create](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#createobject), [create](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#createobject-object), [defineProperties](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#definepropertiesobject-object), [defineProperty](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#definepropertyobject-object-object), [entries](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#entriesobject), [freeze](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#freezeobject), [fromEntries](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#hasownpropertystring), [is](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isobject-object), [isExtensible](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isextensibleobject), [isFrozen](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isfrozenobject), [isPrototypeOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isprototypeofobject), [isSealed](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#issealedobject), [keys](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#keysobject), [preventExtensions](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#propertyisenumerablestring), [seal](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#sealobject), [setPrototypeOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#tolocalestring), [toString](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#tostring), [valueOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#valueof), [values](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#valuesobject)

## Constant Details

### ORDERBY_CREATION_DATE

- ORDERBY_CREATION_DATE: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - : Sorting by creation date. Use with method [getPaymentTransactions()](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#getpaymenttransactions) as an argument to
    method [FilteringCollection.sort(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#sortobject).

***

### ORDERBY_ITEMID

- ORDERBY_ITEMID: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - : Sorting by item id. Use with method [getItems()](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#getitems) as an argument to
    method [FilteringCollection.sort(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#sortobject).

***

### ORDERBY_ITEMPOSITION

- ORDERBY_ITEMPOSITION: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - : Sorting by the position of the related oder item. Use with method
    [getItems()](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#getitems) as an argument to method
    [FilteringCollection.sort(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#sortobject).

***

### ORDERBY_REVERSE

- ORDERBY_REVERSE: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - : Reverse orders. Use as an argument
    to method [FilteringCollection.sort(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#sortobject).

***

### ORDERBY_UNSORTED

- ORDERBY_UNSORTED: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - : Unsorted , as it is. Use with method [getItems()](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#getitems) as an argument
    to method [FilteringCollection.sort(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#sortobject).

***

### QUALIFIER_CAPTURE

- QUALIFIER_CAPTURE: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - : Selects the capture transactions. Use with method [getPaymentTransactions()](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#getpaymenttransactions) as an
    argument to method [FilteringCollection.select(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#selectobject).

***

### QUALIFIER_PRODUCTITEMS

- QUALIFIER_PRODUCTITEMS: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - : Selects the product items. Use with method [getItems()](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#getitems) as an
    argument to method [FilteringCollection.select(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#selectobject).

***

### QUALIFIER_REFUND

- QUALIFIER_REFUND: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - : Selects the refund transactions. Use with method [getPaymentTransactions()](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#getpaymenttransactions) as an
    argument to method [FilteringCollection.select(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#selectobject).

***

### QUALIFIER_SERVICEITEMS

- QUALIFIER_SERVICEITEMS: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - : Selects for the service items. Use with method [getItems()](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#getitems) as an
    argument to method [FilteringCollection.select(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#selectobject).

***

### STATUS_FAILED

- STATUS_FAILED: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "FAILED"
  - : Constant for Invoice Status Failed.

    The invoice handling failed.

***

### STATUS_MANUAL

- STATUS_MANUAL: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "MANUAL"
  - : Constant for Invoice Status Manual.

    The invoice is not paid but will **not** be handled automatically.

    A manual invoice handling (capture or refund) is necessary.

***

### STATUS_NOT_PAID

- STATUS_NOT_PAID: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "NOT_PAID"
  - : Constant for Invoice Status Not Paid.

    The invoice is not paid and will be handled automatically.

***

### STATUS_PAID

- STATUS_PAID: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "PAID"
  - : Constant for Invoice Status Paid.

    The invoice was successfully paid.

***

### TYPE_APPEASEMENT

- TYPE_APPEASEMENT: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "APPEASEMENT"
  - : Constant for Invoice Type Appeasement.

    The invoice was created for an appeasement.

    The invoice amount needs to be refunded.

***

### TYPE_RETURN

- TYPE_RETURN: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "RETURN"
  - : Constant for Invoice Type Return.

    The invoice was created for a return.

    The invoice amount needs to be refunded.

***

### TYPE_RETURN_CASE

- TYPE_RETURN_CASE: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "RETURN_CASE"
  - : Constant for Invoice Type Return Case.

    The invoice was created for a return case.

    The invoice amount needs to be refunded.

***

### TYPE_SHIPPING

- TYPE_SHIPPING: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "SHIPPING"
  - : Constant for Invoice Type Shipping.

    The invoice was created for a shipping order.

    The invoice amount needs to be captured.

***

## Property Details

### capturedAmount

- capturedAmount: [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md) `(read-only)`
  - : Returns the sum of the captured amounts. The captured amounts are
    calculated on the fly.

    Associate a payment capture for a [OrderPaymentInstrument](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderPaymentInstrument.md)
    with an Invoice using
    [addCaptureTransaction(OrderPaymentInstrument, Money)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#addcapturetransactionorderpaymentinstrument-money).

***

### invoiceNumber

- invoiceNumber: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`
  - : Returns the invoice number.

***

### items

- items: [FilteringCollection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md) `(read-only)`
  - : Access the collection of [InvoiceItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.InvoiceItem.md)s.

    This [FilteringCollection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md) can be sorted / filtered using:

    - [FilteringCollection.sort(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#sortobject)with  [ORDERBY_ITEMID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#orderby_itemid)  - [FilteringCollection.sort(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#sortobject)with    [ORDERBY_ITEMPOSITION](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#orderby_itemposition)    - [FilteringCollection.sort(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#sortobject)with      [ORDERBY_UNSORTED](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#orderby_unsorted)      - [FilteringCollection.select(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#selectobject)with        [QUALIFIER_PRODUCTITEMS](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#qualifier_productitems)        - [FilteringCollection.select(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#selectobject)with          [QUALIFIER_SERVICEITEMS](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#qualifier_serviceitems)

***

### paymentTransactions

- paymentTransactions: [FilteringCollection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md) `(read-only)`
  - : Returns the payment transactions belonging to this Invoice.

    This [FilteringCollection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md) can be sorted / filtered using:

    - [FilteringCollection.sort(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#sortobject)with  [ORDERBY_CREATION_DATE](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#orderby_creation_date)  - [FilteringCollection.sort(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#sortobject)with    [ORDERBY_UNSORTED](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#orderby_unsorted)    - [FilteringCollection.select(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#selectobject)with      [QUALIFIER_CAPTURE](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#qualifier_capture)      - [FilteringCollection.select(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#selectobject)with        [QUALIFIER_REFUND](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#qualifier_refund)

    **See Also:**

    - [PaymentTransaction](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md)

***

### refundedAmount

- refundedAmount: [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md) `(read-only)`
  - : Returns the sum of the refunded amounts. The refunded amounts are
    calculated on the fly.

    Associate a payment capture for a [OrderPaymentInstrument](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderPaymentInstrument.md)
    with an Invoice using
    [addRefundTransaction(OrderPaymentInstrument, Money)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#addrefundtransactionorderpaymentinstrument-money).

***

### status

- status: [EnumValue](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.EnumValue.md)
  - : Returns the invoice status.

    The possible values are [STATUS_NOT_PAID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_not_paid), [STATUS_MANUAL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_manual),
    [STATUS_PAID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_paid), [STATUS_FAILED](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_failed).

***

### type

- type: [EnumValue](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.EnumValue.md) `(read-only)`
  - : Returns the invoice type.

    The possible values are [TYPE_SHIPPING](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#type_shipping), [TYPE_RETURN](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#type_return),
    [TYPE_RETURN_CASE](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#type_return_case), [TYPE_APPEASEMENT](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#type_appeasement).

***

## Method Details

### account()

- account(): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)
  - :

    The invoice will be accounted.

    It will be captured in case of a shipping invoice and it will be refunded in
    case of an appeasement, return case or return invoice.

    The accounting will be handled in the payment hooks
    [PaymentHooks.capture(Invoice)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.hooks.PaymentHooks.md#captureinvoice) or
    [PaymentHooks.refund(Invoice)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.hooks.PaymentHooks.md#refundinvoice). The implementing script could add
    payment transactions to the invoice. The accompanying business logic will
    set the status to `PAID` or `FAILED`.

    The accounting will fail when the invoice state is different to
    [STATUS_NOT_PAID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_not_paid) or [STATUS_FAILED](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_failed).

    The method implements its own transaction handling. The method must not
    be called inside a transaction.

    **Returns:**

    - `true` when the accounting was successful, otherwise
      `false`.

***

### addCaptureTransaction(OrderPaymentInstrument, Money)

- addCaptureTransaction(instrument: [OrderPaymentInstrument](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderPaymentInstrument.md), capturedAmount: [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md)): [PaymentTransaction](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md)
  - : Calling this method registers an amount captured for a given
    order payment instrument. The authorization for the
    capture is associated with the payment transaction belonging to the
    instrument. Calling this method allows the Invoice, the
    [OrderPaymentInstrument](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderPaymentInstrument.md) and the [Order](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Order.md) to
    return their captured amount as a sum calculated on the fly. The method
    may be called multiple times for the same instrument (multiple capture
    for one authorization) or for different instruments (invoice settlement
    using multiple payments).

    **Parameters:**

    - instrument - the order payment instrument
    - capturedAmount - amount to register as captured

    **Returns:**

    - the created capture transaction

***

### addRefundTransaction(OrderPaymentInstrument, Money)

- addRefundTransaction(instrument: [OrderPaymentInstrument](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderPaymentInstrument.md), refundedAmount: [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md)): [PaymentTransaction](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md)
  - : Calling this method registers an amount refunded for a given
    order payment instrument. Calling this method allows the
    Invoice, the [OrderPaymentInstrument](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderPaymentInstrument.md) and
    the [Order](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Order.md) to return their refunded amount as a sum
    calculated on the fly. The method may be called multiple times for the
    same instrument (multiple refunds of one payment) or for different
    instruments (invoice settlement using multiple payments).

    **Parameters:**

    - instrument - the order payment instrument
    - refundedAmount - amount to register as refunded

    **Returns:**

    - the created refund transaction

***

### getCapturedAmount()

- getCapturedAmount(): [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md)
  - : Returns the sum of the captured amounts. The captured amounts are
    calculated on the fly.

    Associate a payment capture for a [OrderPaymentInstrument](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderPaymentInstrument.md)
    with an Invoice using
    [addCaptureTransaction(OrderPaymentInstrument, Money)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#addcapturetransactionorderpaymentinstrument-money).

    **Returns:**

    - sum of captured amounts

***

### getInvoiceNumber()

- getInvoiceNumber(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the invoice number.

    **Returns:**

    - the invoice number

***

### getItems()

- getItems(): [FilteringCollection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md)
  - : Access the collection of [InvoiceItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.InvoiceItem.md)s.

    This [FilteringCollection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md) can be sorted / filtered using:

    - [FilteringCollection.sort(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#sortobject)with  [ORDERBY_ITEMID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#orderby_itemid)  - [FilteringCollection.sort(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#sortobject)with    [ORDERBY_ITEMPOSITION](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#orderby_itemposition)    - [FilteringCollection.sort(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#sortobject)with      [ORDERBY_UNSORTED](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#orderby_unsorted)      - [FilteringCollection.select(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#selectobject)with        [QUALIFIER_PRODUCTITEMS](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#qualifier_productitems)        - [FilteringCollection.select(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#selectobject)with          [QUALIFIER_SERVICEITEMS](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#qualifier_serviceitems)

    **Returns:**

    - the invoice items

***

### getPaymentTransactions()

- getPaymentTransactions(): [FilteringCollection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md)
  - : Returns the payment transactions belonging to this Invoice.

    This [FilteringCollection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md) can be sorted / filtered using:

    - [FilteringCollection.sort(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#sortobject)with  [ORDERBY_CREATION_DATE](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#orderby_creation_date)  - [FilteringCollection.sort(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#sortobject)with    [ORDERBY_UNSORTED](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#orderby_unsorted)    - [FilteringCollection.select(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#selectobject)with      [QUALIFIER_CAPTURE](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#qualifier_capture)      - [FilteringCollection.select(Object)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.FilteringCollection.md#selectobject)with        [QUALIFIER_REFUND](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#qualifier_refund)

    **Returns:**

    - the payment transactions.

    **See Also:**

    - [PaymentTransaction](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md)

***

### getRefundedAmount()

- getRefundedAmount(): [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md)
  - : Returns the sum of the refunded amounts. The refunded amounts are
    calculated on the fly.

    Associate a payment capture for a [OrderPaymentInstrument](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderPaymentInstrument.md)
    with an Invoice using
    [addRefundTransaction(OrderPaymentInstrument, Money)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#addrefundtransactionorderpaymentinstrument-money).

    **Returns:**

    - sum of refunded amounts

***

### getStatus()

- getStatus(): [EnumValue](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.EnumValue.md)
  - : Returns the invoice status.

    The possible values are [STATUS_NOT_PAID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_not_paid), [STATUS_MANUAL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_manual),
    [STATUS_PAID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_paid), [STATUS_FAILED](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_failed).

    **Returns:**

    - the invoice status

***

### getType()

- getType(): [EnumValue](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.EnumValue.md)
  - : Returns the invoice type.

    The possible values are [TYPE_SHIPPING](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#type_shipping), [TYPE_RETURN](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#type_return),
    [TYPE_RETURN_CASE](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#type_return_case), [TYPE_APPEASEMENT](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#type_appeasement).

    **Returns:**

    - the invoice type

***

### setStatus(String)

- setStatus(status: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): void
  - : Sets the invoice status.

    The possible values are [STATUS_NOT_PAID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_not_paid), [STATUS_MANUAL](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_manual),
    [STATUS_PAID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_paid), [STATUS_FAILED](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Invoice.md#status_failed).

    **Parameters:**

    - status - the invoice status to set

***
