Update Delivery Note
Updates an existing delivery note. Delivery notes in both draft and issued status can be updated. Once converted or cancelled, the delivery note becomes immutable.
Headers
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer token for authentication |
X-Company | string | Yes | Company UUID to scope the request |
Content-Type | string | Yes | Must be application/json |
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
uuid | string | Yes | The UUID of the delivery note to update |
Request Body
All fields from the create endpoint can be updated. The entire delivery note is replaced with the new data.
| Field | Type | Required | Description |
|---|---|---|---|
clientId | string | Yes | UUID of the client |
documentSeriesId | string | No | UUID of the delivery note series. Can be changed to any active delivery_note series; if omitted, the existing series is preserved |
issueDate | string | Yes | Date of issue (YYYY-MM-DD) |
dueDate | string | Yes | Due date for invoicing (YYYY-MM-DD) |
currency | string | Yes | Currency code |
exchangeRate | number | No | Exchange rate |
deliveryLocation | string | No | Delivery address |
projectReference | string | No | Project reference |
issuerName | string | No | Issuer name |
issuerId | string | No | Issuer UUID |
salesAgent | string | No | Sales agent name |
deputyName | string | No | Deputy name |
deputyIdentityCard | string | No | Deputy ID card |
deputyAuto | string | No | Vehicle registration |
notes | string | No | Public notes |
mentions | string | No | Additional mentions |
internalNote | string | No | Internal note |
lines | array | Yes | Array of line items (replaces all existing lines) |
e-Transport Fields
All e-Transport fields from the Create endpoint are accepted. Key fields:
| Field | Type | Required | Description |
|---|---|---|---|
etransportOperationType | number | No | Operation type (10, 12, 20, 30, 40, 50, 60) |
etransportVehicleNumber | string | No | Vehicle registration (3-20 uppercase alphanumeric) |
etransportTransporterCountry | string | No | Transporter country code (e.g., "RO") |
etransportTransporterCode | string | No | Transporter CUI/CIF (numeric only) |
etransportTransporterName | string | No | Transporter legal name |
etransportTransportDate | string | No | Transport start date (YYYY-MM-DD) |
etransportPostIncident | boolean | No | Post-incident declaration |
etransportTrailer1 | string | No | First trailer registration |
etransportTrailer2 | string | No | Second trailer registration |
etransportStartCounty | number | No | Start county code (1-52) |
etransportStartLocality | string | No | Start locality (2-100 chars) |
etransportStartStreet | string | No | Start street (2-100 chars) |
etransportStartNumber | string | No | Start street number |
etransportStartOtherInfo | string | No | Start additional info |
etransportStartPostalCode | string | No | Start postal code |
etransportEndCounty | number | No | End county code (1-52) |
etransportEndLocality | string | No | End locality (2-100 chars) |
etransportEndStreet | string | No | End street (2-100 chars) |
etransportEndNumber | string | No | End street number |
etransportEndOtherInfo | string | No | End additional info |
etransportEndPostalCode | string | No | End postal code |
Line Item Object
| Field | Type | Required | Description |
|---|---|---|---|
uuid | string | No | UUID of existing line (if updating); omit to create new line |
description | string | Yes | Item description |
quantity | number | Yes | Quantity (must be > 0) |
unitPrice | number | Yes | Price per unit |
vatRateId | string | Yes | UUID of the VAT rate |
unitOfMeasure | string | No | Unit of measure |
productId | string | No | UUID of related product |
tariffCode | string | No | 8-digit HS/CN tariff code (required for e-Transport, BR-206) |
purposeCode | number | No | Purpose code (for TTN: 101, 704, 705, 9901 per BR-070) |
unitOfMeasureCode | string | No | UN/ECE Rec 20 code (e.g., "H87", "KGM", "SET") |
netWeight | string | No | Net weight in kg (required for e-Transport, BR-207) |
grossWeight | string | No | Gross weight in kg |
valueWithoutVat | string | No | Value without VAT (required for e-Transport, BR-208) |
Request
cURL
curl -X PUT https://api.storno.ro/api/v1/delivery-notes/950e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Company: company-uuid-here" \
-H "Content-Type: application/json" \
-d '{
"clientId": "750e8400-e29b-41d4-a716-446655440000",
"documentSeriesId": "850e8400-e29b-41d4-a716-446655440000",
"issueDate": "2026-02-18",
"dueDate": "2026-03-20",
"currency": "RON",
"deliveryLocation": "Updated: Client new warehouse - Str. Nou 10",
"projectReference": "PROJECT-2026-002",
"issuerName": "John Doe",
"deputyName": "Updated Deputy Name",
"deputyIdentityCard": "CD789012",
"deputyAuto": "B-456-XYZ",
"notes": "Updated delivery notes",
"lines": [
{
"uuid": "A10e8400-e29b-41d4-a716-446655440000",
"description": "Laptop Dell Latitude 7420 (Updated qty)",
"quantity": 12,
"unitPrice": 450,
"unitOfMeasure": "piece",
"vatRateId": "350e8400-e29b-41d4-a716-446655440000",
"productId": "B50e8400-e29b-41d4-a716-446655440000"
},
{
"description": "USB-C Cable 2m",
"quantity": 12,
"unitPrice": 15,
"unitOfMeasure": "piece",
"vatRateId": "350e8400-e29b-41d4-a716-446655440000"
}
]
}'
JavaScript
const response = await fetch('https://api.storno.ro/api/v1/delivery-notes/950e8400-e29b-41d4-a716-446655440000', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'X-Company': 'company-uuid-here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
clientId: '750e8400-e29b-41d4-a716-446655440000',
documentSeriesId: '850e8400-e29b-41d4-a716-446655440000',
issueDate: '2026-02-18',
dueDate: '2026-03-20',
currency: 'RON',
deliveryLocation: 'Updated: Client new warehouse - Str. Nou 10',
projectReference: 'PROJECT-2026-002',
issuerName: 'John Doe',
deputyName: 'Updated Deputy Name',
deputyIdentityCard: 'CD789012',
deputyAuto: 'B-456-XYZ',
notes: 'Updated delivery notes',
lines: [
{
uuid: 'A10e8400-e29b-41d4-a716-446655440000',
description: 'Laptop Dell Latitude 7420 (Updated qty)',
quantity: 12,
unitPrice: 450,
unitOfMeasure: 'piece',
vatRateId: '350e8400-e29b-41d4-a716-446655440000',
productId: 'B50e8400-e29b-41d4-a716-446655440000'
},
{
description: 'USB-C Cable 2m',
quantity: 12,
unitPrice: 15,
unitOfMeasure: 'piece',
vatRateId: '350e8400-e29b-41d4-a716-446655440000'
}
]
})
});
const data = await response.json();
Response
Returns the updated delivery note object with recalculated totals:
{
"uuid": "950e8400-e29b-41d4-a716-446655440000",
"number": "DN-2026-012",
"documentSeriesId": "850e8400-e29b-41d4-a716-446655440000",
"clientId": "750e8400-e29b-41d4-a716-446655440000",
"status": "draft",
"issueDate": "2026-02-18",
"dueDate": "2026-03-20",
"currency": "RON",
"exchangeRate": 1.0,
"deliveryLocation": "Updated: Client new warehouse - Str. Nou 10",
"projectReference": "PROJECT-2026-002",
"issuerName": "John Doe",
"deputyName": "Updated Deputy Name",
"deputyIdentityCard": "CD789012",
"deputyAuto": "B-456-XYZ",
"notes": "Updated delivery notes",
"lines": [
{
"uuid": "A10e8400-e29b-41d4-a716-446655440000",
"lineNumber": 1,
"description": "Laptop Dell Latitude 7420 (Updated qty)",
"quantity": "12.00",
"unitPrice": "450.00",
"unitOfMeasure": "piece",
"vatRateId": "350e8400-e29b-41d4-a716-446655440000",
"productId": "B50e8400-e29b-41d4-a716-446655440000",
"subtotal": "5400.00",
"vatAmount": "1026.00",
"total": "6426.00"
},
{
"uuid": "A30e8400-e29b-41d4-a716-446655440000",
"lineNumber": 2,
"description": "USB-C Cable 2m",
"quantity": "12.00",
"unitPrice": "15.00",
"unitOfMeasure": "piece",
"vatRateId": "350e8400-e29b-41d4-a716-446655440000",
"subtotal": "180.00",
"vatAmount": "34.20",
"total": "214.20"
}
],
"subtotal": "5580.00",
"vatAmount": "1060.20",
"total": "6640.20",
"createdAt": "2026-02-18T09:00:00Z",
"updatedAt": "2026-02-18T11:30:00Z"
}
Line Item Behavior
When updating lines:
- Lines with existing
uuidvalues are updated - Lines without
uuidare created as new lines - Existing lines not included in the request are deleted
- Line numbers are automatically reassigned sequentially
Validation Rules
Status Restriction
- Delivery note must be in
draftorissuedstatus - Cannot update after it's converted or cancelled
Dates
issueDatemust be valid YYYY-MM-DD formatdueDatemust be equal to or afterissueDate
Currency & Rates
currencymust be valid ISO 4217 codeexchangeRatemust be greater than 0
Line Items
- Minimum 1 line required
- All line validation rules from create endpoint apply
Error Codes
| Status Code | Error Code | Description |
|---|---|---|
| 400 | bad_request | Invalid request body structure |
| 401 | unauthorized | Missing or invalid authentication token |
| 403 | forbidden | Invalid or missing X-Company header, or delivery note is not editable |
| 404 | not_found | Delivery note not found or doesn't belong to the company |
| 409 | conflict | Delivery note status prevents updates (converted or cancelled) |
| 422 | validation_error | Validation failed (see error details) |
| 500 | internal_error | Server error occurred |
Example Error Responses
Status Conflict
{
"error": {
"code": "conflict",
"message": "Delivery note cannot be updated",
"details": {
"status": "converted",
"reason": "Converted or cancelled delivery notes cannot be updated",
"convertedAt": "2026-02-20T15:00:00Z"
}
}
}
Validation Error
{
"error": {
"code": "validation_error",
"message": "Validation failed",
"details": {
"dueDate": ["Due date must be after issue date"],
"lines.0.quantity": ["Quantity must be greater than 0"],
"lines": ["At least one line item is required"]
}
}
}
Common Update Scenarios
Update Quantities Before Delivery
// Adjust quantities to match actual stock
lines: [
{ uuid: "A10...", quantity: 12, ... }, // Was 10, now 12
{ uuid: "A20...", quantity: 10, ... } // Unchanged
]
Add Items to Delivery
// Keep existing + add new items
lines: [
{ uuid: "A10...", description: "Item 1", ... }, // Keep existing
{ description: "New Item", quantity: 5, ... } // Add new
]
Remove Items from Delivery
// Only include items being delivered
lines: [
{ uuid: "A10...", description: "Item 1", ... } // Keep only this
// Item 2 removed by omitting it
]
Update Delivery Details
// Change delivery location or deputy
{
deliveryLocation: "New warehouse address",
deputyName: "Different person receiving",
deputyIdentityCard: "New ID number"
}
Correct Data Entry Errors
// Fix mistakes before issuing
{
projectReference: "Corrected project code",
notes: "Corrected delivery notes",
lines: [{ ...corrected line data }]
}
Best Practices
- Update before issuing - Make all corrections while in draft status
- Verify totals - Check calculated totals after updating quantities
- Track changes - Log what was changed and why in your system
- Confirm with client - If delivery details change, notify client
- Update promptly - Make changes as soon as discrepancies are discovered
- Check inventory - Ensure updated quantities match available stock
- Issue when ready - Once finalized, mark as issued immediately
When to Update vs Create New
Update Existing
- Delivery note is in
draftorissuedstatus - Fixing errors before or after issue
- Adjusting quantities to match stock
- Correcting client or location details
Create New Delivery Note
- Need to document an additional, separate delivery
- Delivery note is already converted or cancelled
- Separate shipment or delivery event
- Historical record of the original must remain unchanged
Next Steps
After updating a delivery note:
- Review all changes carefully
- Verify totals and calculations
- Confirm inventory availability
- Mark as issued when ready for delivery
- Convert to invoice after successful delivery