Get customer details by email
deonpay_get_customerRetrieve a customer's complete profile by email: basic info, saved cards, active subscriptions, and the last 20 transactions.
Instructions
Fetch a customer's full profile by email. Returns basic info, saved_cards (safe metadata only — never the vault token), active_subscriptions (status active/trialing/past_due/paused), and the last 20 transactions (excluding $10 MXN card-validation charges). Use this when the user asks 'show me everything about cliente@x.com' or 'what cards does this customer have on file'. The email is URL-encoded automatically — pass the plain email.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Yes | Customer email (plain — encoding is handled internally). | ||
| environment | No | Override the environment to query. The DeonPay API only honors this if it matches the environment baked into the API token; otherwise it is silently ignored. Useful when the same dashboard exposes both envs. |
Implementation Reference
- src/tools/customers.ts:61-65 (handler)The handler function for deonpay_get_customer. It takes email (and optional environment), URL-encodes the email, and makes a GET request to /customers/{email}.
safeHandler(async ({ email, environment }) => { const path = `/customers/${encodePathSegment(email)}`; return client.get(path, compact({ environment })); }), ); - src/tools/customers.ts:52-60 (schema)Input schema for deonpay_get_customer: requires an email string (validated as email) and optional environment enum (sandbox/production).
{ title: "Get customer details by email", description: "Fetch a customer's full profile by email. Returns basic info, saved_cards (safe metadata only — never the vault token), active_subscriptions (status active/trialing/past_due/paused), and the last 20 transactions (excluding $10 MXN card-validation charges). Use this when the user asks 'show me everything about cliente@x.com' or 'what cards does this customer have on file'. The email is URL-encoded automatically — pass the plain email.", inputSchema: { email: z.string().email().describe("Customer email (plain — encoding is handled internally)."), environment: EnvironmentSchema.optional(), }, }, - src/tools/customers.ts:50-65 (registration)Registration of deonpay_get_customer via server.registerTool with name, title, description, inputSchema, and the handler callback.
server.registerTool( "deonpay_get_customer", { title: "Get customer details by email", description: "Fetch a customer's full profile by email. Returns basic info, saved_cards (safe metadata only — never the vault token), active_subscriptions (status active/trialing/past_due/paused), and the last 20 transactions (excluding $10 MXN card-validation charges). Use this when the user asks 'show me everything about cliente@x.com' or 'what cards does this customer have on file'. The email is URL-encoded automatically — pass the plain email.", inputSchema: { email: z.string().email().describe("Customer email (plain — encoding is handled internally)."), environment: EnvironmentSchema.optional(), }, }, safeHandler(async ({ email, environment }) => { const path = `/customers/${encodePathSegment(email)}`; return client.get(path, compact({ environment })); }), ); - src/tools/index.ts:20-29 (registration)registerAllTools calls registerCustomerTools which registers the deonpay_get_customer tool (among others).
export function registerAllTools(server: McpServer, client: DeonpayClient): void { registerLinkTools(server, client); registerCheckoutTools(server, client); registerTransactionTools(server, client); registerProductTools(server, client); registerSubscriptionTools(server, client); registerCustomerSubscriptionTools(server, client); registerCustomerTools(server, client); registerMetricsTools(server, client); } - src/tools/_helpers.ts:74-76 (helper)encodePathSegment wraps encodeURIComponent to safely URL-encode the email for the path segment.
export function encodePathSegment(value: string): string { return encodeURIComponent(value); }