Изменения документа ../credit-account
Изменил последним Helge Dahl 2020/02/06 17:55
От версии 3.1
отредактировано David Persson
на 2019/12/04 09:48
на 2019/12/04 09:48
К версии 3.2
отредактировано David Persson
на 2019/12/04 10:04
на 2019/12/04 10:04
Комментарий к изменению: К данной версии нет комментариев
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -33,69 +33,65 @@ 33 33 Content-Type: application/json 34 34 35 35 { 36 - "sellerNumber" : "654", 37 - "invoice" : { 38 - "amountInclVat" : 100, 39 - "currency" : "SEK", 40 - "invoiceNumber" : "852", 41 - "dueDate" : "2019-06-27", 42 - "collectionReferenceText" : "Shoes", 43 - "invoiceDate" : "2019-06-07", 44 - "distributionDate" : "2019-06-08" 45 - }, 46 - "buyer" : { 47 - "emailAddress" : "test@testshop.se", 48 - "cellPhone" : "+46701234456", 49 - "nationalConsumerIdentifier" : { 50 - "value" : "19101010-1010", 51 - "countryCode" : "SE" 52 - }, 53 - "nationalOrganizationIdentifier" : { 54 - "value" : null, 55 - "countryCode" : null 56 - }, 57 - "invoiceAddress" : { 58 - "name" : "John Smith", 59 - "streetAddress" : "Teststreet", 60 - "city" : "Testcity", 61 - "coAddress" : "", 62 - "zipCode" : "12345", 63 - "countryCode" : "SE" 64 - } 36 + "@id": "/ledger/credit-account/v1/501/accounts/123456", 37 + "accountNo": "1234567", 38 + "startDate": "2016-05-21", 39 + "description": null, 40 + "accountProfileType": "strex | kontodebet | kontokredit | kontofaktura", //Nytt begrepp 41 + "accountAlias" : "Coop kontokredit | Coop matkonto", 42 + "customerNo" : "123789654", 43 + "status" : "open | pending-close | closed", 44 + "creditLimit": 2000.00, // Kontots kreditlimit 45 + "unpaidBilledAmount" : 200.0, //total aktuell summa av alla balanser på BillingAcc (endast om negativ/skuld, annars 0) 46 + "debt": 2050.0, // total aktuell summa av alla balanser (kapital/ränta/avgifter osv.) på BillingAcc + underliggande CredAccs, OM NEGATIV (skuld) 47 + "surplus": 0.0, // total aktuell summa av alla balanser (kapital/ränta/avgifter osv.) på BillingAcc + underliggande CredAccs, OM POSITIV (tillgodo) 48 + "reservedAmount": 50.0, // Summerat belopp på alla utestående reservationer mot kontot (som är giltiga och ej captured) 49 + "availableAmount": 100.0, // Tillgänglig kredit (kan ej räknas fram utifrån ovan belopp då avgifter kan ingå där, som inte påverkar tillgänglig kredit) 50 + "openBill" : { 51 + "amount" : 250.0, 52 + "bill" : "/ledger/credit-account/v1/501/accounts/123456/bills/963", 53 + "dueDate" : "2019-10-10", 54 + "billType" : "Bill" 65 65 }, 66 - "invoicePurchaseDetails" : { 67 - "paymentReference" : "426523791", 68 - "paymentAccount" : { 69 - "accountType" : "BGSE", 70 - "accountNumber" : "1234-45", 71 - "bic" : "SWEDSESS", 72 - "iban" : "SE4550000000058398257466" 73 - }, 74 - "invoiceDenuntiationText" : "Vår fordran enligt denna faktura har pantsatts till Acquirer AB ............" 75 - }, 76 - "authorizationId" : 123, 77 - "@id" : "/ledger/invoice-purchase/v1/501/authorizations/123", 78 - "parentHREF": "/", 79 - "operations" : [ 56 + "charityDonation": true, 57 + "interestRate": { 58 + "debtInterest" : 10.00, 59 + "penaltyInterest": 15.00 60 + }, 61 + "offer" : "", //nödvändig?? 62 + "directDebit": "/ledger/credit-account/v1/501/accounts/123456/direct-debit", 63 + "cards": "/ledger/credit-account/v1/501/accounts/123456/cards", 64 + "transactions": "/ledger/credit-account/v1/501/accounts/123456/transactions", 65 + "currency": "sek", 66 + "bills": "/ledger/credit-account/v1/501/accounts/123456/bills", 67 + "customer": "/ledger/customers/v1/501/customer/123456", 68 + "operation" : [ 80 80 { 81 - "rel" : " create-capture",70 + "rel" : "add-card-info", 82 82 "method" : "post", 83 - "href" : "/ledger/ invoice-purchase/v1/501/authorizations/123/captures"72 + "href" : "/ledger/credit-account/v1/501/accounts/123456/cards" 84 84 }, 85 85 { 86 - "rel" : " create-credit",75 + "rel" : "request-close-account", // -> pending-close status (workitem för stängning) 87 87 "method" : "post", 88 - "href" : "/ledger/ invoice-purchase/v1/501/authorizations/123/credits"77 + "href" : "/ledger/credit-account/v1/501/accounts/123456/request-close-account" 89 89 }, 90 90 { 91 - "rel" : " create-cancellation",80 + "rel" : "apply-for-raised-credit-limit", 92 92 "method" : "post", 93 - "href" : "/ledger/invoice-purchase/v1/501/authorizations/123/cancellations" 82 + "href" : "/ledger/credit-account-onboardings/v1/501/accounts/123456/apply-for-raised-credit-limit" 83 + }, 84 + { 85 + "rel" : "lower-credit-limit", 86 + "method" : "patch", 87 + "href" : "/ledger/credit-account-onboardings/v1/501/accounts/123456" 88 + }, 89 + { 90 + "rel" : "change-charity-donation", 91 + "method" : "patch", 92 + "href" : "/ledger/credit-account-onboardings/v1/501/accounts/123456" 94 94 } 95 - ], 96 - "captures": "/ledger/invoice-purchase/v1/501/authorizations/123/captures", 97 - "credits" : "/ledger/invoice-purchase/v1/501/authorizations/123/credits", 98 - "cancellations" : "/ledger/invoice-purchase/v1/501/authorizations/123/cancellations" 94 + ] 99 99 } 100 100 {{/code}} 101 101 ... ... @@ -137,38 +137,67 @@ 137 137 (% class="wikigeneratedid" %) 138 138 (% class="small" %)##//* Either buyer.nationalConsumerIdentifier or buyer.nationalOrganizationIdentifier must be specified in the request//## 139 139 140 -== Captures ==136 +== Bills == 141 141 142 - If the seller decidesoproceed with the process andlet the acquirer purchase the invoice, a call to ##captures## must be made. A post request is sent to the specific ##capture## URL (that was provided in the authorization resource response), the request must contain the actual PDF of the invoice that is to be distributed to the buyer.138 +list bills 143 143 144 -[[image:InvoicePurchase external - Capture.svg||height="443" width="844"]] 145 - 146 -To capture the authorization (with authorizationId 123 in the example below) and complete the invoice purchase, we need to perform a post request as below 147 - 148 148 {{code language="http" title="**Request**"}} 149 - POST /ledger/invoice-purchase/v1/XXX/authorization/123/captures HTTP/1.1141 +GET /ledger/credit-account/v1/XXX/accounts/123/bills HTTP/1.1 150 150 Host: - 151 151 Authorization: Bearer <Token> 152 152 Content-Type: application/json 153 153 154 -{ 155 - "invoicePdfData" : "" 146 +{{/code}} 147 + 148 + 149 +{{code language="http" title="**Response**"}} 150 +HTTP/1.1 200 OK 151 +Content-Type: application/json 152 + 153 +{ 154 + "bills" : [ 155 + { "billDate" : "2018-09-01", "status" : "open", "billAmount" : 374.10, "@id" : "/ledger/credit-account/v1/501/accounts/123456/bills/963" }, 156 + { "billDate" : "2018-08-01", "status" : "closed", "billAmount" : 374.10, "@id" : "/ledger/credit-account/v1/501/accounts/123456/bills/852" }, 157 + { "billDate" : "2018-07-01", "status" : "closed", "billAmount" : 374.10, "@id" : "/ledger/credit-account/v1/501/accounts/123456/bills/741" } 158 + ] 156 156 } 157 157 {{/code}} 158 158 159 -**Request properties** 160 160 161 -(% class="table-bordered table-striped" %) 162 -|=Property|=Data type|=Required in post|=Format|=Description 163 -|##invoicePdfData##|##string##|Y|Base64 encoded byte array|data of the valid pdf document/invoice 163 +{{code language="http" title="**Request**"}} 164 +GET /ledger/credit-account/v1/XXX/accounts/123/bills/456 HTTP/1.1 165 +Host: - 166 +Authorization: Bearer <Token> 167 +Content-Type: application/json 164 164 165 - If thecapture succeeds, it shouldrespond with http status 204169 +{{/code}} 166 166 171 +bills 172 + 167 167 {{code language="http" title="**Response**"}} 168 -HTTP/1.1 20 1Created174 +HTTP/1.1 200 OK 169 169 Content-Type: application/json 170 170 171 -{ 177 +{ 178 + "@id": "/ledger/credit-account/v1/501/accounts/123456/bills/963", 179 + "externalReference": "123456", 180 + "dueDate": "2018-12-05", 181 + "billNo": "124645", 182 + "amountToBePayed": 240.00, //kan inte denna heta bara "amount" egentligen? 183 + "billType" : "Bill", 184 + "bankPayment": { 185 + "bankAccountNo": "123", 186 + "bankAccountType": "BGSE", 187 + "bic": "123456", 188 + "iban": "SE12345678945631", 189 + "paymentReference": "1246fdsdf4687613" 190 + }, 191 + "activePaymentOrder": { 192 + "paymentType": "BGAGSE", 193 + "executionDate": "2019-01-01", 194 + "amount" : 200.0 //beroende på directdebittype så kan denna vara beräknad vid varje hämtning (utifrån ev. delbet) 195 + }, 196 + "pdf": "/ledger/credit-account/v1/501/accounts/123456/bills/963/pdf" //visar senaste ev. childbill? 172 172 } 173 173 {{/code}} 174 174