request_payment_link
Create payment links to request payments to your account via credit card or Solana tokens. Specify amount, recipient details, and customize payment pages for transactions.
Instructions
Create a payment link in order to request a payment to your account. This payment link can be used to pay you. Payment can be made using a credit card, or any Solana token (automatically converted to USDC)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| receivingPayment | No | Email, phone or Solana wallet of the recipient of the payment | |
| amount | Yes | Amount to request | |
| currency | No | Currency of specified amount to request | USD |
| title | No | A title for the payment shown to the payer | |
| description | No | A description, shown in the payment page | |
| returnOKURL | No | Optional : URL to redirect the client to after successfull payment | |
| returnURL | No | Optional : URL to redirect the client to after failed payment | |
| logo | No | Optional : URL to an image displayed in payment page | |
| param | No | Custom parameter | |
| webhook | No | HTTP webhook to call on payment success | |
| notificationEmail | No | Email to notify on payment success |
Implementation Reference
- src/tools/payments.ts:82-106 (handler)Core handler function implementing the request_payment_link tool: prepares request body, fetches user wallet if needed, calls /api/createPLink endpoint to generate payment link.export async function request_payment_link(reqBody: any) { if (reqBody.title) { reqBody.title = reqBody.title.split('\u20AC').join('euro'); } if (!reqBody.receivingPayment) { const { apiKey } = resolveAuth(undefined, undefined); var result = await getAPIuser(apiKey); if (result.pubk) reqBody.receivingPayment = result.pubk; if (result.error) { throw new Error(result.error); } } if (!reqBody.receivingPayment) { throw new Error('receivingPayment parameter required'); } var req = await fetch(BASE + '/api/createPLink', { method: 'POST', body: JSON.stringify(reqBody) }); var plink_Info = await req.json(); return plink_Info; }
- src/tools/payments.ts:24-36 (schema)Zod schema defining the input parameters for the request_payment_link tool (getCreatePLinkShape).export const getCreatePLinkShape = { receivingPayment: z.string().optional().describe("Email, phone or Solana wallet of the recipient of the payment"), amount: z.number().positive().describe("Amount to request"), currency: currencyZOD.describe("Currency of specified amount to request"), title: z.string().optional().describe("A title for the payment shown to the payer"), description: z.string().optional().describe("A description, shown in the payment page"), returnOKURL: z.string().optional().describe("Optional : URL to redirect the client to after successfull payment"), returnURL: z.string().optional().describe("Optional : URL to redirect the client to after failed payment"), logo: z.string().optional().describe("Optional : URL to an image displayed in payment page"), param: z.string().optional().describe("Custom parameter"), webhook: z.string().optional().describe("HTTP webhook to call on payment success"), notificationEmail: z.string().optional().describe("Email to notify on payment success") };
- src/solution.ts:57-61 (registration)Tool definition registered in the tools list for ListToolsRequestSchema response.name: "request_payment_link", description: request_payment_link_title, inputSchema: jsonSchema(zodToJsonSchema(z.object(getCreatePLinkShape))).jsonSchema, annotations: { title: request_payment_link_title, readOnlyHint: true } },
- src/solution.ts:139-141 (registration)Dispatch case in CallToolRequestSchema handler that invokes the request_payment_link function.case "request_payment_link": result = await request_payment_link(args); break;
- src/tools/payments.ts:191-191 (helper)Title string used in tool description and annotations.export const request_payment_link_title = "Create a payment link in order to request a payment to your account. This payment link can be used to pay you. Payment can be made using a credit card, or any Solana token (automatically converted to USDC)";