The Sales Invoices API (/v1/sales/invoices) provides document management for official sales invoices (OINV in SAP Business One), CSV batch billing imports, and cancellation workflows.
/v1/sales/invoices
App\Http\Controllers\V1\Backend\Sales\InvoiceControllerroutes/v1/backend/sales/invoice.phproutes/v1/backend/sales/sales.php under the /v1/sales prefix.| Header | Type | Description |
|---|---|---|
Authorization |
string |
Bearer <access_token> OAuth2 Bearer token. |
x-app-stage |
string |
Tenant stage environment (dev, staging, prod). |
x-app-uid |
string |
Authenticated user application UUID. |
Content-Type |
string |
application/json (or multipart/form-data for batch upload). |
Accept |
string |
application/json. |
| Method | Endpoint | Description |
|---|---|---|
GET |
/v1/sales/invoices |
Paginated listing of sales invoices |
POST |
/v1/sales/invoices |
Create a sales invoice directly |
GET |
/v1/sales/invoices/{id} |
Retrieve single invoice details with line items |
PUT |
/v1/sales/invoices/{id} |
Update draft or editable invoice attributes |
DELETE |
/v1/sales/invoices/{id} |
Soft delete or mark invoice record as discarded |
POST |
/v1/sales/invoices/import |
Upload CSV batch billing file for direct SAP Business One ingestion |
GET |
/v1/sales/invoices/{id}/cancel |
Cancel invoice and trigger credit note / inventory reversal in ERP |
/import)Processes high-volume invoice records exported from external billing software or mobile POS terminals directly into SAP Business One.
POST /v1/sales/invoices/import
Content-Type: multipart/form-data
file (file, required): CSV file containing invoice headers and line items.companyId (int, required): Target company ID.The CSV file must contain the following standard columns:
CardCode: Customer CardCode in SAP B1 (e.g. C20100088921)DocDate: Document date (YYYY-MM-DD)DocDueDate: Due date (YYYY-MM-DD)ItemCode: Product SKU (CERV-CRIS-330)Quantity: Invoiced quantity (10)Price: Unit price before taxes (45.50)WhsCode: Warehouse code (01)200 OK{
"success": true,
"message": "Archivo procesado correctamente.",
"data": {
"total_entries": 45,
"imported_count": 45,
"rejections": []
}
}
/{id}/cancel)Cancels an existing invoice record in GOAL and synchronizes the document voiding / credit reversal into SAP Business One.
GET /v1/sales/invoices/{id}/cancel?companyId=1
200 OK{
"success": true,
"message": "Comprobante cancelado correctamente en SAP Business One.",
"data": {
"id": 12890,
"doc_number": "F001-0004521",
"status": "C",
"sap_doc_entry": 58492
}
}