../credit-account-onboarding

Integrate to PayEx Credit Account Onboarding API 

Changelog

2020-03-02

  • Added statuses on applicationresource: "InitializedSigning" and "SigningFailed"

2020-02-28

  • minor changes in kyc object structure

2020-02-14

  • changed KYC object in ApplicationResource

This API is used to list currently available credit account offers as well as the associated onboarding process

1581023587369-139.png

Offers

List all offers

Response
GET /ledger/credit-account-onboarding/v1/XXX/offers HTTP/1.1
Host: -
Authorization: Bearer <Token>
Content-Type: application/json

{
   "operations": null,
   "items": [
        {                        
           "accountProfile" : "kontotyp-1",
           "title" : "kontotyp 1",
           "currency" : "SEK",
           "maxCreditLimit" : 50000.00,
           "interestFreePurchaseMonth" : true|false,
           "monthlyAdminFee" : 35.00,
           "reminderFee" : 35.00,
           "interest" : 35.00,
           "termsAndConditions" :
            {
               "standardEuropeeanAgreements" : "https://www.payex.com/term-and-conditions/no/-----.pdf",
               "accountTerms" : "https://www.payex.com/term-and-conditions/no/-----.pdf"
            },
           "@id" : "/ledger/credit-account-onboarding/v1/XXX/offers/kontotyp-1",
        },
        {                        
           "accountProfile" : "kontotyp-2",
           "title" : "kontotyp 2",
           "currency" : "SEK",
           "maxCreditLimit" : 0.00,
           "interestFreePurchaseMonth" : true|false,
           "monthlyAdminFee" : 35.00,
           "reminderFee" : 35.00,
           "interest" : 35.00,
           "termsAndConditions" :
            {
               "standardEuropeeanAgreements" : "https://www.payex.com/term-and-conditions/no/-----.pdf",
               "accountTerms" : "https://www.payex.com/term-and-conditions/no/-----.pdf"
            },
           "@id" : "/ledger/credit-account-onboarding/v1/XXX/offers/kontotyp-2",
        }
    ],
   "@id": "/ledger/credit-account-onboarding/v1/XXX/offers",
   "view": {
       "@id": "/ledger/credit-account-onboarding/v1/XXX/offers?$top=2&$skip=0",
       "next": "/ledger/credit-account-onboarding/v1/XXX/offers?$top=2&$skip=2"
    }
}

Offers Resource

Response
HTTP/1.1 200 OK
Content-Type: application/json

{                        
   "accountProfile" : "kontotyp-1000",
   "title" : "kontotyp 1,000",
   "currency" : "NOK",
   "maxCreditLimit" : 50000.00,
   "interestFreePurchaseMonth" : true|false,
   "monthlyAdminFee" : 35.00,
   "reminderFee" : 35.00,
   "interest" : 35.00,
   "termsAndConditions" :
    {
       "standardEuropeeanAgreements" : "https://www.payex.com/term-and-conditions/no/-----.pdf",
       "accountTerms" : "https://www.payex.com/term-and-conditions/no/-----.pdf"
    },
   "@id" : "/ledger/credit-account-onboarding/v1/XXX/offers/kontotyp-1000",
   "operations" :
        [
            {
               "rel" : "apply-for-account",
               "href" : "/ledger/credit-account-onboarding/v1/XXX/offers/kontotyp-1000/applications",
               "method" : "POST"
            }
        ]
}

Resource properties

PropertyData typeFormatDescription
@id stringUri 
accountProfilestringMaxlength: 50 
titlestringMaxlength: 50 
currencystringISO 4217 
maxCreditLimitdecimal  
interestFreePurchaseMonthboolISO 8601 
monthlyAdminFeedecimal  
reminderFeedecimal  
termsAndConditions.standardEuropeeanAgreementsstringUri 
termsAndConditions.accountTermsstringUri 

Applications

Add application to offer

Request
POST /ledger/credit-account-onboarding/v1/XXX/offers/YYY/applications  HTTP/1.1
Host: -
Authorization: Bearer <Token>
Content-Type: application/json

