# Merchants and platforms

> Whether you sell your own goods or your customers sell to each other.

Every KetaPay business is one of two types. The type decides who the seller is, who can refund, and who rules on disputes.

| | Merchant | Platform |
| --- | --- | --- |
| Who it is | A business selling its own goods or services | A marketplace where your customers buy from each other |
| The seller | Your business | One of your customers, named on each session |
| Paid out to | Your KetaPay balance | The seller's own payout account |
| Refunds with your key | Your own sales | Your own sales only |
| Disputes decided by | KetaPay | KetaPay on your own sales; your platform on your customers' deals |
| Approval | None | KetaPay approves it before live use |

Every business starts as a merchant.

## Merchants

Leave `seller` out when you create a checkout session. Your business is the seller, under its name, and each release is paid into your KetaPay balance.

```ts
const session = await ketapay.checkoutSessions.create({
  amount: 250_000,
  title: 'Leather sofa, 3-seater',
  buyer: { email: 'ada@example.com' },
  return_url: 'https://shop.example.com/orders/1042',
})
```

You can refund any of your own sales with a key that has the `escrows:manage` scope (see [Refunds](https://docs.ketapay.com/after-payment/refunds)). KetaPay rules on disputes between you and your buyers.

## Platforms

Name the `seller` on each session. The deal is between two of your customers: the buyer pays into escrow and the seller is paid into their own payout account, which only they can add. Your business is never a party, and you earn your commission on each release.

```ts
const session = await ketapay.checkoutSessions.create({
  amount: 250_000,
  title: 'Logo design, 3 concepts',
  buyer: { email: 'ada@example.com' },
  seller: { phone: '+2348012345678', name: 'Tunde Studio' },
  return_url: 'https://market.example.com/orders/1042',
})
```

While a deal runs, only the buyer and the seller act on it: delivering and releasing are their decisions, confirmed with their customer token or the buyer's release code. Your platform can't refund or release a deal between your customers (`POST /escrows/{id}/refund` answers `403 dispute_required`).

When one of them raises a dispute, your platform decides it under your own published policy, with an `escrows:manage` key or from the dashboard: release it to the seller, refund the buyer, or split it (part back to the buyer, the rest to the seller). See [Disputes](https://docs.ketapay.com/after-payment/disputes). Every ruling is a money action (`GET /money_actions/{id}`): KetaPay moves the money and keeps a record of which key or team member did it and why. No deadline takes a dispute away from you.

### Getting approved

- **Test keys** work as soon as your business asks to be a platform, so you can build before approval. Email [developers@ketapay.com](mailto:developers@ketapay.com) to switch your test mode to platform.
- **Live keys** need KetaPay's approval. Apply in **Compliance** on your [dashboard](https://business.ketapay.com). KetaPay checks your business and how you handle disputes before you take live payments between customers.

Until then, naming a seller is refused with `403 platform_not_approved`. KetaPay can pause a platform: while it is paused its rulings are refused with `rulings_paused`, and KetaPay decides its open disputes.

## Choosing

If the money ends up with your business, you are a merchant. If it ends up with someone who uses your site, you are a platform. When you do both (for example a marketplace that also sells its own stock), apply as a platform and leave `seller` out on your own sales.
