Could not get a flat seam without a large ping-pong size table on which to assemble the work and do the measuring and cutting. .
Are you using a zipper foot? I like them so much, often use them for non-zipper sewing. But if you are, not sure why you are having difficulty. Also am not sure why you are having issues with pins. They must be fine pins, and short ones.
Trust you know how a zipper seam is constructed: First a stitch line is made with the marked seam line (or edge if there is no marked line) right over the outside edge of the zipper tape. Then the bulk of the fabric piece is folded back over the tape and away from the teeth and top stitched. This will conceal the inner stitch line underneath the seam and help prevent snags . The pins are added before sewing, in order to stabilize the fabric flat on the tape on the big table.
Then the second line of stitching, the top stitching, is done over the fabric with the line closer to the edge of the zipper tape and further from the teeth. Used to stitch right over the pins, but now pull each pin out shortly before the work goes under the pressure foot to get sewn. When doing this, it is helpful to hold the work with one hand (am a lefty) after it goes through the foot, with the other hand holding the work at a point just before the work goes under the foot. This makes doubly sure that the work is sewn flat without wrinkles. It is also helpful to have a machine with variable speed, controlled by the floor pedal. Like the tortoise, success comes at slower speeds.
Some use basting tape and find it easier. Since I learned the old way, stuck with that. And would recommend taking a few classes to get a visual idea of how it’s done. Also, starting with a kit, such as one for gaiters, helps because all the cutting and measuring has been done.
Sometimes I separate the two sides of the zipper and stitch them separately. Then thread the zipper through the pulls afterward.
Sometimes I pretend that I’m working in an Asian sweat shop, just to remind myself of all the folks who survive by doing this stuff. Thank goodness I was trained in something else, and this is just a hobby, not a livelihood.