REST API

API Reference

Full REST API for every module. Integrate with anything.

Overview

Everything you need to integrate with the Yield API.

Base URL
https://your-domain.com/api/v1/
Content Type
application/json
Authentication

All API requests require a Bearer token in the Authorization header, obtained via OAuth.

Authorization: Bearer your_access_token

Response Format

All responses follow a standard envelope format.

JSON response
{
"data": [...],
"meta": {
"page": 1,
"pageSize": 25,
"total": 100
}
}

List endpoints return paginated responses with data and meta fields. Single-resource endpoints return the object directly in data.

Query Parameters

Standard query parameters available on all list endpoints.

Parameter Description Example
?search= Full-text search across relevant fields ?search=acme
?sort= Sort by field. Prefix with - for descending ?sort=-createdAt
?page= Page number (default: 1) ?page=3
?pageSize= Items per page (default: 25) ?pageSize=50
example request
GET /api/v1/partners?search=acme&sort=-createdAt&page=1&pageSize=25

Endpoints

Every module exposes a consistent set of RESTful endpoints.

Base

GET POST /api/v1/partners
GET PUT /api/v1/partners/:id

Product

GET POST /api/v1/products
GET PUT /api/v1/products/:id
GET POST /api/v1/products/categories

CRM

GET POST /api/v1/crm/leads
GET PUT /api/v1/crm/leads/:id
POST /api/v1/crm/leads/:id/convert

Sales

GET POST /api/v1/sales/orders
GET PUT /api/v1/sales/orders/:id
POST /api/v1/sales/orders/:id/confirm

Purchasing

GET POST /api/v1/purchasing/orders
POST /api/v1/purchasing/orders/:id/confirm

Inventory

GET POST /api/v1/inventory/transfers
GET /api/v1/inventory/stock
GET /api/v1/inventory/warehouses

Accounting

GET POST /api/v1/accounting/invoices
GET POST /api/v1/accounting/payments
GET /api/v1/accounting/journal-entries

Manufacturing

GET POST /api/v1/manufacturing/orders
GET /api/v1/manufacturing/boms

Project

GET POST /api/v1/project/projects
GET POST /api/v1/project/tasks

Events

GET POST /api/v1/events
GET POST /api/v1/events/:id/registrations

Fleet

GET POST /api/v1/fleet/vehicles
GET POST /api/v1/fleet/fuel-logs

Maintenance

GET POST /api/v1/maintenance/requests
GET POST /api/v1/maintenance/equipment

Repair

GET POST /api/v1/repair/orders
POST /api/v1/repair/orders/:id/confirm

System

GET /api/v1/system/health public
GET /api/v1/system/modules

Audit Trail

GET /api/v1/audit/logs
GET /api/v1/audit/logs/:id
GET /api/v1/audit/entity/:table/:entity_id

Webhooks

Receive real-time notifications when events happen in Yield.

Configuration

Configure webhooks in your Yield admin panel under Settings > Webhooks. Provide a URL and select the events you want to subscribe to.

Events

partner.created
partner.updated
sale.order.confirmed
sale.order.cancelled
purchase.order.confirmed
invoice.created
payment.received
inventory.transfer.completed
lead.converted
manufacturing.order.completed

Signature Verification

Every webhook request includes an X-Yield-Signature header containing an HMAC-SHA256 signature of the request body, signed with your webhook secret.

verification example (pseudo-code)
// Compute HMAC-SHA256 of the raw request body
signature = HMAC_SHA256(webhook_secret, request_body)

// Compare with the header value
if (signature == request.headers["X-Yield-Signature"])
// Request is authentic

Retry Policy

If your endpoint returns a non-2xx status code or times out, Yield will retry the webhook delivery every 5 minutes for up to 24 hours. After 24 hours of failed attempts, the webhook delivery is marked as failed and can be retried manually from the admin panel.

Audit Trail

Yield automatically logs every data change across all modules. Every create, update, delete, and soft-delete is recorded with full before/after snapshots, user attribution, and timestamps.

What's Tracked

The audit system captures comprehensive change data for every database operation:

Event Type

Insert, Update, Delete, or SoftDelete

User Attribution

Which user made the change, linked to ERP user ID

Before/After Snapshots

Full JSON of old and new entity state for every change

Changed Fields

Exactly which columns were modified in each update

Query API

Query audit logs via REST API with filtering by table, event type, user, and entity ID.

audit trail query
# Get recent changes to a specific partner
GET /api/v1/audit/entity/res_partner/42

# Search all deletes by a specific user
GET /api/v1/audit/logs?event_type=Delete&username=5

# Filter by table name
GET /api/v1/audit/logs?table_name=sale_order

Compliance & Forensics

The audit trail is automatic and immutable. It covers every module — partners, products, sales, purchasing, inventory, accounting, and more. Ideal for SOC 2, GDPR data access logging, HIPAA audit requirements, and internal investigations. Soft deletes are detected automatically and logged as a distinct event type.

MCP Protocol

Yield includes a built-in MCP (Model Context Protocol) server. Any AI agent — Claude, GPT, or custom — can discover and interact with your ERP operations through standardized tool interfaces.

Connecting

MCP exposes two endpoints automatically:

/mcp/sse

Server-Sent Events transport

/mcp/messages

HTTP POST transport

$ claude mcp add --transport http yield https://erp.yourcompany.com/mcp

Available Tools

40+ tools organized by module, automatically discoverable by any MCP-compatible AI agent.

Partners

search_partners, get_partner, list_customers, list_suppliers, create_partner

Products

search_products, get_product, list_categories, get_inventory_levels

CRM

search_leads, get_lead, move_lead_stage, get_pipeline, mark_lead_won/lost

Sales

search_orders, get_order, create_order, add_order_line, confirm_order

Purchasing

search_purchase_orders, get_purchase_order, create_purchase_order

Inventory

get_stock_levels, list_warehouses, get_picking, create_transfer

Accounting

list_accounts, search_invoices, get_invoice, list_payments

Projects

list_projects, get_project, list_tasks, create_task, update_task_stage

System

get_erp_status, list_modules, list_companies, get_company

Claude + MCP

Claude connects to your ERP's MCP endpoint to understand live system state before making code changes. It queries your modules, schemas, and data to generate precise, context-aware customizations.

$ claude "show me all products with low stock"

Querying MCP: get_stock_levels...

Found 3 products below reorder point:

  Widget A — 5 units (reorder: 25)

  Gadget B — 2 units (reorder: 10)

  Part C — 0 units (reorder: 50)

Need custom integrations?

Our team can help you build custom integrations, modules, and data migrations.