# Drafts and publishing

> The Seller API isn’t open to every seller yet. You can read the docs now; API keys and the Claude connector work once the API is turned on for your account. To ask for access, contact us: https://gathermark.com/help

The API creates and changes **drafts**. Publishing always happens on the site, by you.

## The flow

1. `POST https://api.gathermark.com/v1/listings` creates a draft and returns its `edit_url`.
2. Optionally change it with `PATCH https://api.gathermark.com/v1/listings/{id}` (title, description, community, shipping profile, the listing photos, or replace the items and their photos).
3. Open `edit_url` (`https://gathermark.com/dashboard/listings/{id}/edit`), add any photos it still needs, check everything, and publish.

Once a listing is live, the API can still read it, but `PATCH` and `DELETE` return `409` with code `listing_not_draft`. Edit live listings on the site.

Creating a draft sends no emails or notifications and does not post anywhere. Nothing is visible to buyers until you publish.

## `can_publish` and `missing`

Every draft response includes:

- `can_publish`: `true` when the draft passes every check that publishing on the site runs.
- `missing`: the checks the draft still fails.

Publishing is stricter than saving a draft. A draft can be saved with a 3-character item name or no item description, but it can't be published until it meets the publish minimums. `GET https://api.gathermark.com/v1/vocab` returns them as `publish_limits`, next to the draft `limits`.

| Value | What to do |
|---|---|
| `selling_disabled` | Selling is paused on Gathermark. Try again later. |
| `seller_suspended` | Your account is suspended. [Contact Gathermark support](https://gathermark.com/help#contact). |
| `email_verification` | Verify your email address on Gathermark. |
| `paypal_onboarding` | Connect your PayPal account in **Dashboard › Settings**. |
| `display_name` | Choose a display name on Gathermark. |
| `title` | Make the title 5 to 200 characters. |
| `items` | Add an item with a quantity of at least 1. |
| `item_name` | Make each item name at least 5 characters. |
| `item_description` | Give each item a description of at least 10 characters. |
| `item_price` | Give each item a price greater than zero. |
| `item_quantity` | Give each item a quantity of at least 1. |
| `variations` | An item's variations are not valid. Fix them on the edit page. |
| `image` | Add at least one listing photo: send listing `image_urls` when you create the draft or with `PATCH`, or add it on the edit page. Item photos don't count (see [Images](https://gathermark.com/developers/images)). |
| `shipping` | Choose a shipping profile on the edit page, or send `shipping_profile_id` (from `GET https://api.gathermark.com/v1/shipping-profiles`). |
| `community` | There is no active community to publish in right now. Try again later or [contact Gathermark support](https://gathermark.com/help#contact). |

`GET https://api.gathermark.com/v1/me` returns the account-level codes from this list (the first five), so you can check your account before you create anything.

```json
{
  "id": "h7Gf2KpL9sQw4ZxC",
  "status": "draft",
  "edit_url": "https://gathermark.com/dashboard/listings/h7Gf2KpL9sQw4ZxC/edit",
  "listing_url": null,
  "can_publish": false,
  "missing": ["image", "shipping"]
}
```

## Shipping

Send `shipping_profile_id` to apply one of your saved shipping profiles, the same way the create page does. Without it the draft has no shipping and `missing` includes `shipping`.

## Communities

Send `community_id` (from `GET https://api.gathermark.com/v1/communities`) to choose where the listing is posted. Without it, the site-wide default community (the one with `"is_default": true` in that list) is used when you publish.

## Finding your drafts

`GET https://api.gathermark.com/v1/listings` lists the drafts and listings you created through the API, newest first, with a cursor for the next page. Add `source=all` to list every listing in your shop, including ones made on the site (`source=api`, the default, keeps the API-made ones only). Drafts also appear in **Dashboard › Listings** with your other drafts.

## Deleting a draft

`DELETE https://api.gathermark.com/v1/listings/{id}` deletes a draft. Live listings return `409` (`listing_not_draft`).
