# Motion

URL: /business/nouns/motion · Id: `noun:motion`

> A Motion is the shape of a sale: who buys an Offer and who acts for them, such as b2b, b2c, b2d, b2a, or b2a2b.

A Motion is the shape of a sale: who buys an [Offer](/business/nouns/offer) and who acts for them, such as b2b, b2c, b2d, b2a, or b2a2b.

## Properties
| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | The code: b2b, b2c, b2d, b2a, b2h2a, b2a2b, b2a2c, or b2a2d. Each letter after the 2 names the next party in the chain. |
| `buyer` | `string` | Yes | The party that accepts the Offer: a business, a consumer, a developer, or an Agent. |
| `actor` | `string` | No | Who calls the Interfaces for the buyer: the buyer, a human operator, or an Agent. |

## Object
```json
{
  "$id": "https://api.sb/quietcopy.com/motions/motion_1",
  "$type": "Motion",
  "code": "Example code",
  "buyer": "Example buyer",
  "actor": "Example actor"
}
```

## Relationships
- <a id="rel-sells"></a>A Motion **sells** many [Offers](/business/nouns/offer): each [Offer](/business/nouns/offer) sells through one Motion, which says who buys and who acts for them. `sells`, inverse [`soldIn`](/business/nouns/offer#rel-sold-in).
- <a id="rel-sold-through-by"></a>A Motion **is sold through by** many [Startup Templates](/business/nouns/startup-template): a [Startup Template](/business/nouns/startup-template) names the Motions its [Startups](/business/nouns/startup) sell through, such as b2b or b2a. `soldThroughBy`, inverse [`sellsThrough`](/business/nouns/startup-template#rel-sells-through).

## Verbs
| Verb | Description | Subject | Event | Class |
| --- | --- | --- | --- | --- |
| <a id="get"></a>[Motion.get](/business/nouns/motion/get) | Returns one Motion by id. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |
| <a id="list"></a>[Motion.list](/business/nouns/motion/list) | Returns Motions, newest first, one page at a time. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |

A Motion is kept forever and never edited: it has no `update` or `delete`.

## Permissions
Which Access level may call each Verb. One-way Verbs wait their delay window.

| Operation | `owner` | `admin` | `member` | `viewer` |
| --- | --- | --- | --- | --- |
| `Motion.get` | Yes | Yes | Yes | Yes |
| `Motion.list` | Yes | Yes | Yes | Yes |

## Call it

**Ask**

```text
Show me the latest motion.
```

**API**

```bash
curl https://api.sb/petpantry.shop/motions/motion_1 \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/petpantry.shop",
  "$type": "Motion",
  "$id": "https://api.sb/petpantry.shop/motions/motion_1",
  "motion": {
    "$id": "https://api.sb/petpantry.shop/motions/motion_1",
    "$type": "Motion",
    "code": "Example code",
    "buyer": "Example buyer"
  },
  "links": {
    "self": "https://api.sb/petpantry.shop/motions/motion_1",
    "up": "https://api.sb/petpantry.shop/motions"
  }
}
```

**SDK**

```ts
import { $ } from 'startup-builder'

const motion = await $.Motion.get({ id: 'motion_1' })
```

**CLI**

```bash
npx startup-builder do Motion.get --json '{"id":"motion_1"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Motion.get({ id: 'motion_1' })"
  }
}
```

## Example
An invoice API sells in b2d when a developer signs up and pays by card. It sells in b2a2b when an accounting firm is the [Customer](/business/nouns/customer) and its [Agent](/business/nouns/agent) calls the API at night.