Skip to main content

TransactDirect Reporting API

Authentication

Generating an OAuth 2 Access Token

Accessing a Monek reporting API requires an OAuth 2 Access Token, whichcan be obtained using Client Credentials.

The client application can obtain an Access Token using the Monek OAuth endpoint:

https://oauth2.monek.com/oauth2/token

This endpoint requires a POST request. A Basic Authorization header should be present containing the client credentials base64-encoded in the format <client_id>:<secret>.

In addition, the client should include an application/x-www-form-urlencoded body specifying the grant_type and scope as follows.

NameValue
grant_typeclient_credentials
scopeAs required by the report API to be requested

Sample OAuth2 Request

The complete auth request should therefore look like this:

POST https://oauth2.monek.com/oauth2/token

Authorization: Basic <client_id>:<secret> Content-Type:
application/x-www-form-urlencoded

grant_type=client_credentials&scope=<reporting-service-scope>

Sample OAuth2 Response

A successful response will include an OAuth2 Access Token, valid for one hour, enabling access to the API.

{ 
"access_token": "c2FtcGxlX2FjY2Vzc190b2tlbl9oZXJl…",
"expires_in": 3600,
"token_type": "Bearer"
}

TransactDirect Transaction Report

The transaction query API will allow a merchant to query their transaction history for a given date range, Cross Reference, or merchant Payment Reference.

Authentication

Accessing the transaction reporting API requires an OAuth 2 Access Token, which can be obtained using the following grant_type and scope:

NameValue
grant_typeclient_credentials
scopetransactdirect/get-transactions

The OAuth2 Access Token must be specified as a Bearer token in the Authorization header.

GET https://api.monek.com/transactdirect/v1/merchants/{monekId}/
transactions?{querystring}

Authorization: Bearer <oauth2token>

Request Fields

Path Parameters

Field NameDescriptionReq'dSizeType
monekIdMonek issued merchant ID.M7N

Query String Parameters

Field NameDescriptionReq'dSizeType
startDateTimeStart date and time for transaction reportM25 max.ISO 8601
endDateTimeEnd date and time for transaction reportM25 max.ISO 8601
crossReferenceFilters the transaction results by the supplied Monek Cross ReferenceO*121 max.A
paymentReferenceFilters the transaction results by the supplied Merchant Payment ReferenceO*150 max.A
trackingTokenFilters the transaction results by the supplied Tracking TokenO*132A
pageSizeIndicates the maximum number of transactions to be returned. Default 1,000, min 50, max 5,000OVN
pageNumberIndicates the page number of the results to retrieve. Used in conjunction with pageSizeOVN
newestFirstIf set to True, transaction results will be ordered from newest to oldest. Defaults to FalseO5B

Notes:

  • Only one optional filter parameter should be supplied. If multiple filter parameters are present the most restrictive will be chosen with the following priority: Cross Reference, Payment Reference, Tracking Token.
  • Tracking token used for search must exist on the monekId specified in the path, results will include matching transactions across all related merchants. Tracking tokens only available to select partners.

Example:

GET
https://api.monek.com/transactdirect/v1/merchants/0000018/transactions?startDateTime=20
19-12-04T10:21:10&endDateTime=2019-12-11T10:21:12

Authorization: Bearer eyJraWQiOiJRekQzNVl4TG9tdURhQ...

Response Fields

Field NameDescriptionSizeType
merchantMonek issued merchant ID7N
startDateTimeStart date and time for transaction report25 max.ISO 8601
endDateTimeEnd date and time for transaction report25 max.ISO 8601
messageSummary message for report e.g. - Success - UnauthorisedVA
filterTypeConfirms the type of filter used for the report, if anyVA
filterValueConfirms the value used to filter the reportVA
transactionCountCount of total transactions returned7N
pageSizePage size for this result setVN
pageNumberPage number for this result setVN
transactionDetailsCollection of Transaction DetailsVA

Transaction Detail

Field NameDescriptionSizeType
transactionDateTimeTransaction response date and time33ISO 8601
requestDateTimeTransaction request date and time33ISO 8601
sourceThe source of the transactionVA
transactionTypeTransaction typeVA
dispatchDeferred dispatch type5A
isReversedIndicates if this transaction was subsequently reversed5B
amountTransaction amount in minor currency10N
cashbackAmountCashback amount in minor currency10N
currencyCodeTransaction currency code3N
countryCodeMerchant country code3N
idempotencyTokenMerchant supplied unique identifier for transaction50A
paymentReferenceMerchant payment reference50A
paymentChannelMerchant payment channel50A
paymentDetailMerchant payment detail1500A
merchantDataAdditional merchant data1500A
resultResult Details object--
merchantMerchant Details object--
subMerchantPayment Facilitator Sub Merchant Details object--
deviceDevice Details object--
cardholderCardholder Details object--
cardCard Details object--
lineItemDataLine Item Details object--

