---
updatedAt: 2026-07-22T09:35:36.000Z
agentTools:
  projectIndex: https://docs.moneyhubenterprise.com/llms.txt
---

# Upload a payment file

Uploads a payment file for processing. Requires **pay_file:write** scope.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "description": "Swagger 2.0 docs for the authentication/authorization Moneyhub API",
    "title": "Moneyhub Identity Service",
    "version": "2.0.0"
  },
  "security": [
    {
      "Bearer": []
    }
  ],
  "paths": {
    "/pay-file/upload-file": {
      "post": {
        "summary": "Upload a payment file",
        "description": "Uploads a payment file for processing. Requires **pay_file:write** scope.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "description": "The payment file to upload (CSV, XML, or JSON)",
                    "type": "string",
                    "format": "binary"
                  },
                  "transactionCount": {
                    "description": "The number of transactions in the file",
                    "type": "integer",
                    "minimum": 1
                  },
                  "controlSum": {
                    "description": "The total value of all transactions in the file",
                    "type": "string",
                    "pattern": "^\\d+(\\.\\d{1,2})?$"
                  },
                  "providerId": {
                    "description": "The ID of the destination provider (bank) for the file",
                    "type": "string",
                    "pattern": "^[a-zA-Z0-9]+$"
                  }
                },
                "required": [
                  "file",
                  "transactionCount",
                  "controlSum",
                  "providerId"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Pay File Upload Response",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PayFile"
                    },
                    "meta": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Unsuccessful Response - Bad request - Missing or invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unsuccessful Response - Not authorised - Missing authorization header - Invalid access Token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Unsuccessful Response - Forbidden - Invalid scopes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "pay-file"
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://identity.moneyhub.co.uk"
    }
  ],
  "components": {
    "securitySchemes": {
      "Bearer": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header"
      }
    },
    "schemas": {
      "PayFile": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "1198df97-7a0f-4f79-bd32-81bbe84b55b1",
            "description": "Unique identifier of the pay file"
          },
          "fileName": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9-_.]+\\.(csv|xml|json)$",
            "example": "payments-2024.json",
            "description": "Original name of the uploaded file"
          },
          "fileHash": {
            "type": "string",
            "description": "Base64 encoded hash of the file content",
            "example": "jH4+P5eCoXE2tm0eEQTKOTHcYZxd9Uft+swyF8tF8Iw="
          },
          "transactionCount": {
            "type": "integer",
            "minimum": 1,
            "description": "Number of transactions in the file",
            "example": 2
          },
          "controlSum": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d{1,2})?$",
            "description": "Total value of all transactions in the file",
            "example": "2500.60"
          },
          "fileType": {
            "type": "string",
            "enum": [
              "csv",
              "xml",
              "json"
            ],
            "description": "Type of the payment file",
            "example": "json"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the file was uploaded",
            "example": "2024-03-01T00:00:00Z"
          },
          "expiredAt": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the file expires, if applicable",
            "example": "2024-03-01T00:00:00Z",
            "nullable": true
          },
          "fileData": {
            "type": "string",
            "description": "Stringified content of the payment file",
            "example": "{\n  \"transactions\": [\n    {\n      \"accountName\": \"John Smith\",\n      \"accountNumber\": \"12345678\",\n      \"sortCode\": \"40-35-21\",\n      \"reference\": \"INV2024001\",\n      \"amount\": 1250.00,\n      \"date\": \"2024-01-15\"\n    },\n    {\n      \"accountName\": \"Sarah Wilson\",\n      \"accountNumber\": \"87654321\",\n      \"sortCode\": \"20-94-63\",\n      \"reference\": \"RENT-JAN24\",\n      \"amount\": 850.00,\n      \"date\": \"2024-01-01\"\n    },\n    {\n      \"accountName\": \"Coffee Bros Ltd\",\n      \"accountNumber\": \"45678912\",\n      \"sortCode\": \"30-91-45\",\n      \"reference\": \"SUPPLIER-CB122\",\n      \"amount\": 432.50,\n      \"date\": \"2024-01-22\"\n    },\n    {\n      \"accountName\": \"David Thompson\",\n      \"accountNumber\": \"98765432\",\n      \"sortCode\": \"60-83-75\",\n      \"reference\": \"CONSULTANCY-Q1\",\n      \"amount\": 2750.00,\n      \"date\": \"2024-02-01\"\n    }\n  ]\n}\n"
          },
          "fileByteSize": {
            "type": "integer",
            "minimum": 1,
            "description": "Size of the file in bytes",
            "example": 836
          },
          "providerId": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9]+$",
            "description": "ID of the destination provider (bank) for the file",
            "example": "fa37a6ecc38eea38bdf3dd0fcb68fab"
          }
        },
        "required": [
          "id",
          "fileName",
          "fileHash",
          "transactionCount",
          "controlSum",
          "fileType",
          "createdAt",
          "fileData",
          "fileByteSize",
          "providerId"
        ]
      },
      "Error": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "description": "The error code",
            "type": "string"
          },
          "message": {
            "description": "The error message",
            "type": "string"
          },
          "correlationId": {
            "description": "Id that identifies the request and can be used to ask for more details related to the error",
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "type": "object"
      }
    }
  }
}
```