Changes for page 4. Invoice

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