# Order commands: fulfill, pay, place, refund

URL: /code/cli/order/verbs-fulfill · Id: `page:code/cli/order/verbs-fulfill`

> The Order Verbs fulfill, pay, place, refund as CLI commands, with inputs, result, refusals and an example.

Reference for [Order](/business/nouns/order), one group of [Order commands](/code/cli/order).

### Order.fulfill
Fulfill grants what an Order bought: Entitlements for software and data, a shipment for goods. [Verb page](/business/nouns/order/fulfill?interface=cli).

```text
npx startup-builder do Order.fulfill --json '<input>' [--try | --send | --do]
```

Emits [`Order.fulfilled`](/business/events/Order.fulfilled).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `order` | [Order](/business/nouns/order) | Yes | The paid Order. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `order` | [Order](/business/nouns/order) | Yes | The fulfilled Order. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The record is not in a state that allows this Verb, so the call is refused. | [`refused`](/code/api/errors/refused) | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |

**Example**

```bash
npx startup-builder do Order.fulfill --json '{"order":"order_dswDnxf2vt"}'
```

### Order.pay
Pay settles an Order’s amount through the Startup’s payment account and posts the matching Entries. [Verb page](/business/nouns/order/pay?interface=cli).

```text
npx startup-builder do Order.pay --json '<input>' [--try | --send | --do]
```

Emits [`Order.paid`](/business/events/Order.paid).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `order` | [Order](/business/nouns/order) | Yes | The placed Order. |
| `paymentMethod` | `string` | No | The saved method to charge. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `order` | [Order](/business/nouns/order) | Yes | The paid Order. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The operation is part of an Offer the caller has not accepted or paid for. | [`payment-required`](/code/api/errors/payment-required) | Accept the Offer named in the response, then retry the call. | [Offer.accept](/business/nouns/offer/accept) |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The record is not in a state that allows this Verb, so the call is refused. | [`refused`](/code/api/errors/refused) | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |
| Stripe disabled charges on the Startup’s payment account because a requirement passed its deadline. | [`charges-disabled`](/code/api/errors/charges-disabled) | Have the owner of record complete the open requirement Task; charges and paid Offers resume on re-enable. | None. |

**Example**

```bash
npx startup-builder do Order.pay --json '{"order":"order_dswDnxf2vt"}'
```

### Order.place
Place commits a Customer to buy an Offer once and records the Offer Version and price at that moment. [Verb page](/business/nouns/order/place?interface=cli).

```text
npx startup-builder do Order.place --json '<input>' [--try | --send | --do]
```

Emits [`Order.placed`](/business/events/Order.placed).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `offer` | [Offer](/business/nouns/offer) | Yes | The Offer to buy. |
| `quantity` | `integer` | No | Units. Defaults to 1. |
| `promotionCode` | `string` | No | A promotion code the buyer typed; applies its Coupon when the Coupon covers the Offer. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `order` | [Order](/business/nouns/order) | Yes | The placed Order. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The input does not match the schema of the operation. | [`invalid-input`](/code/api/errors/invalid-input) | Read the schema of the operation, then send every required field with the right type. | None. |
| The operation is part of an Offer the caller has not accepted or paid for. | [`payment-required`](/code/api/errors/payment-required) | Accept the Offer named in the response, then retry the call. | [Offer.accept](/business/nouns/offer/accept) |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The record is not in a state that allows this Verb, so the call is refused. | [`refused`](/code/api/errors/refused) | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |

**Example**

```bash
npx startup-builder do Order.place --json '{"offer":"offer_2hzYe1ERo0"}'
```

### Order.refund
Refund returns all or part of an Order’s payment to the Customer and posts the reversing Entries. [Verb page](/business/nouns/order/refund?interface=cli).

```text
npx startup-builder do Order.refund --json '<input>' [--try | --send | --do]
```

Emits [`Order.refunded`](/business/events/Order.refunded).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `order` | [Order](/business/nouns/order) | Yes | The paid Order. |
| `amount` | `money` | No | The amount. Defaults to the full payment. |
| `reason` | `text` | Yes | Why the money goes back. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `order` | [Order](/business/nouns/order) | Yes | The refunded Order. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The input does not match the schema of the operation. | [`invalid-input`](/code/api/errors/invalid-input) | Read the schema of the operation, then send every required field with the right type. | None. |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The record is not in a state that allows this Verb, so the call is refused. | [`refused`](/code/api/errors/refused) | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |

**Example**

```bash
npx startup-builder do Order.refund --json '{"order":"order_dswDnxf2vt","reason":"Example reason"}'
```