# Request installment purchase

An agent asks to buy a published plan offer (installments or subscription); the full terms go through policy and usually one approval. Agent credential only; requires an Idempotency-Key (header or body), and a retry with the same key returns the first result.

`POST /v1/installment-purchases`

An agent asks to buy a published plan offer (installments or subscription); the full terms go through policy and usually one approval. Agent credential only; requires an Idempotency-Key (header or body), and a retry with the same key returns the first result.

MCP tool: `request_installment_purchase`.

Accepts `Idempotency-Key`.

Policy decision: REQUIRE_APPROVAL, DENY.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | header | no | Required (header, or idempotency_key in the body). A retry with the same key returns the same plan and intent. |

## Request body

```json
{
  "plan_id": "pof_01jd2x3k4m5n6p7q8r9s0t1v2w",
  "task_id": "research-feed",
  "idempotency_key": "research-feed-plan-1"
}
```

## Responses

- **200**: Success.
- **400**: Invalid request: a field is missing or malformed (VALIDATION_ERROR).
- **401**: No valid session, API key or agent credential (UNAUTHENTICATED, AGENT_CREDENTIAL_INVALID).

Example 200 response:

```json
{
  "status": "active",
  "plan_id": "pln_01jd2x3k4m5n6p7q8r9s0t1v2w",
  "intent_id": "pi_01jd2x3k4m5n6p7q8r9s0t1v2w",
  "plan_status": "string",
  "payment_status": "string",
  "decision": "ALLOW",
  "reason_code": "WITHIN_POLICY",
  "total_base_units": "50000",
  "count": 1,
  "amount_base_units": "50000",
  "period_seconds": 1,
  "asset": "USDC",
  "network": "eip155:84532",
  "schedule": [
    {
      "seq": 1,
      "amount_base_units": "50000",
      "at": "string",
      "status": "active"
    }
  ]
}
```
