55import io .facturapi .models .GenericResponse ;
66import io .facturapi .models .Invoice ;
77import io .facturapi .models .SearchResult ;
8+ import java .io .InputStream ;
89import java .util .Map ;
910
1011public class InvoicesResource extends BaseResource {
@@ -86,6 +87,17 @@ public byte[] downloadPdf(String id) {
8687 return client .getBytes ("/invoices/" + id + "/pdf" );
8788 }
8889
90+ /**
91+ * Opens a streaming invoice PDF download.
92+ *
93+ * @param id Invoice id.
94+ * @return PDF stream. Caller owns closing it.
95+ * @see <a href="https://docs.facturapi.io/api#operation/downloadInvoice">API reference</a>
96+ */
97+ public InputStream downloadPdfStream (String id ) {
98+ return client .getStream ("/invoices/" + id + "/pdf" );
99+ }
100+
89101 /**
90102 * Downloads an invoice XML file.
91103 *
@@ -97,6 +109,17 @@ public byte[] downloadXml(String id) {
97109 return client .getBytes ("/invoices/" + id + "/xml" );
98110 }
99111
112+ /**
113+ * Opens a streaming invoice XML download.
114+ *
115+ * @param id Invoice id.
116+ * @return XML stream. Caller owns closing it.
117+ * @see <a href="https://docs.facturapi.io/api#operation/downloadInvoice">API reference</a>
118+ */
119+ public InputStream downloadXmlStream (String id ) {
120+ return client .getStream ("/invoices/" + id + "/xml" );
121+ }
122+
100123 /**
101124 * Downloads an invoice ZIP package with PDF and XML.
102125 *
@@ -108,6 +131,17 @@ public byte[] downloadZip(String id) {
108131 return client .getBytes ("/invoices/" + id + "/zip" );
109132 }
110133
134+ /**
135+ * Opens a streaming invoice ZIP download.
136+ *
137+ * @param id Invoice id.
138+ * @return ZIP stream. Caller owns closing it.
139+ * @see <a href="https://docs.facturapi.io/api#operation/downloadInvoice">API reference</a>
140+ */
141+ public InputStream downloadZipStream (String id ) {
142+ return client .getStream ("/invoices/" + id + "/zip" );
143+ }
144+
111145 /**
112146 * Downloads the cancellation receipt XML file.
113147 *
@@ -119,6 +153,17 @@ public byte[] downloadCancellationReceiptXml(String id) {
119153 return client .getBytes ("/invoices/" + id + "/cancellation_receipt/xml" );
120154 }
121155
156+ /**
157+ * Opens a streaming cancellation receipt XML download.
158+ *
159+ * @param id Invoice id.
160+ * @return XML stream. Caller owns closing it.
161+ * @see <a href="https://docs.facturapi.io/api#operation/downloadCancellationReceiptXml">API reference</a>
162+ */
163+ public InputStream downloadCancellationReceiptXmlStream (String id ) {
164+ return client .getStream ("/invoices/" + id + "/cancellation_receipt/xml" );
165+ }
166+
122167 /**
123168 * Downloads the cancellation receipt PDF file.
124169 *
@@ -130,6 +175,17 @@ public byte[] downloadCancellationReceiptPdf(String id) {
130175 return client .getBytes ("/invoices/" + id + "/cancellation_receipt/pdf" );
131176 }
132177
178+ /**
179+ * Opens a streaming cancellation receipt PDF download.
180+ *
181+ * @param id Invoice id.
182+ * @return PDF stream. Caller owns closing it.
183+ * @see <a href="https://docs.facturapi.io/api#operation/downloadCancellationReceiptXml">API reference</a>
184+ */
185+ public InputStream downloadCancellationReceiptPdfStream (String id ) {
186+ return client .getStream ("/invoices/" + id + "/cancellation_receipt/pdf" );
187+ }
188+
133189 /**
134190 * Updates a draft invoice.
135191 *
0 commit comments