../credit-account-onboarding

Integrate to PayEx Credit Account Onboarding API 

Offers

List

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

Resource

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

{                        
   "accountProfile" : "kontotyp-1000",
   "title" : "kontotyp 1,000",
   "currency" : "NOK",
   "creditLimit" : 1000.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/501/offers/kontotyp-1000",
   "operations" :
        [
            {
               "title" : "apply-for-account",
               "href" : "/ledger/credit-account-onboarding/v1/501/offers/kontotyp-1000/applications",
               "action" : "post"
            }
        ]
}

Resource properties

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

Applications

List

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

Get

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

Post

Request
GET /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": {
       "parameters":[
            {
               "name": "employment",
               "value": "self-employed"
            },
            {
               "name": "employment-since",
               "value": "2016-09"
            },
            {
               "name": "monthlyIncome",
               "value": "10000.00"
            },
            {
               "name": "monthlyPurchaseAmount",
               "value": "3000.00"
            },
            {
               "name": "monthlyNumberOfDeposits",
               "value": "1-2"
            },
        ]
    },
   "kycAlternativ2": {
       "parameters":[
            {
               "name": "employment",
               "type": "string",
               "stringValue": "self-employed"
            },
            {
               "name": "employment-since",
               "type": "date",
               "dateValue": "2016-09"
            },
            {
               "name": "monthlyIncome",
               "type": "decimal",
               "decimalValue": 10000.00
            },
            {
               "name": "monthlyPurchaseAMount",
               "type": "decimal",
               "decimalValue": 3000.00
            },
            {
               "name": "monthlyNumberOfDeposits",
               "type": "string",
               "stringValue": "1-2"
            },
        ]
    },
}

Resource

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

{    
   "nationalConsumerIdentifier" : {
       "value" : "19101010-1010",
       "countryCode" : "SE"                
    },
   "status" : "awaiting-sign",
   "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": {
       "parameters":[
            {
               "name": "employment",
               "value": "self-employed"
            },
            {
               "name": "employment-since",
               "value": "2016-09"
            },
            {
               "name": "monthlyIncome",
               "value": "10000.00"
            },
            {
               "name": "monthlyPurchaseAmount",
               "value": "3000.00"
            },
            {
               "name": "monthlyNumberOfDeposits",
               "value": "1-2"
            },
        ]
    },
   "kycAlternativ2": {
       "parameters":[
            {
               "name": "employment",
               "type": "string",
               "stringValue": "self-employed"
            },
            {
               "name": "employment-since",
               "type": "date",
               "dateValue": "2016-09"
            },
            {
               "name": "monthlyIncome",
               "type": "decimal",
               "decimalValue": 10000.00
            },
            {
               "name": "monthlyPurchaseAMount",
               "type": "decimal",
               "decimalValue": 3000.00
            },
            {
               "name": "monthlyNumberOfDeposits",
               "type": "string",
               "stringValue": "1-2"
            },
        ]
    },
   "account" : null,
   "@id" : "/ledger/credit-account-onboardings/v1/501/offers/kontotyp-10000/applications/1561561-54641515-56456",
   "parentHREF" : "/ledger/credit-account-onboardings/v1/501/offers/kontotyp-10000",
   "operations" : [
        {
           "rel" : "sign-application",
           "href" : "/ledger/credit-account-onboardings/v1/501/offers/kontotyp-10000/applications/1561561-54641515-56456/sign-agreement",
           "action" : "post"
        }
    ]
}

Resource properties

PropertyData typeFormatDescription
@id stringMaxlength:  
nationalConsumerIdentifier.valuestringYYYYMMDD-NNNCA valid swedish "personnummer"
nationalConsumerIdentifier.countryCodestringISO 3166-1 alpha-2 
statusstringMaxlength: 25
  • awaiting-sign
  • approved
  • rejected
customerNostringMaxlength: 50 
emailAddressstringMaxlength: 254
Regex pattern: [^@]+@[^\.]+\..+
 
cellPhonestringMaxlength: 15 
ipAddressstringMaxlength: 43
Regex pattern: [a-z0-9.:/]*
 
LegalAddress.namestringMaxlength: 72end-customer fullname
LegalAddress.streetAddressstringMaxlength: 35 
LegalAddress.citystringMaxlength: 30 
LegalAddress.coAddressstringMaxlength: 35 
LegalAddress.zipCodestringMaxlength: 15 
LegalAddress.countryCodestringISO 3166-1 alpha-2 
accountstringUriReference to created account

Sign-agreement (Operation)

Request

Request
GET /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/123/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