> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eazecustoms.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Declaration Flow

> The pipeline and lifecycle of declarations in Eaze Customs.

This guide describes how declaration data flows through the Eaze Customs platform and the lifecycle states of a customs declaration.

The most common way customers integrate with the declaration process is by following the flow below.

<div style={{ overflowX: 'auto', width: '100%', margin: '2rem 0' }}>
  <div style={{ position: 'relative', width: '647px', height: '506px', margin: '0 auto' }}>
    <svg width="647" height="506" viewBox="0 0 647 506" fill="none" xmlns="http://www.w3.org/2000/svg" style={{ position: 'absolute', top: 0, left: 0, width: '100%', height: '100%', pointerEvents: 'none' }}>
      {/* Subgraph dashed boxes */}

      <rect x="0.5" y="0.5" width="646" height="117" stroke="#CFCFCF" strokeDasharray="5 5" rx="8" />

      <rect x="0.5" y="388.5" width="646" height="117" stroke="#CFCFCF" strokeDasharray="5 5" rx="8" />

      <rect x="194.5" y="148.5" width="258" height="210" stroke="#CFCFCF" strokeDasharray="5 5" rx="8" />

      {/* Connection lines (blue and green) */}

      <path d="M 83 426 L 83 218 L 244 218" stroke="#0EA5E9" strokeWidth="2" fill="none" />

      <path d="M 397 218 L 556 218 L 556 86" stroke="#0EA5E9" strokeWidth="2" fill="none" />

      <path d="M 104 80 L 104 298 L 224 298" stroke="#22C55E" strokeWidth="2" fill="none" />

      <path d="M 417 298 L 555.5 298 L 555.5 420" stroke="#22C55E" strokeWidth="2" fill="none" />

      {/* Arrowheads drawn as paths to prevent stripping */}

      <path d="M 250 218 L 242 213 L 242 223 Z" fill="#0EA5E9" />

      <path d="M 556 80 L 551 88 L 561 88 Z" fill="#0EA5E9" />

      <path d="M 230 298 L 222 293 L 222 303 Z" fill="#22C55E" />

      <path d="M 555.5 426 L 550.5 418 L 560.5 418 Z" fill="#22C55E" />
    </svg>

    <div style={{ position: 'absolute', top: '16px', left: 0, width: '100%', textAlign: 'center', fontSize: '14px', fontWeight: 600, color: 'var(--ec-text-primary, #4B5563)', fontFamily: 'Inter, system-ui, sans-serif' }}>Customs Systems</div>
    <div style={{ position: 'absolute', top: '164px', left: 0, width: '100%', textAlign: 'center', fontSize: '14px', fontWeight: 600, color: 'var(--ec-text-primary, #4B5563)', fontFamily: 'Inter, system-ui, sans-serif' }}>EC</div>
    <div style={{ position: 'absolute', top: '404px', left: 0, width: '100%', textAlign: 'center', fontSize: '14px', fontWeight: 600, color: 'var(--ec-text-primary, #4B5563)', fontFamily: 'Inter, system-ui, sans-serif' }}>Customer</div>

    {/* Card 4: Customs Response */}

    <div style={{ position: 'absolute', left: '24px', top: '36px', width: '160px', height: '44px', display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: '#F1F3FE', border: '1px solid #DCE1FE', borderRadius: '6px', fontSize: '13px', fontWeight: 500, color: '#1E293B', fontFamily: 'Inter, system-ui, sans-serif' }}>4. Customs Response</div>

    <div style={{ position: 'absolute', left: '489px', top: '36px', width: '134px', height: '44px', display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: '#F1F3FE', border: '1px solid #DCE1FE', borderRadius: '6px', fontSize: '13px', fontWeight: 500, color: '#1E293B', fontFamily: 'Inter, system-ui, sans-serif' }}>3. Declaration</div>

    <div style={{ position: 'absolute', left: '250px', top: '196px', width: '147px', height: '44px', display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: '#F1F3FE', border: '1px solid #DCE1FE', borderRadius: '6px', fontSize: '13px', fontWeight: 500, color: '#1E293B', fontFamily: 'Inter, system-ui, sans-serif' }}>2. Enrich Data</div>

    <div style={{ position: 'absolute', left: '230px', top: '276px', width: '187px', height: '44px', display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: '#F1F3FE', border: '1px solid #DCE1FE', borderRadius: '6px', fontSize: '13px', fontWeight: 500, color: '#1E293B', fontFamily: 'Inter, system-ui, sans-serif' }}>5. Update Status and Data</div>

    <div style={{ position: 'absolute', left: '24px', top: '426px', width: '118px', height: '44px', display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: '#F1F3FE', border: '1px solid #DCE1FE', borderRadius: '6px', fontSize: '13px', fontWeight: 500, color: '#1E293B', fontFamily: 'Inter, system-ui, sans-serif' }}>1. Shipments</div>

    <div style={{ position: 'absolute', left: '489px', top: '426px', width: '133px', height: '44px', display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: '#F1F3FE', border: '1px solid #DCE1FE', borderRadius: '6px', fontSize: '13px', fontWeight: 500, color: '#1E293B', fontFamily: 'Inter, system-ui, sans-serif' }}>6. Notifications</div>
  </div>
