---
title: "get_payment_link"
canonical_url: "https://tweetstream.io/docs/api/agent-action-get-payment-link"
last_updated: 2026-11-05
---

# get_payment_link

A link the person opens to pay what a subscription owes: its open invoice, its renewal in stablecoins, or, by card, an invoice waiting on a stablecoin payment. Tier read: the API key alone. The MCP tool of the same name needs the tweetstream:billing scope.

Canonical URL: https://tweetstream.io/docs/api/agent-action-get-payment-link

## `POST /api/agent/actions/get_payment_link`

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

## 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 | invoice: the open card invoice. renewal: the stablecoin payment of the open renewal. outstanding_invoice_card: pay by card an invoice waiting on a stablecoin payment. |

### Body example

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

## Response fields

| Name | Type | Description |
| --- | --- | --- |
| `expiresAt` | `string`, required |  |
| `outcome` | `enum<string>`, required |  |
| `url` | `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 |  |
| `429` | Rate limit reached (RATE_LIMITED); retry after retryAfterSeconds |  |
| `503` | Temporarily unavailable; retry later |  |

### 200

```json
{
  "expiresAt": "2026-11-06T12:00:00.000Z",
  "outcome": "link",
  "url": "https://tweetstream.io/pay/EXAMPLE_PAYMENT_LINK"
}
```

### 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"
  }
}
```

### 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/get_payment_link \
  --header "Authorization: Bearer $TWEETSTREAM_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "family": "BASE",
  "target": "invoice"
}'
```

### JavaScript

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

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

### Python

```python
import os
import requests

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

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