π 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
- Visit the ChatGPT Merchant Application Page
- 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 createdcheckout.updated- Checkout information updatedpayment.succeeded- Payment successfulpayment.failed- Payment failedorder.confirmed- Order confirmedorder.shipped- Order shipped
Step 6: Testing and Validation
Sandbox Testing
- Deploy API endpoints in test environment
- Configure test product data
- Simulate complete purchase flow
- 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-sdkTesting Tools
π Getting Help
Technical Support
- π§ Email: [email protected]
- π¬ Community: Developer Forum
- π Documentation: Complete Technical Documentation
Community Resources
By following these steps, you can quickly get started with ACP protocol integration and provide users with innovative AI-driven shopping experiences!