GET/api/v1/delivery-notes/{uuid}/email-defaults

Get Email Defaults

Returns pre-filled email content for a delivery note based on the company's configured email template. All template variables are already substituted with real values from the delivery note and client records. Use this to populate the email form before sending.

Headers

NameTypeRequiredDescription
AuthorizationstringYesBearer token for authentication
X-CompanystringYesCompany UUID to scope the request

Path Parameters

NameTypeRequiredDescription
uuidstringYesThe UUID of the delivery note

Request

cURL
curl https://api.storno.ro/api/v1/delivery-notes/950e8400-e29b-41d4-a716-446655440000/email-defaults \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "X-Company: company-uuid-here"
JavaScript
const response = await fetch('https://api.storno.ro/api/v1/delivery-notes/950e8400-e29b-41d4-a716-446655440000/email-defaults', {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'X-Company': 'company-uuid-here'
  }
});

const defaults = await response.json();

// Use to pre-populate email form
document.getElementById('email-to').value = defaults.to;
document.getElementById('email-subject').value = defaults.subject;
document.getElementById('email-body').value = defaults.body;

Response

Returns an object with pre-filled to, subject, and body fields:

{
  "to": "[email protected]",
  "subject": "Aviz de livrare DN-2026-012 de la Your Company SRL",
  "body": "Buna ziua,\n\nGasiti atasat avizul de livrare DN-2026-012 in valoare de 5,950.00 RON.\n\nMultumim!\n\nYour Company SRL"
}

Response Fields

FieldTypeDescription
tostringClient email address (from client record)
subjectstringPre-filled subject with all template variables replaced
bodystringPre-filled body with all template variables replaced

Error Codes

Status CodeError CodeDescription
401unauthorizedMissing or invalid authentication token
403forbiddenInvalid or missing X-Company header
404not_foundDelivery note not found or doesn't belong to the company