File Payment Data Upload
This guide provides a detailed walkthrough in how users can upload data containing transactions as well as payee information and produce a file payment document that can be used to create a consent.
Scope Requirements
In order to be able to upload file-payment-data to create a file payment document, you must have the following scope(s) enabled:
| Name | Action | Required |
|---|---|---|
pay_file:write | Upload and create a file payment document | Yes |
To have these scopes set up, please reach out to your Moneyhub contact.
Upload File Payment Data
To create a file-payment-consent, you must first upload a file payment document. This is achieved by making a POST request to https://identity.moneyhub.co.uk/pay-file-data, and submitting the required data as a JSON object. Below are the details of the data you need to include:
JSON Object Details
| Key | Description | Required |
|---|---|---|
providerId | The ID of the destination provider (bank) for the file. | Yes |
payments | An array containing objects that describe each transaction, including payee information, amount, reference, etc. | Yes |
payeeFormat | Specifies the format of the payee information: set to payees for full payee details or payeeId for payee IDs only. | Yes |
fileReference | The reference for the file to be uploaded. | No |
The payments array should contain objects, each describing a transaction with the following keys:
| Key | Description | Required |
|---|---|---|
amount | The amount to be sent to the payee. | Yes |
reference | The payment reference used to identify the transaction. | Yes |
endToEndId | A unique identifier assigned by the initiating party to unambiguously identify the transaction. This ID is passed unchanged along the entire transaction chain. | Yes |
payeeId | The ID of the payee. | Yes, if the payee object is not provided. |
payee | An object containing specific payee details, including accountNumber, sortCode, and name. | Yes, if the payeeId is not provided. |
Important Note
- You must pass either the
payeeobject or thepayeeIdfor all payment objects. - Ensure that the
payeeFormatis correctly set topayeeswhen providing full payee details (i.e.,payeeobjects) orpayeeIdif only providing payee IDs.
This structured approach ensures clear identification and processing of payment instructions based on the type of payee data provided.
Request Example
With Payee Object
curl -X POST https://identity.moneyhub.co.uk/pay-file-data
-H "Content-Type: application/json" \
-d '{
"providerId": "ec6c9a9d1c152056ea6a018b37a56daf",
"payments": [
{
"amount": 100.00,
"reference": "Invoice 001",
"endToEndId": "e2e123456",
"payee": {
"accountNumber": "12345678",
"sortCode": "12-34-56",
"name": "Recipient A"
}
},
],
"payeeFormat": "payees",
"fileName": "pay-file"
}'
With Payee ID's
curl -X POST https://identity.moneyhub.co.uk/pay-file-data
-H "Content-Type: application/json" \
-d '{
"providerId": "ec6c9a9d1c152056ea6a018b37a56daf",
"payments": [
{
"amount": 100.00,
"reference": "Invoice 001",
"endToEndId": "e2e123456",
"payeeId": "1234182c-7bfe-89bg-269t-521ca78970bc",
},
],
"payeeFormat": "payeeId",
"fileName": "pay-file"
}'
Response Example
{
"data": {
"id": "1926633c-5bee-43be-819b-791ca84370bc",
"fileName": "pay-file",
"fileHash": "ACWdp8z41yyl0TbpgvW5kXCuVI1OYJFrouwPcjyPjzE=",
"transactionCount": 1,
"controlSum": "100",
"fileType": "csv",
"createdAt": "2025-02-04T17:56:40.399Z",
"expiredAt": null,
"fileData": "H,20250204,476c7de7-0,1,100\nC,Recipient A,24216212,982122,Invoice 001,100,Y,,123",
"fileByteSize": null,
"providerId": "ec6c9a9d1c152056ea6a018b37a56daf"
},
"meta": {}
}
Keep note of the id parameter; it will be required during the creation of file-payment-consent as this will be used as the payFileId.
Updated 9 months ago