</div>

1. **Shipments**: You create a shipment containing the goods, deliveries, and delivery items.
2. **Enrich data**: EC validates and enriches the shipment data to automatically generate declarations.
3. **Declaration**: EC validates and submits the declaration to the customs authority system.
4. **Customs response**: The customs authority processes the declaration and returns status updates, requests, or release messages.
5. **Update status & data**: EC updates the declaration status and data based on the customs response.
6. **Notification**: You receive updates through webhooks, API polling, or the user interface.

## Declaration lifecycle

Every declaration goes through several processing stages from creation to final customs clearance and exit confirmation.

<div className="ec-lifecycle-container">
  <div className="ec-lifecycle-wrapper">
    <svg width="650" height="900" viewBox="0 0 650 900" fill="none" xmlns="http://www.w3.org/2000/svg" style={{ position: 'absolute', top: 0, left: 0, width: '100%', height: '100%', pointerEvents: 'none' }}>
      <path d="M 325 48 L 325 112" className="ec-lifecycle-line" />

      <path d="M 325 148 L 325 210 L 200 210 L 200 272" className="ec-lifecycle-line" />

      <path d="M 325 148 L 325 210 L 450 210 L 450 272" className="ec-lifecycle-line" />

      <path d="M 200 308 L 200 412" className="ec-lifecycle-line" />

      <path d="M 200 448 L 200 510 L 110 510 L 110 592" className="ec-lifecycle-line" />

      <path d="M 200 448 L 200 510 L 325 510 L 325 592" className="ec-lifecycle-line" />

      <path d="M 200 448 L 200 510 L 540 510 L 540 592" className="ec-lifecycle-line" />

      <path d="M 325 628 L 325 722" className="ec-lifecycle-line" />

      <path d="M 325 758 L 325 822" className="ec-lifecycle-line" />

      {/* Init to New */}

      <path d="M 325 112 L 320 104 L 330 104 Z" className="ec-lifecycle-arrow" />

      <path d="M 200 272 L 195 264 L 205 264 Z" className="ec-lifecycle-arrow" />

      <path d="M 450 272 L 445 264 L 455 264 Z" className="ec-lifecycle-arrow" />

      <path d="M 200 412 L 195 404 L 205 404 Z" className="ec-lifecycle-arrow" />

      <path d="M 110 592 L 105 584 L 115 584 Z" className="ec-lifecycle-arrow" />

      <path d="M 325 592 L 320 584 L 330 584 Z" className="ec-lifecycle-arrow" />

      <path d="M 540 592 L 535 584 L 545 584 Z" className="ec-lifecycle-arrow" />

      <path d="M 325 722 L 320 714 L 330 714 Z" className="ec-lifecycle-arrow" />

      <path d="M 325 822 L 320 814 L 330 814 Z" className="ec-lifecycle-arrow" />
    </svg>

    <div className="ec-state-card ec-state-violet" style={{ left: '265px', top: '12px', width: '120px', height: '36px', borderRadius: '20px' }}>Init</div>
    <div className="ec-state-card ec-state-violet" style={{ left: '265px', top: '112px', width: '120px', height: '36px', borderRadius: '6px' }}>New</div>
    <div className="ec-state-card ec-state-violet" style={{ left: '140px', top: '272px', width: '120px', height: '36px', borderRadius: '6px' }}>Valid</div>
    <div className="ec-state-card ec-state-red" style={{ left: '390px', top: '272px', width: '120px', height: '36px', borderRadius: '6px' }}>Invalid</div>
    <div className="ec-state-card ec-state-violet" style={{ left: '140px', top: '412px', width: '120px', height: '36px', borderRadius: '6px' }}>Submitted</div>
    <div className="ec-state-card ec-state-red" style={{ left: '20px', top: '592px', width: '180px', height: '36px', borderRadius: '6px', textAlign: 'center' }}>Customs Error</div>
    <div className="ec-state-card ec-state-violet" style={{ left: '265px', top: '592px', width: '120px', height: '36px', borderRadius: '6px' }}>Accepted</div>
    <div className="ec-state-card ec-state-amber" style={{ left: '450px', top: '592px', width: '180px', height: '36px', borderRadius: '6px', textAlign: 'center', lineHeight: '1.2' }}>Sending/Provider Error</div>
    <div className="ec-state-card ec-state-green" style={{ left: '265px', top: '722px', width: '120px', height: '36px', borderRadius: '20px' }}>Released</div>
    <div className="ec-state-card ec-state-green" style={{ left: '255px', top: '822px', width: '140px', height: '36px', borderRadius: '20px', borderStyle: 'dashed' }}>Exit Confirmed</div>

    <div className="ec-action-card" style={{ left: '215px', top: '65px', width: '220px', height: '30px' }}>Flow started & splitting done</div>
    <div className="ec-action-card" style={{ left: '245px', top: '164px', width: '160px', height: '30px' }}>Deductions & validations</div>
    <div className="ec-action-card" style={{ left: '130px', top: '345px', width: '140px', height: '30px' }}>Send to customs</div>
    <div className="ec-action-card" style={{ left: '20px', top: '536px', width: '180px', height: '30px', textAlign: 'center' }}>Customs validation failed</div>
    <div className="ec-action-card" style={{ left: '255px', top: '536px', width: '140px', height: '30px' }}>Accepted by customs</div>
    <div className="ec-action-card" style={{ left: '435px', top: '530px', width: '210px', height: '42px', textAlign: 'center', padding: '2px 4px', lineHeight: '1.2' }}>Customs communication<br />failed temporarily</div>
    <div className="ec-action-card" style={{ left: '255px', top: '660px', width: '140px', height: '30px' }}>Released by customs</div>
  </div>
