Skip to main content

Overview

The Delivery class represents information about the delivery of goods or services in a business transaction. It includes details about delivery location, timing, quantities, parties involved, and tracking information. This component is commonly used in invoices, orders, and despatch advice documents.

Class Definition

import { Delivery } from 'ubl-builder/lib/ubl21/CommonAggregateComponents';

Constructor Parameters

id
string | UdtIdentifier
required
An identifier for this delivery
quantity
string | UdtQuantity
required
The quantity of items, child consignments, or shipments in this delivery
actualDeliveryDate
string | UdtDate
required
The actual date of delivery
deliveryAddress
DeliveryAddress
required
The delivery address
minimumQuantity
string | UdtQuantity
The minimum quantity of items in this delivery
maximumQuantity
string | UdtQuantity
The maximum quantity of items in this delivery
actualDeliveryTime
string | UdtTime
The actual time of delivery
latestDeliveryDate
string | UdtDate
The latest date of delivery allowed by the buyer
latestDeliveryTime
string | UdtTime
The latest time of delivery allowed by the buyer
releaseID
string | UdtIdentifier
An identifier used for approval of access to delivery locations (e.g., port terminals)
trackingID
string | UdtIdentifier
The delivery tracking ID (for transport tracking)
deliveryLocation
DeliveryLocation
The delivery location (more detailed than address)
alternativeDeliveryLocation
AlternativeDeliveryLocation
An alternative delivery location
requestedDeliveryPeriod
RequestedDeliveryPeriod
The period requested for delivery
promisedDeliveryPeriod
PromisedDeliveryPeriod
The period promised for delivery
estimatedDeliveryPeriod
EstimatedDeliveryPeriod
The period estimated for delivery
carrierParty
CarrierParty
The party responsible for delivering the goods
deliveryParty
DeliveryParty
The party to whom the goods are delivered
notifyParties
NotifyParty[]
Parties to be notified of this delivery
despatch
Despatch
The despatch (pickup) associated with this delivery
shipment
ShipmentType
The shipment being delivered

Usage Examples

import { 
  Delivery, 
  PostalAddress,
  Country
} from 'ubl-builder/lib/ubl21/CommonAggregateComponents';

const deliveryAddress = new PostalAddress({
  streetName: '789 Warehouse Boulevard',
  cityName: 'Houston',
  postalZone: '77001',
  countrySubentity: 'Texas',
  country: new Country({ name: 'United States' })
});

const delivery = new Delivery({
  id: 'DEL-001',
  quantity: '100',
  actualDeliveryDate: '2024-03-10',
  deliveryAddress: deliveryAddress
});
When using delivery information at both document level and line level, the line-level delivery information takes precedence for that specific line. Document-level delivery typically represents the primary or default delivery.

Delivery Timing

The Delivery class supports various timing fields:
  • actualDeliveryDate/Time: When delivery actually occurred (past tense)
  • latestDeliveryDate/Time: Deadline for delivery (future tense)
  • requestedDeliveryPeriod: When customer wants delivery
  • promisedDeliveryPeriod: When supplier promises delivery
  • estimatedDeliveryPeriod: Estimated delivery timeframe
  • Address - For delivery addresses
  • Party - For carrier and delivery parties
  • InvoiceLine - Can include line-level delivery
  • Invoice - Can include document-level delivery
  • DeliveryLocation - For detailed location information
  • Despatch - For pickup/despatch information
  • ShipmentType - For shipment details

Best Practices

  1. Tracking IDs: Always include tracking IDs when available for shipment visibility
  2. Accurate Dates: Ensure delivery dates reflect actual delivery, not invoice dates
  3. Complete Addresses: Provide complete delivery addresses including postal codes
  4. Notify Parties: Include all parties that need delivery notifications
  5. Quantities: Delivery quantities should match or be less than invoiced quantities
  6. Carrier Information: Include carrier details for shipment tracking and accountability

UBL Schema Reference

For more information, see the UBL 2.1 Delivery specification.

Build docs developers (and LLMs) love