> For the complete documentation index, see [llms.txt](https://developer.smarts.ee/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.smarts.ee/integration/spring-boot-starter/invoicing.md).

# Invoicing

{% hint style="info" %}
Implementation is **OPTIONAL** (*Recommended*)
{% endhint %}

Smarts will store detailed confirmation invoice only for two months. So it is important to save detailed invoice copy.

### Implementation

You only need to create a new class, implement **`InvoiceReceiverAdapter`** interface and fill all required methods.  API endpoints for invoicing are created automatically and secured with token.&#x20;

It is important to add `@Component` annotation on top of the class. There is no restriction for class name or location in your project. Our SDK will find your implementation based on the interface (DI).

```java
import ee.smarts.common.v1.Entities.invoice.Invoice;
import ee.smarts.starter.adapter.InvoiceReceiverAdapter;
import org.springframework.stereotype.Component;

@Component
public class InvoiceReceiverImpl implements InvoiceReceiverAdapter {
    @Override
    public void receive(Invoice invoice) {
        // implement this method
    } 
}
```

{% hint style="warning" %}
Default invoicing **is not used** when merchant side invoicing is enabled. Merchant side invoicing is using receipt listener method in [ReceiptAdapter](/integration/spring-boot-starter/merchant-side-invoicing.md).
{% endhint %}
