P21 API Selection Guide

Disclaimer: This is unofficial, community-created documentation for Epicor Prophet 21 APIs. It is not affiliated with, endorsed by, or supported by Epicor Software Corporation. All product names, trademarks, and registered trademarks are property of their respective owners. Use at your own risk.


Overview

Prophet 21 provides four different APIs for external data access and manipulation. This guide helps you choose the right API for your use case.

Quick Decision Table

Need Best API Why
Read data quickly OData Standard protocol, efficient queries
Bulk create records Transaction API Stateless, supports batching
Complex business workflows Interactive API Full business logic, validation
Simple CRUD (customers, vendors, contacts, addresses) Entity API Stateless, domain objects
Update existing records Interactive API Reliable field-level updates
Handle response dialogs Interactive API Only API with dialog handling

API Comparison

Feature OData Transaction Interactive Entity
Read Data Excellent Limited Good Good (4 entities)
Create Data No Excellent Good Good (4 entities)
Update Data No Limited* Excellent Good (4 entities)
Delete Data No No Via UI Via flag
Bulk Operations Yes (read) Yes No No
Business Logic No Partial Full No
Session Required No No Yes No
Stateful No No Yes No
Response Dialogs N/A N/A Yes N/A

*Transaction API updates have known issues - see Session Pool Troubleshooting


OData API

Best For

Characteristics

Use When

Don't Use When

Example Use Cases


Transaction API

Best For

Characteristics

Use When

Don't Use When

Known Issues

Example Use Cases


Interactive API

Best For

Characteristics

Use When

Don't Use When

Performance Note

The Interactive API is slower than Transaction API for creates (~5s vs 0.05s per record) but more reliable for updates.

Version Note

Some P21 servers only support v2 Interactive API endpoints. If you receive 404 errors on /api/ui/interactive/v1/* endpoints, use /api/ui/interactive/v2/* instead. The v2 endpoints have different payload formats - see Interactive API v1 vs v2.

Example Use Cases


Entity API

Best For

Characteristics

Use When

Don't Use When

Example Use Cases


Decision Flowchart

Start
  │
  ├─ Need to READ data only?
  │   │
  │   └─ Yes → Use OData API
  │
  ├─ Need to CREATE multiple records?
  │   │
  │   └─ Yes → Use Transaction API
  │
  ├─ Need to UPDATE records?
  │   │
  │   └─ Yes → Use Interactive API
  │
  ├─ Need response dialog handling?
  │   │
  │   └─ Yes → Use Interactive API
  │
  └─ Single-record CREATE?
      │
      ├─ High volume → Use Transaction API
      │
      └─ Low volume / needs validation → Use Interactive API

Hybrid Approaches

Read with OData, Write with Transaction/Interactive

The most common pattern: 1. Use OData for all reads (fast, simple) 2. Use Transaction API for bulk creates (fast) 3. Use Interactive API for updates (reliable)

Example: Price Page Management

# Read existing pages - OData (fast)
pages = odata.get_price_pages(supplier_id=10050)

# Create new pages - Transaction API (bulk, fast)
new_pages = transaction.create_pages([...])

# Update existing page - Interactive API (reliable)
with interactive.open_window("SalesPricePage") as window:
    window.change_data("calculation_value1", "0.55")
    window.save()

Performance Benchmarks

Measured against production P21 instance:

Operation OData Transaction Interactive
Read 160 records 0.12s N/A ~2s
Create 1 record N/A 0.05s 2.5s
Create 25 records N/A 1.4s 62s
Update 1 record N/A Unreliable* 2.0s

*Transaction API updates may fail - see known issues