Changes for page 4. Invoice

Last modified by Simon Melin on 2024/03/11 15:56
From empty
To version 111.1
edited by David Persson
on 2021/08/20 12:53
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.dap
Default language
... ... @@ -1,0 +1,1 @@
1 +en
Tags
... ... @@ -1,0 +1,1 @@
1 +px-custom-page-content
Content
... ... @@ -1,0 +1,674 @@
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 bankaccount)
196 +* PKSE (swedish plusgiro)
197 +* BGSE (swedish bankgiro)
198 +* PGSE (swedish plusgiro OCR)
199 +)))
200 +| bankPayment.bic|string|(% style="width:117px" %)Maxlength: 11|Bank Identifier Code (BIC)
201 +| bankPayment.iban|string|(% style="width:117px" %)Maxlength: 34|International Bank Account Number (IBAN)
202 +| bankPayment.paymentReference|string|(% style="width:117px" %)Maxlength: 50|(((
203 +reference to specify on the payment
204 +)))
205 +|customer|string|(% style="width:117px" %)Uri|Uri to the customer resource related to the invoice
206 +|transactions|string|(% style="width:117px" %)Uri|List all transactions that has occured on the invoice
207 +|activePaymentOrders|string|(% style="width:117px" %)Uri|View scheduled payment orders
208 +|journal|string|(% style="width:117px" %)Uri|Lists events that has occured on the invoice
209 +|documents|string|(% style="width:117px" %)Uri|View the actual invoice document (and other related documents), how it has been distributed etc.
210 +
211 +(% id="HBills" %)
212 +== Documents ==
213 +
214 +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.
215 +
216 +
217 +(% id="HListallbillsofanaccount" %)
218 +==== List all documents of an invoice ====
219 +
220 +{{code language="http" title="**Request**"}}
221 +GET /ledger/invoice/v1/XXX/invoices/NNN/documents HTTP/1.1
222 +Host: -
223 +Authorization: Bearer <Token>
224 +Content-Type: application/json
225 +
226 +{{/code}}
227 +
228 +
229 +{{code language="http" title="**Response**"}}
230 +HTTP/1.1 200 OK
231 +Content-Type: application/json
232 +
233 +{
234 + "@id": "/ledger/invoice/v1/501/invoices/NNN/documents",
235 + "items" : [
236 + {
237 + "@id": "/ledger/invoice/v1/XXX/invoices/NNN/documents/invoice",
238 + "date": "2018-11-15T00:00:00",
239 + "type" : "invoice",
240 + "distributionMethod" : "NotDistributed|Postal|Kivra|EInvoice|EMail",
241 + "document": "/ledger/invoice/v1/XXX/invoices/NNN/documents/invoice/document"
242 + },
243 + {
244 + "@id": "/ledger/invoice/v1/XXX/invoices/NNN/documents/reminder",
245 + "date": "2018-11-15T00:00:00",
246 + "type" : "reminder",
247 + "distributionMethod" : "NotDistributed|Postal|Kivra|EInvoice|EMail",
248 + "document": "/ledger/invoice/v1/XXX/invoices/NNN/documents/reminder/document"
249 + }
250 + ]
251 +}
252 +{{/code}}
253 +
254 +(% id="H-1" %)
255 +==== ====
256 +
257 +(% id="HGetspecificbill" %)
258 +==== Get specific document ====
259 +
260 +{{code language="http" title="**Request**"}}
261 +GET /ledger/invoice/v1/XXX/invoices/NNN/documents/YYY HTTP/1.1
262 +Host: -
263 +Authorization: Bearer <Token>
264 +Content-Type: application/json
265 +
266 +{{/code}}
267 +
268 +
269 +{{code language="http" title="**Response**"}}
270 +HTTP/1.1 200 OK
271 +Content-Type: application/json
272 +
273 +{
274 + "@id": "/ledger/invoice/v1/XXX/invoices/NNN/documents/reminder",
275 + "date": "2018-11-15T00:00:00",
276 + "type" : "reminder",
277 + "distributionMethod" : "NotDistributed|Postal|Kivra|EInvoice|EMail",
278 + "document": "/ledger/invoice/v1/XXX/invoices/NNN/documents/letter-123645/document"
279 +}
280 +{{/code}}
281 +
282 +(% id="HBillresourceproperties" %)
283 +==== Document resource properties ====
284 +
285 +(% class="table-bordered table-striped" %)
286 +|=Property|=Data type|=Format|=Description
287 +|@id|string|Uri|
288 +|date|date|[[ISO 8601>>url:http://en.wikipedia.org/wiki/ISO_8601||rel="noreferrer" title="ISO8601 on Wikipedia"]]|Date when the document was created
289 +|type|string| |(((
290 +Currently available types of document
291 +
292 +* **Invoice **- the actual invoice
293 +* **Reminder **- reminder of the invoice
294 +* **RestReminder **- reminder of rest amounts
295 +* **Collection **- Collection claim of the invoice
296 +* **CreditInvoice**
297 +)))
298 +|distributionMethod|string| |(((
299 +* **NotDistributed **- the letter has been created but not distributed
300 +* **Postal **- Distributed through usual post
301 +* **Kivra **- Digitally distributed through Kivra
302 +* **EInvoice **- Digitally distributed through EInvoice
303 +* **EMail **- Digitally distributed through email
304 +)))
305 +|document|string|Uri|Uri to download the actual document, usually pdf (content type in response).
306 +
307 +== Transactions ==
308 +
309 +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.
310 +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.
311 +
312 +
313 +(% id="HListallbillsofanaccount" %)
314 +==== List all transactions that has occured on an invoice ====
315 +
316 +
317 +{{code language="http" title="**Request**"}}
318 +GET /ledger/invoice/v1/XXX/invoices/NNN/transactions HTTP/1.1
319 +Host: -
320 +Authorization: Bearer <Token>
321 +Content-Type: application/json
322 +
323 +{{/code}}
324 +
325 +
326 +{{code language="http" title="**Response**"}}
327 +HTTP/1.1 200 OK
328 +Content-Type: application/json
329 +
330 +{
331 + "@id": "/ledger/invoice/v1/501/invoices/NNN/transactions",
332 + "items" : [
333 + {
334 + "type": "disbursement",
335 + "typeName": "Utbetalningsuppdrag skapat",
336 + "reference": "",
337 + "amount": 50.00,
338 + "date": "2019-11-09T00:00:00"
339 + },
340 + {
341 + "type": "payment",
342 + "typeName": "Betalning",
343 + "reference": "",
344 + "amount": -100.00,
345 + "date": "2019-11-09T00:00:00"
346 + },
347 + {
348 + "type": "credit",
349 + "typeName": "Kreditering",
350 + "reference": "",
351 + "amount": -100.00,
352 + "date": "2019-11-02T00:00:00",
353 + "cause" : {
354 + "type": "bankruptcy",
355 + "typeName": "Konkurs"
356 + }
357 + },
358 + {
359 + "type": "credit",
360 + "typeName": "Kreditering",
361 + "reference": "korrigering dröjsmålsränta",
362 + "amount": -00.85,
363 + "date": "2019-11-02T00:00:00",
364 + "cause" : {
365 + "type": "remission",
366 + "typeName": "Efterskänkes"
367 + }
368 + },
369 + {
370 + "type": "credit",
371 + "typeName": "Kreditering",
372 + "reference": "reglering mot kreditfaktura NNN",
373 + "amount": -100.00,
374 + "date": "2019-11-02T00:00:00",
375 + },
376 + {
377 + "type": "collectionFee",
378 + "typeName": "Inkassoavgift",
379 + "reference": "",
380 + "amount": 180.00,
381 + "date": "2019-11-02T00:00:00",
382 + },
383 + {
384 + "type": "reminderFee",
385 + "typeName": "PÃ¥minnelseavgift",
386 + "reference": "",
387 + "amount": 30.00,
388 + "date": "2019-11-02T00:00:00",
389 + },
390 + {
391 + "type": "interest",
392 + "typeName": "ränta",
393 + "reference": "",
394 + "amount": 2.00,
395 + "date": "2019-11-02T00:00:00",
396 + },
397 + {
398 + "type": "invoice",
399 + "typeName": "Faktura",
400 + "reference": "butiksnamn, Orderref. 345",
401 + "amount": 200.00,
402 + "date": "2020-10-09T00:00:00"
403 + }
404 + ]
405 +}
406 +{{/code}}
407 +
408 +(% id="H-1" %)
409 +==== ====
410 +
411 +(% id="HGetspecificbill" %)
412 +==== Transaction resource properties ====
413 +
414 +(% class="table-bordered table-striped" %)
415 +|=(% style="width: 405px;" %)Property|=(% style="width: 129px;" %)Data type|=(% style="width: 1236px;" %)Description
416 +|(% style="width:405px" %)@id|(% style="width:129px" %)string|(% style="width:1236px" %)
417 +|(% style="width:405px" %)type|(% style="width:129px" %)string|(% style="width:1236px" %)Type of transaction
418 +|(% style="width:405px" %)typeName|(% style="width:129px" %)string|(% style="width:1236px" %)(((
419 +The type of transaction in form of a readable translated text (the local language of the current company)
420 +
421 +The following types can occur on a invoice
422 +
423 +* Invoice //(the transaction that is the basis for the invoice)//
424 +* CreditInvoice// (the transaction that is the basis for the credit invoice)//
425 +* Credit// (credited amount)//
426 +* Interest
427 +* Payment
428 +* Disbursement //(If, for example, a surplus occur on the invoice, it can be paid out)//
429 +* DisbursementReturned //(amount that failed to be paid out for any reason is returned on the invoice)//
430 +* InvoiceFee
431 +* ReminderFee
432 +* CollectionFee
433 +)))
434 +|(% style="width:405px" %)reference|(% style="width:129px" %)string|(% style="width:1236px" %)Transaction reference
435 +|(% style="width:405px" %)amount|(% style="width:129px" %)decimal|(% style="width:1236px" %)Amount ot the transaction
436 +|(% style="width:405px" %)date|(% style="width:129px" %)date|(% style="width:1236px" %)Date when the transaction occured
437 +|(% 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
438 +|(% style="width:405px" %) cause.type|(% style="width:129px" %)string|(% style="width:1236px" %)Type of cause to why the transaction has occured
439 +|(% 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)
440 +
441 +== Active payment orders ==
442 +
443 +This resource corresponds to an active / scheduled payment order placed against the specific account, the end-customer will be debited at the given executeDate.
444 +
445 +(% id="HGetactivepaymentordersforanaccount" %)
446 +====
447 +Get active payment orders for an account ====
448 +
449 +
450 +{{code language="http" title="**Request**"}}
451 +GET /ledger/invoice/v1/XXX/invoices/NNN/active-payment-orders/ HTTP/1.1
452 +Host: -
453 +Authorization: Bearer <Token>
454 +Content-Type: application/json
455 +{{/code}}
456 +
457 +
458 +{{code language="http" title="**Response**"}}
459 +HTTP/1.1 200 OK
460 +Content-Type: application/json
461 +
462 +{
463 + "operations": null,
464 + "items": [
465 + {
466 + "paymentMethod": "autogiro",
467 + "executeDate": "2020-02-15",
468 + "amount": 200.00
469 + }
470 + ]
471 +}
472 +{{/code}}
473 +
474 +(% id="H-2" %)
475 +==== ====
476 +
477 +(% id="HActive-payment-ordersresourceproperties" %)
478 +==== Active-payment-orders resource properties ====
479 +
480 +(% class="table-bordered table-striped" %)
481 +|=Property|=Data type|=Description
482 +|paymentMethod|string|paymentMethods:(((
483 +* autogiro
484 +)))
485 +|executeDate|Date|(((
486 +The date when the customers bankaccount will be charged
487 +)))
488 +|amount|decimal|The amount that will be withdrawn from the bankaccount
489 +
490 +== Journal ==
491 +
492 +This resource lists all events that has occured on the invoice, in a sorted timeline.
493 +
494 +(% id="HGetactivepaymentordersforanaccount" %)
495 +====
496 +Get journal entries for the invoice ====
497 +
498 +
499 +{{code language="http" title="**Request**"}}
500 +GET /ledger/invoice/v1/XXX/invoices/NNN/journal/ HTTP/1.1
501 +Host: -
502 +Authorization: Bearer <Token>
503 +Content-Type: application/json
504 +{{/code}}
505 +
506 +
507 +{{code language="http" title="**Response**"}}
508 +HTTP/1.1 200 OK
509 +Content-Type: application/json
510 +
511 +{
512 + "operations": null,
513 + "items": [
514 + {
515 + "type": "ComplaintReceived",
516 + "date" : "2020-09-01T00:00:00",
517 + "description" : ""
518 + },
519 + {
520 + "type": "SecondReminderSent",
521 + "date" : "2020-09-01T00:00:00",
522 + "description" : ""
523 + },
524 + {
525 + "type": "ReminderSent",
526 + "date" : "2020-09-01T00:00:00",
527 + "description" : ""
528 + }
529 + ],
530 + "view": {
531 + "@id": "/ledger/invoice/v1/XXX/invoices/NNN/journal?$top=2&$skip=0",
532 + "next": "/ledger/invoice/v1/XXX/invoices/NNN/journal?$top=2&$skip=2"
533 + }
534 +}
535 +{{/code}}
536 +
537 +(% id="H-2" %)
538 +==== ====
539 +
540 +(% id="HActive-payment-ordersresourceproperties" %)
541 +==== Journal resource properties ====
542 +
543 +(% class="table-bordered table-striped" %)
544 +|=Property|=Data type|=Description
545 +|type|string|type:(((
546 +* **ReminderSent **//(an invoice reminder has been sent to the customer)//
547 +* **SecondReminderSent **//(a second invoice reminder has been sent to the customer)//
548 +* **CollectionClaimSent **//(a collection claim has been sent to the customer)//
549 +* **RestReminderSent **//(a reminder including only interest and fees has been sent to the customer)//
550 +* **DebtCollection **//(the invoice has been transferred to collection)//
551 +* **Respite// //**//(the claim is stopped for further claimprocess steps until valid to data of respite or respite is removed)//
552 +* **RespiteRemoved** //(respite has been removed fro claim)//
553 +* **Stop// //**//(the claim is stopped for further claim process steps until stop is removed)//
554 +* **StopRemoved **//(stop has been removed from claim)//
555 +* **ComplaintReceived// //**//(complaint has been registered)//
556 +* **ComplaintResolved **//(complaint has been resolved)//
557 +* **InvoiceClosed **//(status of the invoice in the accounts receivable has been set to closed)//
558 +* **PaymentOrderFailed **//(scheduled paymentorder failed to be executed)//
559 +)))
560 +|date|Date|(((
561 +The date when the journal entry occured
562 +)))
563 +|description|string|detailed description of the entry (if available)
564 +
565 +== Register direct payment ==
566 +
567 +operation for registration of direct payments against invoices
568 +
569 +{{code language="http" title="**Request**"}}
570 +POST /ledger/invoice/v1/XXX/invoices/NNN/register-direct-payment HTTP/1.1
571 +Host: -
572 +Authorization: Bearer <Token>
573 +Content-Type: application/json
574 +
575 +{
576 + "amount" : 100.00,
577 + "paymentDate" : "2021-04-27",
578 + "cause" : "psp"
579 +}
580 +{{/code}}
581 +
582 +(% id="HActive-payment-ordersresourceproperties" %)
583 +==== Register-direct-payment request properties ====
584 +
585 +(% class="table-bordered table-striped" %)
586 +|=Property|=Data type|=Required|=Description
587 +|amount|decimal|Yes|The amount of the direct payment
588 +|paymentDate|Date|Yes|(((
589 +The date when the payment was made
590 +)))
591 +|cause|string|No|(((
592 +* psp
593 +)))
594 +
595 +{{code language="http" title="**Response**"}}
596 +HTTP/1.1 204 NO CONTENT
597 +Content-Type: application/json
598 +
599 +{{/code}}
600 +
601 +== Settle-credit-invoice ==
602 +
603 +operation to settle an existing credit invoice towards debit invoice. This operation is only be available/valid on credit-invoices
604 +
605 +{{code language="http" title="**Request**"}}
606 +POST /ledger/invoice/v1/XXX/invoices/NNN/settle-credit-invoice HTTP/1.1
607 +Host: -
608 +Authorization: Bearer <Token>
609 +Content-Type: application/json
610 +
611 +{
612 + "debitInvoiceNo": "12345",
613 + "creditAmount": 250.00,
614 + "sendCopy": false
615 +}
616 +{{/code}}
617 +
618 +(% id="HActive-payment-ordersresourceproperties" %)
619 +==== Settle-credit-invoice request properties ====
620 +
621 +(% class="table-bordered table-striped" %)
622 +|=Property|=Data type|=Required|=Description
623 +|debitInvoiceNo|string|Yes|invoice number of the debit invoice that the credit invoice is to be settled against
624 +|creditAmount|decimal|Yes|(((
625 +Amount of he credit invoice to use
626 +)))
627 +|sendCopy|bool|No|Whether a new copy should be distributed to the end-customer with updated balances (after settlement has been executed)
628 +Default false
629 +
630 +{{code language="http" title="**Response**"}}
631 +HTTP/1.1 204 NO CONTENT
632 +Content-Type: application/json
633 +
634 +{{/code}}
635 +
636 +== Problems ==
637 +
638 +All errors from the api are returned in the form of "problems" (response body), except for the http status code itself.
639 +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.
640 +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.
641 +
642 +Problems of type validation does contain an additional list ("Problems") that describes exactly which parameter that failed the validation
643 +
644 +=== Example ===
645 +
646 +{{code language="http" title="**Response**"}}
647 +HTTP/1.1 400 Error
648 +Content-Type: application/problem+json
649 +
650 +{
651 + "Type" : "ledger.invoice.validation",
652 + "Title" : "A validation error occurred",
653 + "Status" : 400,
654 + "Instance" : "215d4206-ca35-4f43-85ad-169c8f6d4ec1",
655 + "Detail" : "A validation error occurred. Please fix the problems mentioned in the 'problems' property below.",
656 + "Problems" : [
657 + {
658 + "amount" : "Expected value between [0,01]-[79228162514264337593543950335] actual [0]"
659 + }
660 + ]
661 +}
662 +{{/code}}
663 +
664 +=== Problem types ===
665 +
666 +(% class="box infomessage" %)
667 +(((
668 +Note, each problem typecode is preceded by "ledger.invoice." in this API, e.g. the error "validation" in the table below will appear as typecode "ledger.invoice.validation".
669 +)))
670 +
671 +(% class="table-bordered table-striped" %)
672 +|=(% style="width: 537px;" %)Problem type (code)|=(% style="width: 172px;" %)Httpstatus|=(% style="width: 796px;" %)Description
673 +|(% 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
674 +|(% style="width:537px" %)invoice-not-found|(% style="width:172px" %)404|(% 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