Changes for page 3. Invoice-service

Last modified by Karl Holmbom on 2024/10/07 13:26
From empty
To version 95.1
edited by Karl Holmbom
on 2023/04/12 14:21
Change comment: There is no comment for this version

Summary

Details

Page properties
Title
... ... @@ -1,0 +1,1 @@
1 +3. Invoice-service
Parent
... ... @@ -1,0 +1,1 @@
1 +developer:Main.Invoicing.invoice-service.invoice-service-apis.Technical reference.WebHome
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.XWikiGuest
1 +xwiki:XWiki.kfa
Default language
... ... @@ -1,0 +1,1 @@
1 +en
Tags
... ... @@ -1,0 +1,1 @@
1 +px-custom-page-content
Content
... ... @@ -1,0 +1,637 @@
1 +(% class="jumbotron" %)
2 +(((
3 +(% class="container" %)
4 +(((
5 +Integrate to **PayEx Invoice service API **
6 +)))
7 +)))
8 +
9 +== Introduction ==
10 +
11 +This API is used to create new invoices on existing customers
12 +
13 +[[image:1615196225210-926.png||height="100" width="390"]]
14 +
15 +
16 +Each resource in the API corresponds to its own route. All routes are structured according to a specific standard, explained below
17 +
18 +The below route is an example of a route towards resource1Id
19 +//api.payex.com/ledger/**{Subdomain}**/v1/**{LedgerNumber}**/resource1/**{resource1Id}**//
20 +
21 +(% class="table-bordered table-striped" %)
22 +|=(% style="width: 604px;" %)Route segment|=(% style="width: 2790px;" %)Description
23 +|(% style="width:604px" %)Subdomain|(% style="width:2790px" %)In this part of the API it will be **invoice-service**
24 +|(% style="width:604px" %)LedgerNumber|(% style="width:2790px" %)The ledger identifier/number at PayEx
25 +|(% style="width:604px" %)InvoiceNo|(% style="width:2790px" %)Identifier of resource invoice
26 +
27 +(% class="wikigeneratedid" %)
28 +Routes that occurs in examples of this documentation will use the following identifiers
29 +
30 +(% class="table-bordered table-striped" %)
31 +|=(% style="width: 488px;" %)Resource|=(% style="width: 2271px;" %)Identifier
32 +|(% style="width:488px" %)LedgerNumber|(% style="width:2271px" %)XXX
33 +|(% style="width:488px" %)Invoices|(% style="width:2271px" %)NNN
34 +
35 +== ==
36 +
37 +== Invoices ==
38 +
39 +This resource is used to create new invoices, both debit invoices and credit invoices
40 +
41 +==== Example of a new debit invoice ====
42 +
43 +{{code language="http" title="**Request**"}}
44 +POST /ledger/invoice-service/v1/XXX/invoices HTTP/1.1
45 +Host: -
46 +Authorization: Bearer <Token>
47 +Content-Type: application/json
48 +
49 +{
50 + "customerNo": "2992682",
51 + "invoiceNo": "0000003",
52 + "invoiceDate": "2021-05-15",
53 + "preferredDueDate": "2021-06-15",
54 + "externalInvoiceId": "900003",
55 + "currency": "NOK",
56 + "invoiceAddress": {
57 + "addressee": "Annie Testsson",
58 + "streetAddress": "Teststreet 1",
59 + "zipCode": "50000",
60 + "city": "Testcity",
61 + "coAddress": "CO Bengtsson",
62 + "countryCode": "SE"
63 + },
64 + "distribution": null,
65 + "invoiceReason": {
66 + "invoiceReasonCode": "CAS",
67 + "invoiceReasonDescription": "Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet"
68 + },
69 + "legalMonetaryTotal": {
70 + "payableAmount": 97.99,
71 + "vatInclusiveAmount": 98.01,
72 + "vatExclusiveAmount": 98.01
73 + },
74 + "referenceInfo": {
75 + "invoicePeriod": {
76 + "startDate": "2021-04-07",
77 + "endDate": "2021-04-25"
78 + },
79 + "deliveryInfo": {
80 + "deliveryDate": "2021-04-27",
81 + "deliveryAddress": {
82 + "addressee": "Namn på mottagre",
83 + "streetAddress": "Testgatan 789",
84 + "zipCode": "11111",
85 + "city": "Sthlm",
86 + "coAddress": "C/O Andersson",
87 + "countryCode": "SE"
88 + }
89 + },
90 + "purchaseOrderReference": "Lorem ipsum dolor sit amet",
91 + "salesOrderReference": "Lorem ipsum dolor sit amet",
92 + "buyerReference": "Lorem ipsum dolor sit amet",
93 + "invoicedObjectIdentifier": "Lorem ipsum do",
94 + "contractReference": "Lorem ipsum dolor sit amet",
95 + "despatchReference": "Lorem ipsum dolor sit amet",
96 + "receiptReference": "Lorem ipsum dolor sit amet",
97 + "tenderReference": "Lorem ipsum dolor sit amet",
98 + "projectReference": "Lorem ipsum dolor sit amet"
99 + },
100 + "InvoiceNote": "InvoiceNote-Text e Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, ",
101 + "invoiceSpecification": {
102 + "inclVat": true,
103 + "roundingAmount": -0.01,
104 + "invoiceLines": [
105 + {
106 + "itemDescription": "Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet",
107 + "amount": 98.0,
108 + "datePeriod": {
109 + "StartDate": "2021-04-21",
110 + "EndDate": "2021-04-25"
111 + },
112 + "gTIN": "156789123",
113 + "itemObjectIdentifier": "itemObjectIdentifier",
114 + "quantity": 1,
115 + "unit": "ANN",
116 + "unitPrice": 98.0,
117 + "vatCategoryCode": "AE",
118 + "vatRate": 10
119 + },
120 + {
121 + "itemDescription": "Lorem ipsum dolor sit amet",
122 + "amount": 0.01
123 + }
124 + ],
125 + "invoiceVatSpecification": {
126 + "vatSubTotal": [
127 + {
128 + "taxableAmount": 98.01,
129 + "vatAmount": 0.0,
130 + "vatRate": 1,
131 + "vatCategoryCode": "Z"
132 + }
133 + ]
134 + },
135 + "taxCurrencyVatSpecification": {
136 + "vatSubTotal": [
137 + {
138 + "taxableAmount": 50.0,
139 + "vatAmount": 5.5,
140 + "vatRate": 1.0,
141 + "vatCategoryCode": "O"
142 + }
143 + ],
144 + "taxCurrencyCode": "GBP",
145 + "exchangeRate": 1.55
146 + },
147 + "taxReduction": {
148 + "taxReductionDescription": "Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet",
149 + "taxReductionAmount": 0.01
150 + }
151 + }
152 +}
153 +{{/code}}
154 +
155 +==== Example of a new credit invoice ====
156 +
157 +{{code language="http" title="**Request**"}}
158 +POST /ledger/invoice-service/v1/XXX/invoices HTTP/1.1
159 +Host: -
160 +Authorization: Bearer <Token>
161 +Content-Type: application/json
162 +
163 +{
164 + "customerNo": "2992682",
165 + "invoiceNo": "000004",
166 + "invoiceDate": "2021-05-17",
167 + "externalInvoiceId": "900004",
168 + "currency": "SEK",
169 + "invoiceAddress": {
170 + "addressee": "Annie Testsson",
171 + "streetAddress": "Teststreet 1",
172 + "zipCode": "50000",
173 + "city": "Testcity",
174 + "coAddress": "CO Bengtsson",
175 + "countryCode": "SE"
176 + },
177 + "distribution": null,
178 + "invoiceReason": {
179 + "invoiceReasonCode": "CAS",
180 + "invoiceReasonDescription": "Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet"
181 + },
182 + "legalMonetaryTotal": {
183 + "payableAmount": -88.0,
184 + "vatInclusiveAmount": -88.01,
185 + "vatExclusiveAmount": -88.01
186 + },
187 + "referenceInfo": {
188 + "invoicePeriod": {
189 + "startDate": "2021-04-07",
190 + "endDate": "2021-04-25"
191 + },
192 + "deliveryInfo": {
193 + "deliveryDate": "2021-04-27",
194 + "deliveryAddress": {
195 + "addressee": "Name of recipient",
196 + "streetAddress": "Teststreet 789",
197 + "zipCode": "11111",
198 + "city": "Testcity",
199 + "coAddress": "C/O Andersson",
200 + "countryCode": "SE"
201 + }
202 + },
203 + "purchaseOrderReference": "Lorem ipsum dolor sit amet",
204 + "salesOrderReference": "Lorem ipsum dolor sit amet",
205 + "buyerReference": "Lorem ipsum dolor sit amet",
206 + "invoicedObjectIdentifier": "Lorem ipsum do",
207 + "contractReference": "Lorem ipsum dolor sit amet",
208 + "despatchReference": "Lorem ipsum dolor sit amet",
209 + "receiptReference": "Lorem ipsum dolor sit amet",
210 + "tenderReference": "Lorem ipsum dolor sit amet",
211 + "projectReference": "Lorem ipsum dolor sit amet",
212 + "debitInvoiceReferences": [
213 + {
214 + "debitInvoiceReference": "InvoiceNo xxxx"
215 + }
216 + ]
217 + },
218 + "InvoiceNote": "Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet",
219 + "invoiceSpecification": {
220 + "inclVat": true,
221 + "roundingAmount": 0.01,
222 + "invoiceLines": [
223 + {
224 + "itemDescription": "Description of item 1",
225 + "amount": -88.01
226 + }
227 + ],
228 + "invoiceVatSpecification": {
229 + "vatSubTotal": [
230 + {
231 + "taxableAmount": -88.01,
232 + "vatAmount": 0.0,
233 + "vatRate": 1,
234 + "vatCategoryCode": "Z"
235 + }
236 + ]
237 + },
238 + "taxCurrencyVatSpecification": {
239 + "vatSubTotal": [
240 + {
241 + "taxableAmount": 50.0,
242 + "vatAmount": 5.5,
243 + "vatRate": 1.0,
244 + "vatCategoryCode": "O"
245 + }
246 + ],
247 + "taxCurrencyCode": "GBP",
248 + "exchangeRate": 1.55
249 + }
250 + }
251 +}
252 +{{/code}}
253 +
254 +{{code language="http" title="**Response**"}}
255 +HTTP/1.1 201 Created
256 +Content-Type: application/json
257 +
258 +{
259 + "invoice" : "..ledger/invoice/v1/XXX/invoices/NNN",
260 +}
261 +{{/code}}
262 +
263 +==== Get single "create-invoice" request ====
264 +
265 +{{code language="http" title="**Request**"}}
266 +GET /ledger/invoice-service/v1/XXX/invoices/NNN HTTP/1.1
267 +Host: -
268 +Authorization: Bearer <Token>
269 +Content-Type: application/json
270 +
271 +{{/code}}
272 +
273 +{{code language="http" title="**Response**"}}
274 +POST /ledger/invoice-service/v1/XXX/invoices HTTP/1.1
275 +Host: -
276 +Authorization: Bearer <Token>
277 +Content-Type: application/json
278 +
279 +{
280 + "customerNo" : "900",
281 + "invoiceNo" : "0000001",
282 + "invoiceDate": "2021-05-15",
283 + "preferredDueDate": "2021-06-15",
284 + "externalInvoiceId": "900001",
285 + "currency": "SEK",
286 + "invoiceAddress": {
287 + "addressee": "Annie Testsson",
288 + "streetAddress": "Teststreet 1",
289 + "zipCode": "50000",
290 + "city": "Testcity",
291 + "coAddress": "CO Bengtsson",
292 + "countryCode": "SE"
293 + },
294 + "distribution": null,
295 + "invoiceReason": {
296 + "invoiceReasonCode": "CAS",
297 + "invoiceReasonDescription": "Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet"
298 + },
299 + "legalMonetaryTotal": {
300 + "payableAmount": 88.00,
301 + "vatInclusiveAmount": 98.01,
302 + "vatExclusiveAmount": 98.01
303 + },
304 + "referenceInfo": {
305 + "invoicePeriod": {
306 + "startDate": "2021-04-07",
307 + "endDate": "2021-04-25"
308 + },
309 + "deliveryInfo": {
310 + "deliveryDate": "2021-04-27",
311 + "deliveryAddress": {
312 + "addressee": "Namn på mottagre",
313 + "streetAddress": "Testgatan 789",
314 + "zipCode": "11111",
315 + "city": "Sthlm",
316 + "coAddress": "C/O Andersson",
317 + "countryCode": "SE"
318 + }
319 + },
320 + "purchaseOrderReference": "Lorem ipsum dolor sit amet",
321 + "salesOrderReference": "Lorem ipsum dolor sit amet",
322 + "buyerReference": "Lorem ipsum dolor sit amet",
323 + "invoicedObjectIdentifier": "Lorem ipsum do",
324 + "contractReference": "Lorem ipsum dolor sit amet",
325 + "despatchReference": "Lorem ipsum dolor sit amet",
326 + "receiptReference": "Lorem ipsum dolor sit amet",
327 + "tenderReference": "Lorem ipsum dolor sit amet",
328 + "projectReference": "Lorem ipsum dolor sit amet"
329 + },
330 + "InvoiceNote": "InvoiceNote-Text e Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, ",
331 + "invoiceSpecification": {
332 + "inclVat": true,
333 + "roundingAmount": -0.01,
334 + "invoiceLines": [
335 + {
336 + "itemDescription": "Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet",
337 + "amount": 98.00,
338 + "datePeriod": {
339 + "StartDate": "2021-04-21",
340 + "EndDate": "2021-04-25"
341 + },
342 + "gTIN": "156789123",
343 + "itemObjectIdentifier": "itemObjectIdentifier",
344 + "quantity": 8,
345 + "unit": "ANN",
346 + "unitPrice": 10.00,
347 + "vatCategoryCode": "AE",
348 + "vatRate": 10
349 + },
350 + {
351 + "itemDescription": "Lorem ipsum dolor sit amet",
352 + "amount": 0.01
353 + }
354 + ],
355 + "invoiceVatSpecification": {
356 + "vatSubTotal": [
357 + {
358 + "taxableAmount": 98.01,
359 + "vatAmount": 0.00,
360 + "vatRate": 1,
361 + "vatCategoryCode": "Z"
362 + }
363 + ]
364 + },
365 + "taxCurrencyVatSpecification": {
366 + "vatSubTotal": [
367 + {
368 + "taxableAmount": 50.00,
369 + "vatAmount": 5.50,
370 + "vatRate": 1.00,
371 + "vatCategoryCode": "O"
372 + }
373 + ],
374 + "taxCurrencyCode": "GBP",
375 + "exchangeRate": 1.55
376 + },
377 + "taxReduction": {
378 + "taxReductionDescription": "Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet",
379 + "taxReductionAmount": 10
380 + }
381 +
382 + }
383 +}
384 +{{/code}}
385 +
386 +==== ====
387 +
388 +(% id="HAccountresourceproperties" %)
389 +==== Invoice resource properties ====
390 +
391 +(% class="box infomessage" %)
392 +(((
393 +For basic string properties, all characters included in "Basic Latin" and "Latin-1 Supplement" are generally supported unless otherwise stated in below table
394 +)))
395 +
396 +(% class="table-bordered table-striped" %)
397 +|=(% style="width: 561.984px;" %)Property|=(% style="width: 1px;" %)Data type|=(% style="width: 213px;" %)Format|=(% style="width: 88px;" %)Required|=(% style="width: 792px;" %)Description
398 +|(% style="width:561.984px" %)customerNo|(% style="width:1px" %)string|(% style="width:213px" %)MinLength: 1
399 +MaxLength: 15*
400 +numeric, 1-9 |(% style="width:88px" %)Yes|(% style="width:792px" %)The unique identifier of the customer
401 +MaxLength may differ depending on configuration
402 +KID (Norway)
403 +|(% style="width:561.984px" %)(((
404 +invoiceNo
405 +)))|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 15
406 +Regex pattern:(((
407 +[A-Za-z0-9\-]+
408 +)))|(% style="width:88px" %)Yes|(% style="width:792px" %)Your unique identifier/invoice number of the invoice
409 +|(% style="width:561.984px" %)invoiceDate|(% style="width:1px" %)date|(% style="width:213px" %)[[ISO 8601>>url:http://en.wikipedia.org/wiki/ISO_8601||rel="noreferrer" title="ISO8601 on Wikipedia"]]|(% style="width:88px" %)Yes|(% style="width:792px" %)
410 +|(% style="width:561.984px" %)**invoiceAddress**|(% style="width:1px" %)object|(% style="width:213px" %) |(% style="width:88px" %)No|(% style="width:792px" %)(((
411 +Optional invoice address. Only used if different from customer name and legal address
412 +)))
413 +|(% style="width:561.984px" %) addressee|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 72|(% style="width:88px" %)Yes|(% style="width:792px" %)Full name of addressee
414 +|(% style="width:561.984px" %) streetAddress|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 72|(% style="width:88px" %)No|(% style="width:792px" %)Street address
415 +|(% style="width:561.984px" %) zipCode|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 9|(% style="width:88px" %)Yes|(% style="width:792px" %)Zipcode conforming to country standard
416 +|(% style="width:561.984px" %) city|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 27|(% style="width:88px" %)Yes|(% style="width:792px" %)City
417 +|(% style="width:561.984px" %) coAddress|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 72|(% style="width:88px" %)No|(% style="width:792px" %)Care of address
418 +|(% style="width:561.984px" %) countryCode|(% style="width:1px" %)string|(% style="width:213px" %)ISO 3166-1 alpha-2|(% style="width:88px" %)Yes|(% style="width:792px" %)Country code according to ISO 3166
419 +|(% style="width:561.984px" %)preferredDueDate|(% style="width:1px" %)date|(% style="width:213px" %)[[ISO 8601>>url:http://en.wikipedia.org/wiki/ISO_8601||rel="noreferrer" title="ISO8601 on Wikipedia"]]|(% style="width:88px" %)No|(% style="width:792px" %)(((
420 +Used if a specific duedate is preferred. Number of days between distributiondate, wich it set by PayEx based on invoicedate and processingdate, and preferred due date must exceed minimum payment terms for the specific country. Else minimum paymentterms for the country will be used. Number of days between distributiondate, which is set by PayEx based on invoicedate and processingdate, and preferred due date, can not exceed maximum paymentterms (default 60 days), if true an ERROR is created and the customer and its invoices will be rejected.
421 +)))
422 +|(% style="width:561.984px" %)externalInvoiceId|(% style="width:1px" %)string|(% style="width:213px" %)MaxLength: 50
423 +Regex pattern:
424 +^[a-zA-Z0-9äåöÄÅÖ/_ -.]*$|(% style="width:88px" %)No|(% style="width:792px" %)Additional external unique invoice identfier in accountsreceivable
425 +|(% style="width:561.984px" %)distribution|(% style="width:1px" %)string|(% style="width:213px" %) |(% style="width:88px" %)No|(% style="width:792px" %)(((
426 +* **Postal**
427 +* **Email**
428 +* **EInvoiceB2B **//(some optional fields will be required if this is set*)//
429 +* **ArchiveOnly **//(available 2023-04-19)//
430 +
431 +If no distribution is set, [[default distribution priority >>doc:Main.Invoicing.invoice-service.invoice-service-apis.Invoice layout.WebHome||queryString="#HStandarddistributionorderofpriority"]]order will apply.
432 +)))
433 +|(% style="width:561.984px" %)currency|(% style="width:1px" %)string|(% style="width:213px" %) |(% style="width:88px" %)Yes|(% style="width:792px" %)Valid currency supported in Your accountsreceivable
434 +|(% style="width:561.984px" %)(((
435 +__**invoiceReason**__
436 +)))|(% style="width:1px" %)object|(% style="width:213px" %) |(% style="width:88px" %)Yes|(% style="width:792px" %)
437 +|(% style="width:561.984px" %) invoiceReasonCode|(% style="width:1px" %)string|(% style="width:213px" %)[[UNCL7161>>https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL7161/]]|(% style="width:88px" %)No|(% style="width:792px" %)Invoice reason code according to format UNCL7161
438 +|(% style="width:561.984px" %) invoiceReasonDescription|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 200|(% style="width:88px" %)Yes|(% style="width:792px" %)Description of the reason for the invoice
439 +|(% style="width:561.984px" %)(((
440 +==== __**legalMonetaryTotal**__ ====
441 +)))|(% style="width:1px" %)object|(% style="width:213px" %) |(% style="width:88px" %)Yes|(% style="width:792px" %)(((
442 +Contains total amount and currency of the invoice. Positive amount is used for debit invoice. Negative amount is used for credit invoice
443 +)))
444 +|(% style="width:561.984px" %) PayableAmount|(% style="width:1px" %)decimal|(% style="width:213px" %)Fraction digits: 2
445 +Max size: 100000000
446 +Min size: -100000000|(% style="width:88px" %)Yes|(% style="width:792px" %)Total amount to by payed. LegalMonetary.VatInclusiveAmount + Invoicespecification.Roundingamount - InvoiceSpecification.TaxReductionAmount
447 +|(% style="width:561.984px" %) VatInclusiveAmount|(% style="width:1px" %)decimal|(% style="width:213px" %)Fraction digits: 2
448 +Max size: 100000000
449 +Min size: -100000000|(% style="width:88px" %)Yes|(% style="width:792px" %)Total amount inclusive of Vat. Equals sum of InvoiceSpecification.InvoiceVatSpecification.VatSubTotal.TaxableAmount + VatAmount
450 +|(% style="width:561.984px" %) VatExclusiveAmount|(% style="width:1px" %)decimal|(% style="width:213px" %)Fraction digits: 2
451 +Max size: 100000000
452 +Min size: -100000000|(% style="width:88px" %)Yes|(% style="width:792px" %)Total amount exclusive of Vat. Equals sum of InvoiceSpecification.InvoiceVatSpecification.VatSubTotal.TaxableAmount
453 +|(% style="width:561.984px" %)(((
454 +==== __**referenceInfo**__ ====
455 +)))|(% style="width:1px" %)object|(% style="width:213px" %) |(% style="width:88px" %)No|(% style="width:792px" %)Containing invoice reference information
456 +|(% style="width:561.984px" %)**__invoicePeriod__**|(% style="width:1px" %)object|(% style="width:213px" %) |(% style="width:88px" %)No|(% style="width:792px" %)Optional invoiceperiod. Used in EDI
457 +|(% style="width:561.984px" %) startDate|(% style="width:1px" %)date|(% style="width:213px" %)[[ISO 8601>>url:http://en.wikipedia.org/wiki/ISO_8601||rel="noreferrer" title="ISO8601 on Wikipedia"]]|(% style="width:88px" %)Yes|(% style="width:792px" %)
458 +|(% style="width:561.984px" %) endDate|(% style="width:1px" %)date|(% style="width:213px" %)[[ISO 8601>>url:http://en.wikipedia.org/wiki/ISO_8601||rel="noreferrer" title="ISO8601 on Wikipedia"]]|(% style="width:88px" %)Yes|(% style="width:792px" %)
459 +|(% style="width:561.984px" %)**__deliveryInfo__**|(% style="width:1px" %)object|(% style="width:213px" %) |(% style="width:88px" %)No|(% style="width:792px" %)Optional deliveryinformation of product/service invoiced. Also used in EDI
460 +|(% style="width:561.984px" %) deliveryDate|(% style="width:1px" %)date|(% style="width:213px" %)[[ISO 8601>>url:http://en.wikipedia.org/wiki/ISO_8601||rel="noreferrer" title="ISO8601 on Wikipedia"]]|(% style="width:88px" %)No|(% style="width:792px" %)
461 +|(% style="width:561.984px" %)**__deliveryAddress__**|(% style="width:1px" %)object|(% style="width:213px" %) |(% style="width:88px" %)Yes|(% style="width:792px" %)
462 +|(% style="width:561.984px" %) addressee|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 72|(% style="width:88px" %)Yes|(% style="width:792px" %)
463 +|(% style="width:561.984px" %) streetAddress|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 72|(% style="width:88px" %)No|(% style="width:792px" %)
464 +|(% style="width:561.984px" %) zipCode|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 9|(% style="width:88px" %)Yes|(% style="width:792px" %)
465 +|(% style="width:561.984px" %) city|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 27|(% style="width:88px" %)Yes|(% style="width:792px" %)
466 +|(% style="width:561.984px" %) coAddress|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 72|(% style="width:88px" %)No|(% style="width:792px" %)
467 +|(% style="width:561.984px" %) countryCode|(% style="width:1px" %)string|(% style="width:213px" %)ISO 3166-1 alpha-2|(% style="width:88px" %)Yes|(% style="width:792px" %)
468 +|(% style="width:561.984px" %) purchaseOrderReference|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 50|(% style="width:88px" %)No|(% style="width:792px" %)Optional unique purchase order reference issued by the Buyer. Used in EDI
469 +|(% style="width:561.984px" %) salesOrderReference|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 50|(% style="width:88px" %)No|(% style="width:792px" %)Optional sales order reference issued by Seller. Used in EDI
470 +|(% style="width:561.984px" %) buyerReference|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 50|(% style="width:88px" %)No|(% style="width:792px" %)Optional reference of who ordered the products/services. Example being the name of the person ordering, employee number or a code identifying this person or department/group. Your ref is often used for internal routing at recipient, and hence it is important to fill this element with the correct values according to the need of the recipient. Used in EDI
471 +|(% style="width:561.984px" %) invoicedObjectIdentifier|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 50|(% style="width:88px" %)No|(% style="width:792px" %)Optional identifier for an object on which the invoice is based, given by the Seller. Examples may be a subscription number, telephone number, meter point, vehicle, person etc., as applicable. Used in EDI
472 +|(% style="width:561.984px" %) contractReference|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 50|(% style="width:88px" %)No|(% style="width:792px" %)Optional reference to a purchase contract. Used in EDI
473 +|(% style="width:561.984px" %) despatchReference|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 50|(% style="width:88px" %)No|(% style="width:792px" %)Optional reference to a despatch advice. Used in EDI
474 +|(% style="width:561.984px" %) receiptReference|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 50|(% style="width:88px" %)No|(% style="width:792px" %)Optional reference to a receipt advice. Used in EDI
475 +|(% style="width:561.984px" %) tenderReference|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 50|(% style="width:88px" %)No|(% style="width:792px" %)Optional reference to the tenderer or lot, in most cases the Procurement Procedure Identifier. Used in EDI
476 +|(% style="width:561.984px" %) projectReference|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 50|(% style="width:88px" %)No|(% style="width:792px" %)Optional reference to a project. Used in EDI
477 +|(% style="width:561.984px" %) debitInvoiceReferences|(% style="width:1px" %)list|(% style="width:213px" %) |(% style="width:88px" %)No|(% style="width:792px" %)If creditinvoice, optional reference to debit invoice. Used in EDI
478 +|(% style="width:561.984px" %) debitInvoiceReference|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 50|(% style="width:88px" %)Yes|(% style="width:792px" %)Reference to debit invoice
479 +|(% style="width:561.984px" %)invoiceNote|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 250|(% style="width:88px" %)No|(% style="width:792px" %)A textual note that gives unstructured information that is relevant to the Invoice as a whole
480 +|(% style="width:561.984px" %)(((
481 +==== __**invoiceSpecification**__ ====
482 +)))|(% style="width:1px" %)object|(% style="width:213px" %) |(% style="width:88px" %)Yes|(% style="width:792px" %)(((
483 +Contains the specification of the invoice
484 +)))
485 +|(% style="width:561.984px" %) inclVat|(% style="width:1px" %)bool|(% style="width:213px" %) |(% style="width:88px" %)Yes|(% style="width:792px" %)If True, invoiceLine.amount must include Vat. If False, invoiceLine.amount must exclude Vat. EDI-distribution requires an excl vat InvoiceSpecification
486 +| roundingAmount|decimal|Fraction digits: 2
487 +Max size: 0.99
488 +Min size: -0.99|No|Roundingamount +- 0.99
489 +not affected by VAT
490 +|(% style="width:561.984px" %)(((
491 +**__invoiceLines__**
492 +)))|(% style="width:1px" %)list|(% style="width:213px" %) |(% style="width:88px" %)Yes|(% style="width:792px" %)
493 +|(% style="width:561.984px" %) itemDescription|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 250|(% style="width:88px" %)Yes|(% style="width:792px" %)Mandatory description of the invoiced item/service
494 +|(% style="width:561.984px" %) amount|(% style="width:1px" %)decimal|(% style="width:213px" %) |(% style="width:88px" %)Yes|(% style="width:792px" %)Mandatory amount rounded to two decimals. inclusive or exclusive of vat dependends of setting of the boolean attribute Invoicespecification.InclVat
495 +//Sum of the amounts of all invoiceLines must equal to legalMonetaryTotal.VatInclusiveAmount or VatExclusiveAmount, depending on Invoicespecification.InclVat true/false.//
496 +|(% style="width:561.984px" %)__**datePeriod**__|(% style="width:1px" %)object|(% style="width:213px" %) |(% style="width:88px" %)No|(% style="width:792px" %)Optional date/period
497 +|(% style="width:561.984px" %) startDate|(% style="width:1px" %)date|(% style="width:213px" %)[[ISO 8601>>url:http://en.wikipedia.org/wiki/ISO_8601||rel="noreferrer" title="ISO8601 on Wikipedia"]]|(% style="width:88px" %)Yes|(% style="width:792px" %)
498 +|(% style="width:561.984px" %) endDate|(% style="width:1px" %)date|(% style="width:213px" %)[[ISO 8601>>url:http://en.wikipedia.org/wiki/ISO_8601||rel="noreferrer" title="ISO8601 on Wikipedia"]]|(% style="width:88px" %)No|(% style="width:792px" %)
499 +|(% style="width:561.984px" %) gtin|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 15|(% style="width:88px" %)No|(% style="width:792px" %)Optional global trade item identifier (GS1 GTIN)
500 +|(% style="width:561.984px" %) itemObjectIdentifier|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 50|(% style="width:88px" %)No|(% style="width:792px" %)Optional identifier for an object on which the invoiceitem is based, given by the Seller. Examples may be a subscription number, telephone number, meter point, vehicle, person etc., as applicable. Used in EDI
501 +|(% style="width:561.984px" %) quantity|(% style="width:1px" %)decimal|(% style="width:213px" %)Fraction digits: 5
502 +Max size: 100000000
503 +Min size: -100000000|(% style="width:88px" %)No*|(% style="width:792px" %)//*This field is required if distribution is set to EInvoiceB2B//
504 +Optional quantity with up to 5 decimals
505 +|(% style="width:561.984px" %) unit|(% style="width:1px" %)string|(% style="width:213px" %)UNECERec20 |(% style="width:88px" %)No*|(% style="width:792px" %)(((
506 +//*This field is required if distribution is set to EInvoiceB2B//
507 +Optional unit of quantity according to UNECERec20 code list:
508 +
509 +(((
510 +* **C62 **//- Used for unit-less count (pc))//
511 +* **KGM **//- Kilogram//
512 +* **GRM **//- Gram//
513 +* **AD **//- Byte//
514 +* **2D **//- Kilobyte//
515 +* **4L **//- Megabyte//
516 +* **E34 **//- Gigabyte//
517 +* **E35 **//- Terabyte//
518 +* **SEC **//- Seconds//
519 +* **MIN **//- Minutes//
520 +* **DAY**// - Day//
521 +* **WEE**// - Week//
522 +* **MON **//- Month//
523 +* **ANN **//- Year//
524 +)))
525 +)))
526 +|(% style="width:561.984px" %) unitPrice|(% style="width:1px" %)decimal|(% style="width:213px" %)Fraction digits: 5
527 +Max size: 100000000
528 +Min size: 0|(% style="width:88px" %)No*|(% style="width:792px" %)//*This field is required if distribution is set to EInvoiceB2B//
529 +Optional unitprice with up to 5 decimals. Inclusive or exclusive of vat dependent of setting of the boolean attribute Invoicespecification.InclVat
530 +|(% style="width:561.984px" %) vatCategoryCode|(% style="width:1px" %)string|(% style="width:213px" %) |(% style="width:88px" %)No|(% style="width:792px" %)Optional VatCategoryCode according to UN/CEFACT code list 5305, D.16B(((
531 +* **AE **-// VAT Reverse Charge: Code specifying that the standard VAT rate is levied from the invoicee//
532 +* **E **- //Exempt from tax: Code specifying that taxes are not applicable//
533 +* **S **- //Standard rate: Code specifying the standard rate//
534 +* **Z** - //Zero rated goods: Code specifying that the goods are at a zero rate//
535 +* **G** - //Free export item, tax not charged: Code specifying that the item is free export and taxes are not charged//
536 +* **O** - //Services outside scope of tax: Code specifying that taxes are not applicable to the services//
537 +* **K** - //VAT exempt for EEA intra-community supply of goods and services. A tax category code indicating the item is VAT exempt due to an intra-community supply in the European Economic Area//
538 +)))
539 +|(% style="width:561.984px" %) vatRate|(% style="width:1px" %)decimal|(% style="width:213px" %)Fraction digits: 2
540 +Max size: 100.00
541 +Min size: 0.00|(% style="width:88px" %)No|(% style="width:792px" %)Optional valid VatRate
542 +|(% style="width:561.984px" %)(((
543 +**__invoiceVatSpecifications__**
544 +)))|(% style="width:1px" %)object|(% style="width:213px" %) |(% style="width:88px" %)Yes|(% style="width:792px" %)Is specified once per distinct combination of VatCategoryCode and VatRate. Each combination must match sum of corresponding InvoiceLines
545 +|(% style="width:561.984px" %) vatSubTotal|(% style="width:1px" %)list|(% style="width:213px" %) |(% style="width:88px" %)Yes|(% style="width:792px" %)VatSubTotal is specified once per combination of VatCategoryCode and VatRate
546 +|(% style="width:561.984px" %) taxableAmount|(% style="width:1px" %)decimal|(% style="width:213px" %)Fraction digits: 2
547 +Min size: -100000000
548 +Max size: 100000000|(% style="width:88px" %)Yes|(% style="width:792px" %)
549 +|(% style="width:561.984px" %) vatAmount|(% style="width:1px" %)decimal|(% style="width:213px" %)Fraction digits: 2
550 +Min size: -100000000
551 +Max size: 100000000|(% style="width:88px" %)Yes|(% style="width:792px" %)
552 +|(% style="width:561.984px" %) vatRate|(% style="width:1px" %)decimal|(% style="width:213px" %)percentage
553 +min: 0.00
554 +max: 100.00|(% style="width:88px" %)Yes|(% style="width:792px" %)vatRate in percentage
555 +|(% style="width:561.984px" %) vatCategoryCode|(% style="width:1px" %)string|(% style="width:213px" %) |(% style="width:88px" %)Yes|(% style="width:792px" %)(((
556 +Valid values:
557 +
558 +* **AE **-// VAT Reverse Charge: Code specifying that the standard VAT rate is levied from the invoicee//
559 +* **E **- //Exempt from tax: Code specifying that taxes are not applicable//
560 +* **S **- //Standard rate: Code specifying the standard rate//
561 +* **Z** - //Zero rated goods: Code specifying that the goods are at a zero rate//
562 +* **G** - //Free export item, tax not charged: Code specifying that the item is free export and taxes are not charged//
563 +* **O** - //Services outside scope of tax: Code specifying that taxes are not applicable to the services//
564 +* **K** - //VAT exempt for EEA intra-community supply of goods and services. A tax category code indicating the item is VAT exempt due to an intra-community supply in the European Economic Area//
565 +)))
566 +|(% style="width:561.984px" %)(((
567 +**__taxCurrencyVatSpecification__**
568 +)))|(% style="width:1px" %)object|(% style="width:213px" %) |(% style="width:88px" %)No|(% style="width:792px" %)Used if seller tax currency is other than invoice currency
569 +|(% style="width:561.984px" %)**vatSubTotal**|(% style="width:1px" %)list|(% style="width:213px" %)required 1-10 items|(% style="width:88px" %)Yes|(% style="width:792px" %)VatSubTotal is specified once per combination of VatCategoryCode and VatRate
570 +|(% style="width:561.984px" %) taxableAmount|(% style="width:1px" %)decimal|(% style="width:213px" %)amount|(% style="width:88px" %)Yes|(% style="width:792px" %)
571 +|(% style="width:561.984px" %) vatAmount|(% style="width:1px" %)decimal|(% style="width:213px" %)amount|(% style="width:88px" %)Yes|(% style="width:792px" %)
572 +|(% style="width:561.984px" %) vatRate|(% style="width:1px" %)decimal|(% style="width:213px" %)percentage
573 +min: 0.00
574 +max: 100.00|(% style="width:88px" %)Yes|(% style="width:792px" %)vatRate in percentage
575 +|(% style="width:561.984px" %) vatCategoryCode|(% style="width:1px" %)string|(% style="width:213px" %) |(% style="width:88px" %)Yes|(% style="width:792px" %)(((
576 +Valid values:
577 +
578 +* **AE **-// VAT Reverse Charge: Code specifying that the standard VAT rate is levied from the invoicee//
579 +* **E **- //Exempt from tax: Code specifying that taxes are not applicable//
580 +* **S **- //Standard rate: Code specifying the standard rate//
581 +* **Z** - //Zero rated goods: Code specifying that the goods are at a zero rate//
582 +* **G** - //Free export item, tax not charged: Code specifying that the item is free export and taxes are not charged//
583 +* **O** - //Services outside scope of tax: Code specifying that taxes are not applicable to the services//
584 +* **K** - //VAT exempt for EEA intra-community supply of goods and services. A tax category code indicating the item is VAT exempt due to an intra-community supply in the European Economic Area//
585 +)))
586 +|(% style="width:561.984px" %) taxCurrencyCode|(% style="width:1px" %)string|(% style="width:213px" %) |(% style="width:88px" %)Yes|(% style="width:792px" %)The tax currency code of the seller
587 +|(% style="width:561.984px" %) exchangeRate|(% style="width:1px" %)decimal|(% style="width:213px" %)Fraction digits: 5
588 +Min size: 0.00001|(% style="width:88px" %)Yes|(% style="width:792px" %)ExchangeRate used to calculate vat in seller tax currency
589 +|(% style="width:561.984px" %)**__taxReduction__**|(% style="width:1px" %)object|(% style="width:213px" %) |(% style="width:88px" %)No|(% style="width:792px" %)Taxreduction used for Reversed Tax and ROT/RUT
590 +|(% style="width:561.984px" %) taxReductionDescription|(% style="width:1px" %)string|(% style="width:213px" %)Maxlength: 250|(% style="width:88px" %)Yes|(% style="width:792px" %)
591 +|(% style="width:561.984px" %) taxReductionAmount|(% style="width:1px" %)decimal|(% style="width:213px" %)Fraction digits: 2
592 +Min size: 0,01
593 +Max size: 100000000|(% style="width:88px" %)Yes|(% style="width:792px" %)
594 +
595 +(% id="HBills" %)
596 +== ==
597 +
598 +(% id="H-1" %)
599 +==== Problems ====
600 +
601 +All errors from the api are returned in the form of "problems" (response body), except for the http status code itself.
602 +The problem object contain more detailed info on what the error is. The "type" property can be used to programmatically interpret the error as it contains a code definition of the problem.
603 +Other properties can be useful for logging and subsequent troubleshooting. Some problems are extended with additional parameters so it may be a good idea to log response body as raw data to include these.
604 +
605 +Problems of type validation does contain an additional list ("Problems") that describes exactly which parameter that failed the validation
606 +
607 +=== Example ===
608 +
609 +{{code language="http" title="**Response**"}}
610 +HTTP/1.1 400 Error
611 +Content-Type: application/problem+json
612 +
613 +{
614 + "Type" : "ledger/invoice-service/v1/problems/validation",
615 + "Title" : "A validation error occurred",
616 + "Status" : 400,
617 + "Instance" : "215d4206-ca35-4f43-85ad-169c8f6d4ec1",
618 + "Detail" : "A validation error occurred. Please fix the problems mentioned in the 'problems' property below.",
619 + "Problems" : [
620 + {
621 + "amount" : "Expected value between [0,01]-[79228162514264337593543950335] actual [0]"
622 + }
623 + ]
624 +}
625 +{{/code}}
626 +
627 +=== Problem types ===
628 +
629 +(% class="box infomessage" %)
630 +(((
631 +Note, each problem typecode is preceded by "ledger.invoice-service." in this API, e.g. the error "validation" in the table below will appear as typecode "ledger.invoice-service.validation".
632 +)))
633 +
634 +(% class="table-bordered table-striped" %)
635 +|=(% style="width: 537px;" %)Problem type (code)|=(% style="width: 172px;" %)Httpstatus|=(% style="width: 796px;" %)Description
636 +|(% style="width:537px" %)validation|(% style="width:172px" %)400|(% style="width:796px" %)occurs if any of the inputvalidation fails, it is described in the problem which parameter that failed the validation
637 +|(% style="width:537px" %)invoice-not-found|(% style="width:172px" %)404|(% style="width:796px" %)
1615156719725-659.png
Author
... ... @@ -1,0 +1,1 @@
1 +xwiki:XWiki.dap
Size
... ... @@ -1,0 +1,1 @@
1 +0 bytes
Content
1615196225210-926.png
Author
... ... @@ -1,0 +1,1 @@
1 +xwiki:XWiki.dap
Size
... ... @@ -1,0 +1,1 @@
1 +0 bytes
Content