Changes for page card-transaction
Last modified by David Persson on 2024/02/21 07:48
From version 2.1
edited by David Persson
on 2020/02/19 22:00
on 2020/02/19 22:00
To version 3.1
edited by David Persson
on 2020/02/19 22:00
on 2020/02/19 22:00
Change comment: There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,0 +1,604 @@ 1 +(% class="jumbotron" %) 2 +((( 3 +(% class="container" %) 4 +((( 5 +Integrate to **PayEx Credit Account Acquiring API ** 6 +))) 7 +))) 8 + 9 +(% class="lead" %) 10 +The credit account acquiring api contains functions that are used in payment scenarios: online, in-store and offline. Before transactions can be created an account must exists. 11 + 12 +(% class="lead" %) 13 +[[image:1581023647237-858.png||height="362" width="511"]] 14 + 15 +---- 16 + 17 += Changelog = 18 + 19 +2020-02-03 20 +Renamed parameters 21 +sellerCaptureTransactionId -> sourceCaptureTransactionId 22 +sellerReversalTransactionId -> sourceReversalTransactionId 23 + 24 +2020-01-30 25 +Added "refunds" resource to use when reversal is made with card and the original capture cannot be referenced. 26 + 27 +(% class="wikigeneratedid" %) 28 +2020-01-30 29 +renamed sellerAuthorizationTransactionId to sourceAuthorizationTransactionId 30 + 31 +== Authorizations == 32 + 33 +(% class="wikigeneratedid" %) 34 +An authorization is made to try to use an account for payment. A successful authorization leads to a reservation on the account, the account is identified through the **cardToken** or the **accountNo**. The authorization is not a financial transaction, to make the financial transaction a capture must posted on the authorization. 35 + 36 +==== Post authorizations ==== 37 + 38 +{{code language="http" title="**Request**"}} 39 +POST /ledger/credit-account-acquiring/v1/XXX/authorizations HTTP/1.1 40 +Host: - 41 +Authorization: Bearer <Token> 42 +Content-Type: application/json 43 + 44 +{ 45 + "sourceAuthorizationTransactionId": "789", 46 + "sellerNumber": "654", 47 + "cardToken": "5646735165", 48 + "accountNo": null, 49 + "pointOfSale": "Testshop", 50 + "authorizationAmount": 300.0, 51 + "currency": "SEK" 52 +} 53 +{{/code}} 54 + 55 +(% class="box successmessage" %) 56 +((( 57 +**Note: **Either "card" or "accountNo" must be specified in the post request (not both). 58 + 59 +The above example shows an authorization done with a card. All cards are linked to an account, to which the authorization will also be linked. 60 +If an authorization is to be made directly against the account, the parameter "accountNo" should be specified in the post body, instead of "cardToken". 61 +))) 62 + 63 +{{code language="http" title="**Response**"}} 64 +HTTP/1.1 200 OK 65 +Content-Type: application/json 66 + 67 +{ 68 + "@id": "/ledger/credit-account-acquiring/v1/XXX/authorization/YYY", 69 +} 70 +{{/code}} 71 + 72 +==== 73 +Get authorizations ==== 74 + 75 +{{code language="http" title="**Request**"}} 76 +GET /ledger/credit-account-acquiring/v1/XXX/authorizations/YYY HTTP/1.1 77 +Host: - 78 +Authorization: Bearer <Token> 79 +Content-Type: application/json 80 +{{/code}} 81 + 82 +==== ==== 83 + 84 +{{code language="http" title="**Response**"}} 85 +HTTP/1.1 200 OK 86 +Content-Type: application/json 87 + 88 +{ 89 + "sourceAuthorizationTransactionId": "789", 90 + "authorizationId": 123, 91 + "sellerNumber": "654", 92 + "cardToken": "546415646315", 93 + "accountNo": null, 94 + "pointOfSale": "Testshop", 95 + "validToDate": "2019-11-28", 96 + "authorizationAmount": 300.0, 97 + "remainingAmount" : 150.0, 98 + "currency": "SEK", 99 + "@id": "/ledger/credit-account-acquiring/v1/XXX/authorizations/NNN", 100 + "captures": "/ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/captures", 101 + "cancellations": "/ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/cancellations", 102 + "schemaUri": "/ledger/invoice-purchase/v1/PayEx.AR.InvoicePurchase.Api.Resources.Authorizations.Resource", 103 + "parentHREF": "/", 104 + "operations": [ 105 + { 106 + "rel": "create-capture", 107 + "method": "post", 108 + "href": "/ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/captures" 109 + }, 110 + { 111 + "rel": "create-cancellation", 112 + "method": "post", 113 + "href": "/ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/cancellations" 114 + } 115 + ] 116 +} 117 +{{/code}} 118 + 119 + 120 +==== Resource properties authorizations ==== 121 + 122 +(% class="table-bordered table-striped" %) 123 +|=(% style="width: 215px;" %)Property|=(% style="width: 114px;" %)Data type|=(% style="width: 118px;" %)Format|=(% style="width: 586px;" %)Description 124 +|(% style="width:215px" %)@id |(% style="width:114px" %)string|(% style="width:118px" %)Uri |(% style="width:586px" %) 125 +|(% style="width:215px" %)sourceAuthorizationTransactionId|(% style="width:114px" %)string|(% style="width:118px" %)Maxlength: 50|(% style="width:586px" %)Unique identifier of the specific authorization, generated by source (typically the integrating system) 126 +|(% style="width:215px" %)authorizationId|(% style="width:114px" %)string|(% style="width:118px" %)Maxlength: 6|(% style="width:586px" %)Unique identifier of the authorization, generated by PayEx. Should be stored and must be used in capture 127 +|(% style="width:215px" %)sellerNumber|(% style="width:114px" %)string|(% style="width:118px" %)Maxlength: 15|(% style="width:586px" %)Identifier of the current seller/merchant 128 +|(% style="width:215px" %)cardToken|(% style="width:114px" %)string|(% style="width:118px" %) |(% style="width:586px" %)identifier of the card. The aurhotization is made on the account that the card is linked to 129 +|(% style="width:215px" %)accountNo|(% style="width:114px" %)string|(% style="width:118px" %) |(% style="width:586px" %)identifier of the account 130 +|(% style="width:215px" %)pointOfSale|(% style="width:114px" %)string|(% style="width:118px" %)Maxlength: 50|(% style="width:586px" %)Name of the location/point/shop of sale, will be returned in reservation resource 131 +|(% style="width:215px" %)validToDate|(% style="width:114px" %)date|(% style="width:118px" %)[[ISO 8601>>url:http://en.wikipedia.org/wiki/ISO_8601||rel="noreferrer" title="ISO8601 on Wikipedia"]]|(% style="width:586px" %)Capture can not be executed after this date 132 +|(% style="width:215px" %)authorizeAmount|(% style="width:114px" %)decimal|(% style="width:118px" %)Amount|(% style="width:586px" %)Original authorized amount 133 +|(% style="width:215px" %)remainingAmount|(% style="width:114px" %)decimal|(% style="width:118px" %)Amount|(% style="width:586px" %)Amount left on the authorization that can be captured 134 +|(% style="width:215px" %)currency|(% style="width:114px" %)string|(% style="width:118px" %)[[ISO 4217>>url:https://sv.wikipedia.org/wiki/ISO_4217]]|(% style="width:586px" %) 135 +|(% style="width:215px" %)captures|(% style="width:114px" %)string|(% style="width:118px" %)Uri|(% style="width:586px" %) 136 +|(% style="width:215px" %)cancellations|(% style="width:114px" %)string|(% style="width:118px" %)Uri|(% style="width:586px" %) 137 + 138 +---- 139 + 140 +== Captures == 141 + 142 +==== Post captures ==== 143 + 144 +{{code language="http" title="**Request**"}} 145 +POST /ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/captures HTTP/1.1 146 +Host: - 147 +Authorization: Bearer <Token> 148 +Content-Type: application/json 149 + 150 +{ 151 + "sourceCaptureTransactionId" : "534313", 152 + "sellerReceiptId": "2019-11-28", 153 + "additionalReferences":{ 154 + "acquirerBatchId": "fdsfsdfsd", 155 + "acquirerTransactionId" : "534313" 156 + }, 157 + "amount": 200.0 158 +} 159 +{{/code}} 160 + 161 +==== Get captures ==== 162 + 163 +{{code language="http" title="**Request**"}} 164 +GET /ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/captures/YYY HTTP/1.1 165 +Host: - 166 +Authorization: Bearer <Token> 167 +Content-Type: application/json 168 + 169 +{{/code}} 170 + 171 +==== List captures ==== 172 + 173 +{{code language="http" title="**Request**"}} 174 +GET /ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/captures HTTP/1.1 175 +Host: - 176 +Authorization: Bearer <Token> 177 +Content-Type: application/json 178 + 179 +{{/code}} 180 + 181 +==== Resource captures ==== 182 + 183 +{{code language="http" title="**Response**"}} 184 +HTTP/1.1 201 CREATED 185 +Content-Type: application/json 186 + 187 +{ 188 + "description": "stora butiken test, köpref. 12345689", 189 + "sourceCaptureTransactionId" : "534313", 190 + "additionalReferences":{ 191 + "acquirerBatchId": "fdsfsdfsd", 192 + "acquirerTransactionId" : "534313", 193 + }, 194 + "sellerReceiptId": "12345689", 195 + "amount": 200.0, 196 + "reversals": "/ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/captures/YYY/reversals", 197 + "@id": "/ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/capture/YYY", 198 + "parentHREF": "/ledger/credit-account-acquiring/v1/XXX/authorizations/NNN", 199 + "operations": [ 200 + { 201 + "rel": "create-reversal", 202 + "method": "post", 203 + "href": "/ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/captures/YYY/reversal" 204 + } 205 + ] 206 +} 207 +{{/code}} 208 + 209 +==== Resource properties captures ==== 210 + 211 +(% class="table-bordered table-striped" %) 212 +|=(% style="width: 337px;" %)Property|=(% style="width: 121px;" %)Data type|=(% style="width: 164px;" %)Format|=(% style="width: 1156px;" %)Description 213 +|(% style="width:337px" %)@id |(% style="width:121px" %)string|(% style="width:164px" %)Uri|(% style="width:1156px" %) 214 +|(% style="width:337px" %)description|(% style="width:121px" %)string|(% style="width:164px" %)Maxlength: 200|(% style="width:1156px" %)Describes the current capture (derives from info sent in the authorization), may be printed on the bill, output only 215 +|(% style="width:337px" %)((( 216 +(% style="background-color:transparent" %)sourceCaptureTransactionId 217 +)))|(% style="width:121px" %)string|(% style="width:164px" %)Maxlength: 50|(% style="width:1156px" %)Unique identifier of the capture transaction 218 +|(% style="width:337px" %)((( 219 +additionalReferences.acquirerBatchId 220 +)))|(% style="width:121px" %)string|(% style="width:164px" %)Maxlength: 50|(% style="width:1156px" %)Used for reconciling acquirer transactions. See [[RKHA21>>||anchor="HRKHA21format"]] section on this page for more information 221 +|(% style="width:337px" %)additionalReferences.acquirerTransactionId|(% style="width:121px" %)string|(% style="width:164px" %)Maxlength: 50|(% style="width:1156px" %)Unique acquirer identifier of the transaction 222 +|(% style="width:337px" %)sellerReceiptId|(% style="width:121px" %)string|(% style="width:164px" %)Maxlength: 50|(% style="width:1156px" %) 223 +|(% style="width:337px" %)amount|(% style="width:121px" %)decimal|(% style="width:164px" %) |(% style="width:1156px" %) 224 +|(% style="width:337px" %)reversals|(% style="width:121px" %)string|(% style="width:164px" %)Uri|(% style="width:1156px" %) 225 + 226 +---- 227 + 228 +== Offline-captures == 229 + 230 +Offline capture transactions can be used when the point of sales cannot connect to the acquiring api to perform standard authorizations. Offline captures can cause the charged credit account to exceed the account limits. Offline captures are always limited by agreement. Different acquiring terms apply for offline-captures compared to standard authorization -> captures. 231 + 232 +(% class="box warningmessage" %) 233 +((( 234 +**Note!** This is not a general purpose function. The agreement between the client and PayEx will dictate if the function can be used. 235 +))) 236 + 237 +==== Post offline-captures ==== 238 + 239 +{{code language="http" title="**Request**"}} 240 +POST /ledger/credit-account-acquiring/v1/XXX/offline-captures HTTP/1.1 241 +Host: - 242 +Authorization: Bearer <Token> 243 +Content-Type: application/json 244 + 245 +{ 246 + "pointOfSale": "stora butiken test, köpref. 12345689", 247 + "sourceCaptureTransactionId" : "534313", 248 + "additionalReferences":{ 249 + "acquirerBatchId": "fdsfsdfsd", 250 + "acquirerTransactionId" : "534313", 251 + }, 252 + "sellerReceiptId": "12345689", 253 + "sellerNumber" : "654", 254 + "cardToken" : "1564316498964156", 255 + "accountToken" : null, 256 + "captureAmount": 300.0, 257 + "currency": "SEK", 258 + "@id" : "/ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/captures/YYY", 259 + "credits" : "/ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/captures/YYY/credits", 260 + "schemaUri": "/ledger/invoice-purchase/v1/PayEx.AR.InvoicePurchase.Api.Resources.Authorizations.Resource", 261 + "parentHREF": "/", 262 + "operations" : [] 263 +} 264 +{{/code}} 265 + 266 +(% class="box successmessage" %) 267 +((( 268 +**Note: **The resource created from POST calls towards "offline-capture" operation is actually a "capture" resource, not "offline-capture". 269 +Execute GET calls to the capture resource to retreive previously made offline-captures 270 +))) 271 + 272 +==== Get offline-captures ==== 273 + 274 +{{code language="http" title="**Request**"}} 275 +GET /ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/captures/YYY HTTP/1.1 276 +Host: - 277 +Authorization: Bearer <Token> 278 +Content-Type: application/json 279 + 280 +{{/code}} 281 + 282 +==== List offline-captures ==== 283 + 284 +{{code language="http" title="**Request**"}} 285 +GET /ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/captures HTTP/1.1 286 +Host: - 287 +Authorization: Bearer <Token> 288 +Content-Type: application/json 289 + 290 +{{/code}} 291 + 292 +==== Operation offline-captures response ==== 293 + 294 +{{code language="http" title="**Request**"}} 295 +HTTP/1.1 201 CREATED 296 +Content-Type: application/json 297 + 298 +{ 299 + "captures" : "/ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/captures/YYY" 300 +} 301 +{{/code}} 302 + 303 +== Refunds == 304 + 305 +Used to refund a transaction without any reference to it. 306 + 307 +==== Create refunds ==== 308 + 309 +Execute post towards this resource to place the amount on the specified account 310 + 311 +{{code language="http" title="**Request**"}} 312 +POST /ledger/credit-account-acquiring/v1/XXX/refunds HTTP/1.1 313 +Host: - 314 +Authorization: Bearer <Token> 315 +Content-Type: application/json 316 + 317 +{ 318 + "pointOfSale": "stora butiken test, köpref. 12345689", 319 + "cardToken" : "1564316498964156", 320 + "sellerReceiptId": "12345689", 321 + "sellerNumber" : "654", 322 + "additionalReferences":{ 323 + "acquirerBatchId": "fdsfsdfsd", 324 + "acquirerTransactionId" : "534313", 325 + }, 326 + "sourceRefundTransactionId" : "534312", 327 + "amount": 200.0, 328 + "currency": "SEK" 329 +} 330 +{{/code}} 331 + 332 +==== Get refunds ==== 333 + 334 +{{code language="http" title="**Request**"}} 335 +GET /ledger/credit-account-acquiring/v1/XXX/refunds HTTP/1.1 336 +Host: - 337 +Authorization: Bearer <Token> 338 +Content-Type: application/json 339 + 340 +{{/code}} 341 + 342 +==== List refunds ==== 343 + 344 +{{code language="http" title="**Request**"}} 345 +GET /ledger/credit-account-acquiring/v1/XXX/refunds HTTP/1.1 346 +Host: - 347 +Authorization: Bearer <Token> 348 +Content-Type: application/json 349 + 350 +{{/code}} 351 + 352 +==== Resource refunds ==== 353 + 354 +{{code language="http" title="**Response**"}} 355 +HTTP/1.1 200 OK 356 +Content-Type: application/json 357 + 358 +{ 359 + "pointOfSale": "stora butiken test, köpref. 12345689", 360 + "cardToken" : "1564316498964156", 361 + "sellerReceiptId": "12345689", 362 + "sellerNumber" : "654", 363 + "additionalReferences":{ 364 + "acquirerBatchId": "fdsfsdfsd", 365 + "acquirerTransactionId" : "534313", 366 + }, 367 + "sourceRefundTransactionId" : "534313", 368 + "amount": 200.00, 369 + "currency": "SEK", 370 + "@id" : "/ledger/credit-account-acquiring/v1/XXX/reversals/YYY", 371 + "parentHREF": "", 372 + "operations" : [] 373 +} 374 +{{/code}} 375 + 376 +==== Refunds properties ==== 377 + 378 +(% class="table-bordered table-striped" %) 379 +|=(% style="width: 215px;" %)Property|=(% style="width: 114px;" %)Data type|=(% style="width: 118px;" %)Format|=(% style="width: 586px;" %)Description 380 +|(% style="width:215px" %)@id |(% style="width:114px" %)string|(% style="width:118px" %)Maxlength: |(% style="width:586px" %) 381 +|(% style="width:337px" %)((( 382 +additionalReferences.acquirerBatchId 383 +)))|(% style="width:121px" %)string|(% style="width:164px" %)Maxlength: 50|(% style="width:1156px" %)Used for reconciling acquirer transactions. See [[RKHA21>>||anchor="HRKHA21format"]] section on this page for more information 384 +|(% style="width:337px" %)additionalReferences.acquirerTransactionId|(% style="width:121px" %)string|(% style="width:164px" %)Maxlength: 50|(% style="width:1156px" %)Unique acquirer identifier of the transaction 385 +|(% style="width:215px" %)sourceRefundTransactionId|(% style="width:114px" %)string|(% style="width:118px" %)Maxlength: 50|(% style="width:586px" %) 386 +|(% style="width:215px" %)amount|(% style="width:114px" %)decimal|(% style="width:118px" %) |(% style="width:586px" %) 387 +|(% style="width:215px" %)currency|(% style="width:114px" %)string|(% style="width:118px" %)[[ISO 4217>>url:https://sv.wikipedia.org/wiki/ISO_4217]]|(% style="width:586px" %) 388 +|(% style="width:215px" %)sellerNumber|(% style="width:114px" %)string|(% style="width:118px" %)Maxlength: 15|(% style="width:586px" %)Identifier of the current seller/merchant 389 +|(% style="width:215px" %)cardToken|(% style="width:114px" %)string|(% style="width:118px" %) |(% style="width:586px" %)identifier of the card. The aurhotization is made on the account that the card is linked to 390 +|(% style="width:215px" %)pointOfSale|(% style="width:114px" %)string|(% style="width:118px" %)Maxlength: 50|(% style="width:586px" %)Name of the location/point/shop of sale, will be returned in reservation resource 391 +|(% style="width:215px" %)sellerReceiptId|(% style="width:114px" %)string|(% style="width:118px" %)Maxlength: 50|(% style="width:586px" %) 392 + 393 +== Reversals == 394 + 395 +Used to reverse a capture transaction 396 + 397 +==== Create reversals ==== 398 + 399 +{{code language="http" title="**Request**"}} 400 +POST /ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/captures/YYY/reversals HTTP/1.1 401 +Host: - 402 +Authorization: Bearer <Token> 403 +Content-Type: application/json 404 + 405 +{ 406 + "additionalReferences":{ 407 + "acquirerBatchId": "fdsfsdfsd", 408 + "acquirerTransactionId" : "534313", 409 + }, 410 + "sellerReceiptId" : "534313", 411 + "sourceReversalTransactionId" : "534313", 412 + "amount": 200.0 413 +} 414 +{{/code}} 415 + 416 +==== Get reversals ==== 417 + 418 +{{code language="http" title="**Request**"}} 419 +GET /ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/captures/YYY/reversals/NNN HTTP/1.1 420 +Host: - 421 +Authorization: Bearer <Token> 422 +Content-Type: application/json 423 + 424 +{{/code}} 425 + 426 +==== List reversals ==== 427 + 428 +{{code language="http" title="**Request**"}} 429 +GET /ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/captures/YYY/reversals HTTP/1.1 430 +Host: - 431 +Authorization: Bearer <Token> 432 +Content-Type: application/json 433 + 434 +{{/code}} 435 + 436 +==== Resource reversals ==== 437 + 438 +{{code language="http" title="**Response**"}} 439 +HTTP/1.1 200 OK 440 +Content-Type: application/json 441 + 442 +{ 443 + "additionalReferences":{ 444 + "acquirerBatchId": "fdsfsdfsd", 445 + "acquirerTransactionId" : "534313", 446 + }, 447 + "sourceReversalTransactionId" : "534313", 448 + "amount": 200.00, 449 + "currency": "SEK", 450 + "@id" : "/ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/captures/YYY/credits/ZZZ", 451 + "parentHREF": "/ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/captures/YYY", 452 + "operations" : [] 453 +} 454 +{{/code}} 455 + 456 +==== Reversals resource properties ==== 457 + 458 +(% class="table-bordered table-striped" %) 459 +|=(% style="width: 215px;" %)Property|=(% style="width: 114px;" %)Data type|=(% style="width: 118px;" %)Format|=(% style="width: 586px;" %)Description 460 +|(% style="width:215px" %)@id |(% style="width:114px" %)string|(% style="width:118px" %)Maxlength: |(% style="width:586px" %) 461 +|(% style="width:337px" %)((( 462 +additionalReferences.acquirerBatchId 463 +)))|(% style="width:121px" %)string|(% style="width:164px" %)Maxlength: 50|(% style="width:1156px" %)Used for reconciling acquirer transactions. See [[RKHA21>>||anchor="HRKHA21format"]] section on this page for more information 464 +|(% style="width:337px" %)additionalReferences.acquirerTransactionId|(% style="width:121px" %)string|(% style="width:164px" %)Maxlength: 50|(% style="width:1156px" %)Unique acquirer identifier of the transaction 465 +|(% style="width:215px" %)sourceReversalTransactionId|(% style="width:114px" %)string|(% style="width:118px" %)Maxlength: 50|(% style="width:586px" %) 466 +|(% style="width:215px" %)amount|(% style="width:114px" %)decimal|(% style="width:118px" %) |(% style="width:586px" %) 467 +|(% style="width:215px" %)currency|(% style="width:114px" %)string|(% style="width:118px" %)[[ISO 4217>>url:https://sv.wikipedia.org/wiki/ISO_4217]]|(% style="width:586px" %) 468 + 469 +== Cancellations == 470 + 471 +==== Post cancellations ==== 472 + 473 +{{code language="http" title="**Request**"}} 474 +POST /ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/cancellations HTTP/1.1 475 +Host: - 476 +Authorization: Bearer <Token> 477 +Content-Type: application/json 478 +{{/code}} 479 + 480 +==== Get cancellations ==== 481 + 482 +{{code language="http" title="**Request**"}} 483 +GET /ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/cancellations/NNN HTTP/1.1 484 +Host: - 485 +Authorization: Bearer <Token> 486 +Content-Type: application/json 487 + 488 +{{/code}} 489 + 490 +==== Resource cancellations ==== 491 + 492 +{{code language="http" title="**Response**"}} 493 +HTTP/1.1 200 OK 494 +Content-Type: application/json 495 + 496 +{ 497 + "cancellationDate" : "2019-11-20", 498 + "@id" : "/ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/cancellations", 499 + "parentHREF" : "/ledger/credit-account-acquiring/v1/XXX/authorizations/NNN" 500 +} 501 +{{/code}} 502 + 503 +==== List cancellations ==== 504 + 505 +{{code language="http" title="**Request**"}} 506 +GET /ledger/credit-account-acquiring/v1/XXX/authorizations/NNN/cancellations HTTP/1.1 507 +Host: - 508 +Authorization: Bearer <Token> 509 +Content-Type: application/json 510 + 511 +{{/code}} 512 + 513 +**Resource properties** 514 + 515 +(% class="table-bordered table-striped" %) 516 +|=(% style="width: 215px;" %)Property|=(% style="width: 114px;" %)Data type|=(% style="width: 118px;" %)Format|=(% style="width: 586px;" %)Description 517 +|(% style="width:215px" %)@id |(% style="width:114px" %)string|(% style="width:118px" %)Uri|(% style="width:586px" %) 518 +|(% style="width:215px" %)cancellationDate|(% style="width:114px" %)date|(% style="width:118px" %)[[ISO 8601>>url:http://en.wikipedia.org/wiki/ISO_8601||rel="noreferrer" title="ISO8601 on Wikipedia"]]|(% style="width:586px" %) 519 + 520 +=== RKHA21 format === 521 + 522 +If the original source for the transactions towards Captures/Reversals/Refunds/Offline-captures is the RKHA21 file the below rules should be used to set the AcquirerBatchId. 523 + 524 +AcquirerBatchId = [Processing date][Sender][Cycle] 525 + 526 +For the example values in the table below the AcquirerBatchId will be "**200206885020**". 527 + 528 +**RKHA21 file header row description** 529 + 530 +(% class="table-bordered table-striped" %) 531 +|=(% style="width: 113px;" %)Position|=(% style="width: 226px;" %)Field|=(% style="width: 118px;" %)Format|=(% style="width: 586px;" %)Description|=(% style="width: 586px;" %)Example 532 +|(% style="width:113px" %)1|(% style="width:226px" %)Transaction code|(% style="width:118px" %)2 N|(% style="width:586px" %)01|(% style="width:586px" %) 533 +|(% style="width:113px" %)3|(% style="width:226px" %)Processing date|(% style="width:118px" %)6 N|(% style="width:586px" %)YYMMDD|(% style="width:586px" %)200206 534 +|(% style="width:113px" %)9|(% style="width:226px" %)Sender|(% style="width:118px" %)4 N|(% style="width:586px" %)"8850" (Babs)|(% style="width:586px" %)8850 535 +|(% style="width:113px" %)13|(% style="width:226px" %)Cycle|(% style="width:118px" %)2 AN|(% style="width:586px" %)10/20|(% style="width:586px" %)20 536 +|(% style="width:113px" %)15|(% style="width:226px" %)Filler|(% style="width:118px" %)26 AN|(% style="width:586px" %)Space characters|(% style="width:586px" %) 537 +|(% style="width:113px" %)41|(% style="width:226px" %)Vers.nr/serial number|(% style="width:118px" %)6 N|(% style="width:586px" %)File serial number|(% style="width:586px" %) 538 +|(% style="width:113px" %)47|(% style="width:226px" %)Transaction entry|(% style="width:118px" %)1 AN|(% style="width:586px" %) |(% style="width:586px" %) 539 +|(% style="width:113px" %)48|(% style="width:226px" %)Filler|(% style="width:118px" %)333 AN|(% style="width:586px" %)Space characters|(% style="width:586px" %) 540 + 541 +(% class="box successmessage" %) 542 +((( 543 +The rkha format actually has a 28 character filler at position 13 by default, but for "Babs" the first two positions in this filler are redefined to be "cycle" (position 13 and 14), which leaves the Filler to be 26 characters instead of 28. 544 +))) 545 + 546 +=== Problems === 547 + 548 +If an error occur or any validation failed, a "problem" response will be returned. 549 +Below is a list of problems that can occur: 550 + 551 +**HttpStatus 401 Unauthorized** 552 + 553 +* Token expired 554 +* Token invalid 555 +* SellerNumber does not match token 556 +* CompanyNumber does not match token 557 + 558 +**HttpStatus 400 Error** 559 + 560 +* Validation: Argument required 561 +* Validation: Invalid value 562 + 563 +**HttpStatus 422 Unprocessable entity** 564 + 565 +* Authorization declined 566 + 567 +**HttpStatus 409 Conflict** 568 + 569 +* Invoice already authorized 570 +* Duplicate InvoiceNumber 571 +* Authorization is cancelled 572 +* Authorization already captured 573 +* Authorization has expired 574 +* Insufficient debited amount XXX 575 + 576 +**HttpStatus 501 NotImplemented** 577 + 578 +* CompanyNumber XXX not configured 579 +* SellerNumber XXX not configured at PayEx 580 +* CompanyNumber XXX missing configuration 581 + 582 +**HttpStatus 404 NotFound** 583 + 584 +* Authorization not found 585 + 586 +Below is an example of a problem that will be returned if buyer##.nationalConsumerIdentifier.value## is not valid in the authorization post request. 587 + 588 +{{code language="http" title="**Response**"}} 589 +HTTP/1.1 400 Error 590 +Content-Type: application/problem+json 591 + 592 +{ 593 + "Type": "http://[DNS]/ledger/invoice-purchase/problems/validation", 594 + "Title": "A validation error occurred", 595 + "Status": 400, 596 + "Instance": null, 597 + "Detail": "A validation error occurred. Please fix the problems mentioned in the 'problems' property below.", 598 + "Problems": [ 599 + { 600 + "buyer.nationalConsumerIdentifier.value": "Not a valid SE nationalConsumerIdentifier" 601 + } 602 + ] 603 +} 604 +{{/code}}