Overview
The FacturaScripts API provides both standard model-based endpoints and custom endpoints for specific business operations. This page documents the custom API controllers and their endpoints.All endpoints require authentication via the
X-Auth-Token header. See Authentication for details.Document Creation Endpoints
Create business documents (invoices, delivery notes, orders, quotes) through the API. Base Controller:ApiCreateDocument.php
Create Customer Invoice
Request Parameters
Customer code (required)
Warehouse code
Invoice date (YYYY-MM-DD format)
Invoice time (HH:MM:SS format)
Currency code
JSON array of invoice lines (stringified)
Mark invoice as paid
Line Object Structure
Example Request
Response
The created invoice document
Array of created invoice lines
Create Supplier Invoice
codproveedor instead of codcliente.
Request Parameters
Supplier code (required)
JSON array of invoice lines (stringified)
Other Document Creation Endpoints
All following endpoints use the same request/response format as invoice creation:Customer Documents
- POST
/api/3/crearAlbaranCliente- Create customer delivery note - POST
/api/3/crearPedidoCliente- Create customer order - POST
/api/3/crearPresupuestoCliente- Create customer quote
Supplier Documents
- POST
/api/3/crearAlbaranProveedor- Create supplier delivery note - POST
/api/3/crearPedidoProveedor- Create supplier order - POST
/api/3/crearPresupuestoProveedor- Create supplier quote
Create Rectificative Invoice
ApiCreateFacturaRectificativaCliente.php
Document Export Endpoints
Export business documents as PDF or other formats. Base Controller:ApiExportDocument.php
Export Customer Invoice
URL Parameters
Invoice code or ID
Query Parameters
Export format (PDF, etc.)
Document format/template ID
Language code for export (defaults to customer language)
Example Request
Response
Returns the PDF file as binary data with appropriate content-type header.Other Document Export Endpoints
Customer Documents
- GET
/api/3/exportarAlbaranCliente/{code}- Export customer delivery note - GET
/api/3/exportarPedidoCliente/{code}- Export customer order - GET
/api/3/exportarPresupuestoCliente/{code}- Export customer quote
Supplier Documents
- GET
/api/3/exportarAlbaranProveedor/{code}- Export supplier delivery note - GET
/api/3/exportarFacturaProveedor/{code}- Export supplier invoice - GET
/api/3/exportarPedidoProveedor/{code}- Export supplier order - GET
/api/3/exportarPresupuestoProveedor/{code}- Export supplier quote
Payment Endpoints
Mark invoices as paid or unpaid.Mark Customer Invoice as Paid
ApiPagarFacturaCliente.php
Marks a customer invoice as paid or unpaid by updating all associated receipts.
URL Parameters
Invoice ID
Request Parameters
True to mark as paid, false to mark as unpaid
Payment date (when marking as paid)
Payment method code
Example Request
Response
Success message
Updated invoice data
Mark Supplier Invoice as Paid
ApiPagarFacturaProveedor.php
Same functionality as customer invoice payment but for supplier invoices.
File Management Endpoints
Upload Files
ApiUploadFiles.php
Upload multiple files to the MyFiles directory.
Request Format
Usemultipart/form-data encoding with file fields named files[].
Example Request
Response
Array of uploaded file objects
Attached Files
ApiAttachedFiles.php
Full CRUD operations for attached files.
List All Files
Query Parameters
Filter conditions (field_operator: value)
Sort order (field: ASC/DESC)
Maximum number of records
Offset for pagination
Filter Operators
field- Equalsfield_gt- Greater thanfield_lt- Less thanfield_gte- Greater than or equalfield_lte- Less than or equalfield_neq- Not equalfield_like- Contains (case-insensitive)field_null- Is nullfield_notnull- Is not null
Example Request
Response
X-Total-Count header with the total number of records.
Get Single File
Get File Schema
Create File
multipart/form-data to upload a new file.
Update File
Delete File
Plugin Management Endpoints
ApiPlugins.php
Manage FacturaScripts plugins through the API.
List All Plugins
Query Parameters
Filter plugins by properties
Sort plugins (field: ASC/DESC)
Example Request
Response
Get Single Plugin
Enable Plugin
Example Request
Response
Disable Plugin
Product Images
ApiProductoImagen.php
Manage product images (implementation varies by installation).
Error Responses
All endpoints return consistent error responses:Bad Request (400)
Not Found (404)
Method Not Allowed (405)
Unprocessable Entity (422)
Next Steps
Authentication
Configure API authentication
Webhooks
Learn about webhook support

