πŸš€ Quick Start Guide

πŸš€ Quick Start Guide

This guide will help you quickly begin Agentic Commerce Protocol (ACP) integration, from applying for access to completing basic implementation.

Step 1: Apply for Access

Merchant Application

  1. Visit the ChatGPT Merchant Application Page
  2. Complete merchant information:
    • Company basic information
    • Product categories and scale
    • Existing e-commerce platform information
    • Technical implementation plan

Special Cases

  • Etsy Merchants: US-based merchants automatically qualify
  • Shopify Merchants: Platform merchants require no additional application
  • Other Merchants: Gradually opening through application process

Step 2: Prepare Product Data

Data Format Options

Multiple formats supported:

  • TSV (Recommended) - Tab-separated values
  • CSV - Comma-separated values
  • XML - Extensible Markup Language
  • JSON - JavaScript Object Notation

Required Fields

{
  "id": "prod_12345",
  "title": "Product Name",
  "description": "Detailed product description",
  "price": "29.99",
  "currency": "USD",
  "availability": "in_stock",
  "image_url": "https://example.com/image.jpg"
}

Recommended Fields

{
  "category": "Category Path",
  "brand": "Brand Name",
  "weight": "Weight Information",
  "shipping_cost": "Shipping Cost",
  "reviews": {
    "average_rating": 4.8,
    "review_count": 156
  }
}

Step 3: Implement Core APIs

Agentic Checkout Endpoints

Create Checkout Session

POST /acp/checkout
Content-Type: application/json

{
  "items": [
    {
      "product_id": "prod_12345",
      "quantity": 1
    }
  ],
  "customer": {
    "email": "[email protected]"
  }
}

Response Format

{
  "session_id": "session_abc123",
  "status": "pending",
  "total_amount": 2999,
  "currency": "USD",
  "items": [...],
  "shipping_options": [...],
  "tax_amount": 300
}

Order Status Query

GET /acp/order/{order_id}

Response:
{
  "order_id": "order_xyz789",
  "status": "confirmed",
  "tracking_number": "1234567890",
  "estimated_delivery": "2025-01-20"
}

Step 4: Integrate Payment Processing

Using Stripe Shared Payment Token

Configure Stripe

const stripe = require('stripe')('sk_test_...');

// Create payment intent
const paymentIntent = await stripe.paymentIntents.create({
  amount: 2999,
  currency: 'usd',
  metadata: {
    acp_session: 'session_abc123'
  }
});

Handle Payment Delegation

app.post('/acp/payment/delegate', async (req, res) => {
  const { payment_token, amount, currency } = req.body;
  
  try {
    // Verify payment token
    const charge = await stripe.charges.create({
      amount: amount,
      currency: currency,
      source: payment_token
    });
    
    res.json({
      status: 'succeeded',
      charge_id: charge.id
    });
  } catch (error) {
    res.status(400).json({
      error: error.message
    });
  }
});

Step 5: Set Up Webhooks

Webhook Endpoint

app.post('/acp/webhook', (req, res) => {
  const { event_type, session_id, data } = req.body;
  
  switch (event_type) {
    case 'checkout.created':
      // Handle checkout creation event
      break;
    case 'payment.succeeded':
      // Handle payment success event
      break;
    case 'order.updated':
      // Handle order update event
      break;
  }
  
  res.status(200).send('OK');
});

Event Types

  • checkout.created - Checkout session created
  • checkout.updated - Checkout information updated
  • payment.succeeded - Payment successful
  • payment.failed - Payment failed
  • order.confirmed - Order confirmed
  • order.shipped - Order shipped

Step 6: Testing and Validation

Sandbox Testing

  1. Deploy API endpoints in test environment
  2. Configure test product data
  3. Simulate complete purchase flow
  4. Verify webhook event handling

Validation Checklist

  • βœ… Product feed format correct
  • βœ… Checkout API responses comply with specifications
  • βœ… Payment processing secure and reliable
  • βœ… Webhook events properly handled
  • βœ… Error cases handled appropriately

Step 7: Production Deployment

Security Checks

  • Enable HTTPS encrypted transmission
  • Verify API access permissions
  • Configure rate limiting
  • Set up monitoring alerts

Performance Optimization

  • Optimize API response times
  • Configure Content Delivery Network (CDN)
  • Set up database connection pooling
  • Implement caching strategies

Monitoring Metrics

// Key metrics monitoring
const metrics = {
  api_response_time: 'Average response time',
  success_rate: 'Success rate',
  error_rate: 'Error rate',
  conversion_rate: 'Conversion rate'
};

πŸ› οΈ Development Tools

Official SDKs

# Node.js
npm install @acp/commerce-sdk

# Python
pip install acp-commerce

# PHP
composer require acp/commerce-sdk

Testing Tools

πŸ“ž Getting Help

Technical Support

Community Resources

By following these steps, you can quickly get started with ACP protocol integration and provide users with innovative AI-driven shopping experiences!