Understanding Transaction Sync
Transaction sync records completed sales in Kintsugi. Each transaction represents a completed sale with:- Transaction details (date, amount, currency, status)
- Line items referencing products
- Customer and address information
- Tax amounts (if calculated at checkout)
- Determine economic nexus by tracking sales volume and transaction counts
- Prepare tax filings by aggregating transactions by jurisdiction
- Maintain audit trails for compliance purposes
- Track refund status and credit notes
Transaction sync is separate from tax calculation: The
/v1/transactions endpoint creates records but doesn’t calculate tax. If you need tax amounts, calculate them using /v1/tax/estimate before syncing, or include tax amounts in your transaction data.When to Sync Transactions
Sync transactions after sales are completed and payment is confirmed. The exact timing depends on your business model and compliance requirements.Real-Time Sync
Sync transactions immediately after order completion for:- E-commerce platforms with high transaction volumes
- Systems requiring immediate compliance tracking
- Businesses with real-time reporting needs
Batch Sync
Sync transactions in batches for:- Accounting system integrations
- Systems with periodic order exports
- Platforms syncing daily or weekly
Transaction Statuses
Transactions use status fields to indicate their state in your system and Kintsugi’s processing pipeline.Primary Status
Thestatus field indicates the transaction’s current state:
PENDING: Transaction is created but not yet finalized (payment pending, order not confirmed)COMMITTED: Transaction is finalized and should be included in compliance calculationsCANCELLED: Transaction was cancelled and should not be included in compliance calculations
Transaction Workflow
Creating Transactions
Create transactions usingPOST /v1/transactions. Each transaction requires:
Required Fields
external_id: Your unique identifier for this transaction (e.g., “TXN-2025-001”)date: Transaction date (ISO 8601 format)status: Transaction status (“PENDING” or “COMMITTED”)currency: Currency code (e.g., “USD”)total_amount: Total transaction amounttransaction_items: Array of line items with product referencesaddresses: At least one address (billing or shipping)
Transaction Items
Each transaction item references a product and includes:external_id: Unique identifier for this line itemexternal_product_id: Reference to product created in Kintsugiquantity: Item quantityamount: Line item amount (subtotal for this item)date: Item date (usually matches transaction date)
Addresses
Transactions require at least one address. Include:type: “BILLING” or “SHIP_TO”street_1,city,state,postal_code,country: Address components
SHIP_TO address determines the tax jurisdiction. If no SHIP_TO address is provided, Kintsugi uses the BILLING address.
Historical Transaction Sync
For transaction sync integrations, you must sync historical transactions from the previous full calendar year. This one-time bulk operation establishes your baseline for nexus tracking.Historical Data Requirements
Sync transactions covering:- Start date: January 1st of the previous calendar year
- End date: Today (or your integration start date)
- Status: All completed sales, regardless of when they occurred
What if I don't have complete historical data?
What if I don't have complete historical data?
Sync whatever historical data you have available. Kintsugi will track nexus going forward using the data you provide. You may need to manually set registration effective dates if you can’t provide complete historical records. Contact support to discuss your specific situation.
Should I sync cancelled or refunded transactions?
Should I sync cancelled or refunded transactions?
Yes, sync all transactions including cancelled and refunded ones. Use the transaction status field to indicate cancelled transactions, and create separate credit note transactions for refunds. This maintains a complete audit trail.
How do I handle large historical imports?
How do I handle large historical imports?
Process historical transactions in batches of 50-100 transactions per API call. Use pagination or date ranges to chunk your data. Kintsugi processes transactions asynchronously, so you can import large volumes without timing out.
Bulk Import Strategy
For large historical imports:- Chunk by date range: Process transactions month by month or week by week
- Batch API calls: Send 50-100 transactions per API call
- Handle errors gracefully: Track failed transactions and retry after fixing data issues
- Verify completion: Use
GET /v1/transactionsto verify transactions were created
Verifying Transactions
After creating transactions, verify they exist usingGET /v1/transactions. This endpoint supports:
- Filtering by date range to find specific periods
- Filtering by external_id to find specific transactions
- Pagination to browse all transactions
- Status filtering to find pending vs committed transactions
GET /v1/transactions/{transaction_id} to retrieve a specific transaction by its Kintsugi transaction ID, or GET /v1/transactions/external/{external_id} to find a transaction by your external ID.
Updating Transactions
Update transactions usingPUT /v1/transactions/{transaction_id}. Common update scenarios include:
- Status changes: Update status from PENDING to COMMITTED after payment confirmation
- Address corrections: Fix invalid or incomplete addresses
- Amount adjustments: Correct transaction amounts or line items
Transaction Status Workflow
Transactions often start as PENDING and transition to COMMITTED after payment confirmation.Initial Creation
Create transactions withstatus: "PENDING" when:
- Orders are created but payment isn’t confirmed
- You want to reserve the external_id
- You’re syncing orders before payment processing
Status Update
Update transactions tostatus: "COMMITTED" when:
- Payment is confirmed
- Order is finalized
- Sale is complete
PUT /v1/transactions/{transaction_id} with the new status.
Cancellation
Set transactions tostatus: "CANCELLED" when:
- Orders are cancelled before completion
- Payment fails and order won’t be retried
- Sales are voided
Best Practices
Follow these practices for reliable transaction syncing:Data Quality
- Use consistent external IDs: Use the same external_id format across all systems
- Validate before syncing: Check that products exist and addresses are valid before creating transactions
- Include complete data: Provide all required fields to avoid processing delays
- Handle timezones correctly: Use ISO 8601 format with timezone information for transaction dates
Sync Timing
- Sync after payment confirmation: Only sync COMMITTED transactions for compliance tracking
- Sync in chronological order: Process historical transactions oldest first
- Handle duplicates: Check for existing transactions before creating to avoid duplicate external_id errors
- Monitor sync status: Track sync success rates and handle failures appropriately
Error Handling
Common errors when syncing transactions:- Product not found: Ensure products exist before referencing them in transactions
- Duplicate external_id: Check if transaction already exists before creating
- Invalid address: Validate addresses before syncing transactions
- Missing required fields: Review API documentation for all required fields
Integration Patterns
Different systems require different transaction sync patterns.E-Commerce Platforms
E-commerce platforms typically sync transactions immediately after order completion:- Order is placed and payment confirmed
- Create transaction with
status: "COMMITTED" - Include all line items with product references
- Include shipping address for tax jurisdiction determination
Subscription Platforms
Subscription platforms sync transactions per billing cycle:- Subscription invoice is generated
- Create transaction when invoice is paid
- Reference subscription product and customer
- Include billing address
Accounting Systems
Accounting systems sync transactions in batches:- Export completed invoices/sales from accounting system
- Batch create transactions with
status: "COMMITTED" - Process in date order (oldest first)
- Handle any errors and retry failed transactions
Transaction Lifecycle
Understanding the transaction lifecycle helps you sync at the right times:Next Steps
With transaction syncing set up:- Handle refunds: Learn how to create credit notes for refunds. See the Handling Refund Transactions guide for details.
- Query transactions: Use GET endpoints to retrieve transactions for reporting and verification. See the Get Transactions API reference.
- Monitor sync status: Set up monitoring to track transaction sync success rates and identify issues.