Redtab Logo
Crossover POS Integration
Integration guide for Crossover POS systems

Overview

The RedTab Credit Rating System can use sales data from Crossover POS to enhance credit assessments. This integration works in two ways:

  1. Merchant ID Reference: Merchants can provide their Crossover POS Merchant ID during the credit assessment process
  2. Automated Data Sync: Crossover POS can push sales data to the RedTab API

API Endpoints

1. Submit POS Data

Endpoint: POST /api/pos-data

This endpoint allows Crossover POS to submit merchant sales data to the RedTab system.

Request Format

{
  "merchantId": "MERCH123456",
  "dailySales": 15000,
  "monthlySales": 450000,
  "customerCount": 120,
  "averageTicketSize": 1250,
  "repeatCustomerRate": 0.35,
  "topSellingItems": ["Chicken Momo", "Chowmein", "Thukpa"],
  "salesTrend": "growing"
}

Required Fields

FieldTypeDescription
merchantIdstringUnique Crossover POS merchant identifier
dailySalesnumberAverage daily sales amount in NPR
monthlySalesnumberTotal monthly sales amount in NPR
customerCountnumberAverage number of daily customers
averageTicketSizenumberAverage transaction amount in NPR

Optional Fields

FieldTypeDescription
repeatCustomerRatenumberPercentage (0-1) of repeat customers
topSellingItemsarrayList of top selling menu items
salesTrendstringOne of: "growing", "stable", "declining"

Response Format

{
  "success": true,
  "message": "POS data saved successfully",
  "data": {
    "merchantId": "MERCH123456",
    "dailySales": 15000,
    "monthlySales": 450000,
    "customerCount": 120,
    "averageTicketSize": 1250,
    "repeatCustomerRate": 0.35,
    "topSellingItems": ["Chicken Momo", "Chowmein", "Thukpa"],
    "salesTrend": "growing",
    "timestamp": "2023-06-15T08:30:45.123Z"
  }
}

2. Retrieve POS Data

Endpoint: GET /api/pos-data?merchantId=MERCH123456

This endpoint allows retrieving the latest POS data for a specific merchant.

Query Parameters

ParameterDescription
merchantIdRequired. The Crossover POS merchant ID

Response Format

{
  "success": true,
  "data": {
    "merchantId": "MERCH123456",
    "dailySales": 15000,
    "monthlySales": 450000,
    "customerCount": 120,
    "averageTicketSize": 1250,
    "repeatCustomerRate": 0.35,
    "topSellingItems": ["Chicken Momo", "Chowmein", "Thukpa"],
    "salesTrend": "growing",
    "timestamp": "2023-06-15T08:30:45.123Z"
  }
}

Integration Methods

Method 1: Scheduled Data Sync

We recommend implementing a scheduled job that runs daily to sync merchant data:

  1. For each merchant in your system, collect the relevant sales metrics
  2. Format the data according to the API specification
  3. Submit the data to the RedTab API endpoint
  4. Log the response for verification

Method 2: Real-time Updates

For more timely data, you can implement real-time updates:

  1. Set up a trigger in your system for significant sales events (e.g., day closing)
  2. When triggered, collect the updated metrics
  3. Submit the data to the RedTab API endpoint

Method 3: Batch Updates

For efficiency with many merchants:

  1. Collect data for multiple merchants
  2. Submit individual API requests for each merchant
  3. Process in batches to avoid rate limiting

Authentication

Currently, the API uses IP-based restrictions. Your system's IP addresses must be whitelisted to access the API. Contact RedTab support to have your IPs added to the allowlist.

Future versions will implement token-based authentication.

Example Implementation

Node.js Example

const axios = require('axios');

async function submitPOSData(merchantData) {
  try {
    const response = await axios.post('https://api.redtab.xyz/api/pos-data', merchantData);
    console.log('Data submitted successfully:', response.data);
    return response.data;
  } catch (error) {
    console.error('Error submitting POS data:', error.response?.data || error.message);
    throw error;
  }
}

// Example usage
const merchantData = {
  merchantId: "MERCH123456",
  dailySales: 15000,
  monthlySales: 450000,
  customerCount: 120,
  averageTicketSize: 1250,
  repeatCustomerRate: 0.35,
  topSellingItems: ["Chicken Momo", "Chowmein", "Thukpa"],
  salesTrend: "growing"
};

submitPOSData(merchantData);

Python Example

import requests
import json

def submit_pos_data(merchant_data):
    try:
        response = requests.post('https://api.redtab.xyz/api/pos-data', json=merchant_data)
        response.raise_for_status()
        print('Data submitted successfully:', response.json())
        return response.json()
    except requests.exceptions.RequestException as e:
        print('Error submitting POS data:', e)
        raise

# Example usage
merchant_data = {
    "merchantId": "MERCH123456",
    "dailySales": 15000,
    "monthlySales": 450000,
    "customerCount": 120,
    "averageTicketSize": 1250,
    "repeatCustomerRate": 0.35,
    "topSellingItems": ["Chicken Momo", "Chowmein", "Thukpa"],
    "salesTrend": "growing"
}

submit_pos_data(merchant_data)

Testing

You can test the integration using our sandbox environment:

  • Sandbox URL: https://sandbox-api.redtab.xyz/api/pos-data
  • Test Merchant IDs: TEST001, TEST002, TEST003

Support

For integration support, please contact:

  • Email: integration-support@redtab.xyz
  • Phone: +977-1-XXXXXXX

Changelog

  • v1.0.0 (2023-06-01): Initial API release
  • v1.0.1 (2023-06-15): Added optional fields for enhanced data