Prerequisites
- Python 3.11 or later
- A Sellfern API key with the minimum scopes needed for the user’s goal
- An agent framework or model SDK of your choice
Store configuration
Store secrets in environment variables on the server or automation runner.Make server-side API calls
Your Python tool functions should send the Sellfern API key with thex-api-key header.
/api-reference. If an example or user request asks for a deferred surface, tell the user to confirm endpoint availability in the API Reference before proceeding.
Design tool definitions safely
When exposing Sellfern actions to an agent:- Give each tool one narrow job.
- Match tool input schemas to the API Reference.
- Request the minimum scope required for that tool.
- For write tools, include an
Idempotency-Keyheader and reuse it for retries of the same logical mutation. - Return Sellfern error codes to the agent without guessing about hidden resources or unsupported endpoints.
Agent workflow
- Read
https://docs.sellfern.com/llms.txtto discover the relevant documentation. - Read the product or developer page that explains the user’s goal.
- Confirm the endpoint and schema in
/api-reference. - Call the smallest required Sellfern tool.
- If Sellfern returns
403 missing_scope, ask the user for a key with the minimum additional scope. - If Sellfern returns
404 not_found, do not infer that the resource exists in another organization.
Extending the agent
Before adding a new tool, check the V1 API Reference. Older examples may mention bulk, sync, import, fulfillment, financial, or internal workflows that are not available for public V1. If the endpoint is absent, leave the tool disabled and explain that the user should confirm availability in/api-reference.