Changes for page 4. Invoice
Last modified by dap on 2024/04/08 12:45
From empty
To version 127.1
edited by dap
on 2022/05/18 11:29
on 2022/05/18 11:29
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.dap - Default language
-
... ... @@ -1,0 +1,1 @@ 1 +en - Tags
-
... ... @@ -1,0 +1,1 @@ 1 +px-custom-page-content - Content
-
... ... @@ -1,0 +1,996 @@ 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 +} 692 +{{/code}} 693 + 694 +(% id="HActive-payment-ordersresourceproperties" %) 695 +==== Write-down request properties ==== 696 + 697 +(% class="table-bordered table-striped" %) 698 +|=Property|=Data type|=Required|=Description 699 +|balanceType|string|Yes|((( 700 +The balanceType to be affected 701 + 702 +* Capital 703 +* ReminderFee 704 +* PenaltyInterest 705 +* CollectionFee 706 +))) 707 +|amount|decimal|Yes|The amount of the specified balace type to write-down 708 +|cause|string|Yes|((( 709 +The cause of the write-down 710 + 711 +* Bankruptcy 712 +* Settlement 713 +* Deceased 714 +* Fraud 715 +* Dispute 716 +* Unknown 717 + 718 +If field is null, Then defaults to "Unknown". Case-Sensitive 719 +))) 720 +|{{{invoiceCurrentDebt}}}|decimal|Yes|The amount must match the current debt (excl. Calculated interest) on the invoice. 721 + 722 +{{code language="http" title="**Response**"}} 723 +HTTP/1.1 204 NO CONTENT 724 +Content-Type: application/json 725 + 726 +{{/code}} 727 + 728 +== Respite == 729 + 730 +Resource to create or view respite 731 + 732 +Get respite 733 + 734 +{{code language="http" title="**Request**"}} 735 +GET /ledger/invoice/v1/XXX/invoices/NNN/respite HTTP/1.1 736 +Host: - 737 +Authorization: Bearer <Token> 738 +Content-Type: application/json 739 + 740 +{{/code}} 741 + 742 +{{code language="http" title="**Response**"}} 743 +HTTP/1.1 200 OK 744 +Content-Type: application/json 745 + 746 +{ 747 + "validToDate": "2021-08-01", 748 + "reason": "..." 749 +} 750 +{{/code}} 751 + 752 +Create respite 753 + 754 +{{code language="http" title="**Request**"}} 755 +POST /ledger/invoice/v1/XXX/invoices/NNN/respite HTTP/1.1 756 +Host: - 757 +Authorization: Bearer <Token> 758 +Content-Type: application/json 759 + 760 +{ 761 + "validToDate": "2021-08-01", 762 + "reason": "..." 763 +} 764 +{{/code}} 765 + 766 +{{code language="http" title="**Response**"}} 767 +HTTP/1.1 201 CREATED 768 +Content-Type: application/json 769 +{{/code}} 770 + 771 +(% id="HActive-payment-ordersresourceproperties" %) 772 +==== Respite request properties ==== 773 + 774 +(% class="table-bordered table-striped" %) 775 +|=Property|=Data type|=Required|=Description 776 +|validToDate|Date|Yes|Respite is valid to this date 777 +|reason|string|Yes|Reason for why the respite was created. 778 + 779 +== Active-disbursement-orders == 780 + 781 +View or create disbursement orders, only available for credit-invoices 782 + 783 +Get active-disbursement-orders 784 + 785 +{{code language="http" title="**Request**"}} 786 +GET /ledger/invoice/v1/XXX/invoices/NNN/active-disbursement-orders HTTP/1.1 787 +Host: - 788 +Authorization: Bearer <Token> 789 +Content-Type: application/json 790 + 791 +{{/code}} 792 + 793 +{{code language="http" title="**Response**"}} 794 +HTTP/1.1 200 OK 795 +Content-Type: application/json 796 + 797 +{ 798 + "items" : 799 + [ 800 + { 801 + "@id" : "../ledger/v1/501/invoices/12345/active-disbursement-orders/456789", 802 + "amount" : 10, 803 + "norwegianBankAccount" : { 804 + "accountNo" : "1234" 805 + } 806 + }, 807 + { 808 + "@id" : "../ledger/v1/501/invoices/12345/active-disbursement-orders/456788", 809 + "amount" : 10, 810 + "international" : { 811 + "iban" : "123456", 812 + "bic" : "SWED..." 813 + } 814 + }, 815 + { 816 + "@id" : "../ledger/v1/501/invoices/12345/active-disbursement-orders/456787", 817 + "amount" : 10, 818 + "swedishBankAccount" : { 819 + "accountNo" : "123", 820 + "accountType" : "BKSE | PGSE | BGSE" 821 + } 822 + }, 823 + { 824 + "@id" : "../ledger/v1/501/invoices/12345/active-disbursement-orders/456786", 825 + "amount" : 10, 826 + "swedishSus" : { 827 + "nationalIdentifier": { 828 + "regNo" : "YYYYMMDD-NNNN", 829 + "countryCode" : "SE" 830 + }, 831 + "address" : { 832 + "addressee" : "Kalle Axelstopp", 833 + "streetAddress" : "Axelgatan 18", 834 + "coAddress" : null, 835 + "city" : "STOCKHOLM", 836 + "zipCode" : "16872", 837 + "countryCode" : "se" 838 + } 839 + } 840 + } 841 + ] 842 +} 843 +{{/code}} 844 + 845 +Create disbursement order towards a norwegian bank account 846 + 847 +{{code language="http" title="**Request**"}} 848 +POST /ledger/invoice/v1/XXX/invoices/NNN/active-disbursement-orders HTTP/1.1 849 +Host: - 850 +Authorization: Bearer <Token> 851 +Content-Type: application/json 852 + 853 +{ 854 + "amount" : 10, 855 + "norwegianBankAccount" : { 856 + "accountNo" : "1234" 857 + } 858 +} 859 +{{/code}} 860 + 861 +Create disbursement order towards a international bank account (IBAN) 862 + 863 +{{code language="http" title="**Request**"}} 864 +POST /ledger/invoice/v1/XXX/invoices/NNN/active-disbursement-orders HTTP/1.1 865 +Host: - 866 +Authorization: Bearer <Token> 867 +Content-Type: application/json 868 + 869 +{ 870 + "amount" : 10, 871 + "international" : { 872 + "iban" : "123456", 873 + "bic" : "SWED..." 874 + } 875 +} 876 +{{/code}} 877 + 878 +Create disbursement order towards a swedish bank account 879 + 880 +{{code language="http" title="**Request**"}} 881 +POST /ledger/invoice/v1/XXX/invoices/NNN/active-disbursement-orders HTTP/1.1 882 +Host: - 883 +Authorization: Bearer <Token> 884 +Content-Type: application/json 885 + 886 +{ 887 + "swedishBankAccount" : { 888 + "accountNo" : "123", 889 + "accountType" : "BKSE | PGSE | BGSE" 890 + } 891 +} 892 +{{/code}} 893 + 894 +Create disbursement order using "Swedbanks lön- och utbetalningssystem (SUS)" 895 + 896 +{{code language="http" title="**Request**"}} 897 +POST /ledger/invoice/v1/XXX/invoices/NNN/active-disbursement-orders HTTP/1.1 898 +Host: - 899 +Authorization: Bearer <Token> 900 +Content-Type: application/json 901 + 902 +{ 903 + "swedishSus" : { 904 + "nationalIdentifier": { 905 + "regNo" : "YYYYMMDD-NNNN", 906 + "countryCode" : "SE" 907 + }, 908 + "address" : { 909 + "addressee" : "Kalle Axelstopp", 910 + "streetAddress" : "Axelgatan 18", 911 + "coAddress" : null, 912 + "city" : "STOCKHOLM", 913 + "zipCode" : "16872", 914 + "countryCode" : "se", 915 + } 916 + } 917 +} 918 +{{/code}} 919 + 920 + 921 +{{code language="http" title="**Response**"}} 922 +HTTP/1.1 201 CREATED 923 +Content-Type: application/json 924 +{{/code}} 925 + 926 +(% id="HActive-payment-ordersresourceproperties" %) 927 +==== Respite request properties ==== 928 + 929 +(% class="table-bordered table-striped" %) 930 +|=Property|=Data type|=Required|=Description 931 +|amount|decimal|Yes| 932 +|__**norwegianBankAccount**__|object|No*| 933 +| accountNo|string|Yes| 934 +|__**swedishBankAccount**__|object|No*| 935 +| clearingNo|string|Yes| 936 +| accountNo|string|Yes| 937 +|__**international**__|object|No*| 938 +| iban|string|Yes| 939 +| bic|string|Yes| 940 +|__**swedishSus**__|object|No*| 941 +|**nationalIdentifier**|object|Yes| 942 +| regNo|string|Yes| 943 +| countryCode|string|Yes| 944 +|**address**|object|Yes| 945 +| addressee|string|Yes| 946 +| streetAddress|string|No| 947 +| coAddress|string|No| 948 +| city|string|Yes| 949 +| zipCode|string|Yes| 950 +| countryCode|string|Yes| 951 +| | | | 952 + 953 +//* One and only one of the specified objects can be set at each request// 954 + 955 + 956 + 957 +(% id="HActivepaymentorder" %) 958 +== Problems == 959 + 960 +All errors from the api are returned in the form of "problems" (response body), except for the http status code itself. 961 +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. 962 +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. 963 + 964 +Problems of type validation does contain an additional list ("Problems") that describes exactly which parameter that failed the validation 965 + 966 +=== Example === 967 + 968 +{{code language="http" title="**Response**"}} 969 +HTTP/1.1 400 Error 970 +Content-Type: application/problem+json 971 + 972 +{ 973 + "Type" : "ledger/invoice/v1/problems/validation", 974 + "Title" : "A validation error occurred", 975 + "Status" : 400, 976 + "Instance" : "215d4206-ca35-4f43-85ad-169c8f6d4ec1", 977 + "Detail" : "A validation error occurred. Please fix the problems mentioned in the 'problems' property below.", 978 + "Problems" : [ 979 + { 980 + "amount" : "Expected value between [0,01]-[79228162514264337593543950335] actual [0]" 981 + } 982 + ] 983 +} 984 +{{/code}} 985 + 986 +=== Problem types === 987 + 988 +(% class="box infomessage" %) 989 +((( 990 +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". 991 +))) 992 + 993 +(% class="table-bordered table-striped" %) 994 +|=(% style="width: 537px;" %)Problem type (code)|=(% style="width: 172px;" %)Httpstatus|=(% style="width: 796px;" %)Description 995 +|(% 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 996 +|(% 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