Skip to main content

Testing and Validation

Systematic testing and validation before full-scale integration is the critical step for ensuring data quality.

7.1 Small-Batch-First Strategy

Core principle: Start with approximately 100 products, confirm everything works correctly, then scale up to full volume.
Phase 1: ~100 products    — Validate format and field correctness
Phase 2: ~1,000 products  — Validate batch processing and chunking
Phase 3: ~10,000 products — Validate performance and stability
Phase 4: Full catalog      — Production launch
Do not skip the early phases and jump straight to full volume. Small-batch testing catches format errors, missing fields, and encoding issues quickly, at a fraction of the cost of rolling back a full catalog submission.

7.2 Required Field Validation

Ensure all required fields are correctly populated:
ObjectRequired FieldCommon Errors
ProductidUnstable IDs, duplicates
ProductvariantsEmpty array, missing Variant
VariantidUnstable IDs, cross-Product duplicates
VarianttitleEmpty string, missing
{
  "id": "prod_001",
  "variants": [
    {
      "id": "var_001_black",
      "title": "Wireless Earbuds - Black"
    }
  ]
}

7.3 Price Format Validation

Prices must use minor currency units (the smallest denomination):
CurrencyMinor UnitRepresentation of 10.00
USDcentamount: 1000
EURcentamount: 1000
JPYyen (no decimals)amount: 10
GBPpennyamount: 1000
{
  "price": {
    "amount": 9999,
    "currency": "USD"
  }
}
Validation checklist:
  • amount must be greater than or equal to 0 (0 means free)
  • currency uses ISO 4217 three-letter codes
  • Confirm you are not passing dollars instead of cents ($99.99 USD should be 9999, not 99)

7.4 URL Validation

Check every URL individually:
Validation checklist:
1. URL format is valid (starts with https://)
2. Special characters are properly encoded (spaces use %20)
3. URL is publicly accessible (no login required)
4. No expiring session parameters are included
5. Image URLs return valid images
6. The utm_medium=feed tracking parameter is present

7.5 SFTP Connection Testing

Verify SFTP connectivity before uploading production data:
Test steps:
1. Connect to the SFTP server using the provided credentials
2. Upload a small file to verify write permissions
3. Confirm the file arrives in the target directory
4. Verify the file size matches (transfer integrity)
5. Attempt to overwrite the same filename to verify the overwrite mechanism

7.6 API Authentication Testing

Verify API credentials and header configuration:
GET /product_feeds/feed_abc123
Authorization: Bearer api_key_123
API-Version: 2025-09-12
Accept-Language: en-US
User-Agent: MyStore/1.0
Timestamp: 2026-04-11T08:30:00Z
A 200 response indicates the authentication is configured correctly. If you receive a 401 or 403, check:
  • Whether the Bearer token is correct
  • Whether the token has expired
  • Whether account permissions have been activated

7.7 Common Error Troubleshooting

HTTP 400: invalid_payload

Cause: Malformed request body or missing required fields.
Common ScenarioSolution
Missing variants arrayEvery Product must contain at least one Variant
Variant missing id or titleAdd the required fields
Price amount is negativeEnsure amount is greater than or equal to 0
Invalid JSON formatCheck brackets, quotes, and commas
Encoding is not UTF-8Confirm the file and request use UTF-8

HTTP 404: not_found

Cause: The requested Feed or product does not exist.
Common ScenarioSolution
Incorrect Feed IDConfirm you are using the ID returned by POST /product_feeds
Feed has been deletedRecreate the Feed
Path typoCheck the URL path

Idempotency Conflicts

If you send different request bodies using the same Idempotency-Key, a conflict may occur. Each distinct request batch must use a unique key.

7.8 Checkout Session Testing

If the merchant also implements Agentic Checkout endpoints, the complete transaction flow must be tested.

Create a Session

POST /checkout_sessions
Content-Type: application/json

{
  "line_items": [
    {
      "product_id": "prod_001",
      "variant_id": "var_001_black",
      "quantity": 1
    }
  ]
}

Update a Session

POST /checkout_sessions/:id
Content-Type: application/json

{
  "shipping_address": {
    "line1": "123 Main St",
    "city": "San Francisco",
    "state": "CA",
    "postal_code": "94102",
    "country": "US"
  }
}

Complete Payment

POST /checkout_sessions/:id/complete

Cancel a Session

POST /checkout_sessions/:id/cancel
Test all four flows and confirm that state transitions are correct and error handling is robust.

7.9 Delegate Payment Testing

Stripe provides a test mode for payment integration testing:
Test ItemDescription
Test keysUse Stripe test-mode API keys
Test card numbersUse Stripe’s provided test card numbers
Vault tokenvt_test_... tokens generated in test mode
Payment confirmationVerify payment status callbacks are correct
3DS testingUse Stripe’s 3DS test card numbers to trigger the authentication flow
Test mode does not generate real transactions, allowing you to safely validate the full payment flow.

7.10 Post-Launch Data Sync Monitoring

After going live, continuously monitor data synchronization:
MetricRecommendation
SFTP upload success rateCheck daily that files arrive successfully
API request success rateMonitor 4xx and 5xx error rates
Data consistencyPeriodically compare local data against Feed data
Price accuracySpot-check prices for correctness
Inventory sync latencyMeasure time from inventory change to Feed update
Promotion statusConfirm promotions activate and expire on schedule

Next chapter: Chapter 8: Frequently Asked Questions — Common questions about ACP integration