Generate code to integrate Frappe with external REST APIs. Use when connecting to third-party services, payment gateways, or external data sources.
View on GitHubVenkateshvenki404224/frappe-apps-manager
frappe-apps-manager
frappe-apps-manager/skills/frappe-external-api-connector/SKILL.md
January 21, 2026
Select agents to install to:
npx add-skill https://github.com/Venkateshvenki404224/frappe-apps-manager/blob/main/frappe-apps-manager/skills/frappe-external-api-connector/SKILL.md -a claude-code --skill frappe-external-api-connectorInstallation paths:
.claude/skills/frappe-external-api-connector/# Frappe External API Connector
Generate robust API client code for integrating Frappe with external REST APIs, handling authentication, error recovery, and data transformation.
## When to Use This Skill
Claude should invoke this skill when:
- User wants to integrate external REST APIs
- User needs to call third-party services
- User mentions API integration, external system connection
- User wants to integrate payment gateways, shipping APIs, etc.
- User needs OAuth or API key authentication
## Capabilities
### 1. API Client Class
**REST API Client Template:**
```python
import requests
import frappe
from frappe import _
class ExternalAPIClient:
def __init__(self):
self.base_url = frappe.conf.get('external_api_url')
self.api_key = frappe.conf.get('external_api_key')
self.timeout = 30
def get_headers(self):
return {
'Authorization': f'Bearer {self.api_key}',
'Content-Type': 'application/json',
'User-Agent': 'Frappe/1.0'
}
def get(self, endpoint, params=None):
"""GET request with error handling"""
try:
response = requests.get(
f'{self.base_url}/{endpoint}',
params=params,
headers=self.get_headers(),
timeout=self.timeout
)
response.raise_for_status()
return response.json()
except requests.exceptions.Timeout:
frappe.throw(_('Request timeout'))
except requests.exceptions.HTTPError as e:
self._handle_http_error(e)
except Exception as e:
frappe.log_error(frappe.get_traceback(),
'External API Error')
frappe.throw(_('API request failed'))
def post(self, endpoint, data):
"""POST request"""
response = requests.post(
f'{self.base_url}/{endpoint}',
json=data,
headers=self.get_headers(),
timeout=self.time