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:

NameActionRequired
pay_file:writeUpload and create a file payment documentYes

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

KeyDescriptionRequired
providerIdThe ID of the destination provider (bank) for the file.Yes
paymentsAn array containing objects that describe each transaction, including payee information, amount, reference, etc.Yes
payeeFormatSpecifies the format of the payee information: set to payees for full payee details or payeeId for payee IDs only.Yes
fileReferenceThe reference for the file to be uploaded.No

The payments array should contain objects, each describing a transaction with the following keys:

KeyDescriptionRequired
amountThe amount to be sent to the payee.Yes
referenceThe payment reference used to identify the transaction.Yes
endToEndIdA unique identifier assigned by the initiating party to unambiguously identify the transaction. This ID is passed unchanged along the entire transaction chain.Yes
payeeIdThe ID of the payee.Yes, if the payee object is not provided.
payeeAn object containing specific payee details, including accountNumber, sortCode, and name.Yes, if the payeeId is not provided.

Important Note

  • You must pass either the payee object or the payeeId for all payment objects.
  • Ensure that the payeeFormat is correctly set to payees when providing full payee details (i.e., payee objects) or payeeId if 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.