π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:
π§ cURL (Terminal)
# 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"
}
}π Python
Install dependencies:
pip install requests python-dotenvCreate 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.pyStep 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-keyheader400: 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
π₯ Customers API - Field reference
π Orders API - Order details
π¦ Products API - Product catalog
π Authentication - Security guide
β‘ Rate Limits - Limits & retry logic
π Best Practices - Production tips
Need Help?
Contact support@replen.it
Last updated