ship-hero
ShipHero API Integration
API Overview
ShipHero provides a GraphQL API for managing e-commerce fulfillment operations.
Endpoints:
- GraphQL:
https://public-api.shiphero.com/graphql - Auth:
https://public-api.shiphero.com/auth/token
Quick Start
Authentication
Get a JWT token (expires in 28 days):
curl -X POST https://public-api.shiphero.com/auth/token \
-H "Content-Type: application/json" \
-d '{"email": "EMAIL", "password": "PASSWORD"}'
Use the token in all requests:
Authorization: Bearer YOUR_ACCESS_TOKEN
For detailed auth patterns including token refresh: See references/authentication.md
Basic Query Pattern
All queries return request_id, complexity, and data:
query {
products {
request_id
complexity
data(first: 25) {
pageInfo { hasNextPage endCursor }
edges {
node { id sku name }
}
}
}
}
Core Operations
Orders
# Create order
mutation {
order_create(data: {
order_number: "ORD-123"
shop_name: "my-shop"
shipping_address: { first_name: "John", last_name: "Doe", address1: "123 Main St", city: "NYC", state: "NY", zip: "10001", country: "US" }
line_items: [{ sku: "SKU-001", quantity: 1, price: "29.99", product_name: "Widget" }]
}) {
order { id order_number }
}
}
Inventory
# Add inventory
mutation {
inventory_add(data: {
sku: "SKU-001"
warehouse_id: "WAREHOUSE_UUID"
quantity: 50
reason: "Restocking"
}) {
warehouse_product { on_hand }
}
}
For complete operations: See references/graphql-operations.md
Rate Limits & Query Optimization
Credits:
- Starting: 4,004 credits
- Restore rate: 60 credits/second
- Max operation cost: 4,004 credits
- Hard limit: 7,000 requests per 5 minutes
Optimization tips:
- Always specify
firstorlastparameter (default 100 is expensive) - Use
analyze: trueto preview query cost before executing - Request only needed fields
- Use filters (
created_at_min,updated_at_min) to narrow results
# Preview query cost
query {
orders(analyze: true) {
complexity # Returns estimated cost without executing
}
}
Webhooks
Register webhooks for real-time events:
mutation {
webhook_create(data: {
name: "Shipment Update" # Must match exactly
url: "https://your-endpoint.com/webhook"
shop_name: "api"
}) {
webhook { shared_signature_secret } # Save this!
}
}
Available webhooks: Inventory Update, Inventory Change, Shipment Update, Order Canceled, Order Packed Out, Return Update, PO Update, and more.
For full webhook reference: See references/webhooks.md
3PL Operations
For 3PL accounts managing multiple customers:
Option 1: Use customer's credentials directly
Option 2: Add customer_account_id to requests:
query {
orders(customer_account_id: "CUSTOMER_UUID") {
data(first: 25) { ... }
}
}
Converting Legacy IDs
Convert legacy integer IDs to UUIDs:
query {
uuid(legacy_id: 12345, entity_type: "order") {
uuid
}
}
Error Handling
Capture request_id from all responses for debugging:
{
orders {
request_id # Always include for support
data { ... }
}
}
Common error codes: 3 (Invalid Argument), 5 (Not Found), 16 (Unauthenticated)
Python Client Example
from gql import gql, Client
from gql.transport.requests import RequestsHTTPTransport
transport = RequestsHTTPTransport(
url="https://public-api.shiphero.com/graphql",
headers={"Authorization": f"Bearer {token}"}
)
client = Client(transport=transport)
result = client.execute(gql("""
query { products { data(first: 10) { edges { node { sku } } } } }
"""))
Reference Files
- references/graphql-operations.md: Complete query/mutation examples for orders, products, inventory, shipments, returns, purchase orders
- references/webhooks.md: Webhook types, registration, verification, best practices
- references/authentication.md: Token management, refresh patterns, 3PL auth
More from salmanferozkhan/cloud-and-fast-api
chainlit
Expert guidance for building conversational AI applications with Chainlit framework in Python. Use when (1) creating chat interfaces for LLM applications, (2) building apps with OpenAI, LangChain, LlamaIndex, or Mistral AI, (3) implementing streaming responses, (4) adding UI elements like images, files, charts, (5) handling user file uploads, (6) implementing authentication (OAuth, password), (7) creating multi-step workflows with visible steps, (8) building RAG applications with document upload, or (9) deploying chat apps to web, Slack, Discord, or Teams.
87sqlmodel
Expert guidance for SQLModel - the Python library combining SQLAlchemy and Pydantic for database models. Use when (1) creating database models that work as both SQLAlchemy ORM and Pydantic schemas, (2) building FastAPI apps with database integration, (3) defining model relationships (one-to-many, many-to-many), (4) performing CRUD operations with type safety, (5) setting up async database sessions, (6) integrating with Alembic migrations, (7) handling model inheritance and mixins, or (8) converting between database models and API schemas.
17fastapi
Expert guidance for building REST APIs with FastAPI framework in Python. Use when (1) creating new FastAPI projects from scratch, (2) implementing API endpoints with routing, (3) working with Pydantic models for validation, (4) setting up dependency injection, (5) implementing authentication (OAuth2, JWT, API keys), (6) integrating databases (SQLAlchemy sync/async), (7) writing tests for FastAPI apps, (8) deploying FastAPI to production (Docker, Gunicorn), or (9) implementing advanced features like WebSockets, middleware, background tasks.
5microsoft-agent-framework
Expert guidance for building AI agents and multi-agent workflows using Microsoft Agent Framework for .NET. Use when (1) creating AI agents with OpenAI or Azure OpenAI, (2) implementing function tools and structured outputs, (3) building multi-turn conversations, (4) designing graph-based workflows with streaming/checkpointing, (5) implementing middleware pipelines, (6) orchestrating multi-agent systems with fan-out/fan-in patterns, (7) adding human-in-the-loop interactions, (8) integrating OpenTelemetry observability, or (9) exposing agents as MCP tools.
3docx
Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks
3xlsx
Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas
3