# Marketplace

> Sell a business you built on thelastapi, or buy one. Offers are paid from credits, and accepting hands the whole project over in one step.

A business you list on your [public profile](https://thelastapi.dev/docs/profiles) can be **for sale**. Anyone with an account can make an offer; when you accept, the project moves to their account in one step, with its database, files, domains, customers and history. Both sides need credits: the buyer pays from theirs, and the price is added to the seller's. Credits do not turn into cash here.

## Sell a business

1. List it on your public profile (`listed: true`) and make the profile public.
2. Put it up for sale with a price: `PUT /v1/projects/:id/sale {"for_sale": true, "asking_cents": 500000}`. It appears at `GET /v1/marketplace`, no key needed.
3. `GET /v1/projects/:id/sale` says whether it can be sold right now and, if not, why (`blockers`): each one is something you can fix.
4. Offers reach you by email and at `GET /v1/marketplace/offers?role=seller`. Accept one with `POST /v1/marketplace/offers/:id/accept`, or decline it with `…/decline`.

To take it off sale: `PUT /v1/projects/:id/sale {"for_sale": false}`. Every open offer is declined and returned.

## Make an offer

You can offer on any business that is **listed on a public profile**, for sale or not: an offer to a business that is not for sale reaches its owner the same way, and they can accept it, decline it or ignore it. A business that is unlisted (or on a private profile) cannot be offered on, so unlisting is how an owner stays out of it. You can have 10 open offers at a time.

`POST /v1/marketplace/offers {"project_id": "…", "amount_cents": 450000, "message": "…"}` (the id or the slug). The amount is **held** from your credits while the seller decides, and goes back when the offer is declined, withdrawn, replaced by a newer one of yours, expires (7 days) or the business is sold to someone else. Withdraw it yourself with `POST /v1/marketplace/offers/:id/withdraw`. You need a free project slot on your plan: the business becomes one of yours.

## Browse

`GET /v1/marketplace` (no key) lists the businesses on the marketplace: the ones for sale by default, or every listed business with `for_sale=0` (offers are welcome on any). It is the same data the feed shows, and nothing private.

| Parameter | What it does |
| --- | --- |
| `q` | the business name, its address (slug) or the founder's username contains this; case and accents ignored |
| `sort` | `newest` (default), `price_low`, `price_high`, `mrr`, `revenue`, `visitors`, `name` |
| `min_price_cents`, `max_price_cents` | the asking price is at least / at most this; a business with no price never passes a price filter |
| `for_sale` | `1` (default) only businesses for sale; `0` every listed business |
| `page`, `per_page` | 20 a page by default, up to 50 |

The answer has `total`, `page`, `pages`, `has_more` and `data`: for each business its `name`, `slug`, `tagline`, `for_sale`, `asking_cents`, `owner`, `url`, `listed_at` and `metrics`, which holds only the numbers that business chose to share. A sort by a number (`mrr`, `revenue`, `visitors`) puts the businesses that share it first, ordered by it; the others follow, newest first, so their place tells nothing about a number they keep private. Businesses without a price go last in a price sort.

The same thing as a page: [thelastapi.dev/marketplace](https://thelastapi.dev/marketplace), with a search box, a sort, a price range and a switch between businesses for sale and every listed business. The filters live in the address (`?q=coffee&sort=price_low&max_price=5000&for_sale=0`), so a link opens the same view, and each card carries the command to make an offer. The search box on [thelastapi.dev/feed](https://thelastapi.dev/feed) finds a business by its name, address or founder, as before.

## From the terminal or an agent

The first way to use the marketplace is not a page: ask your agent, or use the CLI. Both use the same API.

```bash
vibiz marketplace                          # businesses for sale
vibiz marketplace coffee --max-price 5000  # search by name, filter by price (dollars)
vibiz marketplace --sort mrr               # sort: newest, price_low, price_high, mrr, revenue, visitors, name
vibiz marketplace --all                    # every listed business: an offer is welcome on any
vibiz marketplace offer sunny-shop 4500 --message "Hi Anna"
vibiz marketplace offers                   # offers you made and offers on your businesses
vibiz marketplace sale                     # is your project for sale, and what is in the way
vibiz marketplace sell --price 5000        # put it up for sale (it must be listed on your profile)
vibiz marketplace accept <offer> --yes     # hand the business over: final, so it asks for --yes
vibiz marketplace decline <offer>          # or: withdraw <offer>, unsell
```

An agent uses the `vibiz_marketplace` tool (`browse`, `sale`, `sell`, `unsell`, `offers`, `offer`, `withdraw`, `decline`, `accept`) or the SDK's `vibiz.marketplace`. Ask it "find me a small SaaS under $3,000 with MRR" and it searches, compares and tells you what it found. Searching changes nothing. Anything that holds credits or hands a business over (`offer`, `sell`, `accept`) is refused until the person has said yes to that business and that amount, and the agent repeats it with `confirm: true`. Selling, offering and answering need a full-access key or the `marketplace:write` permission.

## What a sale needs

The project can be sold when:

- its payments balance is **zero** (withdraw first) and no withdrawal is on its way;
- it charges through Vibiz payments, not your own payment account;
- nothing is being built or changed, and no marketing email is scheduled or sending;
- it has no company or app store listing (those cannot move yet).

## What moves

| Moves to the buyer | Stays with you | Removed (the buyer connects their own) |
| --- | --- | --- |
| The project and its address, database, sign-in users, deployments, files, variables, dashboards | What you were billed (usage, AI calls, actions) and your own exports | Your connectors and their approvals |
| Domains you bought through thelastapi, mailboxes with their mail, phone numbers with their messages | Your account, keys, card and credits | Your payment API keys, AI provider keys, host connections, Google and Bing connections |
| Payments history, products, subscriptions (they keep charging, now for the buyer) | | Where the domain's forwarded mail went |
| Email marketing: contacts, lists, broadcasts, automations | | |
| Connected social accounts and their posts and messages | | |
| The app key (it keeps working so the live app does not break) | | |

The business is unlisted on the buyer's profile and the price cleared: the buyer decides what to show. The seller's payout account does not move; the buyer connects their own before withdrawing.

When it is done the buyer gets a list of what to do next: set the owner details of the domains, rotate the app key and any secret variables, connect their payout account and accounts, check the email marketing sender. It is also in the offer (`transfer.buyer_next`).

All of it happens in one step: if anything is refused, nothing moves and no credits change hands.
