Integrate to PayEx Account transaction API
Changelog
Introduction
The account transaction API is used to create accounts and transactions for retail finance scenarios. The api contains re-direct scenarios for SCA-authentication when the consumer is present.
Pre-authorizations
Check if required conditions are met to begin a transaction. Creates an authentication resource that exposes operation link to redirect if user interaction is required. (Is there an existing account? is the account's limit sufficient for the new transaction? Does the transaction requires strong customer authentication SCA?) Can be used in with TRA assesment to reduce authentication friction.
Host: -
Authorization: Bearer<Token>
Content-Type: application/json
{
"@id": "string",
"customer": {
"nationalConsumerIdentifier": {
"value": "string",
"countryCode": "None"
},
"email": "string",
"msisdn": "string",
"customerNo": "string"
},
"sellerNo": "string",
"sellerReferenceId": "string",
"profileName": "string",
"authorizationAmount": 99999999,
"currency": "None",
"externalReference": "string",
"assesment": {
"assessmentUrl": "string",
"scaStatus": "None"
}
}
Request properties requirements
Property | Required |
---|---|
@id | Yes |
customer | Yes |
nationalConsumerIdentifier | Yes |
value | Yes |
countryCode | Yes |
Yes | |
msisdn | Yes |
customerNo | Yes |
sellerNo | Yes |
sellerReferenceId | Yes |
profileName | Yes |
authorizationAmount | Yes |
currency | Yes |
externalReference | Yes |
assesment | Yes |
assessmentUrl | Yes |
scaStatus | Yes |
Content-Type: application/json
pre-authorizations properties
Property | Data type | Format | Description |
---|---|---|---|
@id | String | ||
customer | object | ||
nationalConsumerIdentifier | object | ||
value | String | ||
countryCode | String | ||
String | |||
msisdn | String | ||
customerNo | String | ||
sellerNo | String | ||
sellerReferenceId | String | ||
profileName | String | ||
authorizationAmount | Integer | ||
currency | String | ||
externalReference | String | ||
assesment | object | ||
assessmentUrl | String | ||
scaStatus | String |
Redirect
Initiates redirect authentication flow, generates redirect url and accepts return url after redirect process finishes. The operation is exposed by the parent authentication if required.
Host: -
Authorization: Bearer<Token>
Content-Type: application/json
{
"returnUrl": "string",
"redirectOptions": {
"nativeAppSwitchingUrl": "string",
"autostartAction": "string",
"languageCode": "string"
}
}
Request properties requirements
Property | Required |
---|---|
returnUrl | Yes |
redirectOptions | Yes |
nativeAppSwitchingUrl | Yes |
autostartAction | Yes |
languageCode | Yes |
Content-Type: application/json
{
"@id": "string",
"redirectUrl": "string"
}
Redirect properties
Property | Data type | Format | Description |
---|---|---|---|
returnUrl | String | ||
redirectOptions | object | ||
nativeAppSwitchingUrl | String | ||
autostartAction | String | ||
languageCode | String |
Split-authorizations
Create split-authorization to see if the account will accept the transaction. When accepted reserves the amount to on the underlying account (may include credit check) and creates the authorization instance. The reservation is time limited, captures will only be exepted until the reservation times out. The 'split' authorization, is used when each product has a separate part payment that should be portioned out according to instruction.
Host: -
Authorization: Bearer<Token>
Content-Type: application/json
{
"@id": "string",
"splitAuthorizationId": "string",
"preAuthorizationId": "string"
}
Request properties requirements
Property | Required |
---|---|
@id | Yes |
splitAuthorizationId | Yes |
preAuthorizationId | Yes |
Content-Type: application/json
{
"@id": "string",
"splitAuthorizationId": "string",
"preAuthorizationId": "string",
"sellerNumber": "string",
"validToDate": "2022-02-24T01:00:49.139Z",
"authorizationAmount": 0,
"remainingAmount": 0,
"currency": "string",
"status": "string",
"operations": [
{
"rel": "string",
"method": "string",
"href": "string"
}
]
}
Split-authorizations properties
Property | Data type | Format | Description |
---|---|---|---|
@id | String | ||
splitAuthorizationId | String | ||
preAuthorizationId | String |
captures
Captures part of (or complete) the split-authorization, includes options for part payment
Host: -
Authorization: Bearer<Token>
Content-Type: application/json
{
"captureId": "string",
"sellerTransactionId": "string",
"currency": "string",
"monthlyBillingAmount": 0,
"months": 0,
"totalAmount": 0,
"productName": "string"
}
Request properties requirements
Property | Required |
---|---|
captureId | Yes |
sellerTransactionId | Yes |
currency | Yes |
monthlyBillingAmount | Yes |
months | Yes |
totalAmount | Yes |
productName | Yes |
Content-Type: application/json
{
"captureId": "string",
"accountNo": "string",
"account": "string"
}
captures properties
Property | Data type | Format | Description |
---|---|---|---|
captureId | String | ||
sellerTransactionId | String | ||
currency | String | ||
monthlyBillingAmount | Integer | ||
months | Integer | ||
totalAmount | Integer | ||
productName | String |
Reversal
For reversing a specific capture
Host: -
Authorization: Bearer<Token>
Content-Type: application/json
{
"@id": "string",
"reversalId": "string",
"currency": "string",
"amount": 0,
"sellerTransactionId": "string"
}
Request properties requirements
Property | Required |
---|---|
@id | Yes |
reversalId | Yes |
currency | Yes |
amount | Yes |
sellerTransactionId | Yes |
Content-Type: application/json
Reversal properties
Property | Data type | Format | Description |
---|---|---|---|
@id | String | ||
reversalId | String | ||
currency | String | ||
amount | Integer | ||
sellerTransactionId | String |
Canellations
This operation will cancel the specified split-authorization
Host: -
Authorization: Bearer<Token>
Content-Type: application/json
{}
Request properties requirements
Property | Required |
---|
Content-Type: application/json
Canellations properties
Property | Data type | Format | Description |
---|
Public-account-transaction
Authentications
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
Properties requirements
Property | Required |
---|---|
AssessmentUrl | Yes |
ExternalReference | No |
Content-Type: application/json
{
"accountOffer" : "/ledger/public-account-transaction/offers/Pay123",
"operations" : [
{
"rel" : "onboard-upgrade-account",
"href" : "/ledger/public-account-transaction/v1/authentications/onboard-upgrade-account",
"method" : "POST"
},
{
"rel" : "begin-bankid-se-authentication",
"href" : "/ledger/public-account-transaction/v1/authentications/begin-bankid-se-authentication",
"method" : "POST"
}
],
"@id" : "/ledger/public-account-transaction/v1/authentications",
}
Account-applications
Add application to offer
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
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
Get a single application
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
Applications Resource
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
Property | Data type | Required in post | Format | Description |
---|---|---|---|---|
@id | string | - | Maxlength: | |
nationalConsumerIdentifier.value | string | Yes | YYYYMMDD-NNNC | A valid swedish "personnummer" |
nationalConsumerIdentifier.countryCode | string | Yes | ISO 3166-1 alpha-2 | |
status | string | - | Maxlength: 25 |
|
customerNo | string | Yes | Maxlength: 15 | |
creditLimit | decimal | Yes | ||
emailAddress | string | Yes | Maxlength: 254 Regex pattern: [^@]+@[^\.]+\..+ | |
cellPhone | string | Yes | Maxlength: 15 | |
ipAddress | string | No | Maxlength: 43 Regex pattern: [a-z0-9.:/]* | |
legalAddress.name | string | Yes | Maxlength: 72 | end-customer fullname |
legalAddress.streetAddress | string | No | Maxlength: 35 | |
legalAddress.city | string | Yes | Maxlength: 30 | |
legalAddress.coAddress | string | No | Maxlength: 35 | |
legalAddress.zipCode | string | Yes | Maxlength: 15 | ZipCode without whitespaces |
legalAddress.countryCode | string | Yes | ISO 3166-1 alpha-2 | |
account | string | - | Uri | Reference to created account |
kyc | object | Yes | 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 | Yes | ||
kyc.questions.code | string | Yes | The code definition of the question | |
kyc.questions.text | string | Yes | The actual question text that was presented to the end-customer | |
kyc.questions.aswer.code | string | Yes | The answered code definition from the end-customer | |
kyc.questions.aswer.text | string | Yes | The actual displayed answertext that was presented to the customer |
Limit-upgrade-application
Problem types
Problem type (code) | Httpstatus | Description |
---|---|---|
validation | 400 | occurs if any of the input validation fails, it is described in the problem which parameter that failed the validation |
not-found | 404 | requested resource not found |
conflict | 409 | state of resource is un valid for any further progress |
claimant-mismatch | 409 | mismatch between claimant (in url) used in new request vs. when authenticaiton resource was made, |
invalid-authentication-state | 422 | un valid authentication status for requested method |
authentication-is-no-longer-valid | 422 | the limited time of the authentication has passed |
credit-check-rejected | 422 | credit check or extend of credit check was rejected |
fatal | 500 | Unexpected error, logs maybe can tell more in detail what the problem is |
not-implemented | 501 | the requested method is not implemented fully by code or not configured for the resource, body will tell which. |