---
title: "Agent programmatic purchase (USDC on Base + mandate-aware)"
method: POST
path: "/api/agent-purchase"
---

# Agent programmatic purchase (USDC on Base + mandate-aware)

`POST /api/agent-purchase`

## Request

- Base URL: `https://marketnow.site`
- URL: `https://marketnow.site/api/agent-purchase`
- Auth: none declared

Dual-mode purchase endpoint. Returns one of: instant_download (free skill), instant_purchase (paid skill with valid mandate + verified USDC tx), direct_purchase (paid skill with verified USDC tx, no mandate), requires_payment (mandate valid but no txHash yet), requires_human_approval (no mandate and no payment — agent must request approval).

## Request body

- object
  - `skillId` string, required
  - `walletAddress` string: agent's wallet, required for paid
  - `txHash` string: USDC Transfer on Base, required for paid
  - `mandateId` string: optional, enables autonomous purchase within pre-approved limit
  - `agentId` string: optional, for tracking

## Response `200`

Purchase response — check the 'mode' field to determine next step

- object
  - `success` boolean
  - `mode` 'instant_download' | 'instant_purchase' | 'direct_purchase' | 'requires_payment' | 'requires_human_approval'
  - `license` object
  - `system_prompt` string
  - `install` string
  - `mandate` object
  - `options` object

## Other responses

- `400`: Payment verification failed
- `404`: Skill or mandate not found
- `405`: Method not allowed

---

[API](https://skmtc.dev/marketnow/apis/marketnow-skills-api.md) · [All operations](https://skmtc.dev/marketnow/apis/marketnow-skills-api/llms.txt) · [OpenAPI document](https://skmtc.dev/marketnow/apis/marketnow-skills-api/revisions/deedc7ba7beb?raw)
