Documentation Index
Fetch the complete documentation index at: https://docs.pinata.cloud/llms.txt
Use this file to discover all available pages before exploring further.
List and filter payment instructions for x402 monetization
Usage
import { PinataSDK } from "pinata";
const pinata = new PinataSDK({
pinataJwt: process.env.PINATA_JWT!,
pinataGateway: "example-gateway.mypinata.cloud",
});
const instructions = await pinata.x402.listPaymentInstructions();
Returns
type PaymentInstructionListResponse = {
data: {
payment_instructions: PaymentInstruction[];
next_page_token?: string;
};
};
type PaymentInstruction = {
id: string;
version: number;
payment_requirements: PaymentRequirement[];
name: string;
description?: string;
created_at: string;
};
type PaymentRequirement = {
asset: string;
pay_to: string;
network: "base" | "base-sepolia" | "eip155:8453" | "eip155:84532";
amount: string;
description?: string;
};
Parameters
Filter response with the following optional parameters.
limit
Limit the number of results returned
const instructions = await pinata.x402.listPaymentInstructions({
limit: 10,
});
pageToken
Paginate through results using a page token from a previous response
const instructions = await pinata.x402.listPaymentInstructions({
pageToken: "MDE5MWIzZWYtM2U0Zi03YTY5LWE3OTQtOTRhZDE5NjQxMTk0",
});
cid
Filter payment instructions by associated CID
const instructions = await pinata.x402.listPaymentInstructions({
cid: "bafkreih5aznjvttude6c3wbvqeebb6rlx5wkbzyppv7garjiubll2ceym4",
});
name
Filter payment instructions by name
const instructions = await pinata.x402.listPaymentInstructions({
name: "Premium Content",
});
Filter by specific payment instruction ID
const instructions = await pinata.x402.listPaymentInstructions({
id: "01234567-89ab-cdef-0123-456789abcdef",
});