一键导入
myforterro-api
Connect to and interact with the MyForterro API (authentication, tenant management, AI agents, invoicing, inference).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Connect to and interact with the MyForterro API (authentication, tenant management, AI agents, invoicing, inference).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
You are a QC inspector agent for a rubber duck factory. You look at batch photos, run quality control inspections, and manage dispositions.
You are an mcp expert, from prompting to mcp tool definition, documentation and debugging.
You are a UX expert, that values consistency above all
Run, maintain, and extend the duck-demo API contract test suite (REST + MCP tools).
Analyse data in the demo SQLite database using SQL queries
| name | myforterro-api |
| description | Connect to and interact with the MyForterro API (authentication, tenant management, AI agents, invoicing, inference). |
Authenticate and call the MyForterro API — a multi-tenant SaaS platform providing Fx Rates, E-Invoicing, AI (inference + agentic platform), and Open Banking modules to Forterro products.
Stored in secrets.sh (git-ignored). Source it before any API call:
source secrets.sh
| Variable | Purpose |
|---|---|
CLIENT_APP_ID | OAuth client ID for the MyForterro application |
CLIENT_APP_SECRET | OAuth client secret |
TENANT_ID | UUID identifying the tenant (used as MFT-Tenant-Id header) |
TENANT_APPLICATION_ID | UUID of the MyForterro business service application linked to the tenant |
MyForterro uses OAuth 2.0 Client Credentials with a custom application parameter.
application parameterA standard client_credentials grant without the application parameter will return a valid JWT, but it will lack the roles/permissions needed to access any API endpoint (every call returns 401).
You must include application=$TENANT_APPLICATION_ID in the token request. This tells the MyForterro auth server to issue a token scoped to the specific tenant application, including proper roles and permissions.
source secrets.sh
TOKEN=$(curl -s -X POST \
https://integration-myforterro-core.fcs-dev.eks.forterro.com/connect/token \
-d "grant_type=client_credentials" \
-d "client_id=$CLIENT_APP_ID" \
-d "client_secret=$CLIENT_APP_SECRET" \
-d "application=$TENANT_APPLICATION_ID" \
| jq -r '.access_token')
The token is a JWT, valid for 3600 seconds (1 hour).
https://integration-myforterro-core.fcs-dev.eks.forterro.com/connect/tokenclient_secret_post, client_secret_basic, private_key_jwtclient_credentials, authorization_code, refresh_token, token-exchangeEvery API call requires two things:
Authorization: Bearer $TOKEN headerMFT-Tenant-Id: $TENANT_ID header (except /v1/admin/tenants which lists all accessible tenants)curl -s \
-H "Authorization: Bearer $TOKEN" \
-H "MFT-Tenant-Id: $TENANT_ID" \
https://integration-myforterro-api.fcs-dev.eks.forterro.com/v1/ai/agents | jq .
GET /v1/admin/tenants does not require MFT-Tenant-Id and is a good first connectivity test:
source secrets.sh && \
TOKEN=$(curl -s -X POST \
https://integration-myforterro-core.fcs-dev.eks.forterro.com/connect/token \
-d "grant_type=client_credentials" \
-d "client_id=$CLIENT_APP_ID" \
-d "client_secret=$CLIENT_APP_SECRET" \
-d "application=$TENANT_APPLICATION_ID" \
| jq -r '.access_token') && \
curl -s -H "Authorization: Bearer $TOKEN" \
https://integration-myforterro-api.fcs-dev.eks.forterro.com/v1/admin/tenants | jq .
Expected response:
[
{
"tenantId": "efc8df60-508d-4d2d-936f-75ba256e7428",
"slug": "stark-industries",
"myForterroIdentifiers": {
"applicationId": "f4c42de8-3bc1-420c-b72e-01f75df2f726",
"clientId": "f4c42de8-3bc1-420c-b72e-01f75df2f726"
}
}
]
The MyForterro AI inference API is OpenAI-compatible:
import openai
API_BASE = "https://integration-myforterro-api.fcs-dev.eks.forterro.com/v1/ai/inference/openai"
client = openai.OpenAI(
api_key=TOKEN,
base_url=API_BASE,
default_headers={"MFT-Tenant-Id": TENANT_ID},
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Tell me a joke."},
],
temperature=1.0,
)
| Module | Endpoints prefix | Roles required |
|---|---|---|
| Fx Rates | /v1/fx/rates | None |
| E-Invoicing | /v1/invoicing/ | Accounting or Admin |
| AI | /v1/ai/ | User or Admin |
| Tenant Admin | /v1/admin/tenants | (varies) |
Note: Modules must be enabled in the MyForterro application overview page. Configuration is cached for 5 minutes.
| Symptom | Cause | Fix |
|---|---|---|
| 401 on every endpoint | Missing application param in token request | Add -d "application=$TENANT_APPLICATION_ID" to the token POST |
| Valid JWT but empty scopes | Same as above — token has no roles without application | Same fix |
| 403 Forbidden | User/app lacks required role for the module | Check role assignments in MyForterro admin |
| 401 after ~1 hour | Token expired | Request a new token (they last 3600s) |
A properly scoped token includes these MyForterro-specific claims:
| Claim | Description |
|---|---|
mf:sid | MyForterro session ID |
mf:cid | MyForterro company/context ID |
mf:app_id | Application ID the token was issued for |
mf:app_name | Human-readable application name |
aud | Always myforterro |
Decode a token for debugging:
echo "$TOKEN" | cut -d. -f2 | (cat; echo '==') | base64 -d 2>/dev/null | jq .