Integrate to PayEx Credit Account API
Offers
Get
Request
GET /ledger/credit-account-onboarding/v1/XXX/offers 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
{
"@id" : "/ledger/credit-account-onboarding/v1/501/offers",
"offers" : [
{
"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"
}
]
}
]
}
Content-Type: application/json
{
"@id" : "/ledger/credit-account-onboarding/v1/501/offers",
"offers" : [
{
"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
| Property | Data type | Format | Description |
|---|---|---|---|
| @id | string | Maxlength: | |
| transactionReferenceId | string | Maxlength: | |
| authorizationId | string | Maxlength | |
| sellerNumber | string | Maxlength: | |
| description | string | Maxlength: | |
| validToDate | date | ISO 8601 | |
| authorizeAmount | decimal | ||
| remainingAmount | decimal | ||
| currency | string | Maxlength | |
| captures | string | Uri | |
| cancellations | string | Uri |
Captures
List
Request
GET /ledger/credit-account-acquiring/v1/XXX/authorizations/captures 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-acquiring/v1/XXX/authorizations/captures/YYY HTTP/1.1
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
Post
Request
GET /ledger/credit-account-acquiring/v1/XXX/authorizations/captures HTTP/1.1
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
{
"description": "Testbutiken, köpref. 12345689",
"sellerCaptureTransactionId" : "534313",
"pspTransactionId" : "d65f46sd4",
"settlementBatchId" : "e98t79er8t79e8t79e",
"sellerReceiptId": "12345689",
"captureAmount": 200.0,
"currency": "SEK"
}
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
{
"description": "Testbutiken, köpref. 12345689",
"sellerCaptureTransactionId" : "534313",
"pspTransactionId" : "d65f46sd4",
"settlementBatchId" : "e98t79er8t79e8t79e",
"sellerReceiptId": "12345689",
"captureAmount": 200.0,
"currency": "SEK"
}
Resource
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"description": "stora coop visby, köpref. 12345689",
"sellerCaptureTransactionId" : "534313",
"pspTransactionId" : "",
"settlementBatchId" : "",
"sellerReceiptId": "12345689",
"captureAmount": 200.0,
"currency": "SEK",
"credits": "/ledger/credit-account-acquiring/v1/501/authorizations/123/captures/852/credits",
"@id": "/ledger/credit-account-acquiring/v1/501/authorizations/123/capture/852",
"parentHREF": "/ledger/credit-account-acquiring/v1/501/authorizations/123",
"operations": [
{
"rel": "create-credit",
"method": "post",
"href": "/ledger/credit-account-acquiring/v1/501/authorizations/123/captures/852/credits"
}
]
}
Content-Type: application/json
{
"description": "stora coop visby, köpref. 12345689",
"sellerCaptureTransactionId" : "534313",
"pspTransactionId" : "",
"settlementBatchId" : "",
"sellerReceiptId": "12345689",
"captureAmount": 200.0,
"currency": "SEK",
"credits": "/ledger/credit-account-acquiring/v1/501/authorizations/123/captures/852/credits",
"@id": "/ledger/credit-account-acquiring/v1/501/authorizations/123/capture/852",
"parentHREF": "/ledger/credit-account-acquiring/v1/501/authorizations/123",
"operations": [
{
"rel": "create-credit",
"method": "post",
"href": "/ledger/credit-account-acquiring/v1/501/authorizations/123/captures/852/credits"
}
]
}
Resource properties
| Property | Data type | Format | Description |
|---|---|---|---|
| @id | string | Maxlength: | |
| description | string | Maxlength: | |
| sellerCaptureTransactionId | string | Maxlength | |
| pspTransactionId | string | Maxlength: | |
| settlementBatchId | string | Maxlength: | |
| sellerReceiptId | date | ISO 8601 | |
| captureAmount | decimal | ||
| currency | decimal | ||
| credits | string | Maxlength |
Credits
List
Request
GET /ledger/credit-account-acquiring/v1/XXX/authorizations/captures/YYY/credits 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-acquiring/v1/XXX/authorizations/captures/YYY/credits/NNN HTTP/1.1
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
Post
Request
GET /ledger/credit-account-acquiring/v1/XXX/authorizations/captures/YYY/credits HTTP/1.1
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
{
"settlementBatchId" : "",
"sellerReversalTransactionId" : "534313",
"amountInclVat": 200.0,
"currency": "SEK",
}
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
{
"settlementBatchId" : "",
"sellerReversalTransactionId" : "534313",
"amountInclVat": 200.0,
"currency": "SEK",
}
Resource
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"settlementBatchId" : "",
"sellerReversalTransactionId" : "534313",
"amountInclVat": 200.0,
"creditedAmountInclVat": 200.0,
"currency": "SEK",
"@id" : "/ledger/credit-account-acquiring/v1/501/authorizations/123/captures/852/credits/741",
"parentHREF": "/ledger/credit-account-acquiring/v1/501/authorizations/123/captures/852",
"operations" : []
}
Content-Type: application/json
{
"settlementBatchId" : "",
"sellerReversalTransactionId" : "534313",
"amountInclVat": 200.0,
"creditedAmountInclVat": 200.0,
"currency": "SEK",
"@id" : "/ledger/credit-account-acquiring/v1/501/authorizations/123/captures/852/credits/741",
"parentHREF": "/ledger/credit-account-acquiring/v1/501/authorizations/123/captures/852",
"operations" : []
}
Resource properties
| Property | Data type | Format | Description |
|---|---|---|---|
| @id | string | Maxlength: | |
| settlementBatchId | string | Maxlength: | |
| sellerReversalTransactionId | string | Maxlength | |
| amountInclVat | decimal | ||
| creditedAmountInclVat | decimal | Maxlength: | |
| currency | date | ISO 8601 |
Cancellations
List
Request
GET /ledger/credit-account-acquiring/v1/XXX/authorizations/captures/YYY/cancellations 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-acquiring/v1/XXX/authorizations/captures/YYY/cancellations/NNN HTTP/1.1
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
Host: -
Authorization: Bearer <Token>
Content-Type: application/json
Post
Request
GET /ledger/credit-account-acquiring/v1/XXX/authorizations/captures/YYY/cancellations 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
{
"cancellationDate" : "2019-11-20",
"@id" : "/ledger/credit-account-acquiring/v1/501/authorizations/123/cancellations",
"parentHREF" : "/ledger/credit-account-acquiring/v1/501/authorizations/123"
}
Content-Type: application/json
{
"cancellationDate" : "2019-11-20",
"@id" : "/ledger/credit-account-acquiring/v1/501/authorizations/123/cancellations",
"parentHREF" : "/ledger/credit-account-acquiring/v1/501/authorizations/123"
}
Resource properties
| Property | Data type | Format | Description |
|---|---|---|---|
| @id | string | Maxlength: | |
| cancellationDate | 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.
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"
}
]
}