{    
   "nationalConsumerIdentifier" : {
       "value" : "19101010-1010",
       "countryCode" : "SE"                
    },
   "creditLimit": 5000.00,
   "customerNo" : "951753456",
   "emailAddress" : "test@testshop.se",
   "cellPhone" : "+46701234456",  
   "ipAddress": "1.1.1.1",     
   "legalAddress" : {
       "name" : "John Smith",
       "streetAddress" : "Teststreet",
       "city" : "Testcity",
       "coAddress" : "",
       "zipCode" : "12345",
       "countryCode" : "SE"
    },
   "kyc": {
       "questions":[
            {
               "code": "employment",                
               "text": "Vad är din sysselsättning?",
               "answer" : {
                   "code": "self-employed",
                   "text": "Egen företagare"
                }                
            },
            {
               "code": "employment-since",                 
               "text": "Hur länge har du haft denna sysselsättning?",
               "answer" : {
                   "code": "2016-09",
                   "text": "2016-09"
                }
            },
            {
               "code": "monthlyIncome",                 
               "text": "Månadsinkomst före skatt",
               "answer" : {
                   "code": "10000.00",
                   "text": "10000"
                }
            },
            {
               "code": "monthlyPurchaseAmount",                 
               "text": "Hur mycket kommer du genomsnitt att handla på ditt kort?",
               "answer" : {
                   "code": "3000.00",               
                   "text": "3000"
                }
            },
            {
               "code": "monthlyNumberOfDeposits",                 
               "text": "Hur många inbetalningar kommer du att göra per månad?",
               "answer" : {
                   "code": "1-2",
                   "text": "1-2"
                }
            },
            {
               "code": "IsPep",                 
               "text": "Är du en person i politiskt utsatt ställning (PEP), det vill säga.....",
               "answer" : {
                   "code" : "true",
                   "text" : "Ja"
                }
            }
        ]
    }
}

List all applications

Request
GET /ledger/credit-account-onboarding/v1/XXX/offers/YYY/applications HTTP/1.1
Host: -
Authorization: Bearer <Token>
Content-Type: application/json

Get a single application

Request
GET /ledger/credit-account-onboarding/v1/XXX/offers/YYY/applications/NNN  HTTP/1.1
Host: -
Authorization: Bearer <Token>
Content-Type: application/json

Applications Resource

Response
HTTP/1.1 200 OK
Content-Type: application/json

{    
   "nationalConsumerIdentifier" : {
       "value" : "19101010-1010",
       "countryCode" : "SE"                
    },
   "status" : "awaiting-sign",
   "customerNo" : "951753456",
   "creditLimit": 5000.00,
   "emailAddress" : "test@testshop.se",
   "cellPhone" : "+46701234456",  
   "ipAddress": "1.1.1.1",     
   "legalAddress" : {
       "name" : "John Smith",
       "streetAddress" : "Teststreet",
       "city" : "Testcity",
       "coAddress" : "",
       "zipCode" : "12345",
       "countryCode" : "SE"
    },
   "kyc": {
       "questions":[
            {
               "code": "employment",                
               "text": "Vad är din sysselsättning?",
               "answer" : {
                   "code": "self-employed",
                   "text": "Egen företagare"
                }                
            },
            {
               "code": "employment-since",                 
               "text": "Hur länge har du haft denna sysselsättning?",
               "answer" : {
                   "code": "2016-09",
                   "text": "2016-09"
                }
            },
            {
               "code": "monthlyIncome",                 
               "text": "Månadsinkomst före skatt",
               "answer" : {
                   "code": "10000.00",
                   "text": "10000"
                }
            },
            {
               "code": "monthlyPurchaseAmount",                 
               "text": "Hur mycket kommer du genomsnitt att handla på ditt kort?",
               "answer" : {
                   "code": "3000.00",               
                   "text": "3000"
                }
            },
            {
               "code": "monthlyNumberOfDeposits",                 
               "text": "Hur många inbetalningar kommer du att göra per månad?",
               "answer" : {
                   "code": "1-2",
                   "text": "1-2"
                }
            },
            {
               "code": "IsPep",                 
               "text": "Är du en person i politiskt utsatt ställning (PEP), det vill säga.....",
               "answer" : {
                   "code" : "true",
                   "text" : "Ja"
                }
            }
        ]
    },
   "account" : null,
   "@id" : "/ledger/credit-account-onboardings/v1/501/offers/kontotyp-10000/applications/1561561-54641515-56456",
   "parentHREF" : "/ledger/credit-account-onboardings/v1/XXX/offers/kontotyp-10000",
   "operations" : [
        {
           "rel" : "sign-agreement",
           "href" : "/ledger/credit-account-onboardings/v1/XXX/offers/kontotyp-10000/applications/1561561-54641515-56456/sign-agreement",
           "method" : "POST"
        }
    ]
}

