From version 53.1
edited by David Persson
on 2020/03/27 14:14
To version 53.2
edited by David Persson
on 2020/04/21 08:14
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -385,59 +385,43 @@
385 385  |=(% style="width: 215px;" %)Property|=(% style="width: 114px;" %)Data type|=(% style="width: 118px;" %)Format|=(% style="width: 586px;" %)Description
386 386  |(% style="width:215px" %)createdAccount|(% style="width:114px" %)string|(% style="width:118px" %)Uri|(% style="width:586px" %)
387 387  
388 +(% id="HProblems-1" %)
388 388  == Problems ==
389 389  
390 -If an error occur or any validation failed, a "problem" response will be returned.
391 -Below is a list of problems that can occur:
391 +All errors from the api are returned in the form of "problems" (response body), except for the http status code itself.
392 +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.
393 +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.
392 392  
393 -**HttpStatus 401 Unauthorized**
395 +Problems of type validation does contain an additional list ("Problems") that describes exactly which parameter that failed the validation
394 394  
395 -* Token expired
396 -* Token invalid
397 -* CompanyNumber does not match token
397 +(% id="HExample" %)
398 +=== Example ===
398 398  
399 -**HttpStatus 400 Error**
400 -
401 -* Validation: Argument required
402 -* Validation: Invalid value
403 -
404 -**HttpStatus 422 Unprocessable entity**
405 -
406 -* Signing process ended unexpectedly
407 -* Customer or account creation failed
408 -* Signicat signing was not successful
409 -
410 -**HttpStatus 409 Conflict**
411 -
412 -* State expected to be [AwaitSigning]. Actual state: [XXXX]
413 -*
414 -
415 -**HttpStatus 501 NotImplemented**
416 -
417 -* CompanyNumber XXX not configured
418 -* SellerNumber XXX not configured at PayEx
419 -* CompanyNumber XXX missing configuration
420 -
421 -**HttpStatus 404 NotFound**
422 -
423 -* Resource not found
424 -
425 -Below is an example of a problem that will be returned if buyer##.nationalConsumerIdentifier.value## is not valid in the authorization post request.
426 -
427 427  {{code language="http" title="**Response**"}}
428 428  HTTP/1.1 400 Error
429 429  Content-Type: application/problem+json
430 430  
431 431  {
432 - "Type": "http://[DNS]/ledger/invoice-purchase/problems/validation",
433 - "Title": "A validation error occurred",
434 - "Status": 400,
435 - "Instance": null,
436 - "Detail": "A validation error occurred. Please fix the problems mentioned in the 'problems' property below.",
437 - "Problems": [
438 - {
439 - "buyer.nationalConsumerIdentifier.value": "Not a valid SE nationalConsumerIdentifier"
440 - }
441 - ]
405 + "Type" : "ledger.credit-account.validation",
406 + "Title" : "A validation error occurred",
407 + "Status" : 400,
408 + "Instance" : "215d4206-ca35-4f43-85ad-169c8f6d4ec1",
409 + "Detail" : "A validation error occurred. Please fix the problems mentioned in the 'problems' property below.",
410 + "Problems" : [
411 + {
412 + "amount" : "Expected value between [0,01]-[79228162514264337593543950335] actual [0]"
413 + }
414 + ]
442 442  }
443 443  {{/code}}
417 +
418 +(% id="HProblemtypes" %)
419 +=== Problem types ===
420 +
421 +Note, each problem typecode is preceded by "ledger.credit-account." in this API, e.g. the error "validation" in the table below will appear as typecode "ledger.credit-account.validation".
422 +
423 +|=Problem type (code)|=Httpstatus|=Description
424 +|validation|400|occurs if any of the inputvalidation fails, it is described in the problem which parameter that failed the validation
425 +|account-profile-exists|404|occurs if the customer already has an account with the requested account profile
426 +
427 +