π§ Overview
The Commerce Data APIs allow you to populate Loopβs ecosystem with commerce data from any sourceβyour commerce platform, ERP, OMS, middleware, or custom systems. These APIs are intended for custom integrations where Loop doesnβt have a prebuilt app for your commerce platform; if youβre using a platform with native Loop integration, commerce data is synced automatically. By syncing products, orders, customers, locations, inventory, and collections into Loop, you enable Loop to validate return eligibility, power exchange workflows, and maintain accurate records across your systems.π¦ API Reference
The Commerce Data APIs are organized into six main domains. Each API follows a consistent pattern with support for Create, List, Get, Update, Upsert, and Delete operations.ποΈ Products API
The Products API provides Loop with standardized product data from any eCommerce system, ensuring accurate return processing and exchange matching.- Product Metadata β Unique product IDs, SKUs, names, descriptions, and vendor details
- Pricing & Classification β Price, product type, collections, and tags
- Identifiers β Barcodes and external references for cross-platform tracking
- Variants & Options β Attributes like colors, sizes, and associated variants
- Media & Assets β Product images for return experience consistency
ID Mapping RequirementWhen syncing products, your middleware must store the returned
loop_product_id mapped to your platformβs external_id. Youβll reference these Loop IDs when creating orders.
Product Variants are managed as sub-resources of products:
π Orders API
The Orders API provides a comprehensive view of transactional data from any eCommerce system, ensuring Loop has the necessary context to facilitate seamless return and exchange processing.- Order Metadata β Unique order identifiers, status, and associated sales channels
- Customer Information β Buyer details, including contact information and external references
- Financial Details β Total price, applied discounts, tax calculations, and refund history
- Shipping & Fulfillment β Shipping addresses, carrier details, fulfillment statuses, and tracking numbers
- Line Items & Adjustments β Purchased products, pricing, applied discounts, duties, and refund eligibility
Prerequisite: Products must exist in Loop before syncing orders. Order line items should reference Loop Product IDs (from your ID mapping) rather than external IDs for accurate return processing.
Key Order Fields:
line_itemsβ Array of purchased items, each referencing a product/variantfulfillmentsβ Fulfillment data including status, tracking, and fulfilled line itemsrefundsβ Refund data for reconciliationshipping_address/billing_addressβ Customer address information
π€ Customers API
The Customers API stores essential customer data to support return validation and exchange processing across platforms.- Customer Identity β Unique customer IDs, external references, and contact details
- Order & Return Context β Flexible tags for purchase history, return status, and customer segmentation
- Channel Association β Identifies where the customer was created or last interacted
Key Customer Fields:
first_name/last_nameβ Customer nameemailβ Email addressphoneβ Phone numbertagsβ Array of tags for customer segmentation
π Locations API
The Locations API provides Loop with a standardized view of return and fulfillment locations, ensuring accurate routing and inventory management.- Location Metadata β Unique location IDs, external references, and status
- Physical Address β Warehouse or store details, including company name and full address
- Channel Association β Identifies where the location is sourced from
Key Location Fields:
nameβ Location name (e.g., βMain Warehouseβ)statusβactiveorinactiveaddressβ Full address object with address1, city, region, postal_code, country_code
π Inventories API
The Inventories API provides real-time visibility into stock levels across locations, ensuring accurate return processing and exchange fulfillment.- Stock Availability β Tracks available inventory counts for product variants
- Product Details β SKU, barcode, name, and weight for precise identification
- Location Association β Links inventory to specific warehouses or return locations
Inventory records are keyed by the combination of
productVariantId and locationId. Both Products and Locations must exist in Loop before creating inventory records.
Key Inventory Fields:
available_countβ Number of units available at the specified location
π·οΈ Collections API
The Collections API organizes products into logical groupings, helping Loop maintain structured catalog data for returns and exchanges.- Collection Metadata β Unique collection IDs, external references, and names
- Associated Products β SKUs, names, and external references for grouped items
- Channel Association β Identifies where the collection data originates
π€ Bulk Operations API
The Bulk Operations API lets you submit large batches of Create, Update, Upsert, and Delete operations across Orders, Products, Product Variants, Collections, and Inventory in a single request, instead of making individual calls for each record.- Batch Processing β Submit a single JSONL file where each line is an independent job (
type,parameters,payload) - Cross-Resource Support β Works across Orders, Products, Product Variants, Collections, and Inventory using the same job payloads as their individual endpoints
- Async Execution & Status Tracking β Jobs run asynchronously; poll the bulk operation or its jobs list for pending, successful, and failed counts
Bulk operation files are JSONL (one JSON object per line,
\n-separated) and limited to 2 MB. Each lineβs payload matches the request body of the equivalent single-resource endpoint above (e.g. a product_update job payload matches Update Product).
Supported Job Types:
- Orders β
order_create,order_update,order_upsert,order_delete - Products β
product_create,product_update,product_upsert,product_delete - Product Variants β
product_variant_create,product_variant_update,product_variant_upsert,product_variant_delete - Collections β
collection_create,collection_update,collection_upsert,collection_delete - Inventory β
inventory_upsert,inventory_delete
β οΈ Technical Considerations
When integrating with the Commerce Data APIs, keep these critical implementation details in mind:π Common Sync Patterns
ποΈ Initial Data Sync (Historical Backfill)
When onboarding, youβll typically sync data in this order:1
Sync Products & Variants
Push your entire product catalog. Store the returned Loop IDs for each product/variant.
2
Sync Customers
Push customer records from your platform. (Note: Customers can also be created via the Orders API.)
3
Sync Orders
Push historical orders, referencing Loop Product IDs in line items.
4
Sync Locations (Exchanges Only)
Create location records for warehouses and fulfillment centers. Required if offering exchanges.
5
Sync Inventory (Exchanges Only)
Push stock levels per variant and location. Required if offering exchanges.
6
Sync Collections (Optional)
Create collections and attach products. Useful for defining advanced exchange rules.
β‘ Real-Time Sync
For ongoing operations, set up event-driven syncs to keep Loop updated:- New Orders β Push to Loop when an order is placed
- Product Updates β Sync when products are created, updated, or discontinued
- Inventory Changes β Update stock levels after sales, returns, or restocks
- Order Status Changes β Update fulfillment status, refunds, and cancellations