> ## Documentation Index
> Fetch the complete documentation index at: https://conto.finance/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# A2A Payments

> Create, list, and execute agent-to-agent payment requests inside the same organization

# Agent-to-Agent (A2A) Payments

Conto supports direct payment requests between agents in the same organization. One agent creates a request and the receiving agent reviews and executes it.

## How It Works

```text theme={null}
Requesting agent -> creates request -> target agent reviews -> target agent executes
```

1. Agent A calls `POST /api/sdk/a2a/request`
2. Agent B either receives a `payment_request.created` webhook or lists incoming requests via `GET /api/sdk/a2a/requests`
3. Agent B approves via `POST /api/sdk/a2a/requests/{id}/approve` or rejects via `POST /api/sdk/a2a/requests/{id}/reject`
4. Agent B executes the approved request via `POST /api/sdk/a2a/requests/{id}/execute`
5. The transfer still runs through Conto policy evaluation before settlement

## Create a Request

You can target the receiving agent by `targetAgentId` or by `targetWalletAddress`.

```bash theme={null}
curl -X POST https://conto.finance/api/sdk/a2a/request \
  -H "Authorization: Bearer $CONTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "targetAgentId": "cmm5a0agt001m49h7bjqza22q",
    "amount": 50,
    "currency": "USDC",
    "purpose": "Reimbursement for API credits",
    "metadata": {
      "invoiceId": "INV-2026-001"
    }
  }'
```

**Response**

```json theme={null}
{
  "success": true,
  "paymentRequest": {
    "id": "cmm5h1a2a001m49h7irxzh22q",
    "status": "PENDING",
    "requestingAgentId": "cmm59z8fj000l49h7bjqza11p",
    "requestedFromAgentId": "cmm5a0agt001m49h7bjqza22q",
    "amount": 50,
    "currency": "USDC",
    "purpose": "Reimbursement for API credits"
  },
  "message": "Payment request sent to DevOps Agent"
}
```

<Info>
  If you pass `targetWalletAddress`, Conto resolves it to a registered agent first. Requests to
  unknown addresses are rejected.
</Info>

## List Requests

```bash theme={null}
GET /api/sdk/a2a/requests
```

Use this endpoint to view both incoming and outgoing requests for the authenticated agent.

## Webhook-First Automation

If the requested-from agent has a webhook or callback URL configured, Conto also emits
`payment_request.created` as soon as a new request is created. That payload targets the paying
agent and includes:

* `paymentRequestId`
* `requestingAgentId` and `requestingAgentName`
* `amount`, `currency`, `purpose`, `invoiceId`
* `approveUrl` and `rejectUrl`

Use this path if you want an autonomous agent to react immediately without polling
`GET /api/sdk/a2a/requests`.

## Approve or Reject a Request

The paying agent can explicitly approve a pending request before execution:

```bash theme={null}
curl -X POST https://conto.finance/api/sdk/a2a/requests/{id}/approve \
  -H "Authorization: Bearer $CONTO_API_KEY"
```

To reject it, call the reject endpoint. You can include an optional `reason` that is stored with the request.

```bash theme={null}
curl -X POST https://conto.finance/api/sdk/a2a/requests/{id}/reject \
  -H "Authorization: Bearer $CONTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "This invoice is missing the deployment reference"
  }'
```

## Execute a Request

The receiving agent executes the request:

```bash theme={null}
curl -X POST https://conto.finance/api/sdk/a2a/requests/{id}/execute \
  -H "Authorization: Bearer $CONTO_API_KEY"
```

Spend limits, approval rules, counterparty rules, and other policies still apply.

## Resolve an Agent from a Wallet Address

```bash theme={null}
curl -X POST https://conto.finance/api/sdk/a2a/resolve \
  -H "Authorization: Bearer $CONTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "address": "0x1234567890abcdef..."
  }'
```

## A2A Statistics

```bash theme={null}
GET /api/sdk/a2a/stats
```

## API Reference

| Endpoint                             | Method | Description                            |
| ------------------------------------ | ------ | -------------------------------------- |
| `/api/sdk/a2a/request`               | POST   | Create an A2A payment request          |
| `/api/sdk/a2a/requests`              | GET    | List A2A requests                      |
| `/api/sdk/a2a/requests/{id}`         | GET    | Get one request                        |
| `/api/sdk/a2a/requests/{id}/approve` | POST   | Approve a pending request              |
| `/api/sdk/a2a/requests/{id}/reject`  | POST   | Reject a pending request               |
| `/api/sdk/a2a/requests/{id}/execute` | POST   | Execute an approved request            |
| `/api/sdk/a2a/resolve`               | POST   | Resolve an agent from a wallet address |
| `/api/sdk/a2a/stats`                 | GET    | View A2A statistics                    |
