../credit-account
Integrate to PayEx Credit Account API
Accounts
The accounts resource located under ledger/credit-account/v1/ api. The accounts- and its sub-resources are used to created, read and modify information related to a credit-account.
Requesting details of a specific account
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
Content-Type: application/json
{
"@id": "/ledger/credit-account/v1/501/accounts/1234567",
"accountNo": "1234567",
"startDate": "2018-05-21",
"description": null,
"accountProfileType": "accountType1 | accountType2 | accountType3 etc.",
"accountAlias" : "accountAlias1 | accountAlias2 etc.",
"customerNo" : "123789654",
"status" : "open | pending-close | closed",
"creditLimit": 2000.00,
"totalBalance" : -1900.0,
"reservedAmount": 50.0,
"availableAmount": 50.0,
"openBill" : "/ledger/credit-account/v1/501/accounts/123456/bills/456",
"charityDonation": true,
"interestRate": {
"debtInterest" : 10.00,
"penaltyInterest": 15.00
},
"bankPayment": {
"bankAccountNo": "123",
"bankAccountType": "BGSE",
"bic": "123456",
"iban": "SE12345678945631",
"paymentReference": "54867165675646"
},
"activePaymentOrders": "/ledger/credit-account/v1/501/accounts/123456/active-payment-orders",
"recurringPaymentConsent": "/ledger/credit-account/v1/501/accounts/123456/recurring-payment",
"cards": "/ledger/credit-account/v1/501/accounts/123456/cards",
"transactions": "/ledger/credit-account/v1/501/accounts/123456/transactions",
"currency": "sek",
"bills": "/ledger/credit-account/v1/501/accounts/123456/bills",
"customer": "/ledger/customers/v1/501/customer/123456",
"operation" : [
{
"rel" : "add-card-info",
"method" : "post",
"href" : "/ledger/credit-account/v1/501/accounts/123456/cards"
},
{
"rel" : "request-close-account",
"method" : "post",
"href" : "/ledger/credit-account/v1/501/accounts/123456/request-close-account"
},
{
"rel" : "apply-for-raised-credit-limit",
"method" : "post",
"href" : "/ledger/credit-account-onboardings/v1/501/accounts/123456/apply-for-raised-credit-limit"
},
{
"rel" : "partial-update",
"method" : "patch",
"href" : "/ledger/credit-account-onboardings/v1/501/accounts/123456"
}
]
}
Resource properties
Property | Data type | Format | Modify (patch) | Description |
---|---|---|---|---|
@id | string | Maxlength: | Uri of the specific account | |
accountNo | string | Maxlength: 50 | The identifier of the account | |
startDate | date | ISO 8601 | Date when the account was started | |
description | string | Maxlength: 200 | A description of the type of account | |
accountProfileType | string | Maxlength: 50 | The defined code of the accounttype, Examples: kontodebet, kontokredit, kontofaktura | |
accountAlias | string | Maxlength: 50 | A descriptive name for the account type, Examples: kontokredit1, matkonto1 | |
customerNo | string | Maxlength: 50 | Identifier of the customer (account owner) | |
status | string | Maxlength: 25 | Status of the account
| |
creditLimit | decimal | The creditlimit of the account, support patch operation but only lower | ||
totalBalance | decimal | Total current sum of all balances (including capital / interest / fees, etc.) | ||
reservedAmount | decimal | Sum of all outstanding reservations (which are valid and not captured) | ||
availableAmount | decimal | Available credit (cannot be calculated from the above amounts as fees can be included there, which does not affect available credit) | ||
openBill.amountToPay | decimal | The minimum amount to pay on the currently open bill | ||
openBill.bill | string | Uri | ||
openBill.dueDate | date | ISO 8601 | ||
openBill.billType | string | Maxlength: 25 | BillTypes:
| |
charityDonation | bool | If donations should be made from the account | ||
interestRate.debtInterest | decimal | Percentage | yearly debt interestrate | |
interestRate.penaltyInterest | decimal | Percentage | yearly penalty interestrate | |
offer | string | Uri | ||
recurringPaymentConsent | string | Uri | ||
cards | string | Uri | ||
transactions | string | Uri | ||
currency | string | ISO 4217 | ||
bills | string | Uri | ||
customer | string | Uri | ||
activePaymentOrder.paymentMethod | string | Maxlength: 15 |
| PaymentTypes:
|
activePaymentOrder.executionDate | date | ISO 8601 | Date when the paymentorder will be executed (when end-customer will be debited) | |
activePaymentOrder.amount | decimal | Amount that will be charged, this amount may be adjusted when the payment order is executed, if the "amount to pay" on the bill has decreased | ||
Bills
The bills resources contains all the documents produced in the accounts billing cycle.
Requesting list of bills belonging to a specific account
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
Content-Type: application/json
{
"@id": "/ledger/credit-account/v1/501/accounts/123456/bills?status=open",
"items" : [
{
"@id": "/ledger/credit-account/v1/501/accounts/123456/bills/reminder-123645",
"dueDate": "2018-12-05",
"billDate": "2018-11-15",
"billNo": "124645",
"billAmount": 240.00,
"billType" : "reminder",
"status": "open",
"activePaymentDetails": {
"minimumAmountToBePayed": 240.00,
"bankAccountNo": "123",
"bankAccountType": "BGSE",
"bic": "123456",
"iban": "SE12345678945631",
"paymentReference": "5465164654663",
"paymentOrdersExists": true,
},
"document": "/ledger/credit-account/v1/501/accounts/123456/bills/reminder-124645/document"
},
{
"@id": "/ledger/credit-account/v1/501/accounts/123456/bills/reminder-123645",
"dueDate": "2018-12-05",
"billDate": "2018-11-15",
"billNo": "124645",
"billAmount": 240.00,
"billType" : "bill",
"status": "closed",
"activePaymentDetails": null,
"document": "/ledger/credit-account/v1/501/accounts/123456/bills/reminder-124645/document"
},
{
"@id": "/ledger/credit-account/v1/501/accounts/123456/bills/bill-123645",
"dueDate": "2018-12-05",
"billDate": "2018-11-15",
"billNo": "124645",
"billAmount": 240.00,
"billType" : "bill",
"status": "closed",
"activePaymentDetails": null,
"document": "/ledger/credit-account/v1/501/accounts/123456/bills/reminder-124645/document"
}
]
}
Requesting details of a specific bill
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
Content-Type: application/json
{
"@id": "/ledger/credit-account/v1/501/accounts/123456/bills/reminder-123645",
"dueDate": "2018-12-05",
"billDate": "2018-11-15",
"billNo": "124645",
"billAmount": 240.00,
"billType" : "reminder",
"status": "open",
"activePaymentDetails": {
"minimumAmountToBePayed": 240.00,
"bankAccountNo": "123",
"bankAccountType": "BGSE",
"bic": "123456",
"iban": "SE12345678945631",
"paymentReference": "5465164654663",
"paymentOrdersExists": true,
},
"document": "/ledger/credit-account/v1/501/accounts/123456/bills/reminder-124645/document"
}
Property | Data type | Format | Description |
---|---|---|---|
@id | string | Uri | |
dueDate | date | ISO 8601 | |
billDate | date | ||
billNo | string | Maxlength: 50 | The identifier of the bill |
billAmount | decimal | the amount that is stated on the actual bill/document | |
billType | string | Maxlength: 25 | BillTypes:
|
status | string | "open" / "closed" | |
activePaymentDetails | object | only set if status of bill is "open" | |
activePaymentDetails.minimumAmountToBePayed | decimal | ||
activePaymentDetails.bankAccountNo | string | Maxlength: 15 | |
activePaymentDetails.bankAccountType | string | Maxlength: 10 | BankAccountTypes:
|
activePaymentDetails.bic | string | Maxlength: 11 | |
activePaymentDetails.iban | string | Maxlength: 34 | |
activePaymentDetails.paymentReference | string | Maxlength: 50 | |
activePaymentDetails.paymentOrdersExists | bool | ||
activePaymentOrder.paymentMethod | string | Maxlength: 15 | PaymentTypes:
|
activePaymentOrder.executionDate | date | ISO 8601 | Date when the paymentorder will be executed (when end-customer will be debited) |
activePaymentOrder.amount | decimal | Amount that will be charged, this amount may be adjusted when the payment order is executed, if the "amount to pay" on the bill has decreased | |
string | Url | Url to download pdf |
recurring-payment-consent
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
Content-Type: application/json
{
"@id" : "/ledger/credit-account/v1/501/accounts/123456/recurring-payment-consent",
"recurringPaymentMethod" : "autogiro",
"recurringPaymentScope" : "fixedRecurring | totalDebt | billedAmount | onDemand",
"fixedRecurringAmount" : 1500.00,
"parentHREF": "/ledger/credit-account/v1/501/accounts/123456"
}
Property | Data type | Format | Modify (patch) | Description |
---|---|---|---|---|
directDebitType | string | DirectDebitType:
| ||
fixedRecurringAmount | decimal | amount to monthly debit end-customers bankaccount (Only valid if directDebitType is fixedRecurring) |
Cards
List cards
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
Content-Type: application/json
{
"cards" : [
{"PanTrunc" : "85479**********648", "@id" : "/ledger/credit-account/v1/501/accounts/123456/cards/741"},
{"PanTrunc" : "12345**********456", "@id" : "/ledger/credit-account/v1/501/accounts/123456/cards/742"}
]
}
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
Get
Content-Type: application/json
{
"token": "954c8699-b38f-47a2-b568-668b8837dad8",
"PanTrunc": "85479*********648",
"deleted" : false,
"mainCard": true,
"cardHolder" : {
"number" : "123465",
"name": "test testsson",
"nationalConsumerIdentifier": {
"value": "19101010-1010",
"countryCode": "SE"
}
},
"@id": "/ledger/credit-account/v1/501/accounts/123456/cards/741",
"parentHREF": "/ledger/credit-account/v1/501/accounts/123456",
"operation" : [
{
"rel" : "partial-update",
"method" : "patch",
"href" : "/ledger/credit-account/v1/501/accounts/123456/cards/741"
}
]
}
Property | Data type | Format | Modify (patch) | Description |
---|---|---|---|---|
token | string | token identifier of the card | ||
panTrunc | string | truncated PAN | ||
deleted | bool | indicates wheter the card has been deleter | ||
mainCard | bool | indicated whether this card is the main card of the account (cardholder is always owner of account) | ||
cardHolder.number | string | Cardholder customernumber | ||
cardHolder.name | string | Cardholder fullname | ||
cardHolder.nationalConsumerIdentifier.value | string | YYYYMMDD-NNNC | ||
cardHolder.nationalConsumerIdentifier.countryCode | string | ISO 3166-1 alpha-2 |
Transactions
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
Content-Type: application/json
{
"operations": null,
"items": [
{
"type": "payment",
"description": "",
"amount": 200.00,
"billed": false|true,
"date": "2019-10-09",
"reserveDate": null
},
{
"type": "purchase",
"description": "testbutiken, köpref. 12345689",
"amount": 200.00,
"billed": false|true,
"date": "2019-10-09",
"reserveDate": "2019-10-05",
},
{
"type": "credit",
"description": "",
"amount": 200.00,
"billed": false|true,
"date": "2019-10-09",
"reserveDate": "2019-10-05"
}
],
"@id": "/ledger/credit-account/v1/501/accounts/123456/transactions?fromDate=2019-10-01",
"view": {
"@id": "/ledger/credit-account/v1/501/accounts/123456/transactions?fromDate=2019-10-01&$top=2&$skip=0",
"next": "/ledger/credit-account/v1/501/accounts/123456/transactions?fromDate=2019-10-01&$top=2&$skip=2"
}
}
Property | Data type | Format | Description |
---|---|---|---|
type | string | (transactionTypeGroup) | |
description | string | ||
amount | decimal | ||
billed | bool | Indicates wheter a bill has been created after the transaction (ie. if the transaction is included in any bill or not) | |
date | date | INTERN KOMMENTAR - Valuedate |
Reservations
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
Content-Type: application/json
{
"operations": null,
"items": [
{
"amount": 200.00,
"description" : "",
"date": "2019-10-05",
},
{
"amount": 450.00,
"description" : "",
"date": "2019-10-02",
},
],
"@id": "/ledger/credit-account/v1/501/accounts/123456/reservations",
}
Property | Data type | Format | Description |
---|---|---|---|
amount | decimal | ||
description | string | ||
date | date |
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.
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"
}
]
}