POST/api/v1/delivery-notes/{uuid}/email

Send Delivery Note Email

Sends a delivery note to a client via email with the PDF attached. The subject and body can be customized or left blank to use the company's default email template.

Headers

NameTypeRequiredDescription
AuthorizationstringYesBearer token for authentication
X-CompanystringYesCompany UUID to scope the request
Content-TypestringYesMust be application/json

Path Parameters

NameTypeRequiredDescription
uuidstringYesThe UUID of the delivery note to email

Request Body

FieldTypeRequiredDescription
tostringYesRecipient email address
subjectstringNoEmail subject (uses default template if omitted)
bodystringNoEmail body (uses default template if omitted)
ccstring[]NoArray of CC email addresses
bccstring[]NoArray of BCC email addresses

Request

cURL
curl -X POST https://api.storno.ro/api/v1/delivery-notes/950e8400-e29b-41d4-a716-446655440000/email \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "X-Company: company-uuid-here" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "[email protected]",
    "subject": "Aviz de livrare DN-2026-012",
    "body": "Buna ziua,\n\nGasiti atasat avizul de livrare DN-2026-012.\n\nMultumim!",
    "cc": ["[email protected]"]
  }'
JavaScript
const response = await fetch('https://api.storno.ro/api/v1/delivery-notes/950e8400-e29b-41d4-a716-446655440000/email', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'X-Company': 'company-uuid-here',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    to: '[email protected]',
    subject: 'Aviz de livrare DN-2026-012',
    body: 'Buna ziua,\n\nGasiti atasat avizul de livrare DN-2026-012.\n\nMultumim!',
    cc: ['[email protected]']
  })
});

const data = await response.json();

Response

Returns an email log object confirming the email was sent:

{
  "id": "8f9a0b1c-2d3e-4f5a-6b7c-8d9e0f1a2b3c",
  "to": "[email protected]",
  "cc": ["[email protected]"],
  "bcc": null,
  "subject": "Aviz de livrare DN-2026-012",
  "attachments": ["aviz-DN-2026-012.pdf"],
  "sentAt": "2026-02-18T14:35:00Z",
  "deliveryStatus": "sent"
}

Response Fields

FieldTypeDescription
idstringEmail log UUID
tostringPrimary recipient email address
ccstring[]|nullCC recipients
bccstring[]|nullBCC recipients
subjectstringSubject line that was sent
attachmentsstring[]List of attached file names
sentAtstringISO 8601 timestamp of when the email was sent
deliveryStatusstringsent, queued, or failed

Template Variables

When using the default email template (subject or body omitted), the following variables are substituted automatically:

VariableDescriptionExample
[[client_name]]Client company nameClient SRL
[[delivery_note_number]]Delivery note numberDN-2026-012
[[total]]Formatted total with currency5,950.00 RON
[[issue_date]]Issue date18.02.2026
[[company_name]]Your company nameYour Company SRL
[[currency]]Currency codeRON

Error Codes

Status CodeError CodeDescription
400bad_requestInvalid or missing to email address
401unauthorizedMissing or invalid authentication token
403forbiddenInvalid or missing X-Company header
404not_foundDelivery note not found or doesn't belong to the company
500internal_errorEmail sending failed