# Mandate methods: revoke, spend

URL: /code/sdk/mandate/verbs-revoke · Id: `page:code/sdk/mandate/verbs-revoke`

> The Mandate Verbs revoke, spend as typed SDK methods, with inputs, result, refusals and an example.

Reference for [Mandate](/business/nouns/mandate), one group of [Mandate methods](/code/sdk/mandate).

### Mandate.revoke
Revoke ends a Mandate at once, so new Actions under it are refused and running ones finish. [Verb page](/business/nouns/mandate/revoke?interface=sdk).

```ts
interface MandateVerbs {
  revoke(input: MandateRevokeInput, options?: SB.CallOptions): SB.Call<Mandate>
}
```

Emits [`Mandate.revoked`](/business/events/Mandate.revoked).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `mandate` | [Mandate](/business/nouns/mandate) | Yes | The Mandate to end. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `mandate` | [Mandate](/business/nouns/mandate) | Yes | The revoked Mandate. |

**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**

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

const mandate = await $.Mandate.revoke({ mandate: 'mandate_mKKPrmFQYD' })
```

### Mandate.spend
Spend pays an outside party for a Startup with a single-use card, within a Mandate and its Limit. [Verb page](/business/nouns/mandate/spend?interface=sdk).

```ts
interface MandateVerbs {
  spend(input: MandateSpendInput, options?: SB.CallOptions): SB.Call<MandateSpendOutput>
}
```

Emits [`Mandate.spent`](/business/events/Mandate.spent).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `mandate` | [Mandate](/business/nouns/mandate) | Yes | The Mandate that covers the purchase. |
| `amount` | `money` | Yes | The amount to spend. |
| `payee` | `string` | Yes | Who is paid. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `transaction` | [Transaction](/business/nouns/transaction) | Yes | The card Transaction. |
| `mandate` | [Mandate](/business/nouns/mandate) | Yes | The Mandate with its remaining Limit. |

**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. |

**Example**

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

const { transaction, mandate } = await $.Mandate.spend({ mandate: 'mandate_mKKPrmFQYD', amount: { amount: 29, currency: 'USD' }, payee: 'Example payee' })
```