</div>

<div
  style={{ 
display: 'flex', 
flexDirection: 'column', 
gap: '1rem', 
padding: '1.25rem', 
backgroundColor: 'var(--ec-bg-subtle, #F8F9FC)', 
border: '1px solid var(--ec-border, #E2E2ED)', 
borderRadius: '8px', 
marginTop: '1.5rem',
marginBottom: '2rem'
}}
>
  <div style={{ fontSize: '14px', fontWeight: 600, color: 'var(--ec-text-primary, #1A1A2E)' }}>Legend</div>

  <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))', gap: '1rem' }}>
    <div style={{ display: 'flex', flexDirection: 'column', gap: '0.75rem' }}>
      <div style={{ fontSize: '12px', fontWeight: 600, textTransform: 'uppercase', letterSpacing: '0.05em', color: 'var(--ec-text-muted, #8888A4)' }}>Declaration States</div>

      <div style={{ display: 'flex', alignItems: 'center', gap: '0.75rem' }}>
        <span className="ec-state-card ec-state-violet" style={{ position: 'relative', width: '90px', height: '26px', fontSize: '11px', borderRadius: '4px', boxShadow: 'none' }}>State</span>
        <span style={{ fontSize: '11px', color: 'var(--ec-text-secondary, #4A4A6A)' }}>Standard processing states (e.g., Init, New, Valid, Submitted, Accepted)</span>
      </div>

      <div style={{ display: 'flex', alignItems: 'center', gap: '0.75rem' }}>
        <span className="ec-state-card ec-state-green" style={{ position: 'relative', width: '90px', height: '26px', fontSize: '11px', borderRadius: '4px', boxShadow: 'none' }}>Released</span>
        <span style={{ fontSize: '11px', color: 'var(--ec-text-secondary, #4A4A6A)' }}>Successful clearance and confirmation (Released, Exit Confirmed)</span>
      </div>

      <div style={{ display: 'flex', alignItems: 'center', gap: '0.75rem' }}>
        <span className="ec-state-card ec-state-red" style={{ position: 'relative', width: '90px', height: '26px', fontSize: '11px', borderRadius: '4px', boxShadow: 'none' }}>Error</span>
        <span style={{ fontSize: '11px', color: 'var(--ec-text-secondary, #4A4A6A)' }}>Validation failure or customs rejection (Invalid, Customs Error)</span>
      </div>

      <div style={{ display: 'flex', alignItems: 'center', gap: '0.75rem' }}>
        <span className="ec-state-card ec-state-amber" style={{ position: 'relative', width: '90px', height: '26px', fontSize: '11px', borderRadius: '4px', boxShadow: 'none' }}>Temp Error</span>
        <span style={{ fontSize: '11px', color: 'var(--ec-text-secondary, #4A4A6A)' }}>Temporary network/provider communication failure</span>
      </div>
    </div>

    <div style={{ display: 'flex', flexDirection: 'column', gap: '0.75rem' }}>
      <div style={{ fontSize: '12px', fontWeight: 600, textTransform: 'uppercase', letterSpacing: '0.05em', color: 'var(--ec-text-muted, #8888A4)' }}>Transitions & Actions</div>

      <div style={{ display: 'flex', alignItems: 'center', gap: '0.75rem' }}>
        <span className="ec-action-card" style={{ position: 'relative', width: '90px', height: '26px', fontSize: '10px', borderRadius: '4px', boxShadow: 'none' }}>Action</span>
        <span style={{ fontSize: '11px', color: 'var(--ec-text-secondary, #4A4A6A)' }}>Actions and validation steps that move declarations between states</span>
      </div>
    </div>
  </div>
