Skip to main content

Order Settlements Quickstart Guide

Table of Contents

  1. Introduction
  2. Core Concepts
  3. Setting Up Your Environment
  4. StateSet API Integration
  5. TikTok Shop Integration
  6. Amazon Integration
  7. Shopify Integration
  8. Consolidating Settlement Data
  9. Reporting and Analytics
  10. Automated Reconciliation
  11. Error Handling and Logging
  12. Best Practices and Optimization

Introduction

This guide demonstrates how to use StateSet’s API to manage order settlements across multiple e-commerce platforms: TikTok Shop, Amazon, Shopify, and StateSet’s own system. By following this guide, you’ll learn how to consolidate settlement data, process it efficiently, and gain insights into your multi-channel e-commerce operations.

Core Concepts

Before diving into the implementation, let’s review some core concepts related to order settlements:
  • Settlement: A financial report that summarizes transactions over a specific period, including order revenue, fees, refunds, and adjustments.
  • Payout: The actual transfer of funds from the e-commerce platform to the seller’s bank account.
  • Reconciliation: The process of matching settlement data with actual received payments and internal order records.
  • Fees: Charges applied by e-commerce platforms for their services (e.g., referral fees, fulfillment fees).
  • Adjustments: Corrections or changes to settlement amounts due to various factors (e.g., customer claims, charge backs).

Setting Up Your Environment

  1. Sign up for StateSet at StateSet.com/sign-up
  2. Generate an API key in the StateSet Cloud Console
  3. Install the StateSet Node.js SDK:
  1. Set up environment variables:
  1. Initialize the StateSet client:

StateSet API Integration

First, let’s set up the core functionality using StateSet’s API:

TikTok Shop Integration

Now, let’s integrate TikTok Shop settlements:

Amazon Integration

Integrate Amazon Seller Central settlements:

Shopify Integration

Integrate Shopify settlements:

Consolidating Settlement Data

Now that we have integrations for each platform, let’s create a function to consolidate all settlement data:

Reporting and Analytics

Create summary reports and analytics based on the consolidated data:

Automated Reconciliation

Implement an automated reconciliation process to match settlements with internal order data:

Error Handling and Logging

Implement robust error handling and logging: