This piece actually consists of a Prelude with a ground bass, Fugue, Interlude (Allegro) and another Fugue, ending in a Toccata-like flourish.
The edition that I have (Hansen) does not give a catalogue number but I believe this is BuxWV149. The original manuscript is written on two staves. Following the Hansen edition I have played the melody in the interlude on the pedals, although other editions show the interlude for manuals only.