Agent Commerce Protocol (ACP) Guide
The Agent Commerce Protocol (ACP) enables AI agents to place orders directly into your commerce infrastructure. With a single API call, an AI agent can create an order that automatically flows through to fulfillment and ERP systems.Overview
Why ACP?
Traditional e-commerce requires customers to navigate websites, add items to carts, and go through checkout flows. Agent Commerce allows AI assistants to handle the entire purchase flow conversationally:- “I’d like to order 2 blue widgets shipped to my office”
- The AI collects details, confirms the order, and places it via ACP
- The order is fulfilled and tracked automatically
- Conversational Commerce - Order via ChatGPT, Claude, Alexa, etc.
- Automated Purchasing - Agents that reorder supplies automatically
- B2B Order Entry - Sales reps using AI to place orders
- Multi-channel Unification - Single API for all agent-based ordering
Quick Start
1. Basic Order Submission
2. Response
API Reference
Endpoints
Authentication
Include your API key in the Authorization header:X-API-Key header:
Request Schema
AcpOrderRequest
Customer
Address
LineItem
RoutingConfig
Control where the order is sent:Routing Options
Full Integration (Default)
Order flows to all configured systems:Fulfillment Only
Skip ERP, just fulfill the order:Record Only
Just create the record, don’t fulfill yet:Specific Fulfillment Provider
Force a specific fulfillment provider:Async Processing
For high-volume or time-sensitive responses, use async processing:Submit Order
Response
Check Status
Job Status Response
Batch Processing
Process up to 100 orders in a single request:Response
Batch Result
Integration Examples
ChatGPT Function Calling
Define this function for ChatGPT to place orders:Python Integration
Node.js Integration
Error Handling
Validation Errors (422)
Integration Not Configured (424)
Partial Success (207)
When some integrations succeed but others fail:Configuration
Tenant Configuration
Ensure your tenant has the required integrations configured inapp_config.json:
Environment Variables
Sensitive values can be stored as environment variables:Best Practices
1. Use Idempotent Order IDs
Always provide a unique, deterministicorderId to prevent duplicate orders:
2. Validate Before Submitting
Have your AI agent confirm order details with the customer before calling ACP.3. Handle Partial Failures
Check bothfulfillment.success and erp.success in responses. An order might be fulfilled even if ERP entry fails.
4. Use Async for High Volume
For bulk imports or high-traffic scenarios, use/acp/orders/async or /acp/orders/batch.
5. Include Customer NetSuite ID
If you know the customer’s NetSuite ID, include it to ensure proper customer linking:6. Map SKUs to NetSuite Items
For fastest NetSuite processing, include NetSuite item IDs:Glossary
Support
For issues or questions:- GitHub Issues: https://github.com/stateset/stateset-sync-server/issues
- Documentation: https://docs.stateset.com