Wiki source code of 4. Invoice

Last modified by Rasmus Enekvist on 2026/02/27 09:27
Hide last authors
David Persson 5.1 1 (% class="jumbotron" %)
2 (((
3 (% class="container" %)
4 (((
David Persson 9.1 5 Integrate to **PayEx Invoice API **
David Persson 5.1 6 )))
7 )))
8
9 (% id="HRoutesegments" %)
10 == Introduction ==
11
12 (% class="lead" %)
David Persson 57.2 13 This api is used to retrieve information related to the customer's invoices.
David Persson 5.1 14
David Persson 143.1 15 [[image:1670584338716-116.png||height="815" width="406"]]
David Persson 5.1 16
17
David Persson 106.1 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
David Persson 5.1 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.
David Persson 166.1 23 //lf-api.payex.com/ledger/**{Subdomain}**/v1/**{LedgerNumber}**/resource1/**{resource1Id}**/resource2/**{resource2Id}**/resource3/**{resource3Id}**//
David Persson 5.1 24
25 (% class="table-bordered table-striped" %)
26 |=(% style="width: 604px;" %)Route segment|=(% style="width: 2790px;" %)Description
David Persson 74.1 27 |(% style="width:604px" %)Subdomain|(% style="width:2790px" %)In this part of the API it will be invoice
David Persson 5.1 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" %)
David Persson 73.1 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)
David Persson 5.1 41
David Persson 173.1 42 == Implementation Guidelines ==
43
44 To ensure optimal experience for end users, it is essential to follow these usage guidelines:
45
David Persson 185.1 46 * **Fetch only the invoice list initially: **Your initial API call for a customer should retrieve only the [[invoice list>>doc:||anchor="HInvoicelist"]], which provides sufficient information to display an overview of each customer’s invoices, both open and closed invoices.
David Persson 184.1 47 * **Request detailed invoice information only when necessary:** Make requests for individual [[invoice details>>doc:||anchor="HGetspecificinvoice"]] only when the end user explicitly chooses to view details for a specific invoice. Alternatively, if needed, you may limit the initial requests for a customer to retrieve the invoice list, including requests for details of only the open invoices, which typically amount to only 1-2
48 * **Use hypermedia-driven navigation:** The Invoice API is hypermedia-driven, meaning each resource links to relevant sub-resources and operations. Rather than preloading data from multiple levels, design your GUI to allow users to click through and access additional details as needed. This approach mirrors the API’s intended structure and minimizes unnecessary API calls.
David Persson 176.2 49 * **Avoid frequent polling:** The API is not designed for regular polling of accounts receivable events (e.g., periodically checking the status of all invoices across all customers to see if any have been paid). Automated status checks, such as hourly polling, are unsupported and will degrade performance
David Persson 173.1 50
51 These guidelines apply to both front-end applications, such as web portals, and backend processes using the API. It is crucial to incorporate these requirements into your design to prevent excessive API calls and ensure a high-quality user experience.
52
David Persson 174.1 53 (% class="box infomessage" %)
54 (((
David Persson 178.1 55 //If you have specific requirements that may deviate from these guidelines, please contact us to discuss potential options that could meet your needs.//
David Persson 174.1 56 )))
David Persson 173.1 57
David Persson 5.2 58 == Invoice ==
David Persson 5.1 59
David Persson 56.2 60 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.
David Persson 5.1 61
62
David Persson 74.2 63 ==== Get specific invoice ====
David Persson 5.1 64
Anders Göthberg 186.1 65 ==== ====
David Persson 5.1 66
David Persson 51.1 67 {{code language="http" title="**Request**"}}
David Persson 52.1 68 GET /ledger/invoice/v1/XXX/invoices/NNN HTTP/1.1
69 Host: -
70 Authorization: Bearer <Token>
71 Content-Type: application/json
David Persson 51.1 72 {{/code}}
David Persson 5.1 73
74
David Persson 51.1 75 {{code language="http" title="**Response**"}}
David Persson 52.1 76 HTTP/1.1 200 OK
77 Content-Type: application/json
78
79 {
80 "@id" : "/ledger/invoice/v1/XXX/invoices/12345",
David Persson 89.3 81 "created" : "2019-05-06T00:00:00",
David Persson 52.1 82 "invoiceNo" : "12345",
83 "externalInvoiceId" : "987654321",
84 "status" : "pending|open|closed",
85 "claimLevel" : "Invoice|RestReminder|Reminder|SecondReminder|CollectionClaim|DebtCollection",
David Persson 99.1 86 "currentDebt" : 463.42,
David Persson 52.1 87 "originalAmount" : 354.10,
88 "currency" : "sek",
David Persson 89.3 89 "invoiceDate" : "2018-10-01T00:00:00",
90 "dueDate" : "2018-10-01T00:00:00",
David Persson 52.1 91 "seller" : {
92 "name" : "testshop",
93 "number" : "12345"
94 },
95 "debt" : {
96 "capital" : 354.10,
97 "remiderFee" : 20.00,
David Persson 99.1 98 "collectionFee" : 80.00,
99 "penaltyInterest" : 8.00,
100 "calculatedPenaltyInterest" : 1.32
David Persson 52.1 101 },
102 "penaltyInterestRate": 15.00,
David Persson 116.1 103 "bankPayment": {
David Persson 52.1 104 "bankAccountNo": "123",
105 "bankAccountType": "BGSE",
106 "bic": "123456",
107 "iban": "SE12345678945631",
108 "paymentReference": "54867165675646"
109 },
110 "customer" : "/ledger/customer/v1/customers/XYZABC",
111 "transactions" : "/ledger/invoice/v1/XXX/invoices/12345/transactions",
David Persson 90.1 112 "activePaymentOrders": "/ledger/invoice/v1/XXX/invoices/NNN/active-payment-orders",
David Persson 52.1 113 "journal" : "/ledger/invoice/v1/XXX/invoices/12345/journal",
David Persson 90.1 114 "documents": "/ledger/invoice/v1/XXX/invoices/NNN/documents",
Mats Lyth 137.1 115 "operations": [
Frida Åberg-Mattsson 149.1 116 {
Frida Åberg-Mattsson 148.1 117 "rel": "generate-invoice-portal-link",
118 "method": "POST",
119 "href": "/ledger/invoice/v1/XXX/invoices/NNN/generate-invoice-portal-link"
120 },
Mats Lyth 137.1 121 {
122 "rel": "transfer-to-account",
123 "method": "POST",
124 "href": "/ledger/invoice/v1/XXX/invoices/NNN/transfer-to-account"
125 }
126 ],
David Persson 52.1 127 }
David Persson 51.1 128 {{/code}}
David Persson 5.1 129
David Persson 176.1 130 ==== Invoice list ====
David Persson 74.1 131
David Persson 176.1 132 The **List Resource** offers an overview of each invoice on a specified customer with key details like InvoiceNo, status, amount, and due date. While it provides less information than a detailed invoice request, it includes the most important attributes for display purposes. Use this resource to minimize API calls and fetch detailed data only when needed.
133
David Persson 74.2 134 Use the querystring parameter "customerNo" to list invoices for a specific customer.
David Persson 5.1 135
David Persson 74.2 136
David Persson 74.1 137 {{code language="http" title="**Request**"}}
David Persson 74.2 138 GET /ledger/invoice/v1/XXX/invoices?customerNo=XYZABC HTTP/1.1
David Persson 74.1 139 Host: -
140 Authorization: Bearer <Token>
141 Content-Type: application/json
142 {{/code}}
143
144
145 {{code language="http" title="**Response**"}}
146 HTTP/1.1 200 OK
147 Content-Type: application/json
148
David Persson 74.2 149 {
150 "items": [
151 {
152 "@id" : "/ledger/invoice/v1/XXX/invoices/12345",
153 "invoiceNo" : "12345",
154 "status" : "pending",
155 "claimLevel" : "Invoice",
156 "originalAmount" : 354.10,
David Persson 168.1 157 "currency" : "sek",
158 "invoiceDate" : "2021-09-15T00:00:00",
159 "dueDate" : "2021-10-01T00:00:00",
160 "customerNo" : "XYZABC"
161 },
162 {
163 "@id" : "/ledger/invoice/v1/XXX/invoices/987654",
164 "invoiceNo" : "987654",
165 "status" : "open",
166 "claimLevel" : "Invoice",
167 "originalAmount" : 122.00,
168 "currency" : "sek",
169 "invoiceDate" : "2021-09-15T00:00:00",
170 "dueDate" : "2020-10-01T00:00:00",
171 "customerNo" : "XYZABC"
172 },
173 {
174 "@id" : "/ledger/invoice/v1/XXX/invoices/456321",
175 "invoiceNo" : "456321",
176 "status" : "closed",
177 "claimLevel" : "Invoice",
178 "originalAmount" : 846.50,
179 "currency" : "sek",
180 "invoiceDate" : "2021-09-15T00:00:00",
181 "dueDate" : "2020-08-01T00:00:00",
182 "customerNo" : "XYZABC"
183 }
184 ]
185 }
186 {{/code}}
187
David Persson 9.2 188 (% id="HAccountresourceproperties" %)
189 ==== Invoice resource properties ====
190
David Persson 159.1 191
David Persson 12.1 192 (% class="table-bordered table-striped" %)
David Persson 55.1 193 |=Property|=Data type|=(% style="width: 117px;" %)Format|=Description
194 |@id |string|(% style="width:117px" %)Maxlength: |Uri of the specific account
David Persson 59.1 195 |created|date|(% style="width:117px" %) |Date when the invoice was created in the system
David Persson 55.1 196 |invoiceNo|string|(% style="width:117px" %)Maxlength: 50|The identifier of the account
197 |externalInvoiceId|string|(% style="width:117px" %)Maxlength: 50|External identifier of the invoice
198 |status|string|(% style="width:117px" %)Maxlength: 25|Status of the invoice(((
David Persson 9.4 199 * **Pending**: the invoice has not been created yet, awaiting transactions
David Persson 9.5 200 * **Open**: the invoice is open and active
201 * **Closed**: the invoice has been closed
David Persson 9.2 202 )))
David Persson 56.2 203 |claimLevel|string|Maxlength: 25|Current claim level of the invoice.(((
David Persson 59.1 204 * **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)
205 * **RestReminder:** Reminder to pay remaining fees of the invoice (all capital has been payed) has been created/sent
206 * **Reminder:** First reminder to pay invoice that has been past due date has been creted/sent
207 * **SecondReminder:** Second reminder to pay invoice has been created/sent
208 * **CollectionClaim:** Debt collection claim has been created/sent to the customer
209 * **DebtCollection:** The invoice has been exported to other system for further handling of collection claims
David Persson 9.5 210 )))
David Persson 55.1 211 |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**)
David Persson 93.3 212 |originalAmount|decimal|(% style="width:117px" %) |The original debt amount stated on the invoice.
David Persson 168.1 213 |currency|string|(% style="width:117px" %)[[ISO 4217>>https://sv.wikipedia.org/wiki/ISO_4217]]|Currency of the invoice
David Persson 59.1 214 |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)
David Persson 93.2 215 |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
David Persson 55.1 216 |seller.name|string|(% style="width:117px" %) |Name of the seller related to the invoice
217 |seller.number|string|(% style="width:117px" %) |The identifier of the seller
David Persson 57.2 218 |debt|object|(% style="width:117px" %) |Current debt of the invoices separated in the different debt types
219 | debt.capital|decimal|(% style="width:117px" %) |This value only exists if there is any capital amount
220 | debt.reminderFee|decimal|(% style="width:117px" %) |This value only exists if there is any reminder fee //(also includes businessRemiderFee)//
221 | debt.collectionFee|decimal|(% style="width:117px" %) |This value only exists if there is any collection fee
222 | debt.penaltyInterest|decimal|(% style="width:117px" %) |This value only exists if there is any penalty interest
David Persson 99.1 223 | debt.calculatedPenaltyInterest|decimal|(% style="width:117px" %) |Todays pending calculated penalty interest. Will be valid if a payment is made today.
224 This value only exists if there is any calculated penalty interest.
David Persson 55.1 225 |penaltyInterestRate|decimal|(% style="width:117px" %)Percentage|yearly penalty interestrate (optional)
David Persson 93.2 226 |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
227 | bankPayment.bankAccountNo|string|(% style="width:117px" %)Maxlength: 15|bankaccount for payment
228 | bankPayment.bankAccountType|string|(% style="width:117px" %)Maxlength: 10|BankAccountTypes:(((
David Persson 117.1 229 * BKSE (swedish bank account)
David Persson 9.10 230 * PKSE (swedish plusgiro)
231 * BGSE (swedish bankgiro)
232 * PGSE (swedish plusgiro OCR)
David Persson 117.1 233 * BKNO (norwegian bank account)
234 * BKDK (danish bank account)
David Persson 9.10 235 )))
David Persson 93.2 236 | bankPayment.bic|string|(% style="width:117px" %)Maxlength: 11|Bank Identifier Code (BIC)
237 | bankPayment.iban|string|(% style="width:117px" %)Maxlength: 34|International Bank Account Number (IBAN)
238 | bankPayment.paymentReference|string|(% style="width:117px" %)Maxlength: 50|(((
David Persson 9.10 239 reference to specify on the payment
David Persson 9.2 240 )))
David Persson 56.2 241 |customer|string|(% style="width:117px" %)Uri|Uri to the customer resource related to the invoice
David Persson 55.1 242 |transactions|string|(% style="width:117px" %)Uri|List all transactions that has occured on the invoice
David Persson 57.2 243 |activePaymentOrders|string|(% style="width:117px" %)Uri|View scheduled payment orders
244 |journal|string|(% style="width:117px" %)Uri|Lists events that has occured on the invoice
245 |documents|string|(% style="width:117px" %)Uri|View the actual invoice document (and other related documents), how it has been distributed etc.
David Persson 9.2 246
David Persson 161.1 247 (% id="HDocuments" %)
248 == Documents ==
David Persson 9.2 249
David Persson 56.2 250 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.
David Persson 9.2 251
252
253 (% id="HListallbillsofanaccount" %)
David Persson 74.3 254 ==== List all documents of an invoice ====
David Persson 9.2 255
David Persson 51.1 256 {{code language="http" title="**Request**"}}
David Persson 70.1 257 GET /ledger/invoice/v1/XXX/invoices/NNN/documents HTTP/1.1
David Persson 52.1 258 Host: -
259 Authorization: Bearer <Token>
260 Content-Type: application/json
261
David Persson 51.1 262 {{/code}}
David Persson 9.2 263
264
David Persson 51.1 265 {{code language="http" title="**Response**"}}
David Persson 52.1 266 HTTP/1.1 200 OK
267 Content-Type: application/json
268
269 {
270 "@id": "/ledger/invoice/v1/501/invoices/NNN/documents",
271 "items" : [
272 {
David Persson 121.2 273 "@id": "/ledger/invoice/v1/XXX/invoices/NNN/documents/852147",
David Persson 90.1 274 "date": "2018-11-15T00:00:00",
David Persson 66.1 275 "type" : "invoice",
David Persson 52.1 276 "distributionMethod" : "NotDistributed|Postal|Kivra|EInvoice|EMail",
David Persson 121.2 277 "document": "/ledger/invoice/v1/XXX/invoices/NNN/documents/852147/document"
David Persson 52.1 278 },
279 {
David Persson 121.2 280 "@id": "/ledger/invoice/v1/XXX/invoices/NNN/documents/123654",
David Persson 90.1 281 "date": "2018-11-15T00:00:00",
David Persson 52.1 282 "type" : "reminder",
283 "distributionMethod" : "NotDistributed|Postal|Kivra|EInvoice|EMail",
David Persson 121.2 284 "document": "/ledger/invoice/v1/XXX/invoices/NNN/documents/123654/document"
David Persson 52.1 285 }
286 ]
287 }
David Persson 51.1 288 {{/code}}
David Persson 5.1 289
David Persson 9.2 290 (% id="H-1" %)
Anders Göthberg 186.1 291 ==== ====
David Persson 5.1 292
David Persson 9.2 293 (% id="HGetspecificbill" %)
David Persson 21.3 294 ==== Get specific document ====
David Persson 9.2 295
David Persson 51.1 296 {{code language="http" title="**Request**"}}
Magnus Kull 79.1 297 GET /ledger/invoice/v1/XXX/invoices/NNN/documents/YYY HTTP/1.1
David Persson 52.1 298 Host: -
299 Authorization: Bearer <Token>
300 Content-Type: application/json
301
David Persson 51.1 302 {{/code}}
David Persson 9.2 303
304
David Persson 51.1 305 {{code language="http" title="**Response**"}}
David Persson 52.1 306 HTTP/1.1 200 OK
307 Content-Type: application/json
308
309 {
David Persson 121.2 310 "@id": "/ledger/invoice/v1/XXX/invoices/NNN/documents/123645",
David Persson 89.3 311 "date": "2018-11-15T00:00:00",
David Persson 71.1 312 "type" : "reminder",
David Persson 52.1 313 "distributionMethod" : "NotDistributed|Postal|Kivra|EInvoice|EMail",
David Persson 121.2 314 "document": "/ledger/invoice/v1/XXX/invoices/NNN/documents/123645/document"
David Persson 52.1 315 }
David Persson 51.1 316 {{/code}}
David Persson 5.1 317
David Persson 9.2 318 (% id="HBillresourceproperties" %)
David Persson 21.3 319 ==== Document resource properties ====
David Persson 5.1 320
David Persson 12.1 321 (% class="table-bordered table-striped" %)
David Persson 40.1 322 |=Property|=Data type|=Format|=Description
323 |@id|string|Uri|
324 |date|date|[[ISO 8601>>url:http://en.wikipedia.org/wiki/ISO_8601||rel="noreferrer" title="ISO8601 on Wikipedia"]]|Date when the document was created
Magnus Kull 79.1 325 |type|string| |(((
David Persson 58.1 326 Currently available types of document
David Persson 21.4 327
328 * **Invoice **- the actual invoice
329 * **Reminder **- reminder of the invoice
330 * **RestReminder **- reminder of rest amounts
331 * **Collection **- Collection claim of the invoice
332 * **CreditInvoice**
Pablo Vivar-Gonzalez 155.2 333 * **BillAttachmentTypeName**
334 ** **SA **(summary)
335 ** **SSA **(Consolidated Summary)
336 ** **SP **(Specification)
David Persson 21.4 337 )))
David Persson 40.1 338 |distributionMethod|string| |(((
David Persson 64.2 339 * **NotDistributed **- the letter has been created but not distributed
340 * **Postal **- Distributed through usual post
341 * **Kivra **- Digitally distributed through Kivra
342 * **EInvoice **- Digitally distributed through EInvoice
343 * **EMail **- Digitally distributed through email
David Persson 21.4 344 )))
David Persson 57.1 345 |document|string|Uri|Uri to download the actual document, usually pdf (content type in response).
David Persson 9.2 346
David Persson 17.3 347 == Transactions ==
David Persson 17.2 348
David Persson 56.2 349 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.
350 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.
David Persson 17.3 351
David Persson 18.1 352
353 (% id="HListallbillsofanaccount" %)
354 ==== List all transactions that has occured on an invoice ====
355
356
David Persson 51.1 357 {{code language="http" title="**Request**"}}
David Persson 71.1 358 GET /ledger/invoice/v1/XXX/invoices/NNN/transactions HTTP/1.1
David Persson 52.1 359 Host: -
360 Authorization: Bearer <Token>
361 Content-Type: application/json
362
David Persson 51.1 363 {{/code}}
David Persson 18.1 364
365
David Persson 51.1 366 {{code language="http" title="**Response**"}}
David Persson 52.1 367 HTTP/1.1 200 OK
368 Content-Type: application/json
369
370 {
371 "@id": "/ledger/invoice/v1/501/invoices/NNN/transactions",
372 "items" : [
373 {
David Persson 95.1 374 "type": "disbursement",
375 "typeName": "Utbetalningsuppdrag skapat",
376 "reference": "",
377 "amount": 50.00,
378 "date": "2019-11-09T00:00:00"
379 },
380 {
David Persson 52.1 381 "type": "payment",
382 "typeName": "Betalning",
383 "reference": "",
David Persson 95.1 384 "amount": -100.00,
David Persson 90.1 385 "date": "2019-11-09T00:00:00"
David Persson 52.1 386 },
387 {
388 "type": "credit",
389 "typeName": "Kreditering",
390 "reference": "",
391 "amount": -100.00,
David Persson 90.1 392 "date": "2019-11-02T00:00:00",
David Persson 52.1 393 "cause" : {
394 "type": "bankruptcy",
395 "typeName": "Konkurs"
396 }
397 },
398 {
399 "type": "credit",
400 "typeName": "Kreditering",
401 "reference": "korrigering dröjsmålsränta",
402 "amount": -00.85,
David Persson 90.1 403 "date": "2019-11-02T00:00:00",
David Persson 52.1 404 "cause" : {
405 "type": "remission",
406 "typeName": "Efterskänkes"
407 }
408 },
409 {
410 "type": "credit",
411 "typeName": "Kreditering",
412 "reference": "reglering mot kreditfaktura NNN",
413 "amount": -100.00,
David Persson 90.1 414 "date": "2019-11-02T00:00:00",
David Persson 52.1 415 },
416 {
David Persson 59.2 417 "type": "collectionFee",
418 "typeName": "Inkassoavgift",
419 "reference": "",
420 "amount": 180.00,
David Persson 90.1 421 "date": "2019-11-02T00:00:00",
David Persson 59.2 422 },
423 {
David Persson 52.1 424 "type": "reminderFee",
425 "typeName": "Påminnelseavgift",
426 "reference": "",
427 "amount": 30.00,
David Persson 90.1 428 "date": "2019-11-02T00:00:00",
David Persson 52.1 429 },
430 {
David Persson 108.3 431 "type": "interest",
432 "typeName": "ränta",
David Persson 52.1 433 "reference": "",
434 "amount": 2.00,
David Persson 90.1 435 "date": "2019-11-02T00:00:00",
David Persson 52.1 436 },
437 {
438 "type": "invoice",
439 "typeName": "Faktura",
440 "reference": "butiksnamn, Orderref. 345",
441 "amount": 200.00,
David Persson 90.1 442 "date": "2020-10-09T00:00:00"
David Persson 52.1 443 }
444 ]
445 }
David Persson 51.1 446 {{/code}}
David Persson 18.1 447
Rasmus Enekvist 188.1 448 ===== OK - Purchased claim =====
449
Rasmus Enekvist 190.1 450 Get transaction list, example of a Purchased claim
Rasmus Enekvist 188.1 451
452 {{code language="http" title="**Response**"}}
453 HTTP/1.1 200 OK
454 Content-Type: application/json
455
456 {
457 "items": [
458 {
459 "type": "Invoice",
460 "typeName": "Invoice",
461 "reference": "",
462 "amount": 1100.99,
Rasmus Enekvist 189.1 463 "date": "2026-03-29T00:00:00"
Rasmus Enekvist 188.1 464 },
465 {
466 "type": "Credit",
467 "typeName": "Credit",
468 "reference": "",
469 "amount": -1100.99,
Rasmus Enekvist 189.1 470 "date": "2026-04-08T00:00:00",
Rasmus Enekvist 188.1 471 "cause": {
472 "type": "PurchasedClaim",
473 "typeName": "Purchased claim"
474 }
475 }
476 ],
477 "navigation": {
478 "@id": "/ledger/invoice/v1/xxx/invoices/123456/transactions"
479 }
480 }
481 {{/code}}
482
David Persson 18.1 483 (% id="H-1" %)
Anders Göthberg 186.1 484 ==== ====
David Persson 18.1 485
486 (% id="HGetspecificbill" %)
David Persson 21.6 487 ==== Transaction resource properties ====
David Persson 18.1 488
489 (% class="table-bordered table-striped" %)
David Persson 55.1 490 |=(% style="width: 405px;" %)Property|=(% style="width: 129px;" %)Data type|=(% style="width: 1236px;" %)Description
491 |(% style="width:405px" %)@id|(% style="width:129px" %)string|(% style="width:1236px" %)
David Persson 56.1 492 |(% style="width:405px" %)type|(% style="width:129px" %)string|(% style="width:1236px" %)Type of transaction
David Persson 108.3 493 |(% style="width:405px" %)typeName|(% style="width:129px" %)string|(% style="width:1236px" %)(((
494 The type of transaction in form of a readable translated text (the local language of the current company)
495
496 The following types can occur on a invoice
497
David Persson 110.1 498 * Invoice //(the transaction that is the basis for the invoice)//
499 * CreditInvoice// (the transaction that is the basis for the credit invoice)//
500 * Credit// (credited amount)//
David Persson 108.3 501 * Interest
502 * Payment
David Persson 110.1 503 * Disbursement //(If, for example, a surplus occur on the invoice, it can be paid out)//
504 * DisbursementReturned //(amount that failed to be paid out for any reason is returned on the invoice)//
David Persson 108.3 505 * InvoiceFee
506 * ReminderFee
507 * CollectionFee
Anders Göthberg 172.1 508 * BadDebt// (BadCapital is an expected loss that may be reclaimed if debt monitoring results in a payment from the customer)//
David Persson 170.3 509 * Converted //(only available by agreement with PayEx)//
David Persson 108.3 510 )))
David Persson 56.1 511 |(% style="width:405px" %)reference|(% style="width:129px" %)string|(% style="width:1236px" %)Transaction reference
512 |(% style="width:405px" %)amount|(% style="width:129px" %)decimal|(% style="width:1236px" %)Amount ot the transaction
513 |(% style="width:405px" %)date|(% style="width:129px" %)date|(% style="width:1236px" %)Date when the transaction occured
514 |(% 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
515 |(% style="width:405px" %) cause.type|(% style="width:129px" %)string|(% style="width:1236px" %)Type of cause to why the transaction has occured
516 |(% 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)
David Persson 18.1 517
David Persson 17.3 518 == Active payment orders ==
519
David Persson 21.6 520 This resource corresponds to an active / scheduled payment order placed against the specific account, the end-customer will be debited at the given executeDate.
David Persson 17.3 521
David Persson 21.6 522 (% id="HGetactivepaymentordersforanaccount" %)
523 ====
524 Get active payment orders for an account ====
525
526
David Persson 51.1 527 {{code language="http" title="**Request**"}}
David Persson 90.1 528 GET /ledger/invoice/v1/XXX/invoices/NNN/active-payment-orders/ HTTP/1.1
David Persson 52.1 529 Host: -
530 Authorization: Bearer <Token>
531 Content-Type: application/json
David Persson 51.1 532 {{/code}}
David Persson 21.6 533
534
David Persson 51.1 535 {{code language="http" title="**Response**"}}
David Persson 52.1 536 HTTP/1.1 200 OK
537 Content-Type: application/json
538
539 {
540 "operations": null,
541 "items": [
542 {
543 "paymentMethod": "autogiro",
544 "executeDate": "2020-02-15",
545 "amount": 200.00
546 }
547 ]
548 }
David Persson 51.1 549 {{/code}}
David Persson 21.6 550
551 (% id="H-2" %)
Anders Göthberg 186.1 552 ==== ====
David Persson 21.6 553
554 (% id="HActive-payment-ordersresourceproperties" %)
555 ==== Active-payment-orders resource properties ====
556
David Persson 21.8 557 (% class="table-bordered table-striped" %)
David Persson 55.1 558 |=Property|=Data type|=Description
559 |paymentMethod|string|paymentMethods:(((
David Persson 21.6 560 * autogiro
561 )))
David Persson 55.1 562 |executeDate|Date|(((
David Persson 26.2 563 The date when the customers bankaccount will be charged
David Persson 21.6 564 )))
David Persson 55.1 565 |amount|decimal|The amount that will be withdrawn from the bankaccount
David Persson 21.6 566
David Persson 162.1 567 (% id="HJournal" %)
David Persson 17.3 568 == Journal ==
569
David Persson 21.6 570 This resource lists all events that has occured on the invoice, in a sorted timeline.
David Persson 17.3 571
David Persson 21.6 572 (% id="HGetactivepaymentordersforanaccount" %)
573 ====
574 Get journal entries for the invoice ====
575
576
David Persson 51.1 577 {{code language="http" title="**Request**"}}
David Persson 90.1 578 GET /ledger/invoice/v1/XXX/invoices/NNN/journal/ HTTP/1.1
David Persson 52.1 579 Host: -
580 Authorization: Bearer <Token>
581 Content-Type: application/json
David Persson 51.1 582 {{/code}}
David Persson 21.6 583
584
David Persson 51.1 585 {{code language="http" title="**Response**"}}
David Persson 52.1 586 HTTP/1.1 200 OK
587 Content-Type: application/json
588
589 {
590 "operations": null,
591 "items": [
592 {
David Persson 66.1 593 "type": "ComplaintReceived",
David Persson 90.1 594 "date" : "2020-09-01T00:00:00",
David Persson 52.1 595 "description" : ""
596 },
597 {
David Persson 66.1 598 "type": "SecondReminderSent",
David Persson 90.1 599 "date" : "2020-09-01T00:00:00",
David Persson 52.1 600 "description" : ""
601 },
602 {
David Persson 66.1 603 "type": "ReminderSent",
David Persson 90.1 604 "date" : "2020-09-01T00:00:00",
David Persson 52.1 605 "description" : ""
Anders Göthberg 186.1 606 },
607 {
608 "type": "InvoiceClosed",
609 "date" : "2020-09-02T00:00:00",
Anders Göthberg 187.1 610 "description" : "Loss"
David Persson 52.1 611 }
612 ],
613 "view": {
614 "@id": "/ledger/invoice/v1/XXX/invoices/NNN/journal?$top=2&$skip=0",
615 "next": "/ledger/invoice/v1/XXX/invoices/NNN/journal?$top=2&$skip=2"
616 }
617 }
David Persson 51.1 618 {{/code}}
David Persson 21.6 619
620 (% id="H-2" %)
Anders Göthberg 186.1 621 ==== ====
David Persson 21.6 622
623 (% id="HActive-payment-ordersresourceproperties" %)
624 ==== Journal resource properties ====
625
David Persson 21.8 626 (% class="table-bordered table-striped" %)
David Persson 55.1 627 |=Property|=Data type|=Description
628 |type|string|type:(((
David Persson 59.2 629 * **ReminderSent **//(an invoice reminder has been sent to the customer)//
630 * **SecondReminderSent **//(a second invoice reminder has been sent to the customer)//
631 * **CollectionClaimSent **//(a collection claim has been sent to the customer)//
632 * **RestReminderSent **//(a reminder including only interest and fees has been sent to the customer)//
633 * **DebtCollection **//(the invoice has been transferred to collection)//
634 * **Respite// //**//(the claim is stopped for further claimprocess steps until valid to data of respite or respite is removed)//
635 * **RespiteRemoved** //(respite has been removed fro claim)//
636 * **Stop// //**//(the claim is stopped for further claim process steps until stop is removed)//
637 * **StopRemoved **//(stop has been removed from claim)//
638 * **ComplaintReceived// //**//(complaint has been registered)//
639 * **ComplaintResolved **//(complaint has been resolved)//
640 * **InvoiceClosed **//(status of the invoice in the accounts receivable has been set to closed)//
641 * **PaymentOrderFailed **//(scheduled paymentorder failed to be executed)//
David Persson 21.6 642 )))
David Persson 55.1 643 |date|Date|(((
David Persson 21.6 644 The date when the journal entry occured
645 )))
David Persson 60.1 646 |description|string|detailed description of the entry (if available)
David Persson 21.6 647
Fredrik Nilsson 107.1 648 == Register direct payment ==
David Persson 5.1 649
David Persson 88.1 650 operation for registration of direct payments against invoices
651
652 {{code language="http" title="**Request**"}}
David Persson 91.2 653 POST /ledger/invoice/v1/XXX/invoices/NNN/register-direct-payment HTTP/1.1
David Persson 88.1 654 Host: -
655 Authorization: Bearer <Token>
656 Content-Type: application/json
657
658 {
659 "amount" : 100.00,
David Persson 91.2 660 "paymentDate" : "2021-04-27",
David Persson 170.1 661 "transactionCause" : "psp"
David Persson 88.1 662 }
663 {{/code}}
664
665 (% id="HActive-payment-ordersresourceproperties" %)
666 ==== Register-direct-payment request properties ====
667
668 (% class="table-bordered table-striped" %)
669 |=Property|=Data type|=Required|=Description
670 |amount|decimal|Yes|The amount of the direct payment
671 |paymentDate|Date|Yes|(((
672 The date when the payment was made
673 )))
David Persson 170.1 674 |transactionCause|string|No|(((
David Persson 91.2 675 * psp
676 )))
David Persson 88.1 677
678 {{code language="http" title="**Response**"}}
David Persson 91.2 679 HTTP/1.1 204 NO CONTENT
David Persson 88.1 680 Content-Type: application/json
David Persson 91.2 681
David Persson 88.1 682 {{/code}}
683
Fredrik Nilsson 107.1 684 == Settle-credit-invoice ==
David Persson 88.1 685
David Persson 102.1 686 operation to settle an existing credit invoice towards debit invoice. This operation is only be available/valid on credit-invoices
David Persson 100.1 687
688 {{code language="http" title="**Request**"}}
689 POST /ledger/invoice/v1/XXX/invoices/NNN/settle-credit-invoice HTTP/1.1
690 Host: -
691 Authorization: Bearer <Token>
692 Content-Type: application/json
693
694 {
695 "debitInvoiceNo": "12345",
696 "creditAmount": 250.00,
697 "sendCopy": false
698 }
699 {{/code}}
700
David Persson 88.1 701 (% id="HActive-payment-ordersresourceproperties" %)
David Persson 101.1 702 ==== Settle-credit-invoice request properties ====
David Persson 100.1 703
704 (% class="table-bordered table-striped" %)
705 |=Property|=Data type|=Required|=Description
706 |debitInvoiceNo|string|Yes|invoice number of the debit invoice that the credit invoice is to be settled against
707 |creditAmount|decimal|Yes|(((
Daniel Engström 154.1 708 Amount of the credit invoice to use
David Persson 100.1 709 )))
David Persson 106.3 710 |sendCopy|bool|No|Whether a new copy should be distributed to the end-customer with updated balances (after settlement has been executed)
711 Default false
David Persson 100.1 712
713 {{code language="http" title="**Response**"}}
714 HTTP/1.1 204 NO CONTENT
715 Content-Type: application/json
716
717 {{/code}}
718
David Persson 119.1 719 == Remission ==
720
721 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.
722
723 {{code language="http" title="**Request**"}}
724 POST /ledger/invoice/v1/XXX/invoices/NNN/remission HTTP/1.1
725 Host: -
726 Authorization: Bearer <Token>
727 Content-Type: application/json
728
729 {
730 "balanceType": "CollectionFee",
David Persson 169.1 731 "amount": 12.00,
732 "invoiceCurrentDebt": 12.00
David Persson 119.1 733 }
734 {{/code}}
735
736 (% id="HActive-payment-ordersresourceproperties" %)
737 ==== remission request properties ====
738
739 (% class="table-bordered table-striped" %)
740 |=Property|=Data type|=Required|=Description
David Persson 120.2 741 |balanceType|string|Yes|(((
742 The balanceType to be affected
743
744 * capital
745 * reminderfee
746 * penaltyinterest
747 * collectionfee
748 )))
David Persson 119.1 749 |amount|decimal|Yes|The amount of the specified balace type to exeute remission on
David Persson 169.1 750 |invoiceCurrentDebt|decimal|Yes|The amount must match the current debt (**excl. Calculated interest**) on the invoice.
751 currentDebt - debt.calculatedPenaltyInterest
David Persson 119.1 752
753 {{code language="http" title="**Response**"}}
754 HTTP/1.1 204 NO CONTENT
755 Content-Type: application/json
756
757 {{/code}}
758
759 == Write-down ==
760
761 operation to allow partialy or full write-down of the debt. the reason/cause of the write-down should be specified (affects accounting)
762
763 {{code language="http" title="**Request**"}}
764 POST /ledger/invoice/v1/XXX/invoices/NNN/write-down HTTP/1.1
765 Host: -
766 Authorization: Bearer <Token>
767 Content-Type: application/json
768
769 {
770 "balanceType": "CollectionFee",
771 "amount": 12.00,
Bent Pitkänen 128.1 772 "cause": "deceased",
773 "invoiceCurrentDebt": 462.10
David Persson 119.1 774 }
775 {{/code}}
776
777 (% id="HActive-payment-ordersresourceproperties" %)
778 ==== Write-down request properties ====
779
780 (% class="table-bordered table-striped" %)
781 |=Property|=Data type|=Required|=Description
David Persson 120.2 782 |balanceType|string|Yes|(((
783 The balanceType to be affected
784
David Persson 126.2 785 * Capital
786 * ReminderFee
787 * PenaltyInterest
788 * CollectionFee
David Persson 120.2 789 )))
David Persson 119.1 790 |amount|decimal|Yes|The amount of the specified balace type to write-down
Simon Melin 122.1 791 |cause|string|Yes|(((
792 The cause of the write-down
David Persson 119.1 793
Simon Melin 122.1 794 * Bankruptcy
795 * Settlement
796 * Deceased
797 * Fraud
798 * Dispute
Karl Holmbom 172.2 799 * NonDeductible
Simon Melin 122.1 800 * Unknown
Simon Melin 123.1 801
Simon Melin 124.1 802 If field is null, Then defaults to "Unknown". Case-Sensitive
Simon Melin 122.1 803 )))
David Persson 136.1 804 |{{{invoiceCurrentDebt}}}|decimal|Yes|The amount must match the current debt (**excl. Calculated interest**) on the invoice.
David Persson 135.1 805 currentDebt - debt.calculatedPenaltyInterest
Simon Melin 122.1 806
David Persson 119.1 807 {{code language="http" title="**Response**"}}
808 HTTP/1.1 204 NO CONTENT
809 Content-Type: application/json
810
811 {{/code}}
812
813 == Respite ==
814
815 Resource to create or view respite
816
817 Get respite
818
819 {{code language="http" title="**Request**"}}
820 GET /ledger/invoice/v1/XXX/invoices/NNN/respite HTTP/1.1
821 Host: -
822 Authorization: Bearer <Token>
823 Content-Type: application/json
824
825 {{/code}}
826
827 {{code language="http" title="**Response**"}}
828 HTTP/1.1 200 OK
829 Content-Type: application/json
830
831 {
832 "validToDate": "2021-08-01",
833 "reason": "..."
834 }
835 {{/code}}
836
837 Create respite
838
839 {{code language="http" title="**Request**"}}
840 POST /ledger/invoice/v1/XXX/invoices/NNN/respite HTTP/1.1
841 Host: -
842 Authorization: Bearer <Token>
843 Content-Type: application/json
844
845 {
846 "validToDate": "2021-08-01",
847 "reason": "..."
848 }
849 {{/code}}
850
851 {{code language="http" title="**Response**"}}
852 HTTP/1.1 201 CREATED
853 Content-Type: application/json
854 {{/code}}
855
856 (% id="HActive-payment-ordersresourceproperties" %)
857 ==== Respite request properties ====
858
859 (% class="table-bordered table-striped" %)
860 |=Property|=Data type|=Required|=Description
861 |validToDate|Date|Yes|Respite is valid to this date
862 |reason|string|Yes|Reason for why the respite was created.
863
864 == Active-disbursement-orders ==
865
866 View or create disbursement orders, only available for credit-invoices
867
868 Get active-disbursement-orders
869
870 {{code language="http" title="**Request**"}}
871 GET /ledger/invoice/v1/XXX/invoices/NNN/active-disbursement-orders HTTP/1.1
872 Host: -
873 Authorization: Bearer <Token>
874 Content-Type: application/json
875
876 {{/code}}
877
878 {{code language="http" title="**Response**"}}
Simon Melin 165.1 879 HTTP/1.1 200 OK
880 Content-Type: application/json
881
David Persson 119.1 882 {
Simon Melin 165.1 883 "items" :
884 [
885 {
886 "@id" : "../ledger/v1/501/invoices/12345/active-disbursement-orders/456789",
887 "amount" : 10,
888 "norwegianBankAccount" : {
889 "accountNo" : "1234"
890 }
891 },
892 {
893 "@id" : "../ledger/v1/501/invoices/12345/active-disbursement-orders/456788",
894 "amount" : 10,
895 "international" : {
896 "iban" : "123456",
897 "bic" : "SWED..."
898 }
899 },
900 {
901 "@id" : "../ledger/v1/501/invoices/12345/active-disbursement-orders/456787",
902 "amount" : 10,
903 "swedishBankAccount" : {
904 "accountNo" : "123",
905 "accountType" : "BKSE | PGSE | BGSE"
906 }
907 },
908 {
909 "@id" : "../ledger/v1/501/invoices/12345/active-disbursement-orders/456786",
910 "amount" : 10,
911 "swedishSus" : {
912 "nationalIdentifier": {
913 "regNo" : "YYYYMMDD-NNNN",
914 "countryCode" : "SE"
915 },
916 "address" : {
917 "addressee" : "Kalle Axelstopp",
918 "streetAddress" : "Axelgatan 18",
919 "coAddress" : null,
920 "city" : "STOCKHOLM",
921 "zipCode" : "16872",
922 "countryCode" : "se"
923 }
924 }
925 }
926 ]
David Persson 119.1 927 }
928 {{/code}}
929
930 Create disbursement order towards a norwegian bank account
931
932 {{code language="http" title="**Request**"}}
933 POST /ledger/invoice/v1/XXX/invoices/NNN/active-disbursement-orders HTTP/1.1
934 Host: -
935 Authorization: Bearer <Token>
936 Content-Type: application/json
937
938 {
939 "amount" : 10,
940 "norwegianBankAccount" : {
941 "accountNo" : "1234"
942 }
943 }
944 {{/code}}
945
946 Create disbursement order towards a international bank account (IBAN)
947
948 {{code language="http" title="**Request**"}}
949 POST /ledger/invoice/v1/XXX/invoices/NNN/active-disbursement-orders HTTP/1.1
950 Host: -
951 Authorization: Bearer <Token>
952 Content-Type: application/json
953
954 {
955 "amount" : 10,
956 "international" : {
957 "iban" : "123456",
958 "bic" : "SWED..."
959 }
960 }
961 {{/code}}
962
963 Create disbursement order towards a swedish bank account
964
965 {{code language="http" title="**Request**"}}
966 POST /ledger/invoice/v1/XXX/invoices/NNN/active-disbursement-orders HTTP/1.1
967 Host: -
968 Authorization: Bearer <Token>
969 Content-Type: application/json
970
971 {
David Persson 155.1 972 "amount" : 100,
David Persson 119.1 973 "swedishBankAccount" : {
974 "accountNo" : "123",
975 "accountType" : "BKSE | PGSE | BGSE"
976 }
977 }
978 {{/code}}
979
980 Create disbursement order using "Swedbanks lön- och utbetalningssystem (SUS)"
981
982 {{code language="http" title="**Request**"}}
983 POST /ledger/invoice/v1/XXX/invoices/NNN/active-disbursement-orders HTTP/1.1
984 Host: -
985 Authorization: Bearer <Token>
986 Content-Type: application/json
987
988 {
David Persson 155.1 989 "amount" : 100,
David Persson 119.1 990 "swedishSus" : {
991 "nationalIdentifier": {
992 "regNo" : "YYYYMMDD-NNNN",
993 "countryCode" : "SE"
994 },
995 "address" : {
996 "addressee" : "Kalle Axelstopp",
997 "streetAddress" : "Axelgatan 18",
998 "coAddress" : null,
999 "city" : "STOCKHOLM",
1000 "zipCode" : "16872",
1001 "countryCode" : "se",
1002 }
1003 }
1004 }
1005 {{/code}}
1006
1007
1008 {{code language="http" title="**Response**"}}
1009 HTTP/1.1 201 CREATED
1010 Content-Type: application/json
1011 {{/code}}
1012
1013 (% id="HActive-payment-ordersresourceproperties" %)
1014 ==== Respite request properties ====
1015
1016 (% class="table-bordered table-striped" %)
1017 |=Property|=Data type|=Required|=Description
1018 |amount|decimal|Yes|
1019 |__**norwegianBankAccount**__|object|No*|
1020 | accountNo|string|Yes|
1021 |__**swedishBankAccount**__|object|No*|
1022 | clearingNo|string|Yes|
1023 | accountNo|string|Yes|
1024 |__**international**__|object|No*|
1025 | iban|string|Yes|
1026 | bic|string|Yes|
1027 |__**swedishSus**__|object|No*|
1028 |**nationalIdentifier**|object|Yes|
1029 | regNo|string|Yes|
1030 | countryCode|string|Yes|
1031 |**address**|object|Yes|
1032 | addressee|string|Yes|
1033 | streetAddress|string|No|
1034 | coAddress|string|No|
1035 | city|string|Yes|
1036 | zipCode|string|Yes|
1037 | countryCode|string|Yes|
1038 | | | |
1039
1040 //* One and only one of the specified objects can be set at each request//
1041
Thomas Hedström 130.1 1042 == Transfer-to-account ==
David Persson 119.1 1043
Thomas Hedström 130.1 1044 operation transfer current capital debt on the invoice to a provided account. This will close the invoice.
David Persson 119.1 1045
Thomas Hedström 130.1 1046 {{code language="http" title="**Request**"}}
1047 POST /ledger/invoice/v1/XXX/invoices/NNN/transfer-to-account HTTP/1.1
1048 Host: -
1049 Authorization: Bearer <Token>
1050 Content-Type: application/json
1051
1052 {
1053 "accountNo" : "123",
1054
1055 }
1056
1057 {{/code}}
1058
1059 (% id="HActive-payment-ordersresourceproperties" %)
Thomas Hedström 131.1 1060 ==== Transfer-to-account request properties ====
Thomas Hedström 130.1 1061
1062 (% class="table-bordered table-striped" %)
1063 |=Property|=Data type|=Required|=Description
1064 |accountNo|string|Yes|account number to the to transfer current capital debt into
1065
1066 {{code language="http" title="**Response**"}}
1067 HTTP/1.1 204 NO CONTENT
1068 Content-Type: application/json
1069
1070 {{/code}}
1071
Anders Göthberg 186.1 1072 == ==
David Persson 88.1 1073
Thomas Hedström 144.1 1074 == Generate-invoice-portal-link ==
1075
Fredrik Nilsson 152.1 1076 Creates a new public available (no authorization needed) link to the targeted invoice. Default lifetime of a link is 120 days. Creating new links does not affect old links.
Thomas Hedström 144.1 1077
1078 {{code language="http" title="**Request**"}}
1079 POST /ledger/invoice/v1/XXX/invoices/NNN/generate-invoice-portal-link HTTP/1.1
1080 Host: -
1081 Authorization: Bearer <Token>
1082 Content-Type: application/json
1083
1084 {
1085 }
1086
1087 {{/code}}
1088
1089 (% id="HActive-payment-ordersresourceproperties" %)
Anders Göthberg 186.1 1090 ==== ====
Thomas Hedström 144.1 1091
1092 {{code language="http" title="**Response**"}}
1093 HTTP/1.1 200 OK
1094 Content-Type: application/json
1095
1096 {
1097 "invoicePortalLink": "https://public-invoice-example.com/sv/XXX?token=eyJhbGciOiJSUzI1Ni..."
1098 }
1099 {{/code}}
1100
Mats Lyth 139.1 1101 {{display reference="developer:Main.Invoicing.ledger-api-general-docs.api-section-problems.WebHome"/}}
David Persson 52.1 1102
David Persson 5.1 1103 === Problem types ===
1104
1105 (% class="box infomessage" %)
1106 (((
David Persson 117.2 1107 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".
David Persson 5.1 1108 )))
1109
1110 (% class="table-bordered table-striped" %)
1111 |=(% style="width: 537px;" %)Problem type (code)|=(% style="width: 172px;" %)Httpstatus|=(% style="width: 796px;" %)Description
Mats Lyth 138.1 1112 |(% style="width:537px" %)forbidden|(% style="width:172px" %)403|(% style="width:796px" %)occurs if access to method is not allowed.
David Persson 67.1 1113 |(% 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
1114 |(% style="width:537px" %)invoice-not-found|(% style="width:172px" %)404|(% style="width:796px" %)
Thomas Hedström 128.2 1115 |(% style="width:537px" %)missing-offer|(% style="width:172px" %)409|(% style="width:796px" %)Invoice is not a candidate for **transfer-to-account**. This has nothing to do with the provided Account
1116 |(% style="width:537px" %)missing-account-for-billing-account|(% style="width:172px" %)409|(% style="width:796px" %)No account found on the provided AccountNo, can be expected on the us of **transfer-to-account** operation
1117 |(% style="width:537px" %)not-acceptable-for-conversion|(% style="width:172px" %)409|(% style="width:796px" %)Invoice or account was not acceptable for transfer. This could be caused a number of parameters both on the invoice and the account.
1118 |(% style="width:537px" %)credit-check-rejected|(% style="width:172px" %)422|(% style="width:796px" %)Score does not approve the conversion
1119 |(% style="width:537px" %)customer-mismatch|(% style="width:172px" %)422|(% style="width:796px" %)Invoice and account is on separate customers in the **transfer-to-account** request
1120 |(% style="width:537px" %) |(% style="width:172px" %) |(% style="width:796px" %)