Integrate to PayEx Credit Account Onboarding API
Changelog
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
Offers
List
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"
}
}
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"
}
}
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/XXX/offers/kontotyp-1000",
"operations" :
[
{
"title" : "apply-for-account",
"href" : "/ledger/credit-account-onboarding/v1/XXX/offers/kontotyp-1000/applications",
"action" : "post"
}
]
}
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/XXX/offers/kontotyp-1000",
"operations" :
[
{
"title" : "apply-for-account",
"href" : "/ledger/credit-account-onboarding/v1/XXX/offers/kontotyp-1000/applications",
"action" : "post"
}
]
}
Resource properties
Property | Data type | Format | Description |
---|---|---|---|
@id | string | Uri | |
accountProfile | string | Maxlength: 50 | |
title | string | Maxlength: 50 | |
currency | string | ISO 4217 | |
creditLimit | decimal | ||
interestFreePurchaseMonth | bool | ISO 8601 | |
monthlyAdminFee | decimal | ||
reminderFee | decimal | ||
termsAndConditions.standardEuropeeanAgreements | string | Uri | |
termsAndConditions.accountTerms | string | Uri |
Applications
Post
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":[
{
"questionCode": "employment",
"question": "Vad är din sysselsättning?",
"answerCode": "self-employed",
"answerText": "Egen företagare"
},
{
"questionCode": "employment-since",
"question": "Hur länge har du haft denna sysselsättning?",
"answerCode": "2016-09",
"answerText": "2016-09"
},
{
"questionCode": "monthlyIncome",
"question": "Månadsinkomst före skatt",
"answerCode": "10000.00",
"answerText": "10000"
},
{
"questionCode": "monthlyPurchaseAmount",
"question": "Hur mycket kommer du genomsnitt att handla på ditt kort?",
"answerCode": "3000.00",
"answerText": "3000"
},
{
"questionCode": "monthlyNumberOfDeposits",
"question": "Hur många inbetalningar kommer du att göra per månad?",
"answerCode": "1-2",
"answerText": "1-2"
},
{
"questionCode": "IsPep",
"question": "Är du en person i politiskt utsatt ställning (PEP), det vill säga.....",
"answerCode": "true",
"answerText": "Ja"
}
]
},
}
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":[
{
"questionCode": "employment",
"question": "Vad är din sysselsättning?",
"answerCode": "self-employed",
"answerText": "Egen företagare"
},
{
"questionCode": "employment-since",
"question": "Hur länge har du haft denna sysselsättning?",
"answerCode": "2016-09",
"answerText": "2016-09"
},
{
"questionCode": "monthlyIncome",
"question": "Månadsinkomst före skatt",
"answerCode": "10000.00",
"answerText": "10000"
},
{
"questionCode": "monthlyPurchaseAmount",
"question": "Hur mycket kommer du genomsnitt att handla på ditt kort?",
"answerCode": "3000.00",
"answerText": "3000"
},
{
"questionCode": "monthlyNumberOfDeposits",
"question": "Hur många inbetalningar kommer du att göra per månad?",
"answerCode": "1-2",
"answerText": "1-2"
},
{
"questionCode": "IsPep",
"question": "Är du en person i politiskt utsatt ställning (PEP), det vill säga.....",
"answerCode": "true",
"answerText": "Ja"
}
]
},
}
List
Request
GET /ledger/credit-account-onboarding/v1/XXX/offers/YYY/applications HTTP/1.1
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
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
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
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": {
"questions":[
{
"questionCode": "employment",
"question": "Vad är din sysselsättning?",
"answerCode": "self-employed",
"answerText": "Egen företagare"
},
{
"questionCode": "employment-since",
"question": "Hur länge har du haft denna sysselsättning?",
"answerCode": "2016-09",
"answerText": "2016-09"
},
{
"questionCode": "monthlyIncome",
"question": "Månadsinkomst före skatt",
"answerCode": "10000.00",
"answerText": "10000"
},
{
"questionCode": "monthlyPurchaseAmount",
"question": "Hur mycket kommer du genomsnitt att handla på ditt kort?",
"answerCode": "3000.00",
"answerText": "3000"
},
{
"questionCode": "monthlyNumberOfDeposits",
"question": "Hur många inbetalningar kommer du att göra per månad?",
"answerCode": "1-2",
"answerText": "1-2"
},
{
"questionCode": "IsPep",
"question": "Är du en person i politiskt utsatt ställning (PEP), det vill säga.....",
"answerCode": "true",
"answerText": "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-application",
"href" : "/ledger/credit-account-onboardings/v1/XXX/offers/kontotyp-10000/applications/1561561-54641515-56456/sign-agreement",
"action" : "post"
}
]
}
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": {
"questions":[
{
"questionCode": "employment",
"question": "Vad är din sysselsättning?",
"answerCode": "self-employed",
"answerText": "Egen företagare"
},
{
"questionCode": "employment-since",
"question": "Hur länge har du haft denna sysselsättning?",
"answerCode": "2016-09",
"answerText": "2016-09"
},
{
"questionCode": "monthlyIncome",
"question": "Månadsinkomst före skatt",
"answerCode": "10000.00",
"answerText": "10000"
},
{
"questionCode": "monthlyPurchaseAmount",
"question": "Hur mycket kommer du genomsnitt att handla på ditt kort?",
"answerCode": "3000.00",
"answerText": "3000"
},
{
"questionCode": "monthlyNumberOfDeposits",
"question": "Hur många inbetalningar kommer du att göra per månad?",
"answerCode": "1-2",
"answerText": "1-2"
},
{
"questionCode": "IsPep",
"question": "Är du en person i politiskt utsatt ställning (PEP), det vill säga.....",
"answerCode": "true",
"answerText": "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-application",
"href" : "/ledger/credit-account-onboardings/v1/XXX/offers/kontotyp-10000/applications/1561561-54641515-56456/sign-agreement",
"action" : "post"
}
]
}
Resource properties
Property | Data type | Format | Description |
---|---|---|---|
@id | string | Maxlength: | |
nationalConsumerIdentifier.value | string | YYYYMMDD-NNNC | A valid swedish "personnummer" |
nationalConsumerIdentifier.countryCode | string | ISO 3166-1 alpha-2 | |
status | string | Maxlength: 25 |
|
customerNo | string | Maxlength: 50 | |
emailAddress | string | Maxlength: 254 Regex pattern: [^@]+@[^\.]+\..+ | |
cellPhone | string | Maxlength: 15 | |
ipAddress | string | Maxlength: 43 Regex pattern: [a-z0-9.:/]* | |
LegalAddress.name | string | Maxlength: 72 | end-customer fullname |
LegalAddress.streetAddress | string | Maxlength: 35 | |
LegalAddress.city | string | Maxlength: 30 | |
LegalAddress.coAddress | string | Maxlength: 35 | |
LegalAddress.zipCode | string | Maxlength: 15 | |
LegalAddress.countryCode | string | ISO 3166-1 alpha-2 | |
account | string | Uri | Reference to created account |
kyc | object | 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.questions | list of objects | ||
kyc.questions.questionCode | string | The code definition of the question | |
kyc.questions.question | string | The actual question text that was presented to the end-customer | |
kyc.questions.aswer | string | The answer from the end-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
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",
}
Content-Type: application/json
{
"createdAccount" : "https://api.payex.com/ledger/credit-account/v1/XXX/accounts/123456",
}
Resource properties
Property | Data type | Format | Description |
---|---|---|---|
createdAccount | string | Uri |
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"
}
]
}
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"
}
]
}