Integration Architecture and Data Flow

The Walmart Marketplace integration with Odoo 18 employs a distributed event-driven architecture. This design handles high-volume data exchange while maintaining system resilience. The core integration uses Odoo’s built-in IoT Box as a message broker, coordinating data flow between Walmart’s API gateway and Odoo’s ORM layer. This architecture supports bidirectional synchronization for critical commerce operations.

Authentication and Service Discovery

Walmart Marketplace employs OAuth 2.0 client credentials grant flow for API access. Your integration must obtain and refresh access tokens every 60 minutes. The system stores these tokens in Odoo’s encrypted keychain with automatic renewal 5 minutes before expiration. Service discovery occurs through Walmart’s environment endpoints, which differ between staging and production. The integration tests connectivity during initial setup and maintains persistent sessions for optimal performance.

Core Data Flow Patterns

Inventory updates follow a push model from Odoo to Walmart Marketplace. Odoo’s stock.quant model triggers webhook events that transform inventory data into Walmart’s Item API specifications. The system batches these updates every 15 minutes to optimize API rate limit usage. Order synchronization uses a pull model, where the integration queries Walmart’s Orders API every 10 minutes for new orders. It converts these orders into Odoo sale.order records with complete line item mapping.

Error Handling and Retry Logic

The architecture implements a dead letter queue for failed API calls. Each failed request enters a retry cycle with exponential backoff, starting at 30 seconds and extending to 24 hours. Critical failures like authentication errors trigger immediate alerts through Odoo’s notification system. The integration logs all synchronization attempts with detailed request/response payloads for audit purposes. This ensures data consistency across both platforms despite temporary network issues.

Data Transformation Layer

A dedicated transformation engine converts data between Walmart’s JSON schema and Odoo’s XML-RPC structure. This layer handles currency formatting, measurement unit conversion, and tax calculation differences. The transformer applies business rules like minimum advertised price (MAP) compliance and category-specific attribute mapping. It also enforces data validation rules before committing records to either system, preventing synchronization of corrupt data.

Step-by-Step Configuration

Begin with Walmart Developer Portal registration at developer.walmart.com. Create a new application with “Marketplace Supplier” privileges. Generate your client ID and client secret, which serve as permanent credentials for API access. Configure redirect URIs that point to your Odoo instance’s authentication callback endpoint. Download your private key pair for signing JWT tokens, which Walmart requires for specific high-security operations.

Odoo Module Installation and Dependencies

