Bribery is a severe sin, as reported by Ahmad (6791) and Abu Dawood (3580) from ‘Abd-Allaah ibn ‘Amr (may Allaah be pleased with him), who said: The Messenger of Allaah (peace and blessings of Allaah be upon him) cursed the one who gives a bribe and the one who takes it. Al-Albaani classified it as saheeh in Irwa’ al-Ghaleel (2621).
So, if you can do the task without paying a bribe, it is haraam to do so.
If a person who has a right cannot obtain it without paying a bribe, scholars (may Allaah have mercy on him) have stated that it is allowed for him to give the bribe in that instance, and that the prohibition only applies to the one who receives it, not the one who gives it. They cited the story related by Ahmad (10739) from ‘Umar ibn al-Khattaab, according to which the Messenger of Allaah (peace and blessings of Allaah be upon him) said: “One of them begs for something, and I give it to him, and he goes out with it under his arm, and it is nothing but fire for him.”