Changes for page 4. Invoice

Last modified by Pablo Vivar-Gonzalez on 2023/09/08 11:47
From empty
To version 147.1
edited by Thomas Hedström
on 2023/04/12 08:57
Change comment: There is no comment for this version

Summary

Details

Page properties
Title
... ... @@ -1,0 +1,1 @@
1 +4. Invoice
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.djr
Default language
... ... @@ -1,0 +1,1 @@
1 +en
Tags
... ... @@ -1,0 +1,1 @@
1 +px-custom-page-content
Content
... ... @@ -1,0 +1,1041 @@
1 +(% class="jumbotron" %)
2 +(((
3 +(% class="container" %)
4 +(((
5 +Integrate to **PayEx Invoice API **
6 +)))
7 +)))
8 +
9 +(% id="HRoutesegments" %)
10 +== Introduction ==
11 +
12 +(% class="lead" %)
13 +This api is used to retrieve information related to the customer's invoices.
14 +
15 +[[image:1670584338716-116.png||height="815" width="406"]]
16 +
17 +
18 +PayEx supports HTTP headers for tracking that are used for troubleshooting purposes, implement according to [[specification>>https://developer.payex.com/xwiki/wiki/developer/view/Main/Invoicing/invoice-service/Technical%20reference/API/security/#HHTTPHeaders]]
19 +
20 +Each resource in the API corresponds to its own route. All routes are structured according to a specific standard, explained below
21 +
22 +The below route is an example of a route towards resource3Id, to operate on this resource you must also include the ids of its parentresources in the route.
23 +//api.payex.com/ledger/**{Subdomain}**/v1/**{LedgerNumber}**/resource1/**{resource1Id}**/resource2/**{resource2Id}**/resource3/**{resource3Id}**//
24 +
25 +(% class="table-bordered table-striped" %)
26 +|=(% style="width: 604px;" %)Route segment|=(% style="width: 2790px;" %)Description
27 +|(% style="width:604px" %)Subdomain|(% style="width:2790px" %)In this part of the API it will be invoice
28 +|(% style="width:604px" %)LedgerNumber|(% style="width:2790px" %)The ledger identifier/number at PayEx
29 +|(% style="width:604px" %)resource1Id|(% style="width:2790px" %)Identifier of resource1
30 +|(% style="width:604px" %)resource2Id|(% style="width:2790px" %)identifier of resource2, subresource to resource1
31 +|(% style="width:604px" %)resource3Id|(% style="width:2790px" %)identifier of resource3, subresource to resource2
32 +
33 +(% class="wikigeneratedid" %)
34 +Routes that occurs in examples of this documentation will use the following identifiers
35 +
36 +(% class="table-bordered table-striped" %)
37 +|=(% style="width: 330px;" %)Resource|=(% style="width: 1517px;" %)Identifier
38 +|(% style="width:330px" %)LedgerNumber|(% style="width:1517px" %)XXX
39 +|(% style="width:330px" %)Invoices|(% style="width:1517px" %)NNN (invoiceNo)
40 +|(% style="width:330px" %)Documents|(% style="width:1517px" %)YYY (type)
41 +
42 +== Invoice ==
43 +
44 +The **invoice **resource is located under **ledger/invoice/v1/ **api**. **This resource is used to get general information about existing invoices and its current state. Creation of new invoices is done through other resource.
45 +
46 +
47 +==== Get specific invoice ====
48 +
49 +==== ====
50 +
51 +{{code language="http" title="**Request**"}}
52 +GET /ledger/invoice/v1/XXX/invoices/NNN HTTP/1.1
53 +Host: -
54 +Authorization: Bearer <Token>
55 +Content-Type: application/json
56 +{{/code}}
57 +
58 +
59 +{{code language="http" title="**Response**"}}
60 +HTTP/1.1 200 OK
61 +Content-Type: application/json
62 +
63 +{
64 + "@id" : "/ledger/invoice/v1/XXX/invoices/12345",
65 + "created" : "2019-05-06T00:00:00",
66 + "invoiceNo" : "12345",
67 + "externalInvoiceId" : "987654321",
68 + "status" : "pending|open|closed",
69 + "claimLevel" : "Invoice|RestReminder|Reminder|SecondReminder|CollectionClaim|DebtCollection",
70 + "currentDebt" : 463.42,
71 + "originalAmount" : 354.10,
72 + "currency" : "sek",
73 + "invoiceDate" : "2018-10-01T00:00:00",
74 + "dueDate" : "2018-10-01T00:00:00",
75 + "seller" : {
76 + "name" : "testshop",
77 + "number" : "12345"
78 + },
79 + "debt" : {
80 + "capital" : 354.10,
81 + "remiderFee" : 20.00,
82 + "collectionFee" : 80.00,
83 + "penaltyInterest" : 8.00,
84 + "calculatedPenaltyInterest" : 1.32
85 + },
86 + "penaltyInterestRate": 15.00,
87 + "bankPayment": {
88 + "bankAccountNo": "123",
89 + "bankAccountType": "BGSE",
90 + "bic": "123456",
91 + "iban": "SE12345678945631",
92 + "paymentReference": "54867165675646"
93 + },
94 + "customer" : "/ledger/customer/v1/customers/XYZABC",
95 + "transactions" : "/ledger/invoice/v1/XXX/invoices/12345/transactions",
96 + "activePaymentOrders": "/ledger/invoice/v1/XXX/invoices/NNN/active-payment-orders",
97 + "journal" : "/ledger/invoice/v1/XXX/invoices/12345/journal",
98 + "documents": "/ledger/invoice/v1/XXX/invoices/NNN/documents",
99 + "operations": [
100 + {
101 + "rel": "transfer-to-account",
102 + "method": "POST",
103 + "href": "/ledger/invoice/v1/XXX/invoices/NNN/transfer-to-account"
104 + }
105 + ],
106 +}
107 +{{/code}}
108 +
109 +==== Get specific customers invoices ====
110 +
111 +Use the querystring parameter "customerNo" to list invoices for a specific customer.
112 +
113 +
114 +{{code language="http" title="**Request**"}}
115 +GET /ledger/invoice/v1/XXX/invoices?customerNo=XYZABC HTTP/1.1
116 +Host: -
117 +Authorization: Bearer <Token>
118 +Content-Type: application/json
119 +{{/code}}
120 +
121 +
122 +{{code language="http" title="**Response**"}}
123 +HTTP/1.1 200 OK
124 +Content-Type: application/json
125 +
126 +{
127 + "items": [
128 + {
129 + "@id" : "/ledger/invoice/v1/XXX/invoices/12345",
130 + "invoiceNo" : "12345",
131 + "status" : "pending",
132 + "claimLevel" : "Invoice",
133 + "originalAmount" : 354.10,
134 + "dueDate" : "2021-10-01T00:00:00",
135 + "customerNo" : "XYZABC"
136 + },
137 + {
138 + "@id" : "/ledger/invoice/v1/XXX/invoices/987654",
139 + "invoiceNo" : "987654",
140 + "status" : "open",
141 + "claimLevel" : "Invoice",
142 + "originalAmount" : 122.00,
143 + "dueDate" : "2020-10-01T00:00:00",
144 + "customerNo" : "XYZABC"
145 + },
146 + {
147 + "@id" : "/ledger/invoice/v1/XXX/invoices/456321",
148 + "invoiceNo" : "456321",
149 + "status" : "closed",
150 + "claimLevel" : "Invoice",
151 + "originalAmount" : 846.50,
152 + "dueDate" : "2020-08-01T00:00:00",
153 + "customerNo" : "XYZABC"
154 + }
155 + ]
156 +}
157 +{{/code}}
158 +
159 +==== ====
160 +
161 +(% id="HAccountresourceproperties" %)
162 +==== Invoice resource properties ====
163 +
164 +(% class="table-bordered table-striped" %)
165 +|=Property|=Data type|=(% style="width: 117px;" %)Format|=Description
166 +|@id |string|(% style="width:117px" %)Maxlength: |Uri of the specific account
167 +|created|date|(% style="width:117px" %) |Date when the invoice was created in the system
168 +|invoiceNo|string|(% style="width:117px" %)Maxlength: 50|The identifier of the account
169 +|externalInvoiceId|string|(% style="width:117px" %)Maxlength: 50|External identifier of the invoice
170 +|status|string|(% style="width:117px" %)Maxlength: 25|Status of the invoice(((
171 +* **Pending**: the invoice has not been created yet, awaiting transactions
172 +* **Open**: the invoice is open and active
173 +* **Closed**: the invoice has been closed
174 +)))
175 +|claimLevel|string|Maxlength: 25|Current claim level of the invoice.(((
176 +* **Invoice:** This is the first state the invoice get when it is created, it will have this state until due date is passed (and possibly later depending on companys claim process configuration)
177 +* **RestReminder:** Reminder to pay remaining fees of the invoice (all capital has been payed) has been created/sent
178 +* **Reminder:** First reminder to pay invoice that has been past due date has been creted/sent
179 +* **SecondReminder:** Second reminder to pay invoice has been created/sent
180 +* **CollectionClaim:** Debt collection claim has been created/sent to the customer
181 +* **DebtCollection:** The invoice has been exported to other system for further handling of collection claims
182 +)))
183 +|currentDebt|decimal| |Total current debt of all balances (including capital / interest / fees, etc.). This value can be either positive or negative. (**positive value means it is a debt**)
184 +|originalAmount|decimal|(% style="width:117px" %) |The original debt amount stated on the invoice.
185 +|currency|decimal|(% style="width:117px" %)[[ISO 4217>>https://sv.wikipedia.org/wiki/ISO_4217]]|Currency of the invoice
186 +|invoiceDate|date|(% style="width:117px" %)[[ISO 8601>>url:http://en.wikipedia.org/wiki/ISO_8601||rel="noreferrer" title="ISO8601 on Wikipedia"]]|Date when the invoice was created (printed on the invoice document)
187 +|dueDate|date|(% style="width:117px" %)[[ISO 8601>>url:http://en.wikipedia.org/wiki/ISO_8601||rel="noreferrer" title="ISO8601 on Wikipedia"]]|Duedate of the invoice. This value does not exist for credit invoices
188 +|seller.name|string|(% style="width:117px" %) |Name of the seller related to the invoice
189 +|seller.number|string|(% style="width:117px" %) |The identifier of the seller
190 +|debt|object|(% style="width:117px" %) |Current debt of the invoices separated in the different debt types
191 +| debt.capital|decimal|(% style="width:117px" %) |This value only exists if there is any capital amount
192 +| debt.reminderFee|decimal|(% style="width:117px" %) |This value only exists if there is any reminder fee //(also includes businessRemiderFee)//
193 +| debt.collectionFee|decimal|(% style="width:117px" %) |This value only exists if there is any collection fee
194 +| debt.penaltyInterest|decimal|(% style="width:117px" %) |This value only exists if there is any penalty interest
195 +| debt.calculatedPenaltyInterest|decimal|(% style="width:117px" %) |Todays pending calculated penalty interest. Will be valid if a payment is made today.
196 +This value only exists if there is any calculated penalty interest.
197 +|penaltyInterestRate|decimal|(% style="width:117px" %)Percentage|yearly penalty interestrate (optional)
198 +|bankPayment|object|(% style="width:117px" %) |optional. This object is only visible if the invoice is ready to be paid. Does not exists for invoices with status "closed", or for creditinvoices
199 +| bankPayment.bankAccountNo|string|(% style="width:117px" %)Maxlength: 15|bankaccount for payment
200 +| bankPayment.bankAccountType|string|(% style="width:117px" %)Maxlength: 10|BankAccountTypes:(((
201 +* BKSE (swedish bank account)
202 +* PKSE (swedish plusgiro)
203 +* BGSE (swedish bankgiro)
204 +* PGSE (swedish plusgiro OCR)
205 +* BKNO (norwegian bank account)
206 +* BKDK (danish bank account)
207 +)))
208 +| bankPayment.bic|string|(% style="width:117px" %)Maxlength: 11|Bank Identifier Code (BIC)
209 +| bankPayment.iban|string|(% style="width:117px" %)Maxlength: 34|International Bank Account Number (IBAN)
210 +| bankPayment.paymentReference|string|(% style="width:117px" %)Maxlength: 50|(((
211 +reference to specify on the payment
212 +)))
213 +|customer|string|(% style="width:117px" %)Uri|Uri to the customer resource related to the invoice
214 +|transactions|string|(% style="width:117px" %)Uri|List all transactions that has occured on the invoice
215 +|activePaymentOrders|string|(% style="width:117px" %)Uri|View scheduled payment orders
216 +|journal|string|(% style="width:117px" %)Uri|Lists events that has occured on the invoice
217 +|documents|string|(% style="width:117px" %)Uri|View the actual invoice document (and other related documents), how it has been distributed etc.
218 +
219 +(% id="HBills" %)
220 +== Documents ==
221 +
222 +The documents resources contains basic info of each invoice, reminder, letters etc. that has been produced related to the invoice. It also includes a url to download the actual document.
223 +
224 +
225 +(% id="HListallbillsofanaccount" %)
226 +==== List all documents of an invoice ====
227 +
228 +{{code language="http" title="**Request**"}}
229 +GET /ledger/invoice/v1/XXX/invoices/NNN/documents HTTP/1.1
230 +Host: -
231 +Authorization: Bearer <Token>
232 +Content-Type: application/json
233 +
234 +{{/code}}
235 +
236 +
237 +{{code language="http" title="**Response**"}}
238 +HTTP/1.1 200 OK
239 +Content-Type: application/json
240 +
241 +{
242 + "@id": "/ledger/invoice/v1/501/invoices/NNN/documents",
243 + "items" : [
244 + {
245 + "@id": "/ledger/invoice/v1/XXX/invoices/NNN/documents/852147",
246 + "date": "2018-11-15T00:00:00",
247 + "type" : "invoice",
248 + "distributionMethod" : "NotDistributed|Postal|Kivra|EInvoice|EMail",
249 + "document": "/ledger/invoice/v1/XXX/invoices/NNN/documents/852147/document"
250 + },
251 + {
252 + "@id": "/ledger/invoice/v1/XXX/invoices/NNN/documents/123654",
253 + "date": "2018-11-15T00:00:00",
254 + "type" : "reminder",
255 + "distributionMethod" : "NotDistributed|Postal|Kivra|EInvoice|EMail",
256 + "document": "/ledger/invoice/v1/XXX/invoices/NNN/documents/123654/document"
257 + }
258 + ]
259 +}
260 +{{/code}}
261 +
262 +(% id="H-1" %)
263 +==== ====
264 +
265 +(% id="HGetspecificbill" %)
266 +==== Get specific document ====
267 +
268 +{{code language="http" title="**Request**"}}
269 +GET /ledger/invoice/v1/XXX/invoices/NNN/documents/YYY HTTP/1.1
270 +Host: -
271 +Authorization: Bearer <Token>
272 +Content-Type: application/json
273 +
274 +{{/code}}
275 +
276 +
277 +{{code language="http" title="**Response**"}}
278 +HTTP/1.1 200 OK
279 +Content-Type: application/json
280 +
281 +{
282 + "@id": "/ledger/invoice/v1/XXX/invoices/NNN/documents/123645",
283 + "date": "2018-11-15T00:00:00",
284 + "type" : "reminder",
285 + "distributionMethod" : "NotDistributed|Postal|Kivra|EInvoice|EMail",
286 + "document": "/ledger/invoice/v1/XXX/invoices/NNN/documents/123645/document"
287 +}
288 +{{/code}}
289 +
290 +(% id="HBillresourceproperties" %)
291 +==== Document resource properties ====
292 +
293 +(% class="table-bordered table-striped" %)
294 +|=Property|=Data type|=Format|=Description
295 +|@id|string|Uri|
296 +|date|date|[[ISO 8601>>url:http://en.wikipedia.org/wiki/ISO_8601||rel="noreferrer" title="ISO8601 on Wikipedia"]]|Date when the document was created
297 +|type|string| |(((
298 +Currently available types of document
299 +
300 +* **Invoice **- the actual invoice
301 +* **Reminder **- reminder of the invoice
302 +* **RestReminder **- reminder of rest amounts
303 +* **Collection **- Collection claim of the invoice
304 +* **CreditInvoice**
305 +)))
306 +|distributionMethod|string| |(((
307 +* **NotDistributed **- the letter has been created but not distributed
308 +* **Postal **- Distributed through usual post
309 +* **Kivra **- Digitally distributed through Kivra
310 +* **EInvoice **- Digitally distributed through EInvoice
311 +* **EMail **- Digitally distributed through email
312 +)))
313 +|document|string|Uri|Uri to download the actual document, usually pdf (content type in response).
314 +
315 +== Transactions ==
316 +
317 +This resource lists all transactions that has occured on the invoice. The resource does not support "GET" on individual transactions, only listing of all transactions.
318 +Property "typeName" is ment to be displayed directly "as is" in a customer portal, it is translated to a readable text in the language configured on the current company.
319 +
320 +
321 +(% id="HListallbillsofanaccount" %)
322 +==== List all transactions that has occured on an invoice ====
323 +
324 +
325 +{{code language="http" title="**Request**"}}
326 +GET /ledger/invoice/v1/XXX/invoices/NNN/transactions HTTP/1.1
327 +Host: -
328 +Authorization: Bearer <Token>
329 +Content-Type: application/json
330 +
331 +{{/code}}
332 +
333 +
334 +{{code language="http" title="**Response**"}}
335 +HTTP/1.1 200 OK
336 +Content-Type: application/json
337 +
338 +{
339 + "@id": "/ledger/invoice/v1/501/invoices/NNN/transactions",
340 + "items" : [
341 + {
342 + "type": "disbursement",
343 + "typeName": "Utbetalningsuppdrag skapat",
344 + "reference": "",
345 + "amount": 50.00,
346 + "date": "2019-11-09T00:00:00"
347 + },
348 + {
349 + "type": "payment",
350 + "typeName": "Betalning",
351 + "reference": "",
352 + "amount": -100.00,
353 + "date": "2019-11-09T00:00:00"
354 + },
355 + {
356 + "type": "credit",
357 + "typeName": "Kreditering",
358 + "reference": "",
359 + "amount": -100.00,
360 + "date": "2019-11-02T00:00:00",
361 + "cause" : {
362 + "type": "bankruptcy",
363 + "typeName": "Konkurs"
364 + }
365 + },
366 + {
367 + "type": "credit",
368 + "typeName": "Kreditering",
369 + "reference": "korrigering dröjsmålsränta",
370 + "amount": -00.85,
371 + "date": "2019-11-02T00:00:00",
372 + "cause" : {
373 + "type": "remission",
374 + "typeName": "Efterskänkes"
375 + }
376 + },
377 + {
378 + "type": "credit",
379 + "typeName": "Kreditering",
380 + "reference": "reglering mot kreditfaktura NNN",
381 + "amount": -100.00,
382 + "date": "2019-11-02T00:00:00",
383 + },
384 + {
385 + "type": "collectionFee",
386 + "typeName": "Inkassoavgift",
387 + "reference": "",
388 + "amount": 180.00,
389 + "date": "2019-11-02T00:00:00",
390 + },
391 + {
392 + "type": "reminderFee",
393 + "typeName": "Påminnelseavgift",
394 + "reference": "",
395 + "amount": 30.00,
396 + "date": "2019-11-02T00:00:00",
397 + },
398 + {
399 + "type": "interest",
400 + "typeName": "ränta",
401 + "reference": "",
402 + "amount": 2.00,
403 + "date": "2019-11-02T00:00:00",
404 + },
405 + {
406 + "type": "invoice",
407 + "typeName": "Faktura",
408 + "reference": "butiksnamn, Orderref. 345",
409 + "amount": 200.00,
410 + "date": "2020-10-09T00:00:00"
411 + }
412 + ]
413 +}
414 +{{/code}}
415 +
416 +(% id="H-1" %)
417 +==== ====
418 +
419 +(% id="HGetspecificbill" %)
420 +==== Transaction resource properties ====
421 +
422 +(% class="table-bordered table-striped" %)
423 +|=(% style="width: 405px;" %)Property|=(% style="width: 129px;" %)Data type|=(% style="width: 1236px;" %)Description
424 +|(% style="width:405px" %)@id|(% style="width:129px" %)string|(% style="width:1236px" %)
425 +|(% style="width:405px" %)type|(% style="width:129px" %)string|(% style="width:1236px" %)Type of transaction
426 +|(% style="width:405px" %)typeName|(% style="width:129px" %)string|(% style="width:1236px" %)(((
427 +The type of transaction in form of a readable translated text (the local language of the current company)
428 +
429 +The following types can occur on a invoice
430 +
431 +* Invoice //(the transaction that is the basis for the invoice)//
432 +* CreditInvoice// (the transaction that is the basis for the credit invoice)//
433 +* Credit// (credited amount)//
434 +* Interest
435 +* Payment
436 +* Disbursement //(If, for example, a surplus occur on the invoice, it can be paid out)//
437 +* DisbursementReturned //(amount that failed to be paid out for any reason is returned on the invoice)//
438 +* InvoiceFee
439 +* ReminderFee
440 +* CollectionFee
441 +)))
442 +|(% style="width:405px" %)reference|(% style="width:129px" %)string|(% style="width:1236px" %)Transaction reference
443 +|(% style="width:405px" %)amount|(% style="width:129px" %)decimal|(% style="width:1236px" %)Amount ot the transaction
444 +|(% style="width:405px" %)date|(% style="width:129px" %)date|(% style="width:1236px" %)Date when the transaction occured
445 +|(% style="width:405px" %)cause|(% style="width:129px" %)object|(% style="width:1236px" %)This object is available when there is a specific cause to why the transaction has occured
446 +|(% style="width:405px" %) cause.type|(% style="width:129px" %)string|(% style="width:1236px" %)Type of cause to why the transaction has occured
447 +|(% style="width:405px" %) cause.typeName|(% style="width:129px" %)string|(% style="width:1236px" %)The type of cause in form of a readable translated text (in the local language of the current company)
448 +
449 +== Active payment orders ==
450 +
451 +This resource corresponds to an active / scheduled payment order placed against the specific account, the end-customer will be debited at the given executeDate.
452 +
453 +(% id="HGetactivepaymentordersforanaccount" %)
454 +====
455 +Get active payment orders for an account ====
456 +
457 +
458 +{{code language="http" title="**Request**"}}
459 +GET /ledger/invoice/v1/XXX/invoices/NNN/active-payment-orders/ HTTP/1.1
460 +Host: -
461 +Authorization: Bearer <Token>
462 +Content-Type: application/json
463 +{{/code}}
464 +
465 +
466 +{{code language="http" title="**Response**"}}
467 +HTTP/1.1 200 OK
468 +Content-Type: application/json
469 +
470 +{
471 + "operations": null,
472 + "items": [
473 + {
474 + "paymentMethod": "autogiro",
475 + "executeDate": "2020-02-15",
476 + "amount": 200.00
477 + }
478 + ]
479 +}
480 +{{/code}}
481 +
482 +(% id="H-2" %)
483 +==== ====
484 +
485 +(% id="HActive-payment-ordersresourceproperties" %)
486 +==== Active-payment-orders resource properties ====
487 +
488 +(% class="table-bordered table-striped" %)
489 +|=Property|=Data type|=Description
490 +|paymentMethod|string|paymentMethods:(((
491 +* autogiro
492 +)))
493 +|executeDate|Date|(((
494 +The date when the customers bankaccount will be charged
495 +)))
496 +|amount|decimal|The amount that will be withdrawn from the bankaccount
497 +
498 +(% id="HActivepaymentorder" %)
499 +== Journal ==
500 +
501 +This resource lists all events that has occured on the invoice, in a sorted timeline.
502 +
503 +(% id="HGetactivepaymentordersforanaccount" %)
504 +====
505 +Get journal entries for the invoice ====
506 +
507 +
508 +{{code language="http" title="**Request**"}}
509 +GET /ledger/invoice/v1/XXX/invoices/NNN/journal/ HTTP/1.1
510 +Host: -
511 +Authorization: Bearer <Token>
512 +Content-Type: application/json
513 +{{/code}}
514 +
515 +
516 +{{code language="http" title="**Response**"}}
517 +HTTP/1.1 200 OK
518 +Content-Type: application/json
519 +
520 +{
521 + "operations": null,
522 + "items": [
523 + {
524 + "type": "ComplaintReceived",
525 + "date" : "2020-09-01T00:00:00",
526 + "description" : ""
527 + },
528 + {
529 + "type": "SecondReminderSent",
530 + "date" : "2020-09-01T00:00:00",
531 + "description" : ""
532 + },
533 + {
534 + "type": "ReminderSent",
535 + "date" : "2020-09-01T00:00:00",
536 + "description" : ""
537 + }
538 + ],
539 + "view": {
540 + "@id": "/ledger/invoice/v1/XXX/invoices/NNN/journal?$top=2&$skip=0",
541 + "next": "/ledger/invoice/v1/XXX/invoices/NNN/journal?$top=2&$skip=2"
542 + }
543 +}
544 +{{/code}}
545 +
546 +(% id="H-2" %)
547 +==== ====
548 +
549 +(% id="HActive-payment-ordersresourceproperties" %)
550 +==== Journal resource properties ====
551 +
552 +(% class="table-bordered table-striped" %)
553 +|=Property|=Data type|=Description
554 +|type|string|type:(((
555 +* **ReminderSent **//(an invoice reminder has been sent to the customer)//
556 +* **SecondReminderSent **//(a second invoice reminder has been sent to the customer)//
557 +* **CollectionClaimSent **//(a collection claim has been sent to the customer)//
558 +* **RestReminderSent **//(a reminder including only interest and fees has been sent to the customer)//
559 +* **DebtCollection **//(the invoice has been transferred to collection)//
560 +* **Respite// //**//(the claim is stopped for further claimprocess steps until valid to data of respite or respite is removed)//
561 +* **RespiteRemoved** //(respite has been removed fro claim)//
562 +* **Stop// //**//(the claim is stopped for further claim process steps until stop is removed)//
563 +* **StopRemoved **//(stop has been removed from claim)//
564 +* **ComplaintReceived// //**//(complaint has been registered)//
565 +* **ComplaintResolved **//(complaint has been resolved)//
566 +* **InvoiceClosed **//(status of the invoice in the accounts receivable has been set to closed)//
567 +* **PaymentOrderFailed **//(scheduled paymentorder failed to be executed)//
568 +)))
569 +|date|Date|(((
570 +The date when the journal entry occured
571 +)))
572 +|description|string|detailed description of the entry (if available)
573 +
574 +== Register direct payment ==
575 +
576 +operation for registration of direct payments against invoices
577 +
578 +{{code language="http" title="**Request**"}}
579 +POST /ledger/invoice/v1/XXX/invoices/NNN/register-direct-payment HTTP/1.1
580 +Host: -
581 +Authorization: Bearer <Token>
582 +Content-Type: application/json
583 +
584 +{
585 + "amount" : 100.00,
586 + "paymentDate" : "2021-04-27",
587 + "transactionCause" : "psp"
588 +}
589 +{{/code}}
590 +
591 +(% id="HActive-payment-ordersresourceproperties" %)
592 +==== Register-direct-payment request properties ====
593 +
594 +(% class="table-bordered table-striped" %)
595 +|=Property|=Data type|=Required|=Description
596 +|amount|decimal|Yes|The amount of the direct payment
597 +|paymentDate|Date|Yes|(((
598 +The date when the payment was made
599 +)))
600 +|transactionCause|string|No|(((
601 +* psp
602 +)))
603 +
604 +{{code language="http" title="**Response**"}}
605 +HTTP/1.1 204 NO CONTENT
606 +Content-Type: application/json
607 +
608 +{{/code}}
609 +
610 +== Settle-credit-invoice ==
611 +
612 +operation to settle an existing credit invoice towards debit invoice. This operation is only be available/valid on credit-invoices
613 +
614 +{{code language="http" title="**Request**"}}
615 +POST /ledger/invoice/v1/XXX/invoices/NNN/settle-credit-invoice HTTP/1.1
616 +Host: -
617 +Authorization: Bearer <Token>
618 +Content-Type: application/json
619 +
620 +{
621 + "debitInvoiceNo": "12345",
622 + "creditAmount": 250.00,
623 + "sendCopy": false
624 +}
625 +{{/code}}
626 +
627 +(% id="HActive-payment-ordersresourceproperties" %)
628 +==== Settle-credit-invoice request properties ====
629 +
630 +(% class="table-bordered table-striped" %)
631 +|=Property|=Data type|=Required|=Description
632 +|debitInvoiceNo|string|Yes|invoice number of the debit invoice that the credit invoice is to be settled against
633 +|creditAmount|decimal|Yes|(((
634 +Amount of he credit invoice to use
635 +)))
636 +|sendCopy|bool|No|Whether a new copy should be distributed to the end-customer with updated balances (after settlement has been executed)
637 +Default false
638 +
639 +{{code language="http" title="**Response**"}}
640 +HTTP/1.1 204 NO CONTENT
641 +Content-Type: application/json
642 +
643 +{{/code}}
644 +
645 +
646 +== Remission ==
647 +
648 +operation to allow partialy remission of the debt. Usually used if there is a small debt left on the invoice after a payment hade been done, and the remaining amount should be offered.
649 +
650 +{{code language="http" title="**Request**"}}
651 +POST /ledger/invoice/v1/XXX/invoices/NNN/remission HTTP/1.1
652 +Host: -
653 +Authorization: Bearer <Token>
654 +Content-Type: application/json
655 +
656 +{
657 + "balanceType": "CollectionFee",
658 + "amount": 12.00
659 +}
660 +{{/code}}
661 +
662 +(% id="HActive-payment-ordersresourceproperties" %)
663 +==== remission request properties ====
664 +
665 +(% class="table-bordered table-striped" %)
666 +|=Property|=Data type|=Required|=Description
667 +|balanceType|string|Yes|(((
668 +The balanceType to be affected
669 +
670 +* capital
671 +* reminderfee
672 +* penaltyinterest
673 +* collectionfee
674 +)))
675 +|amount|decimal|Yes|The amount of the specified balace type to exeute remission on
676 +
677 +{{code language="http" title="**Response**"}}
678 +HTTP/1.1 204 NO CONTENT
679 +Content-Type: application/json
680 +
681 +{{/code}}
682 +
683 +== Write-down ==
684 +
685 +operation to allow partialy or full write-down of the debt. the reason/cause of the write-down should be specified (affects accounting)
686 +
687 +{{code language="http" title="**Request**"}}
688 +POST /ledger/invoice/v1/XXX/invoices/NNN/write-down HTTP/1.1
689 +Host: -
690 +Authorization: Bearer <Token>
691 +Content-Type: application/json
692 +
693 +{
694 + "balanceType": "CollectionFee",
695 + "amount": 12.00,
696 + "cause": "deceased",
697 + "invoiceCurrentDebt": 462.10
698 +}
699 +{{/code}}
700 +
701 +(% id="HActive-payment-ordersresourceproperties" %)
702 +==== Write-down request properties ====
703 +
704 +(% class="table-bordered table-striped" %)
705 +|=Property|=Data type|=Required|=Description
706 +|balanceType|string|Yes|(((
707 +The balanceType to be affected
708 +
709 +* Capital
710 +* ReminderFee
711 +* PenaltyInterest
712 +* CollectionFee
713 +)))
714 +|amount|decimal|Yes|The amount of the specified balace type to write-down
715 +|cause|string|Yes|(((
716 +The cause of the write-down
717 +
718 +* Bankruptcy
719 +* Settlement
720 +* Deceased
721 +* Fraud
722 +* Dispute
723 +* Unknown
724 +
725 +If field is null, Then defaults to "Unknown". Case-Sensitive
726 +)))
727 +|{{{invoiceCurrentDebt}}}|decimal|Yes|The amount must match the current debt (**excl. Calculated interest**) on the invoice.
728 +currentDebt - debt.calculatedPenaltyInterest
729 +
730 +{{code language="http" title="**Response**"}}
731 +HTTP/1.1 204 NO CONTENT
732 +Content-Type: application/json
733 +
734 +{{/code}}
735 +
736 +== Respite ==
737 +
738 +Resource to create or view respite
739 +
740 +Get respite
741 +
742 +{{code language="http" title="**Request**"}}
743 +GET /ledger/invoice/v1/XXX/invoices/NNN/respite HTTP/1.1
744 +Host: -
745 +Authorization: Bearer <Token>
746 +Content-Type: application/json
747 +
748 +{{/code}}
749 +
750 +{{code language="http" title="**Response**"}}
751 +HTTP/1.1 200 OK
752 +Content-Type: application/json
753 +
754 +{
755 + "validToDate": "2021-08-01",
756 + "reason": "..."
757 +}
758 +{{/code}}
759 +
760 +Create respite
761 +
762 +{{code language="http" title="**Request**"}}
763 +POST /ledger/invoice/v1/XXX/invoices/NNN/respite HTTP/1.1
764 +Host: -
765 +Authorization: Bearer <Token>
766 +Content-Type: application/json
767 +
768 +{
769 + "validToDate": "2021-08-01",
770 + "reason": "..."
771 +}
772 +{{/code}}
773 +
774 +{{code language="http" title="**Response**"}}
775 +HTTP/1.1 201 CREATED
776 +Content-Type: application/json
777 +{{/code}}
778 +
779 +(% id="HActive-payment-ordersresourceproperties" %)
780 +==== Respite request properties ====
781 +
782 +(% class="table-bordered table-striped" %)
783 +|=Property|=Data type|=Required|=Description
784 +|validToDate|Date|Yes|Respite is valid to this date
785 +|reason|string|Yes|Reason for why the respite was created.
786 +
787 +== Active-disbursement-orders ==
788 +
789 +View or create disbursement orders, only available for credit-invoices
790 +
791 +Get active-disbursement-orders
792 +
793 +{{code language="http" title="**Request**"}}
794 +GET /ledger/invoice/v1/XXX/invoices/NNN/active-disbursement-orders HTTP/1.1
795 +Host: -
796 +Authorization: Bearer <Token>
797 +Content-Type: application/json
798 +
799 +{{/code}}
800 +
801 +{{code language="http" title="**Response**"}}
802 +HTTP/1.1 200 OK
803 +Content-Type: application/json
804 +
805 +{
806 + "items" :
807 + [
808 + {
809 + "@id" : "../ledger/v1/501/invoices/12345/active-disbursement-orders/456789",
810 + "amount" : 10,
811 + "norwegianBankAccount" : {
812 + "accountNo" : "1234"
813 + }
814 + },
815 + {
816 + "@id" : "../ledger/v1/501/invoices/12345/active-disbursement-orders/456788",
817 + "amount" : 10,
818 + "international" : {
819 + "iban" : "123456",
820 + "bic" : "SWED..."
821 + }
822 + },
823 + {
824 + "@id" : "../ledger/v1/501/invoices/12345/active-disbursement-orders/456787",
825 + "amount" : 10,
826 + "swedishBankAccount" : {
827 + "accountNo" : "123",
828 + "accountType" : "BKSE | PGSE | BGSE"
829 + }
830 + },
831 + {
832 + "@id" : "../ledger/v1/501/invoices/12345/active-disbursement-orders/456786",
833 + "amount" : 10,
834 + "swedishSus" : {
835 + "nationalIdentifier": {
836 + "regNo" : "YYYYMMDD-NNNN",
837 + "countryCode" : "SE"
838 + },
839 + "address" : {
840 + "addressee" : "Kalle Axelstopp",
841 + "streetAddress" : "Axelgatan 18",
842 + "coAddress" : null,
843 + "city" : "STOCKHOLM",
844 + "zipCode" : "16872",
845 + "countryCode" : "se"
846 + }
847 + }
848 + }
849 + ]
850 +}
851 +{{/code}}
852 +
853 +Create disbursement order towards a norwegian bank account
854 +
855 +{{code language="http" title="**Request**"}}
856 +POST /ledger/invoice/v1/XXX/invoices/NNN/active-disbursement-orders HTTP/1.1
857 +Host: -
858 +Authorization: Bearer <Token>
859 +Content-Type: application/json
860 +
861 +{
862 + "amount" : 10,
863 + "norwegianBankAccount" : {
864 + "accountNo" : "1234"
865 + }
866 +}
867 +{{/code}}
868 +
869 +Create disbursement order towards a international bank account (IBAN)
870 +
871 +{{code language="http" title="**Request**"}}
872 +POST /ledger/invoice/v1/XXX/invoices/NNN/active-disbursement-orders HTTP/1.1
873 +Host: -
874 +Authorization: Bearer <Token>
875 +Content-Type: application/json
876 +
877 +{
878 + "amount" : 10,
879 + "international" : {
880 + "iban" : "123456",
881 + "bic" : "SWED..."
882 + }
883 +}
884 +{{/code}}
885 +
886 +Create disbursement order towards a swedish bank account
887 +
888 +{{code language="http" title="**Request**"}}
889 +POST /ledger/invoice/v1/XXX/invoices/NNN/active-disbursement-orders HTTP/1.1
890 +Host: -
891 +Authorization: Bearer <Token>
892 +Content-Type: application/json
893 +
894 +{
895 + "swedishBankAccount" : {
896 + "accountNo" : "123",
897 + "accountType" : "BKSE | PGSE | BGSE"
898 + }
899 +}
900 +{{/code}}
901 +
902 +Create disbursement order using "Swedbanks lön- och utbetalningssystem (SUS)"
903 +
904 +{{code language="http" title="**Request**"}}
905 +POST /ledger/invoice/v1/XXX/invoices/NNN/active-disbursement-orders HTTP/1.1
906 +Host: -
907 +Authorization: Bearer <Token>
908 +Content-Type: application/json
909 +
910 +{
911 + "swedishSus" : {
912 + "nationalIdentifier": {
913 + "regNo" : "YYYYMMDD-NNNN",
914 + "countryCode" : "SE"
915 + },
916 + "address" : {
917 + "addressee" : "Kalle Axelstopp",
918 + "streetAddress" : "Axelgatan 18",
919 + "coAddress" : null,
920 + "city" : "STOCKHOLM",
921 + "zipCode" : "16872",
922 + "countryCode" : "se",
923 + }
924 + }
925 +}
926 +{{/code}}
927 +
928 +
929 +{{code language="http" title="**Response**"}}
930 +HTTP/1.1 201 CREATED
931 +Content-Type: application/json
932 +{{/code}}
933 +
934 +(% id="HActive-payment-ordersresourceproperties" %)
935 +==== Respite request properties ====
936 +
937 +(% class="table-bordered table-striped" %)
938 +|=Property|=Data type|=Required|=Description
939 +|amount|decimal|Yes|
940 +|__**norwegianBankAccount**__|object|No*|
941 +| accountNo|string|Yes|
942 +|__**swedishBankAccount**__|object|No*|
943 +| clearingNo|string|Yes|
944 +| accountNo|string|Yes|
945 +|__**international**__|object|No*|
946 +| iban|string|Yes|
947 +| bic|string|Yes|
948 +|__**swedishSus**__|object|No*|
949 +|**nationalIdentifier**|object|Yes|
950 +| regNo|string|Yes|
951 +| countryCode|string|Yes|
952 +|**address**|object|Yes|
953 +| addressee|string|Yes|
954 +| streetAddress|string|No|
955 +| coAddress|string|No|
956 +| city|string|Yes|
957 +| zipCode|string|Yes|
958 +| countryCode|string|Yes|
959 +| | | |
960 +
961 +//* One and only one of the specified objects can be set at each request//
962 +
963 +== Transfer-to-account ==
964 +
965 +operation transfer current capital debt on the invoice to a provided account. This will close the invoice.
966 +
967 +{{code language="http" title="**Request**"}}
968 +POST /ledger/invoice/v1/XXX/invoices/NNN/transfer-to-account HTTP/1.1
969 +Host: -
970 +Authorization: Bearer <Token>
971 +Content-Type: application/json
972 +
973 +{
974 + "accountNo" : "123",
975 +
976 +}
977 +
978 +{{/code}}
979 +
980 +(% id="HActive-payment-ordersresourceproperties" %)
981 +==== Transfer-to-account request properties ====
982 +
983 +(% class="table-bordered table-striped" %)
984 +|=Property|=Data type|=Required|=Description
985 +|accountNo|string|Yes|account number to the to transfer current capital debt into
986 +
987 +{{code language="http" title="**Response**"}}
988 +HTTP/1.1 204 NO CONTENT
989 +Content-Type: application/json
990 +
991 +{{/code}}
992 +
993 +== ==
994 +
995 +== Generate-invoice-portal-link ==
996 +
997 +Creates a new public available(no authorization needed) link to the targeted invoice. Creating new links does not affect old links.
998 +
999 +{{code language="http" title="**Request**"}}
1000 +POST /ledger/invoice/v1/XXX/invoices/NNN/generate-invoice-portal-link HTTP/1.1
1001 +Host: -
1002 +Authorization: Bearer <Token>
1003 +Content-Type: application/json
1004 +
1005 +{
1006 +}
1007 +
1008 +{{/code}}
1009 +
1010 +(% id="HActive-payment-ordersresourceproperties" %)
1011 +==== ====
1012 +
1013 +{{code language="http" title="**Response**"}}
1014 +HTTP/1.1 200 OK
1015 +Content-Type: application/json
1016 +
1017 +{
1018 + "invoicePortalLink": "https://public-invoice-example.com/sv/XXX?token=eyJhbGciOiJSUzI1Ni..."
1019 +}
1020 +{{/code}}
1021 +
1022 +{{display reference="developer:Main.Invoicing.ledger-api-general-docs.api-section-problems.WebHome"/}}
1023 +
1024 +=== Problem types ===
1025 +
1026 +(% class="box infomessage" %)
1027 +(((
1028 +Note, each problem typecode is preceded by "ledger/invoice/v1/problems/" in this API, e.g. the error "validation" in the table below will appear as typecode "ledger/invoice/v1/problems/validation".
1029 +)))
1030 +
1031 +(% class="table-bordered table-striped" %)
1032 +|=(% style="width: 537px;" %)Problem type (code)|=(% style="width: 172px;" %)Httpstatus|=(% style="width: 796px;" %)Description
1033 +|(% style="width:537px" %)forbidden|(% style="width:172px" %)403|(% style="width:796px" %)occurs if access to method is not allowed.
1034 +|(% style="width:537px" %)customer-not-found|(% style="width:172px" %)404|(% style="width:796px" %)can occur if customernumber is part of the querystring towards invoice resource
1035 +|(% style="width:537px" %)invoice-not-found|(% style="width:172px" %)404|(% style="width:796px" %)
1036 +|(% style="width:537px" %)missing-offer|(% style="width:172px" %)409|(% style="width:796px" %)Invoice is not a candidate for **transfer-to-account**. This has nothing to do with the provided Account
1037 +|(% style="width:537px" %)missing-account-for-billing-account|(% style="width:172px" %)409|(% style="width:796px" %)No account found on the provided AccountNo, can be expected on the us of **transfer-to-account** operation
1038 +|(% style="width:537px" %)not-acceptable-for-conversion|(% style="width:172px" %)409|(% style="width:796px" %)Invoice or account was not acceptable for transfer. This could be caused a number of parameters both on the invoice and the account.
1039 +|(% style="width:537px" %)credit-check-rejected|(% style="width:172px" %)422|(% style="width:796px" %)Score does not approve the conversion
1040 +|(% style="width:537px" %)customer-mismatch|(% style="width:172px" %)422|(% style="width:796px" %)Invoice and account is on separate customers in the **transfer-to-account** request
1041 +|(% style="width:537px" %) |(% style="width:172px" %) |(% style="width:796px" %)
1602850855982-540.png
Author
... ... @@ -1,0 +1,1 @@
1 +xwiki:XWiki.dap
Size
... ... @@ -1,0 +1,1 @@
1 +0 bytes
Content
1603272734121-573.png
Author
... ... @@ -1,0 +1,1 @@
1 +xwiki:XWiki.dap
Size
... ... @@ -1,0 +1,1 @@
1 +0 bytes
Content
1611132614793-633.png
Author
... ... @@ -1,0 +1,1 @@
1 +xwiki:XWiki.dap
Size
... ... @@ -1,0 +1,1 @@
1 +0 bytes
Content
1611132645651-800.png
Author
... ... @@ -1,0 +1,1 @@
1 +xwiki:XWiki.dap
Size
... ... @@ -1,0 +1,1 @@
1 +0 bytes
Content
1615145255456-449.png
Author
... ... @@ -1,0 +1,1 @@
1 +xwiki:XWiki.dap
Size
... ... @@ -1,0 +1,1 @@
1 +0 bytes
Content
1617094783353-392.png
Author
... ... @@ -1,0 +1,1 @@
1 +xwiki:XWiki.dap
Size
... ... @@ -1,0 +1,1 @@
1 +0 bytes
Content
1619519632632-939.png
Author
... ... @@ -1,0 +1,1 @@
1 +xwiki:XWiki.dap
Size
... ... @@ -1,0 +1,1 @@
1 +0 bytes
Content
1670584338716-116.png
Author
... ... @@ -1,0 +1,1 @@
1 +xwiki:XWiki.dap
Size
... ... @@ -1,0 +1,1 @@
1 +0 bytes
Content