Skip to main content

CDI Integration (standalone mode)

Overview

CDI Standalone Flow
  • Data Consumer is given an account with Data Consumer ID to authenticate and access the APIs. For authentication, code and key are provided.

  • For Consent Request, a API is provided for triggered in testing environment. An event will be sent to the registered notification URL once the consent is approved.

  • For Data Request, a API is provided to request data based on a valid Consent ID. An event will be sent once the data request is approved.

  • For Data Sharing, once the data generation is completed and uploaded to SFTP server. An event notification with data access info will be sent.

  • For any revoke or reject action, an event notification will be sent with the reason code and detail with related objects in same format.

API Environment

The table below lists the service URL for each environments

Environment Nameservice URL
Sandboxhttps://openapi-int.qfapi.com

API Request and Response

Authentication method

credential code & key are provided, the data consumer can generate X-QF-SIGN header to access the APIs. Required Parameter Settings in HTTP Header Please refer to the following URL Signature requirement

API Common Response Format

Please refer to the following URL Response Format

Notification verification

Verify the notification authenticated source by checking the X-QF-SIGN header in the notification request. Signature Verification

Testing

Test values for integration testing By using the test merchant values below, you can simulate the data consent & data request flow in Sandbox environment.

authorization code should be provided by merchants.

API Path: /data/consent/v1/create Request Parameter:

Parameter NameTypeMandatoryDescription
data_consumer_idStringYdata consumer Id, provided by QFPay
auth_codeStringYauthorization code,which retrieved from QFPay Merchant Portal
data_scope_typeStringYdata scope type, possible value: DataScopeTypeDateRange
data_start_dateStringYthe start day of the date range of the requested data, format: YYYY-MM-DD
data_end_dateStringYthe end day of the date range of the requested data, format: YYYY-MM-DD

Failure Response Example:

{
"respcd": "1104"
"respmsg": "Invalid Date Range"
}

Data Request

Create Data Request

API Path : /data/request/v1/create Request Parameters:

Parameter NameTypeMandatoryDescription
data_consumer_idStringYdata consumer Id, provided by QFPay
consent_idStringYdata consent Id
data_scope_typeStringYdata scope type, possible value: DataScopeTypeDateRange
data_start_dateStringYthe start day of the date range of the requested data, format: YYYY-MM-DD
data_end_dateStringYthe end day of the date range of the requested data, format: YYYY-MM-DD

Failure Response Example:

{
"respcd": "1104"
"respmsg": "Invalid Consent Id"
}

Event Notification

Notifications are available for both data consent and data request events. Once data consent or data request is approved, QFPay will send asynchronous notification to the URL registered in the system.

All event notifications are in JSON format

Parameter NameDescritpion
typenotification type, value: Consent
consentIdsystem generated data consent Id
scopethe scope of the consent
scopeTypetypes of scope of data to cover
documentTypethe types of documents
startDatethe start day of the date range of the requested data
endDatethe end day of the date range of the requested data
expireTimethe expire time of the customer consent in Unix time format (no. of seconds since the Unix epoch)
dataConsumerIdData Consumer Id assigned by QFPay
statusstatus of a consent record, possible value: ConsentValid, ConsentRevoked
privateConsent data with possible privacy concerns
dataOwnerIdQFPay Merchant Id
updateTimeupdate time object
tupdate time value in unix time format
humanTupdate time value in human readable format
createTimecreate timeobject
tcreation time value in unix time format
humanTcreation time value in human readable format

Consent event notification example:

{
"type":"Consent"
"consentId": "c65dc7a6-3a64-4354-b69c-2d4100683358",
"dataProviderId": "QFPay",
"scope": {
"scopeType": "DataScopeTypeDateRange",
"documentType": "Trade Report",
"startDate": "2025-05-01",
"endDate": "2025-05-30"
},
"purpose": "purpose description",
"dataConsumerId": "DATACONSUMER0001",
"expireTime": 1748703600,
"status": "ConsentValid",
"private": {
"purposePrivate": "Authorization Code",
}
"updateTime": {
"t": 1746768573,
"humanT": "2025-05-09 14:29:33"
},
"createTime": {
"t": 1746768573,
"humanT": "2025-05-09 14:29:33"
}
}