Resource properties

PropertyData typeRequired in postFormatDescription
@id string-Maxlength:  
nationalConsumerIdentifier.valuestringYesYYYYMMDD-NNNCA valid swedish "personnummer"
nationalConsumerIdentifier.countryCodestringYesISO 3166-1 alpha-2 
statusstring-Maxlength: 25
  • AwaitingSign
  • InitializedSigning
  • Approved
  • Rejected
  • SigningFailed
customerNostringYesMaxlength: 50 
creditLimitdecimalYes  
emailAddressstringYesMaxlength: 254
Regex pattern: [^@]+@[^\.]+\..+
 
cellPhonestringYesMaxlength: 15 
ipAddressstringNoMaxlength: 43
Regex pattern: [a-z0-9.:/]*
 
legalAddress.namestringYesMaxlength: 72end-customer fullname
legalAddress.streetAddressstringNoMaxlength: 35 
legalAddress.citystringYesMaxlength: 30 
legalAddress.coAddressstringNoMaxlength: 35 
legalAddress.zipCodestringYesMaxlength: 15ZipCode without whitespaces
legalAddress.countryCodestringYesISO 3166-1 alpha-2 
accountstring-UriReference to created account
kycobjectYes kyc (know your customer). The questions and answers in the above example are just examples of what it might look like. This API does not validate that "correct" questions are asked
kyc.questionslist of objectsYes  
kyc.questions.codestringYes The code definition of the question
kyc.questions.textstringYes The actual question text that was presented to the end-customer
kyc.questions.aswer.codestringYes The answered code definition from the end-customer
kyc.questions.aswer.textstringYes The actual displayed answertext that was presented to the customer

Sign-agreement (Operation)

Request

Request
POST /ledger/credit-account-onboarding/v1/XXX/offers/YYY/applications/NNN/sign-agreement HTTP/1.1
Host: -
Authorization: Bearer <Token>
Content-Type: application/json

Response

Request
HTTP/1.1 201 Created
Content-Type: application/json

{
   "createdAccount" : "https://api.payex.com/ledger/credit-account/v1/XXX/accounts/123456",
}

Resource properties

PropertyData typeFormatDescription
createdAccountstringUri 

Problems

If an error occur or any validation failed, a "problem" response will be returned.
Below is a list of problems that can occur:

HttpStatus 401 Unauthorized

  • Token expired
  • Token invalid
  • SellerNumber does not match token
  • CompanyNumber does not match token

HttpStatus 400 Error

  • Validation: Argument required
  • Validation: Invalid value

HttpStatus 422 Unprocessable entity

  • Authorization declined

HttpStatus 409 Conflict

  • Invoice already authorized
  • Duplicate InvoiceNumber
  • Authorization is cancelled
  • Authorization already captured
  • Authorization has expired
  • Insufficient debited amount XXX

HttpStatus 501 NotImplemented

  • CompanyNumber XXX not configured
  • SellerNumber XXX not configured at PayEx
  • CompanyNumber XXX missing configuration

HttpStatus 404 NotFound

  • Authorization not found

Below is an example of a problem that will be returned if buyer.nationalConsumerIdentifier.value is not valid in the authorization post request.

Response
HTTP/1.1 400 Error
Content-Type: application/problem+json

{
   "Type": "http://[DNS]/ledger/invoice-purchase/problems/validation",
   "Title": "A validation error occurred",
   "Status": 400,
   "Instance": null,
   "Detail": "A validation error occurred. Please fix the problems mentioned in the 'problems' property below.",
   "Problems": [
        {
           "buyer.nationalConsumerIdentifier.value": "Not a valid SE nationalConsumerIdentifier"
        }
    ]
}
Created by David Persson on 2019/12/04 09:43