- Receiving cart requests from PayPal Commerce Platform to validate products, calculate taxes, and handle shipping
- Handling updates to a shopping cart, like shipping options and line items
- Completing orders by processing PayPal payments and fulfilling shipments
Benefits
Merchants using PayPal’s agentic commerce services can enable AI agents to shop on their behalf by integrating with shop sync, which includes cart orchestration and offers the following benefits:- Customers interact with AI agents in natural language.
- AI agents understand intent and search for products via PayPal’s Commerce Platform.
- PayPal’s Commerce Platform validates requests and routes to your merchant API.
- Your API validates products, calculates pricing, handles inventory and orders.
API endpoints
System flow
Quickstart integration
This section walks you through the essential steps to implement a working Cart API integration. You’ll learn how to handle incoming cart requests, process payment completions, and manage the full transaction lifecycle. Follow these 3 core steps to get your merchant API up and running with the store sync feature from PayPal’s agentic commerce services, from initial cart creation through successful order fulfillment.Important: This quickstart guide provides a simplified overview. You must complete the product feed integration before you can set up cart orchestration.
Step 1: Handle incoming cart creation from PayPal Commerce Platform
When a customer interacts with an AI agent to buy something, Commerce Platform calls your API endpoint, as shown in the following example.Note: This step shows one type of product feed integration. To determine which type of product feed integration is best for your environment, see the Product feed integration guide.
Success Response (201 created)
Key response fields
Step 2: PayPal handles payment with customer
After receiving a successful cart creation response:- PayPal Commerce Platform presents the cart to customer for approval.
- Customer approves payment using PayPal’s agentic checkout APIs.
- PayPal returns payment approval details to complete the checkout.
- Your API receives the checkout completion request, which is Step 3: Handle order completion request.
Step 3: Handle order completion request
After customer approves payment, PayPal Commerce Platform calls your API to complete the order.Key parameters
Success response (200 OK)
Developer quick reference
This reference section provides essential lookup tables and patterns you’ll need during implementation. Use these quick references to understand HTTP status codes, cart states, validation error structures, and common integration patterns. Keep this section handy while building and debugging your Cart API integration—it contains the most frequently needed information for handling responses, troubleshooting issues, and implementing proper error handling. For the complete protocol reference, seeHTTP status patterns
Cart status values
Common status combinations
State transition example (INCOMPLETE → READY)
Common validation_issues
The validation_issues array communicates business logic problems that prevent cart completion but don’t warrant HTTP error codes. These structured error objects help AI agents understand what went wrong and how to fix it, whether that’s suggesting alternative products for out-of-stock items, requesting missing information, or explaining pricing changes. Use these patterns to provide clear, actionable feedback that enables automatic resolution or guides customers to make informed decisions.
Note: When validation_issues exist, PayPal Commerce Platform will send a PUT request with the updated cart state.