customer_get
Retrieve complete customer profile including purchase history, active and expired subscriptions, renewal status, and introductory period details using a customer ID.
Instructions
Get detailed information about a specific customer.
Returns complete customer profile including:
Application username
Purchase history
Active and expired subscriptions
Last purchase details
Subscription renewal status
Trial and introductory period information
Required: customerId parameter
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| customerId | Yes | Unique identifier of the customer |
Implementation Reference
- src/tools/customers.ts:216-223 (handler)The handler function for customer_get. Calls this.api.getCustomer(args.customerId) and returns the result as JSON text.
case 'customer_get': const customer = await this.api.getCustomer(args.customerId); return { content: [{ type: "text", text: JSON.stringify(customer, null, 2) }] }; - src/tools/customers.ts:75-90 (schema)Input schema for customer_get tool. Defines customerId (required string) and optionally appName when using master key.
inputSchema: { type: "object", properties: { customerId: { type: "string", description: "Unique identifier of the customer" }, ...(appNameRequired ? { appName: { type: "string", description: "Name of the app to fetch data from. Required when using master key." } } : {}) }, required: appNameRequired ? ["customerId", "appName"] : ["customerId"] } - src/tools/customers.ts:64-91 (registration)Registration of the customer_get tool with name, description, and inputSchema in the getTools() method of CustomerTools class.
{ name: "customer_get", description: `Get detailed information about a specific customer. - Returns complete customer profile including: - Application username - Purchase history - Active and expired subscriptions - Last purchase details - Subscription renewal status - Trial and introductory period information - Required: customerId parameter${appNameRequired ? '\n- Requires appName parameter when using master key' : ''}`, inputSchema: { type: "object", properties: { customerId: { type: "string", description: "Unique identifier of the customer" }, ...(appNameRequired ? { appName: { type: "string", description: "Name of the app to fetch data from. Required when using master key." } } : {}) }, required: appNameRequired ? ["customerId", "appName"] : ["customerId"] } }, - src/iaptic-api.ts:176-179 (helper)The API helper method getCustomer() that makes the actual HTTP GET request to /customers/:customerId endpoint.
async getCustomer(customerId: string, params?: { appName?: string }) { const response = await this.client.get(`/customers/${customerId}`, { params }); return response.data; } - src/server.ts:90-91 (registration)Server routing: tools starting with 'customer_' are routed to CustomerTools.handleTool(), which handles customer_get via switch-case.
if (name.startsWith('customer_')) { return await this.tools.customers.handleTool(name, args);