Skip to main content
To let AI agents shop on behalf of customers, merchants can enable store sync, including cart orchestration. This revolutionary approach transforms how customers interact with online stores. Instead of browsing websites, customers can use their own words to tell an AI agent what they want. The AI agent can handle product discovery, cart management, and checkout completion through secure API calls to your merchant system by way of PayPal’s Commerce Platform. With this integration, you can open your storefront to a new generation of AI-powered shopping assistants, commerce platforms, and automated purchasing systems.
In this guide, you’ll see how to build an API that integrates with PayPal Checkout for AI-powered commerce, including:
  • 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:
  1. PayPal Commerce Platform presents the cart to customer for approval.
  2. Customer approves payment using PayPal’s agentic checkout APIs.
  3. PayPal returns payment approval details to complete the checkout.
  4. 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)

At this point, your API has successfully processed the AI-assisted purchase, the customer now owns a new t-shirt, and the AI agent can confirm the successful order.

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, see

HTTP status patterns

Cart status values

Common status combinations

State transition example (INCOMPLETEREADY)

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.

Simple validation error (minimal fields)

Complete validation error (all fields)

Error categories

Types

Customer information availability