A Northern Territory woman has had her conviction for supplying a dangerous drug upheld, despite the substance inside the capsules she sold being legal.

The Court of Appeal in Darwin heard Sarah Ann Bridle decided to buy a herbal stimulant on the internet and pass it off as ecstasy.

But an early customer was an undercover policeman.

The court was told Bridle sold capsules to the officer three times before being arrested and convicted last year of supplying a dangerous drug.

Bridle tried to contest the guilty finding because the capsules contained caffeine and not illegal drugs.

But the court of appeal found that because Bridle had sold the capsules as ecstasy, the legal definition of supply had been met.

The judge ruled the conviction should stand but agreed to reduce Bridle's original five-month jail sentence.

Instead, the 18 year-old was placed on a good behaviour bond for a year.