# Invoice design patterns * You already have a finished PDF invoice produced by your platform system. * You only need Adfin to distribute it and handle payment collection—no AI text/line-item extraction is required. br ## How to attach a file to an invoice ### Create an invoice with attachment Endpoint: POST /invoices 1. The header should be a multipart request 2. Include the required invoice information in the form 3. Attach the file invoice and declare it as a pdf. Example request: ```curl curl -X POST https://api.staging.adfin.com/api/invoices \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: multipart/form-data" \ -F 'metadata={ "invoiceNo": "INV-202508", "customer": "d5a11475-2e09-49ff-85b6-9b8d34b8ed06" "description": "August 2025 subscription", "dueDate": "2025-09-01T23:59:59Z", "fileSource": "FILE_UPLOAD, "source": "MANUAL" };type=application/json' -F "file=@invoice123.pdf;type=application/pdf" ``` br ### Update an attachment to an invoice Endpoint: PUT /invoices 1. This will remove the previously attached file and upload the new version in its place 2. It will return a 200 on successful operation ```curl curl -X PUT https://api.staging.adfin.com/api/invoices/d5a11475-2e09-49ff-85b6-9b8d34b8ed06 \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: multipart/form-data" \ -F "file=@invoice123.pdf;type=application/pdf" ``` Full API specification will be released shortly. For questions please contact [support@adfin.com](mailto:support@adfin.com)