Data Request Event

Parameter NameDescritpion
typenotification type, value: Data-Request
dataConsumerIdData Consumer Id, which is assigned by QFPay
dataProviderIdvalue:QFPay
consentIdsystem generated data consent Id
dataRequestIdsystem generated data request Id
dataScopescope of data request
scopeTypetypes of the scope, possible value:DataScopeTypeDateRange
startDatestart day of the date range of the requested data covered in this scope
endDateend day of the date range of the requested data covered in this scope
statusdata request status, possible value: DataRequestApproved,DataRequestDataShared, DataRequestRejected
updateTimeupdate time object
tupdate time value in unix time format
humanTupdate time value in human readable format
createTimecreate timeobject
tcreation time value in unix time format
humanTcreation time value in human readable format

Data request event notifiaction example:

{
"type":"Data-Request",
"dataRequestId": "a3757a11-bcd9-4a9d-ac2b-c8bbd15346e3",
"dataConsumerId": "DATACONSUMER0001",
"dataProviderId": "QFPay",
"dataProviderName": "Data Provider example 0001",
"consentId": "c65dc7a6-3a64-4354-b69c-2d4100683358",
"dataScope": {
"scopeType": "DataScopeTypeDateRange",
"startDate": "2025-05-01",
"endDate": "2025-05-07"
},
"status": "DataRequestApproved",
"updateTime": {
"t": 1746768573,
"humanT": "2025-05-09 14:29:33"
},
"createTime": {
"t": 1746768573,
"humanT": "2025-05-09 14:29:33"
}
}

Data Access Info Event

Parameter NameDescription
typenotification type, value: Data-Access-Info
dataRequestIdsystem generated data request Id
dataConsumerIdData Consumer Id assigned by QFPay
dataConsumerNameData Consumer display name
dataProviderIdData Provider Id
dataProviderNameData Provider display name
consentIdsystem generated data consent Id
dataScopescope of data request
scopeTypetypes of the scope
documentTypetype of document
udrUniversal Data Reference
startDatestart date of the data range
endDateend date of the data range
statusdata request status
rejectReasonCodereason code if rejected
rejectReasonDetaildetailed reason for rejection
purposepurpose of the data request
hashKeyOfRequestPrivatehash key for request private data
hashKeyOfDatahash key for the data
updateTimeupdate time object
tupdate time value in unix time format
humanTupdate time value in human readable format
createTimecreate time object
tcreation time value in unix time format
humanTcreation time value in human readable format
privateprivate data object
idprivate data Id
purposePrivateprivate purpose
dataOwnerIddata owner's Id
dataOwnerNamedata owner's name
secretsecret key
brNobusiness registration number
LEILegal Entity Identifier
crNocompany registration number
dataOwnerReferencedata owner reference object
refcode: reference code
name: reference name
dataOwnerReferenceDPdata provider internal reference
updateTimeupdate time object
t: update time value in unix time format
humanT: update time value in human readable format
createTimecreate time object
t: creation time value in unix time format
humanT: creation time value in human readable format
responseListarray of response objects
idresponse Id
dataOwnerIddata owner's Id
dataOwnerNamedata owner's name
publicKeyIdpublic key identifier
dataFiledata file object
channel: data transfer channel (e.g., HTTPS or SFTP)
endPoint: endpoint URL. For HTTPS: full URL; For SFTP: ${SFTP_HOSTNAME}:${SFTP_PORT}
endpointReverseProxy: reverse proxy endpoint URL (available for HTTPS channel)
accessToken: access token. For HTTPS: JWT token;
fileType: type of file (e.g., csv, Trade declaration)
filePath: path to the file. For SFTP: full remote path like ${uploadAbsoluteRemotePath}/${consumerId}/upload/filename.csv
fileHash: hash of the file
updateTimeupdate time object
t: update time value in unix time format
humanT: update time value in human readable format
createTimecreate time object
t: creation time value in unix time format
humanT: creation time value in human readable format
receptionListarray of reception objects
idreception Id
dataResponseIdcorresponding response Id
dataFiledata file object
endPoint: endpoint URL
filePath: path to the file
fileHash: hash of the file
updateTimeupdate time object
t: update time value in unix time format
humanT: update time value in human readable format
createTimecreate time object
t: creation time value in unix time format
humanT: creation time value in human readable format

