If you want to sell your books in bookstores or through other distribution services (i.e., Amazon, Diamond), then you are required to have an ISBN (International Standard Book Number) for selling and tracking purposes. An ISBN is required for each version of your book: new editions, softcover and hardcover versions all need a unique identifier. The only place to purchase your own ISBN is www.isbn.org. You should never buy ISBNs from a reseller as the reseller will be listed as your publisher instead of you.
You don’t need an ISBN code if you are only planning to sell your books directly through conventions, events or workshops, or by using them as incentives, giveaways, etc.
Once you have an ISBN you can generate a free barcode online. You do not need to purchase the barcode separately. When designing your cover or jacket, you can put the barcode and ISBN wherever you want, so be sure to include them in your art when you submit your files. Just make sure it’s 300dpi (ideally a vector PDF file). Otherwise, it may appear too blurry to scan.