For scrolls I've always used 300 g.p. per spell level if the spell has no significant consumable components.
If the spell has significant component costs attached the buyer must either assume these costs or provide the component(s).
Some spells - mostly divine - require additional payments i.e. sacrifices to appease the caster's deity (regardless whether the caster/scriber is a PC or an NPC) and these must always be paid.
And some spells, due to their power and-or rarity, have costs somewhat higher than the 300/level baseline.
For studying and copying a spell from a guild or NPC the 300 / spell level also applies, plus any power/rarity adjusts.
To simply get a spell cast for you is usually pretty cheap if the spell carries no risk to the caster, though you still have to pay for the components and-or sacrifices. If the spell carries risk to the caster, costs rise dramatically.