getPaymentInstruction
Retrieve a x402 payment instruction using its unique identifier to access transaction details and processing information.
Instructions
Retrieve a specific x402 payment instruction by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The unique identifier of the payment instruction |
Implementation Reference
- src/index.ts:1088-1117 (registration)The getPaymentInstruction tool is registered with the MCP server. It retrieves a specific x402 payment instruction by ID from the Pinata API.
server.tool( "getPaymentInstruction", "Retrieve a specific x402 payment instruction by ID", { id: z .string() .describe("The unique identifier of the payment instruction"), }, async ({ id }) => { try { const url = `https://api.pinata.cloud/v3/x402/payment_instructions/${id}`; const response = await fetch(url, { method: "GET", headers: getHeaders(), }); if (!response.ok) { throw new Error( `Failed to get payment instruction: ${response.status} ${response.statusText}` ); } const data = await response.json(); return successResponse(data); } catch (error) { return errorResponse(error); } } );