{"title":"Batch file naming and structure","category":"default","creationDate":1779620072,"content":"<h2 id=\"naming\">Naming<\/h2>\n<h3 id=\"batch-request-file\">Batch request file<\/h3>\n<p>The file name for each batch request file must be unique.\u00a0To be accepted for further processing, a batch request file name must comply with the following format:\u00a0<\/p>\n<pre><code class=\"language-text\">[Submission Platform]_[File Sequence Number]_[FileType].csv<\/code><\/pre>\n<ul>\n<li>\n<p><strong>Submission Platform<\/strong> is the unique identifier for the server you use to submit batch files to Adyen.<br \/>\nThis is especially important if you have multiple servers submitting files, and find it difficult to keep track of the sequence number across the servers.<\/p>\n<\/li>\n<li>\n<p><strong>File Sequence Number<\/strong> is the file submission number. It must always increment by exactly one unit after each successful file submission.<br \/>\nFile sequence numbers\u00a0correlate with the submission platform, i.e. the server from where the files originate.<br \/>\nThe Adyen payments platform\u00a0rejects batch files when:<\/p>\n<ul>\n<li>The batch file submission number, i.e. the file sequence number, has already been used;<\/li>\n<li>The system detects a gap in the number sequence because adjacent numbers are not consecutive. For example: 201 followed by 203.<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>FileType<\/strong> defines the type of transactions\/requests that the file contains.<br \/>\nAllowed values:<\/p>\n<ul>\n<li><a href=\"\/development-resources\/batch-processing\/advanced-sftp-batch-files\/batch-request-file\/authorisation-request-file\">\n  <code>Authorisation<\/code>\n<\/a><\/li>\n<li><a href=\"\/development-resources\/batch-processing\/advanced-sftp-batch-files\/batch-request-file\/payout-request-file\">\n  <code>Payout<\/code>\n<\/a><\/li>\n<li><a href=\"\/development-resources\/batch-processing\/advanced-sftp-batch-files\/batch-request-file\/storetoken-request-file\">\n  <code>StoreToken<\/code>\n<\/a><\/li>\n<li><a href=\"\/development-resources\/batch-processing\/advanced-sftp-batch-files\/batch-request-file\/refundwithdata-request-file\">\n  <code>RefundWithData<\/code>\n<\/a><\/li>\n<li><a href=\"\/development-resources\/batch-processing\/advanced-sftp-batch-files\/batch-request-file\/modification-request-file\">\n  <code>Modification<\/code>\n<\/a><\/li>\n<li><a href=\"\/development-resources\/batch-processing\/advanced-sftp-batch-files\/batch-request-file\/payoutmodification-request-file\">\n  <code>PayoutModification<\/code>\n<\/a><\/li>\n<li><a href=\"\/development-resources\/batch-processing\/advanced-sftp-batch-files\/batch-request-file\/accountupdater-request-file\">\n  <code>AccountUpdater<\/code>\n<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3 id=\"batch-result-file\">Batch result file<\/h3>\n<p>The file name for each batch result file will be original filename, with <code>_result<\/code> (if the file is not encrypted) or <code>_result_enc<\/code> (if the file is encrypted) appended to the end.<\/p>\n<table title=\"Batch result file examples\"><tbody><tr><td><em>Non-encrypted<\/em><br>\nbatch result file<\/td><td>\n<pre class=\"text\"><code>[Submission Platform]_[File Sequence Number]_[FileType].csv_result<\/code><\/pre>\n<\/td><\/tr><tr><td><em>Encrypted<br>\n<\/em>batch result file<\/td><td>\n<pre class=\"text\"><code>[Submission Platform]_[File Sequence Number]_[FileType].csv_result_enc<\/code><\/pre>\n<\/td><\/tr><\/tbody><\/table>\n<p>The batch request file undergoes a series of validation checks at line item level, and then the batch result file is posted to the\u00a0<em>result<\/em>\u00a0folder on the SFTP.<\/p>\n<h3 id=\"batch-acknowledgment-file\">Batch acknowledgment file<\/h3>\n<p>The file name for each batch acknowledgment file will be original filename, with <code>_ack<\/code> appended to the end.<\/p>\n<pre><code class=\"language-text\">[Submission Platform]_[File Sequence Number]_[FileType].csv_ack<\/code><\/pre>\n<p>The batch request file undergoes a series of validation checks at line item level. If any error occurs during the process,\u00a0the batch\u00a0acknowledgment\u00a0file is posted to the\u00a0<em>ack<\/em>\u00a0folder on the SFTP.<\/p>\n<h2 id=\"structure\">Structure<\/h2>\n<p>The batch file should be delivered in CSV (Comma Separated Values) format, as per\u00a0<a href=\"https:\/\/tools.ietf.org\/html\/rfc4180\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">RFC 4180<\/a>, with the following exceptions:<\/p>\n<ul>\n<li>Multi-line fields are not allowed;<\/li>\n<li>It is allowed to have a variable number of fields per line.\u00a0<\/li>\n<\/ul>\n<p><div class=\"sc-notice note\"><div> The file needs to have a file header and a file trailer to allow parsing.<br \/>\nIf either file header or file trailer is missing, it is not possible to top parse the file, and the process returns one or more errors. <\/div><\/div><\/p>\n<p>The batch file has the following structure:<\/p>\n<p><img alt=\"\" src=\"\/user\/pages\/docs\/13.development-resources\/14.batch-processing\/03.advanced-sftp-batch-files\/02.batch-file-naming-and-structure\/batch-file-structure.png\" \/><\/p>\n<p>The file must conform to the following parameters:<\/p>\n<ul>\n<li>\n<p><strong>File sequence number<\/strong>: the file header ([FH]) contains a file sequence number that\u00a0<em>must match<\/em>\u00a0the file sequence number in the\u00a0<a href=\"\/development-resources\/batch-processing\/advanced-sftp-batch-files\/batch-file-naming-and-structure\">file name<\/a>.<\/p>\n<\/li>\n<li>\n<p><strong>File types<\/strong>: the batch file can contain\u00a0<em>only one<\/em>\u00a0of the\u00a0allowed file types\u00a0identifying the type of transaction that\u00a0processes.<br \/>\nIt is not allowed to mix file types\/transaction types in the same file. i.e. it is not possible to specify more than one file type\/transaction type per batch file.<\/p>\n<\/li>\n<li>\n<p><strong>File encoding<\/strong>: the batch file should be encoded using\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/UTF-8\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">UTF-8<\/a>.<\/p>\n<\/li>\n<li>\n<p><strong>Column counts<\/strong>: Some lines in the file contain optional fields.<br \/>\nWhile the\u00a0number of fields per line may vary depending on the specified transaction type, the column count per transaction type is fixed.<br \/>\nFor example,\u00a0<a href=\"\/development-resources\/batch-processing\/advanced-sftp-batch-files\/batch-request-file\">File Header field 9<\/a>\u00a0is an optional field. However, if you do not use it, you need in any case to insert a delimiter as a placeholder.<\/p>\n<\/li>\n<li>\n<p><strong>Character set<\/strong>: the character set used to represent text data needs to be\u00a0<a href=\"http:\/\/www.unicode.org\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Unicode<\/a>.<\/p>\n<\/li>\n<\/ul>","url":"https:\/\/docs.adyen.com\/development-resources\/batch-processing\/advanced-sftp-batch-files\/batch-file-naming-and-structure","articleFields":{"id":"24216638","type":"page","_expandable":{"operations":""},"status":"current","last_edit_on":"09-04-2020 12:29"},"algolia":{"url":"https:\/\/docs.adyen.com\/development-resources\/batch-processing\/advanced-sftp-batch-files\/batch-file-naming-and-structure","title":"Batch file naming and structure","content":"Naming\nBatch request file\nThe file name for each batch request file must be unique.\u00a0To be accepted for further processing, a batch request file name must comply with the following format:\u00a0\n[Submission Platform]_[File Sequence Number]_[FileType].csv\n\n\nSubmission Platform is the unique identifier for the server you use to submit batch files to Adyen.\nThis is especially important if you have multiple servers submitting files, and find it difficult to keep track of the sequence number across the servers.\n\n\nFile Sequence Number is the file submission number. It must always increment by exactly one unit after each successful file submission.\nFile sequence numbers\u00a0correlate with the submission platform, i.e. the server from where the files originate.\nThe Adyen payments platform\u00a0rejects batch files when:\n\nThe batch file submission number, i.e. the file sequence number, has already been used;\nThe system detects a gap in the number sequence because adjacent numbers are not consecutive. For example: 201 followed by 203.\n\n\n\nFileType defines the type of transactions\/requests that the file contains.\nAllowed values:\n\n\n  Authorisation\n\n\n  Payout\n\n\n  StoreToken\n\n\n  RefundWithData\n\n\n  Modification\n\n\n  PayoutModification\n\n\n  AccountUpdater\n\n\n\n\nBatch result file\nThe file name for each batch result file will be original filename, with _result (if the file is not encrypted) or _result_enc (if the file is encrypted) appended to the end.\nNon-encrypted\nbatch result file\n[Submission Platform]_[File Sequence Number]_[FileType].csv_result\nEncrypted\nbatch result file\n[Submission Platform]_[File Sequence Number]_[FileType].csv_result_enc\n\nThe batch request file undergoes a series of validation checks at line item level, and then the batch result file is posted to the\u00a0result\u00a0folder on the SFTP.\nBatch acknowledgment file\nThe file name for each batch acknowledgment file will be original filename, with _ack appended to the end.\n[Submission Platform]_[File Sequence Number]_[FileType].csv_ack\nThe batch request file undergoes a series of validation checks at line item level. If any error occurs during the process,\u00a0the batch\u00a0acknowledgment\u00a0file is posted to the\u00a0ack\u00a0folder on the SFTP.\nStructure\nThe batch file should be delivered in CSV (Comma Separated Values) format, as per\u00a0RFC 4180, with the following exceptions:\n\nMulti-line fields are not allowed;\nIt is allowed to have a variable number of fields per line.\u00a0\n\n The file needs to have a file header and a file trailer to allow parsing.\nIf either file header or file trailer is missing, it is not possible to top parse the file, and the process returns one or more errors. \nThe batch file has the following structure:\n\nThe file must conform to the following parameters:\n\n\nFile sequence number: the file header ([FH]) contains a file sequence number that\u00a0must match\u00a0the file sequence number in the\u00a0file name.\n\n\nFile types: the batch file can contain\u00a0only one\u00a0of the\u00a0allowed file types\u00a0identifying the type of transaction that\u00a0processes.\nIt is not allowed to mix file types\/transaction types in the same file. i.e. it is not possible to specify more than one file type\/transaction type per batch file.\n\n\nFile encoding: the batch file should be encoded using\u00a0UTF-8.\n\n\nColumn counts: Some lines in the file contain optional fields.\nWhile the\u00a0number of fields per line may vary depending on the specified transaction type, the column count per transaction type is fixed.\nFor example,\u00a0File Header field 9\u00a0is an optional field. However, if you do not use it, you need in any case to insert a delimiter as a placeholder.\n\n\nCharacter set: the character set used to represent text data needs to be\u00a0Unicode.\n\n","type":"page","locale":"en","boost":16,"hierarchy":{"lvl0":"Home","lvl1":"Development resources","lvl2":"Batch processing","lvl3":"Submit transaction batch files through SFTP","lvl4":"Batch file naming and structure"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/","lvl1":"https:\/\/docs.adyen.com\/development-resources","lvl2":"https:\/\/docs.adyen.com\/development-resources\/batch-processing","lvl3":"https:\/\/docs.adyen.com\/development-resources\/batch-processing\/advanced-sftp-batch-files","lvl4":"\/development-resources\/batch-processing\/advanced-sftp-batch-files\/batch-file-naming-and-structure"},"levels":5,"category":"Development Resources","category_color":"green","tags":["Batch","naming","structure"]},"articleFiles":{"batch-file-structure.png":"<img alt=\"\" src=\"https:\/\/docs.adyen.com\/user\/pages\/docs\/13.development-resources\/14.batch-processing\/03.advanced-sftp-batch-files\/02.batch-file-naming-and-structure\/batch-file-structure.png\" \/>"}}
