Sales Track Live API Docs

Get Orders

Retrieve all orders for the authenticated admin.

GET/api/integrations/crm/orders

How to Integrate at Your Website

Step-by-step guide to integrate order management data into your CRM or website

1. Get Your API Keys

Contact us to get your API key and secret key for accessing order data

2. Use Our Pre-built Components

Download our ready-to-use UI components from the UI Components page - just copy and paste!

3. Connect to Your System

Add the API integration code to your website or CRM system using the examples in the right sidebar

4. Display Data

Your website will now show live order data from our system automatically

What You Get

  • Complete order information with item details and pricing
  • Payment status and method tracking
  • Store and merchandiser information for each order
  • Order status tracking (pending, completed, cancelled)
  • Discount and credit management data
  • Ready-to-use UI components and code examples

Code Examples

GET /api/integrations/crm/orders
const apiKey = 'your_api_key_here';
const secretKey = 'your_secret_key_here';

async function getOrders() {
  const response = await fetch('/api/integrations/crm/orders?limit=20&status=completed', {
    method: 'GET',
    headers: {
      'X-API-Key': apiKey,
      'X-Secret-Key': secretKey,
      'Content-Type': 'application/json'
    }
  });

  if (!response.ok) {
    throw new Error(`HTTP error! status: ${response.status}`);
  }

  const data = await response.json();
  console.log(data.data.orders);
}

getOrders().catch(console.error);

Response Examples

{
  "success": true,
  "data": {
    "orders": [
      {
        "id": "123",
        "visit_id": "visit_456",
        "store_id": "store_789",
        "merchandiser_id": "merch_101",
        "total_amount": 1500.00,
        "order_items": [
          {
            "product_name": "Product A",
            "quantity": 2,
            "price": 750.00
          }
        ],
        "status": "completed",
        "payment_method": "cash",
        "payment_status": "paid",
        "paid_amount": 1500.00,
        "discount": 0.00,
        "order_date": "2024-12-15T10:30:00Z",
        "stores": {
          "id": "store_789",
          "name": "SuperMart Store",
          "address": "123 Main St, City, State"
        },
        "profiles": {
          "id": "merch_101",
          "fullname": "John Manager",
          "email": "john@example.com"
        }
      }
    ],
    "pagination": {
      "total": 45,
      "limit": 20,
      "offset": 0,
      "has_more": true
    }
  }
}

Need Help?