Data access info event notification example:

{
"type":"Data-Access-Info",
"dataRequestId": "b3dfa083-aa7f-4627-8314-cdebadb361cf",
"dataConsumerId": "DATAPROVIDER0001",
"dataConsumerName": "Data Provider example 0001",
"dataProviderId": "DATAPROVIDER0001",
"dataProviderName": "Data Provider example 0001",
"consentId": "37ce697c-83cd-4e67-8e78-2cc00b76cbe2",
"dataScope": {
"scopeType": "DataScopeTypeUDR",
"documentType": "Annual report",
"udr": "ANNRPT0001",
"startDate": "2020-05-01",
"endDate": "2021-10-30"
},
"status": "PENDING",
"rejectReasonCode": "DataRequestRejectReasonInvalidConsent",
"rejectReasonDetail": "string",
"purpose": "Some platitudinal purpose",
"hashKeyOfRequestPrivate": "string",
"hashKeyOfData": "string",
"updateTime": {
"t": 1632896973,
"humanT": "2021-09-29 14:29:33"
},
"createTime": {
"t": 1632896973,
"humanT": "2021-09-29 14:29:33"
},
"private": {
"id": "d4bf6e1e-0882-4e1e-b310-befc87b3541a",
"purposePrivate": "Some despicable purpose",
"dataOwnerId": "1b1f276f-6d7d-4437-9ea3-ea068d92f7ac",
"dataOwnerName": "Sun Tech Co.",
"secret": "10306228ee0b6720ca61802dd7e92cee",
"brNo": "HKG:12345678",
"LEI": "529900T8BM49AURSDO55",
"crNo": "HKG:2345678",
"dataOwnerReference": {
"refcode": "A1234567",
"name": "SUNTECH"
},
"dataOwnerReferenceDP": "DPINTERNALID001",
"updateTime": {
"t": 1632896973,
"humanT": "2021-09-29 14:29:33"
},
"createTime": {
"t": 1632896973,
"humanT": "2021-09-29 14:29:33"
}
},
"responseList": [
{
"id": "8ef1e651-843c-424c-8891-b425460088cf",
"dataOwnerId": "1b1f276f-6d7d-4437-9ea3-ea068d92f7ac",
"dataOwnerName": "Sun Tech Co.",
"publicKeyId": "string",
"dataFile": {
"channel": "HTTPS",
"endPoint": "https://www.fake.it/20240401/fake-data.csv",
"endpointReverseProxy": "https://www.cdi.network/48721f8ad1a5ce2c197bf5bd17cb5bac/20240401/fake-data.csv",
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyTmFtZSI6ImRjc2ltMDE0Iiwib3JnVHlw…",
"fileType": "Trade declaration",
"filePath": "/data/20240401/fake-data.csv",
"fileHash": "1425224BD3ABB25F444DEF931F1FE2D3FD6F52DDA199D0A0FC96D05CCD6D4619"
},
"updateTime": {
"t": 1632896973,
"humanT": "2021-09-29 14:29:33"
},
"createTime": {
"t": 1632896973,
"humanT": "2021-09-29 14:29:33"
}
}
],
"receptionList": [
{
"id": "550c630f-926f-45b6-b861-6f69f33e4a8f",
"dataResponseId": "8ef1e651-843c-42hkma4c-8891-b425460088cf",
"dataFile": {
"endPoint": "https://www.fake.it/20240401/fake-data.csv",
"filePath": "/data/20240401/fake-data.csv",
"fileHash": "1425224BD3ABB25F444DEF931F1FE2D3FD6F52DDA199D0A0FC96D05CCD6D4619"
},
"updateTime": {
"t": 1632896973,
"humanT": "2021-09-29 14:29:33"
},
"createTime": {
"t": 1632896973,
"humanT": "2021-09-29 14:29:33"
}
}
]
}