Install the Walmart Connector module from Odoo’s app store. This automatically installs dependency modules including connector_importer, base_rest, and queue_job. Enable developer mode in Odoo to access technical menus required for configuration. Navigate to Settings > Technical > Connectors > Backends and create a new Walmart backend. Enter your base API URL, which differs between staging (https://marketplace.stage.walmartapis.com/v3/) and production (https://marketplace.walmartapis.com/v3/).

Authentication Configuration

Create a new authentication record in Odoo’s auth configuration menu. Select “OAuth 2.0 Client Credentials” as the authentication method. Paste your client ID and client secret from the Walmart Developer Portal. Configure the token endpoint as https://marketplace.walmartapis.com/v3/token. Set the scope parameter to “supplier”. Test the connection using the “Verify Credentials” button, which should return a 200 OK response with your access token.

API Endpoint Configuration

Configure each Walmart API endpoint as a separate connector component. Create components for Items, Inventory, Orders, and Returns with their respective API paths. Set appropriate rate limits for each endpoint: 5 calls per second for Items, 10 for Inventory, 15 for Orders. Define the pagination parameters for each endpoint, as Walmart uses cursor-based pagination with 200-record limits per request. Enable webhook support for real-time inventory updates from Odoo to Walmart.

Data Model Mapping Setup

Map Odoo’s product.template model to Walmart’s Item schema. Create field mappings for SKU, GTIN, product name, description, and main image URL. Configure category mapping between Odoo’s product.category and Walmart’s taxonomy API categories. Set up inventory synchronization between Odoo’s stock.quant and Walmart’s Inventory API. Define order status mapping between Odoo’s sale.order states and Walmart’s order lifecycle statuses.

Code Example: OAuth 2.0 Token Generation

import requests
import base64

def get_walmart_token(client_id, client_secret):
    auth_string = f"{client_id}:{client_secret}"
    auth_bytes = auth_string.encode('ascii')
    auth_b64 = base64.b64encode(auth_bytes).decode('ascii')
    
    headers = {
        'Authorization': f'Basic {auth_b64}',
        'Content-Type': 'application/x-www-form-urlencoded',
        'Accept': 'application/json'
    }
    
    data = {
        'grant_type': 'client_credentials',
        'scope': 'supplier'
    }
    
    response = requests.post(
        'https://marketplace.walmartapis.com/v3/token',
        headers=headers,
        data=data
    )
    
    if response.status_code == 200:
        return response.json()['access_token']
    else:
        raise Exception(f"Authentication failed: {response.text}")

Code Example: Inventory Update Batch Processing

from odoo import models, fields, api

class WalmartInventoryBatch(models.Model):
    _name = 'walmart.inventory.batch'
    
    @api.model
    def process_inventory_updates(self, batch_size=100):
        """Process inventory updates in batches to respect rate limits"""
        products = self.env['product.product'].search([
            ('walmart_sync', '=', True),
            ('inventory_updated', '=', True)
        ], limit=batch_size)
        
        inventory_data = []
        for product in products:
            inventory_data.append({
                'sku': product.default_code,
                'quantity': {
                    'unit': 'EACH',
                    'amount': str(int(product.qty_available))
                }
            })
            product.inventory_updated = False
        
        if inventory_data:
            access_token = self.env['walmart.auth'].get_access_token()
            headers = {
                'Authorization': f'Bearer {access_token}',
                'Content-Type': 'application/json',
                'Accept': 'application/json'
            }
            
            response = requests.post(
                'https://marketplace.walmartapis.com/v3/inventory',
                headers=headers,
                json={'inventory': inventory_data}
            )
            
            if response.status_code == 200:
                self.env['walmart.sync.log'].create({
                    'operation': 'inventory_update',
                    'records_processed': len(inventory_data),
                    'status': 'success'
                })
            else:
                # Implement retry logic with exponential backoff
                self._handle_failed_inventory_update(inventory_data, response.text)

Common Configuration Pitfalls

Many implementations fail due to incorrect timezone configuration. Walmart expects all timestamps in UTC, while Odoo uses the company’s local timezone. Set Odoo’s timezone to UTC during integration setup. Another common issue involves category mapping - Walmart requires specific category codes from their taxonomy API, not free-form category names. Always validate category codes using Walmart’s Category API before mapping. SSL certificate verification failures often occur in staging environments - configure proper certificate bundles for production deployments.

Data Mapping and Transformation

Walmart’s product schema demands precise field mapping to Odoo’s more flexible product structure. Map Walmart’s SKU field to Odoo’s product.default_code, which serves as the primary identifier. Transform Walmart’s productName to Odoo’s product.template name field with a 150-character limit enforcement. Handle Walmart’s rich HTML description by mapping to Odoo’s product.description field while stripping unsupported HTML tags. Convert Walmart’s image URLs to Odoo’s product.image model with automatic download and optimization.

Inventory and Pricing Transformations

Walmart’s inventory API expects quantity as whole numbers in EACH units, while Odoo supports decimal quantities. Implement rounding logic that converts Odoo’s float quantities to integers for Walmart. For pricing, Walmart requires MAP compliance checks before sending price updates. Transform Odoo’s product.list_price to Walmart’s price.amount with currency conversion if needed. Handle Walmart’s two-step price validation that requires separate approval for significant price changes.

Order Data Transformation

Convert Walmart’s order JSON to Odoo’s sale.order model with complex line item mapping. Transform Walmart’s orderLine.quantity to Odoo’s sale.order.line product_uom_qty. Map Walmart’s shipping address to Odoo’s partner shipping address fields, handling USPS standardization rules. Convert Walmart’s order date from ISO 8601 format to Odoo’s datetime format with UTC timezone adjustment. Transform Walmart’s order status to Odoo’s order stages: “Acknowledged” becomes “Quotation”, “Shipped” becomes “Done”.

Customer Data Handling

Walmart provides limited customer information due to privacy policies. Map Walmart’s buyerInfo.email to Odoo’s res.partner email field when available. Create anonymous customer records for orders without email addresses using Walmart’s orderId as identifier. Transform Walmart’s shipping phone numbers to Odoo’s standard E.164 format. Handle address line concatenation since Walmart splits address lines while Odoo uses a single address field.

Tax and Currency Conversions

Walmart provides detailed tax breakdowns that Odoo must reconcile with its tax structure. Map Walmart’s tax amount to Odoo’s account.tax model, creating separate tax lines for state, county, and city taxes. Transform Walmart’s currency amounts from string format to Odoo’s float values with proper decimal handling. Implement currency conversion for international orders using Odoo’s built-in exchange rate system. Handle Walmart’s tax exemption cases by creating zero-rated tax positions in Odoo.

Custom Attribute Mapping

Walmart’s variant attributes require special transformation to Odoo’s product.attribute system. Map Walmart’s “color” attribute to Odoo’s corresponding attribute with value normalization. Transform Walmart’s size variations to Odoo’s product templates with proper attribute value mapping. Handle Walmart’s specific required attributes like “isProp65WarningRequired” by creating custom fields in Odoo. Convert Walmart’s measurement attributes from imperial to metric units for international consistency.

Error Handling and Resilience

Walmart’s API returns specific error codes that demand tailored handling strategies. The 4000 series errors indicate authentication failures - refresh the access token and retry immediately. The 5000 series errors represent system issues - implement exponential backoff with maximum 5 retry attempts. The 6000 series errors signify business rule violations - log these errors for manual review without automatic retry. Create custom Odoo exceptions for each Walmart error category with appropriate recovery procedures.

Inventory Synchronization Errors

Inventory update failures often stem from quantity format mismatches. Walmart rejects decimal quantities - implement integer conversion with floor rounding. SKU not found errors occur when products exist in Odoo but not in Walmart - create automated product creation workflows. Inventory limit errors happen when quantities exceed Walmart’s maximum allowed - implement quantity capping at 999 units. Handle concurrent modification errors with version checking and conditional updates.

Order Processing Failures

Order acknowledgment failures typically involve invalid shipping method mapping. Create a validation routine that checks shipping method compatibility before order import. Payment authorization failures require immediate order cancellation in both systems - implement two-phase cancellation with rollback. Address validation errors demand address normalization using USPS address verification APIs before order processing. Duplicate order prevention requires checksum validation on order payloads with duplicate detection.

Data Validation and Corruption Prevention

Implement pre-synchronization validation that checks data integrity before API submission. Validate product images meet Walmart’s requirements: JPEG format, minimum 1000x1000 pixels, RGB color space. Check product descriptions for prohibited content like competitor references or pricing information. Validate GTIN/UPC codes using check digit algorithms before synchronization. Implement data sanitization that removes special characters from product titles that Walmart’s system rejects.

Recovery Procedures and Data Reconciliation

Schedule daily reconciliation jobs that compare Odoo and Walmart data for discrepancies. Create automated correction workflows for inventory differences exceeding 10 units. Implement order status synchronization that resolves state mismatches between systems. Develop manual intervention protocols for persistent synchronization failures with alert escalation. Maintain detailed audit logs that track every data modification with before/after values for forensic analysis.

Testing and Validation

Create a comprehensive test suite that validates every integration component before production deployment. Begin with unit tests that verify data transformation logic with edge cases. Progress to integration tests that validate API connectivity with Walmart’s sandbox environment. Conduct end-to-end tests that simulate complete order lifecycle from placement to fulfillment. Perform load tests that verify system behavior under high-volume conditions with 10,000+ product SKUs.

Sandbox Environment Configuration

Configure Walmart’s sandbox environment (https://sandbox.walmartapis.com) as your primary testing platform. Create test products with specific SKU patterns that identify them as test data. Generate test orders using Walmart’s Order Simulation API to avoid manual order placement. Set up separate Odoo database for testing that mirrors your production configuration. Implement data isolation that prevents test data from leaking into production environments.

Data Synchronization Validation

Develop validation scripts that compare record counts between Odoo and Walmart after each synchronization cycle. Verify inventory level consistency by creating test products and monitoring synchronization accuracy. Validate order import completeness by comparing Walmart order counts with Odoo sale.order records. Test product creation workflows by pushing new products from Odoo to Walmart and verifying publication status. Conduct price synchronization tests with various currency and rounding scenarios.

Error Scenario Testing

Simulate network failures during API calls to verify retry mechanism effectiveness. Test rate limit handling by exceeding API quotas and observing backoff behavior. Create invalid data scenarios like malformed SKUs or oversized product descriptions to validate error handling. Simulate Walmart system outages by mocking 5xx HTTP responses and verifying graceful degradation. Test authentication token expiration and renewal during long-running synchronization jobs.

Performance Benchmarking

Establish performance baselines for critical operations: product sync should complete within 2 minutes per 1000 products. Order import should process 100 orders in under 5 minutes. Inventory updates should synchronize within 15 minutes of stock level changes. Measure API response times and set alerts for performance degradation. Conduct stress tests with concurrent users to identify resource contention and database locking issues.

Security Considerations

Walmart’s API security model demands strict adherence to their authentication protocols. Implement secure storage for client credentials using Odoo’s encrypted configuration storage. Never log sensitive data like access tokens or customer information to plain text files. Rotate API credentials every 90 days following Walmart’s security guidelines. Use HTTPS with TLS 1.2+ for all API communications, disabling older protocol versions.

Data Protection and Privacy

Anonymize customer data in test environments by implementing data masking routines. Encrypt personally identifiable information (PII) at rest using Odoo’s built-in encryption fields. Implement access controls that restrict Walmart integration configuration to authorized administrators only. Create audit trails that track who accesses customer order data with timestamped records. Comply with GDPR and CCPA requirements by implementing data deletion workflows for customer information.

API Security Best Practices

Validate all incoming data from Walmart against strict schemas to prevent injection attacks. Implement request signing for critical operations using Walmart’s private key requirements. Use separate API credentials for staging and production environments with appropriate access restrictions. Monitor API usage patterns for anomalies that indicate credential compromise. Implement IP whitelisting for production API calls if your infrastructure supports static IP addresses.

System Hardening

Secure the Odoo server hosting the Walmart integration with regular security patches. Implement network segmentation that isolates the integration layer from public-facing systems. Use database encryption for Odoo’s PostgreSQL backend to protect sensitive business data. Configure regular security scans that detect vulnerabilities in custom integration code. Establish incident response procedures for security breaches involving API credential exposure.

Performance Optimization

Walmart’s API rate limits demand careful request management to maximize throughput. Implement request batching that groups similar operations into single API calls. Use Walmart’s bulk operations for inventory updates, processing up to 200 items per request. Schedule non-critical operations during off-peak hours to reserve capacity for time-sensitive tasks. Implement request queuing with priority levels that ensure order processing takes precedence over product updates.

Database Optimization Techniques

Optimize Odoo’s PostgreSQL database with appropriate indexes on Walmart-related fields. Create partial indexes on walmart_sync and inventory_updated fields to speed up synchronization queries. Implement database connection pooling to reduce connection overhead during high-volume operations. Use Odoo’s built-in query optimization tools to identify and fix slow-performing data retrieval operations. Schedule regular database maintenance tasks like VACUUM and ANALYZE during low-activity periods.

Caching Strategies

Implement Redis caching for Walmart’s category taxonomy to avoid repeated API calls. Cache product information that changes infrequently, like product attributes and category mappings. Use Odoo’s ORM cache effectively by preloading related data in batch operations. Implement HTTP response caching for Walmart’s static resources like product images. Create cache invalidation strategies that ensure data consistency while maximizing cache hit rates.

Monitoring and Metrics

Implement comprehensive monitoring that tracks synchronization latency and success rates. Set up alerts for synchronization delays exceeding 30 minutes or error rates above 5%. Monitor API rate limit usage and create predictive alerts for approaching quotas. Track system resource utilization during synchronization operations to identify bottlenecks. Create performance dashboards that display key metrics like orders processed per hour and inventory sync completion times.