# Payhere

Easy payment links for accepting online payments

- **Category:** payment processing
- **Auth:** API_KEY
- **Composio Managed App Available?** N/A
- **Tools:** 13
- **Triggers:** 0
- **Slug:** `PAYHERE`
- **Version:** 20260307_00

## Tools

### Create Hook

**Slug:** `PAYHERE_CREATE_HOOK`

Tool to subscribe to a REST hook for receiving webhook events. Use when you need to register a webhook endpoint to receive real-time notifications for payment_received, subscription_cancelled, or subscription_created events.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `post_url` | string | Yes | Your platform's endpoint URL that will receive POST requests when events trigger. |
| `resource` | string ("payment_received" | "subscription_cancelled" | "subscription_created") | Yes | Event type to monitor. Must be one of: 'payment_received', 'subscription_cancelled', or 'subscription_created'. |
| `integration` | string | Yes | Friendly name of your platform. Helps with metrics and debugging. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Plan

**Slug:** `PAYHERE_CREATE_PLAN`

Tool to create a new payment plan in PayHere. Use when you need to set up either a recurring subscription or one-off payment plan for accepting payments.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | Display name for the plan shown to customers. |
| `price` | number | No | Plan pricing. Omit for donation plans where user_selects_amount is true. |
| `hidden` | boolean | No | Hide plan from landing page if true. |
| `currency` | string | Yes | Three-letter currency code (e.g., 'usd', 'gbp', 'eur'). |
| `show_qty` | boolean | No | Enable quantity selection field. Only applies to one-off plans. |
| `setup_fee` | number | No | Initial one-time charge amount for recurring plans. |
| `billing_day` | integer | No | Day of month for monthly charges (1-31) for recurring plans. |
| `description` | string | No | Product or service description shown to customers. |
| `success_url` | string | No | URL to redirect customers after successful payment. |
| `webhook_url` | string | No | Endpoint URL for receiving payment status notifications. |
| `cancel_after` | integer | No | Auto-cancel subscription after N payments for recurring plans. |
| `payment_type` | string ("recurring" | "one_off") | Yes | Type of plan: "recurring" for subscriptions or "one_off" for one-time payments. |
| `receipt_text` | string | No | Custom message displayed on payment receipts. |
| `pay_button_text` | string | No | Custom label for payment button. Defaults to "Pay". |
| `billing_interval` | string ("week" | "month" | "year") | No | Billing frequency for recurring plans: "week", "month", or "year". Required for recurring plans. |
| `min_billing_cycles` | integer | No | Minimum billing cycles before cancellation is allowed for recurring plans. |
| `user_selects_amount` | boolean | No | Enable donation functionality where users choose the payment amount. When true, omit the price field. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete Hook

**Slug:** `PAYHERE_DELETE_HOOK`

Tool to remove a REST hook listener subscription. Use when you need to stop receiving webhook events for a specific hook.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | integer | Yes | The unique identifier of the REST hook to delete |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Current Company

**Slug:** `PAYHERE_GET_CURRENT_COMPANY`

Tool to fetch company information for the currently authenticated user. Use when you need to retrieve comprehensive company details including identity, configuration, integration status, and associated users.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Current Company Stats

**Slug:** `PAYHERE_GET_CURRENT_COMPANY_STATS`

Tool to fetch payment statistics for the last 30 days with comparison data from the preceding 30-day period (30-60 days ago). Use when you need to analyze recent payment trends, subscriber growth, or compare current performance against the previous month.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get User

**Slug:** `PAYHERE_GET_USER`

Tool to fetch information on the currently authenticated user. Use when you need to retrieve details about the logged-in user.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Customers

**Slug:** `PAYHERE_LIST_CUSTOMERS`

Tool to list all customers from Payhere, ordered chronologically with most recent first. Use when you need to retrieve customer records, browse customers, or access customer information. Supports pagination via page and per_page parameters.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `page` | integer | No | Page number for pagination. Use to navigate through paginated results. |
| `per_page` | integer | No | Records per page. Default is 20, maximum is 100. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List REST Hooks

**Slug:** `PAYHERE_LIST_HOOKS`

Tool to list all active REST hooks subscriptions for the authenticated company. Use when you need to view all currently registered webhook listeners for your PayHere account.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Payments

**Slug:** `PAYHERE_LIST_PAYMENTS`

Tool to list all payments ordered chronologically, most recent first. Use when you need to retrieve payment history or check payment statuses. Supports pagination with page and per_page parameters.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `page` | integer | No | Page number for pagination. |
| `per_page` | integer | No | Number of records per page (default: 20, maximum: 100). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Plans

**Slug:** `PAYHERE_LIST_PLANS`

Tool to list all plans in your PayHere account. Use when you need to retrieve and paginate through available plans.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `page` | integer | No | Page number for pagination. Must be >= 1. |
| `per_page` | integer | No | Number of plans per page. Default is 20, maximum is 100. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List subscriptions

**Slug:** `PAYHERE_LIST_SUBSCRIPTIONS`

Tool to list all subscriptions ordered chronologically by most recent payment first. Use when you need to retrieve subscription data with customer and plan details.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `page` | integer | No | Page number for pagination. Defaults to 1 if not specified. |
| `per_page` | integer | No | Number of records returned per page. Defaults to 20 if not specified. Maximum value is 100. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Current Company

**Slug:** `PAYHERE_UPDATE_CURRENT_COMPANY`

Tool to update the company information for the currently authenticated user. Use when modifying company details such as name, legal name, address, logo, support email, website, or branding preferences (button color and text color).

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `logo` | object | No | Logo image for the company. |
| `name` | string | No | Display name of the company |
| `address` | string | No | Company address for receipt display |
| `website` | string | No | Company website shown in receipts |
| `legal_name` | string | No | Legal name shown on receipts |
| `button_text` | string | No | Text color: empty (auto), 'white', or 'black' |
| `button_color` | string | No | Hex color for pay button (e.g., #ff6600) |
| `support_email` | string | No | Support email displayed in receipts |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Plan

**Slug:** `PAYHERE_UPDATE_PLAN`

Tool to update an existing plan's configuration and settings. Use when you need to modify plan properties like name, description, pricing, or other settings for both one-off and subscription plans.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | The unique identifier of the plan to update |
| `name` | string | No | Display name for the plan |
| `price` | number | No | Plan cost (for one-off plans only) |
| `hidden` | boolean | No | Exclude plan from payment landing page |
| `currency` | string | No | ISO 4217 currency code (for one-off plans only) |
| `show_qty` | boolean | No | Enable quantity field on payment form (for one-off plans only) |
| `setup_fee` | number | No | Initial one-time charge (for subscription plans only) |
| `billing_day` | integer | No | Monthly charge date (for subscription plans only) |
| `description` | string | No | Product/service description shown to customers |
| `success_url` | string | No | Post-payment redirect destination |
| `webhook_url` | string | No | Endpoint for payment status notifications |
| `cancel_after` | integer | No | Auto-cancel after N payments (for subscription plans only) |
| `receipt_text` | string | No | Custom message added to email receipts |
| `pay_button_text` | string | No | Button label (e.g., 'Subscribe', 'Donate') |
| `min_billing_cycles` | integer | No | Minimum payments before cancellation (for subscription plans only) |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
