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