The country's trade position has improved, driven by strong prices for meat and dairy products and a softer currency.
The terms of trade increased by 1.6 percent in the three months ended June, as export prices grew faster than import costs.
The data measures how much imports can be bought with a fixed amount of export earnings, and is taken as a sign of economic health.
The trade position is close to its strongest in 40 years and has been an important factor underpinning the economy.
"The goods terms of trade set fractionally below their late 2017 peak and remain a key support to the NZ economic outlook," said ASB senior economist Mark Smith.
Record prices for lamb and stronger returns for beef and dairy, offset weaker forestry earnings. Export earnings rose 3.4 percent.
A strong lift in petrol prices accounted for much of the rise of import costs, which were up 1.8 percent.
The volume of goods exported fell, but the drop was greater for import volumes.
"A sharper fall for imports than exports, (is) consistent with weakening domestic demand," Mr Smith said.
He said the country's trade position should remain relatively strong over the next couple of years as prices for key produce remain solid.
"New Zealand's specialisation on food exports leaves us reasonably well placed, although slowing in global growth will likely crimp export sector returns more generally."
Mr Smith said local exporters were also getting support from the weaker New Zealand dollar, which boosts export earnings.