Result Details

Field NameDescriptionSizeType
crossReferenceA unique reference for this transaction50A
responseCodeTransactDirect response code2N
responseMessageTransaction response message80A
authorisationCodeAuthorisation code2-8N
avsCv2CodeAVS/CV2 response code6N
avsCv2MessageAVS/CV2 response message30A
threeDSecure3-D Secure Details object--
acquirerReferenceAcquirer reference numberVA
auditTrailInformation about linked transactionsVA
cardTokenA reusable code identifying this card50A
trackingTokenA unique tracking token for the card used32A
terminalIdTerminal ID used for this transaction8N
messageNumberTransaction message number4N

3-D Secure Details

Field NameDescriptionSizeType
enrolled3-D Secure enrolment status code1A
authenticated3-D Secure authenticated status code1A
eciE-commerce indicator2A
cavvCardholder authentication value32A
transactionId3-D Secure transaction ID20N

Merchant Details

Field NameDescriptionSizeType
monekIdMonek merchant ID7N
merchantNumberBank issuer merchant number15N
acquirerAcquirer name. Echo+VA
nameMerchant nameVA
locationMerchant locationVA

Sub Merchant Details

Field NameDescriptionSizeType
subMerchantIdSub merchant number15A
nameSub merchant name22A
addressSub merchant address48A
citySub merchant city13A
postcodeSub merchant postcode10A
stateSub merchant state3A
countryCodeSub merchant country code3N

Device Details

Field NameDescriptionSizeType
deviceDateTimeTransaction date and time on payment deviceV8601
terminalIdPayment device terminal ID8N
messageNumberPayment device message number4N

Cardholder Details

Field NameDescriptionSizeType
nameCardholder name30A
addressCardholder address100A
postcodeCardholder postal code10A
phoneNumberCardholder phone number30A
emailAddressCardholder email address50A

Card Details

Field NameDescriptionSizeType
maskedCardMasked PAN21A
startDateCard start date in form YYMM4N
expiryDateCard expiry date in form YYMM4N
cardTypeMonek card type code2A
cardDescriptionCard type descriptionVA
issuerCountryCodeCard issuing country code where available3N

Line Item Details

Field NameDescriptionSizeType
descriptionLine item data product summary. From QAProducts.168A
taxDiscountDescriptionDescription of tax or discount applied20A
discountAmountValue of discount change to total value9N
taxAmountValue of tax change to total value9N
lineItemsCollection of line items--

Line Item

Field NameDescriptionSizeType
descriptionDescription of line item15A
grossValueGross value of item in minor currency10N
quantityQuantity of item3N

Successful Response Example

{ 
"merchant": "9876543",
"startDateTime": "2020-01-01T00:00:00+00:00",
"endDateTime": "2020-02-01T00:00:00+00:00",
"message": "Success",
"filterType": "CrossReference",
"filterValue": "200101135257222244XYX",
"transactionCount": 1,
"pageSize": 1000,
"pageNumber": 1,
"transactionDetails": [
{
"transactionDateTime": "2020-01-01T13:52:57.3698135+00:00",
"requestDateTime": "2020-01-01T13:52:56.1946514+00:00",
"source": "INTERNET",
"transactionType": "ESALE_KEYED",
"dispatch": "NOW",
"isReversed": false,
"amount": "499",
"currencyCode": "826",
"countryCode": "826",
"idempotencyToken": "e04128ad-66ab-4a6c-ae40-bbf4fc91b5ee",
"paymentReference": "PayRef23908",
"paymentDetail": "UGF5bWVudERldGFpbA==",
"merchantData": "QWxzb01lcmNoYW50RGF0YQ==",
"result": {
"crossReference": "200101135257222244XYX",
"responseCode": "00",
"responseMessage": "AUTH CODE:222244",
"authorisationCode": "222244",
"avsCv2Code": "222800",
"avsCv2Message": "ALL MATCH",
"trackingToken": "c37e041d129a43e58b330f8a71bb7f87",
"terminalId": "22080001",
"messageNumber": "0858"
},
"merchant": {
"monekId": "9876543",
"merchantNumber": "0123456789",
"acquirer": "Monek",
"name": "Test Merchant",
"location": "Lichfield"
},
"cardholder": {
"name": "Mr Smith",
"address": "12 High Street",
"postcode": "B1 2BC"
},
"card": {
"maskedCard": "453979******0106",
"expiryDate": "2212",
"cardType": "VD",
"cardDescription": "Visa Debit",
"issuerCountryCode": "826"
},
"lineItemData": {
"lineItems": [
{
"description": "Goods",
"grossValue": "499",
"quantity": "1"
}
]
}
}
]
}

Unauthorised Example

{ 
"message": "Unauthorized"
}