---
name: natural-create-payment
description: Create a payment from a customer's wallet to a recipient on the Natural platform. Use when you have a customerPartyId and need to create a payment. Use natural-list-customers to discover customers and natural-check-balance for pre-flight balance checks.
metadata:
  author: Natural
  version: "1.0"
---

# Create Payment

Create a payment from a customer's wallet to a recipient (email, phone, or party ID) on the Natural platform.

This skill handles only payment creation. For related operations, see:

- **[List Customers](https://natural.com/skills/list-customers.md)** — discover customers with delegated payment authority
- **[Check Balance](https://natural.com/skills/check-balance.md)** — pre-flight balance check
- **[Get Transaction](https://natural.com/skills/get-transaction.md)** — verify payment status after creation

## Prerequisites

- A Natural credential with payment creation access is configured
- You have a `customerPartyId` (`pty_xxx`) with delegated payment authority
- For agent-attributed payment creation, you have a stable `instanceId`

## Parameters

Required:

| Parameter         | Format                     | Description                                           |
| ----------------- | -------------------------- | ----------------------------------------------------- |
| `customerPartyId` | `pty_xxx`                  | The customer's party ID                               |
| `recipient`       | email, phone, or `pty_xxx` | Who receives the payment                              |
| payment amount    | transport-specific         | MCP: `amount: "50.00"`; CLI: `--amount 5000`          |
| `currency`        | ISO code                   | Required by MCP (`"USD"`); CLI currently defaults USD |
| `description`     | string (max 500)           | Description of the payment                            |
| `idempotencyKey`  | string (max 256)           | Unique key for this request                           |

Agent attribution:

| Parameter    | Format           | Description                                                                                                                                                  |
| ------------ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `instanceId` | free-form string | Session or conversation ID (e.g., a UUID or your own identifier). Always pass one on money-movement calls; agent-scoped credentials are rejected without it. |

## Workflow

### 1. Validate inputs

- **Use the transport's money contract.** MCP requires a decimal string at the currency's exact precision plus currency: normalize a user saying `$5` to `amount: "5.00", currency: "USD"` and `$5.3` to `amount: "5.30", currency: "USD"` without changing the numeric value. If the value cannot be represented exactly at that currency's precision (for example USD `$1.983475`), do not call a money-moving tool. Ask the user which exact amount to send; never choose a rounded or truncated value for them. Never copy the CLI's integer-minor-unit form into MCP. The CLI takes integer minor units, so `--amount 5000` means USD 50.00 only on the CLI.
- **Recipient format:** email must contain `@`, phone must start with `+` or be 10+ digits, party ID must start with `pty_`.
- **Idempotency:** Generate a unique `idempotencyKey` per payment intent. If you need to retry a failed request, reuse the same key to prevent duplicate payments. Generate a new key for each distinct payment.

### 2. Send the payment

Execute the payment creation using the CLI or MCP adapter below.

### 3. Confirm submission

The response includes a `transactionId` (`txn_xxx`) and initial `status`. Use [Get Transaction](https://natural.com/skills/get-transaction.md) to check the final status if needed.

## Error handling

When a payment fails, categorize by cause:

- **Insufficient funds:** Inform the user of the shortfall — use [Check Balance](https://natural.com/skills/check-balance.md) to show the current balance
- **Invalid recipient:** Verify the recipient format
- **Auth error:** API key is missing, invalid, or lacks permission for this customer
- **Rate limit / server error:** Wait and retry with the same `idempotencyKey`

## Agent attribution

Agent attribution comes from the credential:

- **Agent credential**: agent keys (`ak_ntl_...`) and agent-scoped OAuth grants identify the agent. The payment is attributed to that agent; pass `instanceId` for money-moving calls.
- **Party credential**: party API keys (`sk_ntl_...`) and user-scoped OAuth grants act as the user/party and cannot act as an agent. To act as an agent, authenticate with that agent's key.

`instanceId` is required whenever the payment is agent-attributed. In practice, always pass one on money-movement calls — any stable conversation/session ID you choose. A model cannot inspect its own credential type, and connector OAuth sessions (Claude, ChatGPT) are agent-scoped, so omitting it fails those calls.

---

## CLI Adapter

Execute the create-payment workflow using the `natural` CLI. All commands should use `--format json` for structured output that agents can parse.

### Command

```bash
natural payments create \
  --customer-party-id pty_xxx \
  --counterparty bob@example.com \
  --amount 5000 \
  --description "Invoice #789" \
  --instance-id conv-abc-123 \
  --format json
```

Agent attribution comes from the credential: set `NATURAL_API_KEY` to the agent's key (`ak_ntl_...`) to create the payment as that agent. The `--idempotency-key` flag is optional — the CLI auto-generates a UUID if omitted. Pass it explicitly when retrying a failed request.

Response shape:

```json
{
  "transactionId": "txn_xxx",
  "status": "PROCESSING",
  "amount": 5000,
  "currency": "USD",
  "description": "Invoice #789",
  "senderName": "John Doe",
  "recipientName": "bob@example.com",
  "direction": "OUTBOUND",
  "isDelegated": true,
  "createdAt": "2026-04-03T12:00:00Z",
  "idempotencyKey": "550e8400-e29b-41d4-a716-446655440000"
}
```

### Exit codes

| Code | Meaning                                              | Action                           |
| ---- | ---------------------------------------------------- | -------------------------------- |
| 0    | Success                                              | Parse JSON response              |
| 1    | Business error (insufficient funds, invalid request) | Read error message, do not retry |
| 2    | Usage error (missing flags, bad arguments)           | Fix the command                  |
| 3    | Auth error (missing or invalid API key)              | Check credentials                |
| 4    | Network/server error (timeout, rate limit)           | Retry with same idempotency key  |

### Notes

- Always pass `--format json` — human-formatted output is not designed for agent parsing
- Amounts are always minor units (cents) in both input and output
- Pass the format flag explicitly for clarity, even when stdout is piped

---

## MCP Adapter

Execute the create-payment workflow using Natural MCP server tools. The MCP server authenticates via Bearer token in the session.

MCP deliberately differs from the CLI and REST API at this human-facing boundary. Pass a canonical decimal string with exactly two digits for USD and a required currency. Do not send a JSON number, integer cents, a dollar sign, or a comma.

### Tool

Tool: `create_payment`

```json
{
  "amount": "50.00",
  "currency": "USD",
  "customerPartyId": "pty_xxx",
  "recipient": "bob@example.com",
  "description": "Invoice #789",
  "idempotencyKey": "550e8400-e29b-41d4-a716-446655440000",
  "instanceId": "conv-abc-123"
}
```

Agent attribution comes from the session credential (agent key or agent-scoped OAuth grant); there is no `agentId` argument.

Unlike the CLI, the MCP tool requires `idempotencyKey` explicitly — it does not auto-generate one.

The response includes the payment fields and status. Claim links are never returned: when status is `PENDING_CLAIM`, Natural delivers the claim link to the recipient directly.

The monetary result is one value:

```json
{
  "amount": {
    "decimal": "50.00",
    "currency": "USD",
    "display": "USD 50.00"
  }
}
```

### Error handling

MCP tool errors are returned as tool call failures with an error message. Categorize by the message content:

- Authentication errors: API key issues
- Validation errors: missing or invalid parameters (for example, `Missing instanceId` — retry the same call with `instanceId` set to a stable conversation/session identifier)
- Business errors: insufficient funds, invalid recipient
- Server errors: retry with the same `idempotencyKey`

### Notes

- `idempotencyKey` is required — always generate and provide one
- `amount` and `currency` are required — use a canonical value such as `"50.00"` with `"USD"`, never integer cents
- Agent attribution comes from the credential; there is no `agentId` argument
- `instanceId` is required for agent-attributed money movement (agent keys and agent-scoped OAuth grants) — in practice, always pass one on money-movement calls (connector OAuth sessions are agent-scoped)