</div>

### Lifecycle stages explained

* **Init**: The pipeline is initialized, and shipment consignments are automatically split into separate declarations based on country of origin, destination, and other grouping rules.
* **New**: The declaration is created in the system.
* **Valid / Invalid**: Eaze Customs runs automated data validations and enrichment. If any required fields are missing or invalid, the declaration is marked as `Invalid` for review. Otherwise, it moves to `Valid`.
* **Submitted**: The declaration is successfully transmitted to the customs authority.
* **CustomsError**: The declaration is rejected by customs due to validation errors.
* **Sending/ProviderError**: There is a temporary communication failure with the customs server; the system will retry transmission.
* **Accepted**: Customs has validated and accepted the declaration filing.
* **Released**: Customs has cleared the declaration and released the goods for transit or free circulation.
* **ExitConfirmed**: Physical verification that the goods have departed the customs territory.

## Status descriptions

| Status             | Description                                                                |
| :----------------- | :------------------------------------------------------------------------- |
| `NEW`              | Declaration has been created from shipment data.                           |
| `READY_TO_DECLARE` | Validation completed successfully and declaration is ready for submission. |
| `INVALID`          | Validation errors were found and user action is required.                  |
| `PRE_LODGED`       | Declaration has been pre-lodged with customs.                              |
| `REGISTERED`       | Customs has registered the declaration.                                    |
| `ACKNOWLEDGED`     | Customs has accepted receipt of the declaration.                           |
| `CONTROL`          | Customs inspection or control process is required.                         |
| `RELEASED`         | Goods have been released by customs.                                       |
| `NO_RELEASE`       | Customs rejected release of the goods.                                     |
| `COMPLETED`        | Final successful completion of the declaration process.                    |
| `CANCELLATION_REQ` | Cancellation has been requested.                                           |
| `CANCELED`         | Declaration has been canceled.                                             |
