πŸš€Getting Started

Quick guide to start using the API

Estimated time: 10 minutes


Prerequisites

  • Replenit account (Request invitation email from your Customer Success Manager)

  • Your Tenant ID and API Key from Panel β†’ Settings β†’ API


Step 1: Make Your First API Call

Choose your preferred programming language:

chevron-rightπŸ”§ cURL (Terminal)hashtag
# Replace YOUR_TENANT_ID and YOUR_API_KEY
curl -X POST "https://api.replen.it/customers/YOUR_TENANT_ID" \
  -H "Content-Type: application/json" \
  -H "x-replenit-auth-key: YOUR_API_KEY" \
  -d '[{
    "CustomerId": "test-001",
    "Email": "test@example.com",
    "Name": "Test",
    "Surname": "User",
    "EmailOptin": true,
    "GdprOptin": true
  }]'

Expected output:

{
  "success": true,
  "message": "Customers saved.",
  "data": {
    "count": 1,
    "processedAt": "2025-12-22T15:00:00Z"
  }
}
chevron-right🐍 Pythonhashtag

Install dependencies:

pip install requests python-dotenv

Create test_api.py:

import os
import requests
from dotenv import load_dotenv

# Load credentials from .env
load_dotenv()

API_KEY = os.getenv('REPLENIT_API_KEY')
TENANT_ID = os.getenv('REPLENIT_TENANT_ID')

# Validate credentials
if not API_KEY or not TENANT_ID:
    raise ValueError("Missing credentials! Check your .env file")

# API endpoint
url = f"https://api.replen.it/customers/{TENANT_ID}"

# Headers
headers = {
    "Content-Type": "application/json",
    "x-replenit-auth-key": API_KEY
}

# Data (must be an array)
customers = [{
    "CustomerId": "test-001",
    "Email": "test@example.com",
    "Name": "Test",
    "Surname": "User",
    "EmailOptin": True,
    "GdprOptin": True
}]

# Make API call
try:
    response = requests.post(url, headers=headers, json=customers)
    response.raise_for_status()  # Raise error for bad status codes
    
    result = response.json()
    
    if result.get("success"):
        print(f"βœ… Success! Created {result['data']['count']} customer(s)")
        print(f"Processed at: {result['data']['processedAt']}")
    else:
        print(f"❌ Error: {result.get('message')}")
        
except requests.exceptions.HTTPError as e:
    print(f"❌ HTTP Error: {e}")
    print(f"Response: {e.response.text}")
except Exception as e:
    print(f"❌ Error: {e}")

Run:

python test_api.py
chevron-right🟒 Node.jshashtag

Install dependencies:

Create test_api.js:

Run:


Step 2: Verify Success

βœ… Success response:

Verify in your Replenit panel β†’ Customers β†’ Search test-001

Common issues:

  • 404: Wrong tenant ID

  • 401: Check x-replenit-auth-key header

  • 400: Request must be an array [{...}]


Step 3: Try Other Endpoints

Import an Order:

Sync a Product:


Step 4: Production Tips

Batch your requests (recommended: 100-500 records)

Handle rate limits (100 req/min)

Secure your keys


Next Steps


Need Help?

Contact support@replen.itenvelope

Last updated