Since you have not specified the exact error you are getting when making the publishOffer
call, I will try to outline the whole process for reference. The prerequisite steps for publishing an offer from your sandbox account are:
- Create Payment, Fulfillment, and Return policies for your sandbox account. For this, you may call their respective APIs or you can use their API Explorer which has sample policy requests ready to be executed or, easiest of all, you can manage your business policies from the sandbox website here
- Create your inventory item using
createOrReplaceInventoryItem
call
- Create an inventory location for the created item through the
createInventoryLocation
API call. Your offer won't publish without this.
- Create an offer for the inventory item. Specify the offer details, such as fulfillment, payment, return policy IDs, category ID, inventory location ID, etc
- Publish the offer
There are quite a few requirements, specific to the type of item you are providing through a listing, that you have to fulfill before eBay will let you publish the offer. You can find more information about this in the error response you get when publishing the offer.
With that said, eBay's sandbox has behaved very unreliably in the past from my experience. So if you are doing everything right and still running into problems, as a last resort, you can try creating the listing by using eBay's Trading API's AddItem call. I have personally found these sets of eBay APIs to be more reliable (albeit more outdated).