Does Dockflow return the CO2 emission value in the API output, and where do I find it?

Yes. Dockflow returns CO2 emission data in the API record. Look for the carbon_emissions field, which the documentation describes as CO2 emission data for the shipment route.

Polling returns records in the data array. Webhooks send one record in data, and that record is the same as polling with the default fields, which include shipment. Both modes return the same record.

Inside carbon_emissions, read distance_km for route distance in kilometers and co2_emissions_kg for total CO2 in kilograms. The total is Well-to-Wheel, made up of Tank-to-Wheel plus Well-to-Tank. ttw_kg is the Tank-to-Wheel part, meaning direct fuel combustion. The field is null when the value has not yet been calculated.

So your integration should read the CO2 value from the carbon_emissions field in each record. If that field is null, no calculated CO2 value is available yet.

Example
For a general ocean shipment, the record can show a route distance in distance_km and a total CO2 value in co2_emissions_kg. The ttw_kg value is the direct combustion part. Your integration reads these from carbon_emissions in each polling or webhook record. If carbon_emissions is null, the calculation has not been done yet.