../credit-account-onboardings

Integrate to PayEx Credit Account API 

Authorizations

Get

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

Post

Request
POST /ledger/credit-account-acquiring/v1/XXX/authorizations HTTP/1.1
Host: -
Authorization: Bearer <Token>
Content-Type: application/json

{
   "sellerAuthorizationTransactionId": "789",
   "sellerNumber": "654",
   "cardToken": "5646735165",
   "accountToken": null,
   "description": "stora coop visby",
   "validToDate": "2019-11-28",
   "authorizationAmount": 300.0,
   "currency": "SEK",
}

Resource

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

{
   "sellerAuthorizationTransactionId": "789",
   "authorizationId": 123,
   "sellerNumber": "654",
   "cardToken": "546415646315",
   "accountToken": null,
   "description": "Testshop",
   "validToDate": "2019-11-28",
   "authorizationAmount": 300.0,
   "remainingAmount" : 150.0,
   "currency": "SEK",
   "@id": "/ledger/credit-account-acquiring/v1/501/authorizations/123",
   "captures": "/ledger/credit-account-acquiring/v1/501/authorizations/123/captures",
   "cancellations": "/ledger/credit-account-acquiring/v1/501/authorizations/123/cancellations",
   "schemaUri": "/ledger/invoice-purchase/v1/PayEx.AR.InvoicePurchase.Api.Resources.Authorizations.Resource",
   "parentHREF": "/",
   "operations": [
        {
           "rel": "create-capture",
           "method": "post",
           "href": "/ledger/credit-account-acquiring/v1/501/authorizations/123/captures"
        },
        {
           "rel": "create-cancellation",
           "method": "post",
           "href": "/ledger/credit-account-acquiring/v1/501/authorizations/123/cancellations"
        }
    ]
}

Resource properties

PropertyData typeFormatDescription
@id stringMaxlength:  
transactionReferenceIdstringMaxlength:  
authorizationIdstringMaxlength 
sellerNumberstringMaxlength:  
descriptionstringMaxlength:  
validToDatedateISO 8601 
authorizeAmountdecimal  
remainingAmountdecimal  
currencystringMaxlength 
capturesstringUri 
cancellationsstringUri 

Captures

List

Request
GET /ledger/credit-account-acquiring/v1/XXX/authorizations/captures HTTP/1.1
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

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"
}

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"
        }
    ]
}

Resource properties

PropertyData typeFormatDescription
@id stringMaxlength:  
descriptionstringMaxlength:  
sellerCaptureTransactionIdstringMaxlength 
pspTransactionIdstringMaxlength:  
settlementBatchIdstringMaxlength:  
sellerReceiptIddateISO 8601 
captureAmountdecimal  
currencydecimal  
creditsstringMaxlength 

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

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

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",
}

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" : []
}

Resource properties

PropertyData typeFormatDescription
@id stringMaxlength:  
settlementBatchIdstringMaxlength:  
sellerReversalTransactionIdstringMaxlength 
amountInclVatdecimal  
creditedAmountInclVatdecimalMaxlength:  
currencydateISO 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

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

Post

Request
GET /ledger/credit-account-acquiring/v1/XXX/authorizations/captures/YYY/cancellations HTTP/1.1
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"
}

Resource properties

PropertyData typeFormatDescription
@id stringMaxlength:  
cancellationDatedate  

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