---
title: "cancel_pending_payment"
canonical_url: "https://tweetstream.io/docs/api/agent-action-cancel-pending-payment"
last_updated: 2026-11-05
---

# cancel_pending_payment

Prepare to cancel a family's open stablecoin payment, Scale's scheduled limit change, or Ultra Speed's open checkout. Nothing changes until confirm_action runs it with the code emailed to the person. Tier confirm: the call only holds the change and returns it. request_confirmation_code emails the person a code; confirm_action runs the change once they read it back. The MCP tool of the same name needs the tweetstream:billing scope.

Canonical URL: https://tweetstream.io/docs/api/agent-action-cancel-pending-payment

## `POST /api/agent/actions/cancel_pending_payment`

`https://tweetstream.io/api/agent/actions/cancel_pending_payment`

## Authorization

| Name | Type | Description |
| --- | --- | --- |
| `Authorization` | `string`, required | Bearer authentication with your TweetStream API key: `Bearer <key>`. |

## Body

| Name | Type | Description |
| --- | --- | --- |
| `family` | `enum<string>`, required |  |
| `target` | `enum<string>`, required | open_payment: the family's open stablecoin payment request. scale_limit_change: Scale's scheduled limit change. open_checkout: Ultra Speed's open checkout. |

### Body example

```json
{
  "family": "BASE",
  "target": "open_payment"
}
```

## Response fields

| Name | Type | Description |
| --- | --- | --- |
| `next` | `object`, required |  |
| `next.action` | `enum<string>`, required |  |
| `next.message` | `string`, required |  |
| `next.name` | `string`, required |  |
| `next.who` | `enum<string>`, required |  |
| `pendingAction` | `object`, required |  |
| `pendingAction.action` | `string`, required |  |
| `pendingAction.expiresAt` | `string`, required | a string to be decoded into a Date |
| `pendingAction.id` | `string`, required |  |
| `pendingAction.quote` | `object`, required |  |
| `pendingAction.quote.amountDueCents` | `integer`, required | an integer |
| `pendingAction.quote.effectiveAt` | `string`, required | a string to be decoded into a Date |
| `pendingAction.quote.renewal` | `object`, required |  |
| `pendingAction.quote.renewal.amountCents` | `integer`, required | an integer |
| `pendingAction.quote.renewal.at` | `string`, required | a string to be decoded into a Date |
| `pendingAction.quote.renewal.termMonths` | `integer`, required | an integer |
| `pendingAction.quote.saveOffer` | `object`, required |  |
| `pendingAction.quote.saveOffer.description` | `string`, required |  |
| `pendingAction.quote.saveOffer.offer` | `object`, required |  |
| `pendingAction.summary` | `string`, required |  |
| `status` | `enum<string>`, required |  |

## Responses

| Status | Description | Headers |
| --- | --- | --- |
| `200` | Success |  |
| `400` | The input does not match the action's schema (INVALID_REQUEST) |  |
| `401` | Missing or invalid API key |  |
| `403` | The request carried a foreign Origin |  |
| `409` | Nothing to change, or the change is not offered (ACTION_REFUSED with reason) |  |
| `429` | Rate limit reached (RATE_LIMITED); retry after retryAfterSeconds |  |
| `503` | Temporarily unavailable; retry later |  |

### 200

```json
{
  "next": {
    "action": "call_action",
    "message": "Show the person this change. If they want it, call request_confirmation_code to email them a code.",
    "name": "request_confirmation_code",
    "who": "agent"
  },
  "pendingAction": {
    "action": "cancel_pending_payment",
    "expiresAt": "2026-11-05T12:05:00.000Z",
    "id": "pa_7Rk2mQ9xL4",
    "quote": {
      "amountDueCents": 0,
      "effectiveAt": "2026-11-05T12:05:00.000Z",
      "renewal": null,
      "saveOffer": null
    },
    "summary": "Cancel the unpaid 199 USDC stablecoin payment for your TweetStream plan. Takes effect at once. Nothing is charged now."
  },
  "status": "confirmation_required"
}
```

### 400

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "<string>",
    "reason": "not_offered",
    "retryAfterSeconds": 123
  },
  "next": {
    "message": "<string>",
    "action": "call_action",
    "method": "POST",
    "name": "<string>",
    "url": "<string>",
    "who": "agent"
  }
}
```

### 401

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "<string>",
    "reason": "not_offered",
    "retryAfterSeconds": 123
  },
  "next": {
    "message": "<string>",
    "action": "call_action",
    "method": "POST",
    "name": "<string>",
    "url": "<string>",
    "who": "agent"
  }
}
```

### 403

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "<string>",
    "reason": "not_offered",
    "retryAfterSeconds": 123
  },
  "next": {
    "message": "<string>",
    "action": "call_action",
    "method": "POST",
    "name": "<string>",
    "url": "<string>",
    "who": "agent"
  }
}
```

### 409

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "<string>",
    "reason": "not_offered",
    "retryAfterSeconds": 123
  },
  "next": {
    "message": "<string>",
    "action": "call_action",
    "method": "POST",
    "name": "<string>",
    "url": "<string>",
    "who": "agent"
  }
}
```

### 429

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "<string>",
    "reason": "not_offered",
    "retryAfterSeconds": 123
  },
  "next": {
    "message": "<string>",
    "action": "call_action",
    "method": "POST",
    "name": "<string>",
    "url": "<string>",
    "who": "agent"
  }
}
```

### 503

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "<string>",
    "reason": "not_offered",
    "retryAfterSeconds": 123
  },
  "next": {
    "message": "<string>",
    "action": "call_action",
    "method": "POST",
    "name": "<string>",
    "url": "<string>",
    "who": "agent"
  }
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://tweetstream.io/api/agent/actions/cancel_pending_payment \
  --header "Authorization: Bearer $TWEETSTREAM_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "family": "BASE",
  "target": "open_payment"
}'
```

### JavaScript

```javascript
const response = await fetch("https://tweetstream.io/api/agent/actions/cancel_pending_payment", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TWEETSTREAM_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "family": "BASE",
    "target": "open_payment"
  }),
});

console.log(response.status, await response.json());
```

### Python

```python
import os
import requests

response = requests.post(
    "https://tweetstream.io/api/agent/actions/cancel_pending_payment",
    headers={"Authorization": f"Bearer {os.environ['TWEETSTREAM_API_KEY']}"},
    json={
        "family": "BASE",
        "target": "open_payment",
    },
)

print(response.status_code, response.json())
```
