listPaymentInstructions
Retrieve and filter x402 payment instructions for content monetization by CID, name, or ID to manage revenue streams.
Instructions
List and filter x402 payment instructions for content monetization
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Limit the number of results returned | |
| pageToken | No | Token for pagination | |
| cid | No | Filter by associated CID | |
| name | No | Filter by name | |
| id | No | Filter by specific payment instruction ID |
Implementation Reference
- src/index.ts:1045-1086 (handler)Complete implementation of the listPaymentInstructions tool - includes tool registration with schema definition and the async handler that lists and filters x402 payment instructions via the Pinata API
server.tool( "listPaymentInstructions", "List and filter x402 payment instructions for content monetization", { limit: z .number() .optional() .describe("Limit the number of results returned"), pageToken: z.string().optional().describe("Token for pagination"), cid: z.string().optional().describe("Filter by associated CID"), name: z.string().optional().describe("Filter by name"), id: z.string().optional().describe("Filter by specific payment instruction ID"), }, async ({ limit, pageToken, cid, name, id }) => { try { const params = new URLSearchParams(); if (limit) params.append("limit", limit.toString()); if (pageToken) params.append("pageToken", pageToken); if (cid) params.append("cid", cid); if (name) params.append("name", name); if (id) params.append("id", id); const url = `https://api.pinata.cloud/v3/x402/payment_instructions?${params.toString()}`; const response = await fetch(url, { method: "GET", headers: getHeaders(), }); if (!response.ok) { throw new Error( `Failed to list payment instructions: ${response.status} ${response.statusText}` ); } const data = await response.json(); return successResponse(data); } catch (error) { return errorResponse(error); } } );