P21 API Documentation
Comprehensive guides and examples for Epicor Prophet 21 APIs
Disclaimer: This is unofficial, community-created documentation. It is not affiliated with, endorsed by, or supported by Epicor Software Corporation. All trademarks are property of their respective owners. Use at your own risk.
Getting Started
Task Index
"I want to..." routing map — jump straight to the exact section for your task instead of reading whole guides.
Authentication
Token generation, credentials vs consumer keys, V1 and V2 endpoints, and token refresh patterns.
API Selection Guide
Decision tree and comparison table to help you choose the right API for your use case.
API Reference
OData API READ
Query any P21 table using standard OData v3 protocol. Filtering, pagination, and complex queries.
Transaction API WRITE
Stateless bulk operations for creating and updating records. Service discovery and async operations.
Interactive API READ/WRITE
Stateful window interactions with full business logic. Sessions, windows, and response handling.
Entity API CRUD
Simple REST operations on customers, vendors, contacts, and addresses.
Inventory REST API CRUD
Inventory item CRUD and multi-company workflows. Read inv_loc data, append locations and suppliers.
Production & Labor API READ/WRITE
Production orders, labor hours, time entry, and the end-to-end production lifecycle.
UDT Service API CRUD
Insert, update, and delete rows in user-defined tables via /udtservice/api/udtdata/.
Recipes — Copy-and-Run Tasks
Self-contained task pages: one task, one page — the complete payload, a full runnable example in Python and C#, and every verified gotcha.
Recipes Overview
How the cookbook works: conventions, shared auth helper, dry-run and verify rules.
Create Bins (Bulk)
Complete payload, runnable Python & C#, verified gotchas.
Create a Customer
Complete payload, runnable Python & C#, verified gotchas.
Create a Requisition Purchase Order
Complete payload, runnable Python & C#, verified gotchas.
Create a Sales Order
Complete payload, runnable Python & C#, verified gotchas.
Edit Contract Bin Quantities
Complete payload, runnable Python & C#, verified gotchas.
Generate Pick Ticket and PO PDFs
Complete payload, runnable Python & C#, verified gotchas.
Adjust On-Hand Quantity (Write-Off)
Complete payload, runnable Python & C#, verified gotchas.
Order with an Assembly Line
Complete payload, runnable Python & C#, verified gotchas.
Production Order Runbook — Create to Invoice
Complete payload, runnable Python & C#, verified gotchas.
Record Labor Time on a Production Order
Complete payload, runnable Python & C#, verified gotchas.
Set an Item's Primary Bin or Primary Supplier at a Location
Complete payload, runnable Python & C#, verified gotchas.
Update Contract Lines
Complete payload, runnable Python & C#, verified gotchas.
Update Supplier Contact Info (Email / Central Phone)
Complete payload, runnable Python & C#, verified gotchas.
Troubleshooting & Reference
P21 Breaking Changes
Version-indexed registry of P21 upgrade changes that break or silently corrupt integrations. Check before upgrading.
Error Handling
HTTP status codes, API-specific errors, Python error handling patterns, and debugging tips.
Session Pool Issues
Diagnosing and fixing Transaction API session pool contamination and related problems.
SalesPricePage Codes
Dropdown code mappings for the Sales Price Page window in the Interactive API.
Batch Processing Patterns
Production patterns for bulk operations: session batching, error recovery, and async client.
Changelog
Complete history of changes, additions, and contributors to this documentation project.