Skip to main content
GET
/
api
/
orders
/
{order_id}
{
  "id": "<string>",
  "created_at": "<string>",
  "product_id": "<string>",
  "product_name": "<string>",
  "product_image": "<string>",
  "status": "<string>",
  "customer": {
    "name": "<string>",
    "email": "<string>",
    "number": "<string>",
    "full_address": {
      "line1": "<string>",
      "line2": "<string>",
      "city": "<string>",
      "state": "<string>",
      "country": "<string>"
    },
    "pincode": "<string>"
  },
  "order_details": {
    "quantity": 123,
    "amount": 123,
    "variation": {},
    "size": {},
    "color": {},
    "special_instructions": {},
    "custom_questions": [
      {}
    ]
  },
  "rating": {},
  "review": {},
  "tracking_url": {}
}

Overview

Retrieve complete details of an order including customer information, order status, product details, and more. Use this endpoint to fetch order data for processing, analytics, or integration with other systems.
Rate Limit: 50 requests per minute

Endpoint

GET https://api.tribemade.in/api/orders/{order_id}

Path Parameters

order_id
string
required
UUID of the order to retrieve

Authentication

X-API-Key
string
required
Your TribeMade API key (format: tb-xxxx-xxx-xxxx)

Response Fields

Always Present

id
string
Order unique identifier (UUID)
created_at
string
Order creation timestamp (ISO 8601 format, UTC)
product_id
string
Associated product UUID
product_name
string
Product name at time of order
product_image
string
Product main image URL
status
string
Current order status: started, processing, dispatched, cancelled, or delivered
customer
object
Customer information object
order_details
object
Order details object

Conditional Fields

rating
number | null
Customer rating (1-5) if provided, null otherwise
review
string | null
Customer review text if provided, null otherwise
tracking_url
string | null
Shipment tracking URL if available, null otherwise

Order Status Values

StatusDescriptionWhen Used
startedPayment received, order createdInitial state after successful payment
processingOrder being prepared/packedWhen you start preparing the order
dispatchedOrder shipped to customerWhen handed over to courier
deliveredOrder delivered successfullyWhen customer receives order
cancelledOrder cancelledWhen order is cancelled

Examples

Basic Request

curl https://api.tribemade.in/api/orders/770e8400-e29b-41d4-a716-446655440789 \
  -H "X-API-Key: tb-a1b2-c3d-e4f5"

Success Response

{
  "id": "770e8400-e29b-41d4-a716-446655440789",
  "created_at": "2024-11-16T10:30:00.000000Z",
  "product_id": "660e8400-e29b-41d4-a716-446655440123",
  "product_name": "Premium Cotton T-Shirt",
  "product_image": "https://cdn.example.com/products/tshirt-main.jpg",
  "status": "dispatched",
  "customer": {
    "name": "Rahul Sharma",
    "email": "[email protected]",
    "number": "9876543210",
    "full_address": {
      "line1": "123, MG Road",
      "line2": "Apartment 4B",
      "city": "Mumbai",
      "state": "Maharashtra",
      "country": "India"
    },
    "pincode": "400001"
  },
  "order_details": {
    "variation": "Slim Fit",
    "size": "L",
    "color": "Navy Blue",
    "quantity": 2,
    "amount": 2048,
    "special_instructions": "Please gift wrap",
    "custom_questions": []
  },
  "rating": 4.5,
  "review": "Excellent quality and fit!",
  "tracking_url": "https://delhivery.com/track/DLVY123456"
}

Error Responses

404 Not Found

{
  "error": "Order not found"
}
Cause: Order ID doesn’t exist in the system.

403 Forbidden

{
  "error": "Order does not belong to this store"
}
Cause: Order exists but belongs to a different store. Your API key can only access orders for your store.

401 Unauthorized

{
  "error": "Missing API key"
}
or
{
  "error": "Invalid API key"
}

429 Too Many Requests

{
  "error": "Rate limit exceeded",
  "retry_after": 60
}

Common Use Cases

Process New Orders

Fetch order details when you receive a webhook notification:
import requests

def process_order(order_id):
    """
    Fetch and process order details
    """
    url = f"https://api.tribemade.in/api/orders/{order_id}"
    headers = {"X-API-Key": "tb-a1b2-c3d-e4f5"}
    
    response = requests.get(url, headers=headers)
    
    if response.status_code == 200:
        order = response.json()
        
        # Extract key information
        customer = order['customer']
        order_details = order['order_details']
        
        print(f"Order ID: {order['id']}")
        print(f"Customer: {customer['name']}")
        print(f"Email: {customer['email']}")
        print(f"Phone: {customer['number']}")
        print(f"Address: {customer['full_address']['line1']}, {customer['full_address']['city']}")
        print(f"Product: {order['product_name']}")
        print(f"Quantity: {order_details['quantity']}")
        print(f"Amount: ₹{order_details['amount']}")
        
        if order_details['size']:
            print(f"Size: {order_details['size']}")
        if order_details['color']:
            print(f"Color: {order_details['color']}")
        
        return order
    else:
        print(f"Error: {response.json()['error']}")
        return None

# Usage (typically called from webhook handler)
order = process_order("770e8400-e29b-41d4-a716-446655440789")

Generate Packing Slip

Create a packing slip with order information:
import requests
from datetime import datetime

def generate_packing_slip(order_id):
    """
    Generate packing slip for order
    """
    url = f"https://api.tribemade.in/api/orders/{order_id}"
    headers = {"X-API-Key": "tb-a1b2-c3d-e4f5"}
    
    response = requests.get(url, headers=headers)
    
    if response.status_code == 200:
        order = response.json()
        
        # Format packing slip
        slip = f"""
        ═══════════════════════════════════════
                    PACKING SLIP
        ═══════════════════════════════════════
        
        Order ID: {order['id'][:8]}...
        Date: {datetime.fromisoformat(order['created_at'].replace('Z', '+00:00')).strftime('%B %d, %Y')}
        
        CUSTOMER DETAILS:
        ────────────────────────────────────────
        Name: {order['customer']['name']}
        Phone: {order['customer']['number']}
        Email: {order['customer']['email']}
        
        DELIVERY ADDRESS:
        ────────────────────────────────────────
        {order['customer']['full_address']['line1']}
        {order['customer']['full_address'].get('line2', '')}
        {order['customer']['full_address']['city']}, {order['customer']['full_address']['state']}
        PIN: {order['customer']['pincode']}
        {order['customer']['full_address']['country']}
        
        ORDER DETAILS:
        ────────────────────────────────────────
        Product: {order['product_name']}
        Quantity: {order['order_details']['quantity']}
        """
        
        if order['order_details']['size']:
            slip += f"Size: {order['order_details']['size']}\n        "
        if order['order_details']['color']:
            slip += f"Color: {order['order_details']['color']}\n        "
        if order['order_details']['variation']:
            slip += f"Variation: {order['order_details']['variation']}\n        "
        
        if order['order_details']['special_instructions']:
            slip += f"""
        SPECIAL INSTRUCTIONS:
        ────────────────────────────────────────
        {order['order_details']['special_instructions']}
        """
        
        slip += f"""
        ────────────────────────────────────────
        Amount Paid: ₹{order['order_details']['amount']}
        
        ═══════════════════════════════════════
        """
        
        print(slip)
        return slip
    
    return None

# Usage
generate_packing_slip("770e8400-e29b-41d4-a716-446655440789")

Integrate with Shipping Provider

Automatically create shipping labels:
import requests

def create_shipping_label(order_id):
    """
    Fetch order and create shipping label with courier API
    """
    # Get order details
    url = f"https://api.tribemade.in/api/orders/{order_id}"
    headers = {"X-API-Key": "tb-a1b2-c3d-e4f5"}
    
    response = requests.get(url, headers=headers)
    
    if response.status_code != 200:
        print(f"Error fetching order: {response.json()['error']}")
        return None
    
    order = response.json()
    customer = order['customer']
    address = customer['full_address']
    
    # Prepare shipping data
    shipping_data = {
        "order_id": order['id'],
        "customer_name": customer['name'],
        "customer_phone": customer['number'],
        "address": {
            "line1": address['line1'],
            "line2": address.get('line2', ''),
            "city": address['city'],
            "state": address['state'],
            "country": address['country'],
            "pincode": customer['pincode']
        },
        "product_name": order['product_name'],
        "quantity": order['order_details']['quantity'],
        "amount": order['order_details']['amount']
    }
    
    # Call your shipping provider API
    # shipping_label = create_delhivery_shipment(shipping_data)
    # tracking_url = shipping_label['tracking_url']
    
    # For demo:
    print(f"Created shipping label for order {order['id'][:8]}...")
    print(f"Shipping to: {customer['name']}, {address['city']}")
    
    return shipping_data

# Usage
create_shipping_label("770e8400-e29b-41d4-a716-446655440789")

Export Orders for Analytics

Fetch multiple orders for reporting:
import requests
import csv
from datetime import datetime

def export_orders_to_csv(order_ids, filename="orders_export.csv"):
    """
    Export multiple orders to CSV for analysis
    """
    url_base = "https://api.tribemade.in/api/orders"
    headers = {"X-API-Key": "tb-a1b2-c3d-e4f5"}
    
    orders_data = []
    
    for order_id in order_ids:
        url = f"{url_base}/{order_id}"
        response = requests.get(url, headers=headers)
        
        if response.status_code == 200:
            order = response.json()
            
            orders_data.append({
                "Order ID": order['id'][:13],
                "Date": datetime.fromisoformat(order['created_at'].replace('Z', '+00:00')).strftime('%Y-%m-%d'),
                "Customer": order['customer']['name'],
                "City": order['customer']['full_address']['city'],
                "State": order['customer']['full_address']['state'],
                "Product": order['product_name'],
                "Quantity": order['order_details']['quantity'],
                "Amount": order['order_details']['amount'],
                "Status": order['status'],
                "Rating": order.get('rating', 'N/A')
            })
    
    # Write to CSV
    if orders_data:
        with open(filename, 'w', newline='') as f:
            writer = csv.DictWriter(f, fieldnames=orders_data[0].keys())
            writer.writeheader()
            writer.writerows(orders_data)
        
        print(f"✓ Exported {len(orders_data)} orders to {filename}")
        return filename
    
    return None

# Usage
order_ids = ["770e8400-...", "880e8400-...", "990e8400-..."]
export_orders_to_csv(order_ids)

Best Practices

Instead of repeatedly calling this endpoint to check for new orders, use webhooks to receive real-time notifications:❌ Bad: Polling for new orders
while True:
    check_for_new_orders()  # Wastes API calls
    time.sleep(60)
✅ Good: Webhook notifications
@app.route('/webhook', methods=['POST'])
def handle_order():
    order_data = request.json
    order_id = order_data['order_id']
    process_order(order_id)  # Fetch full details only when needed
    return '', 200
Store order data locally to reduce API calls:
  • Cache orders after first fetch
  • Only re-fetch if data might have changed (status update)
  • Use order ID as cache key
Always check for errors:
response = requests.get(url, headers=headers)

if response.status_code == 200:
    order = response.json()
    # Process order
elif response.status_code == 404:
    print("Order not found")
elif response.status_code == 403:
    print("Order doesn't belong to your store")
else:
    print(f"Error: {response.status_code}")
Some fields may be null - always check before using:
order = response.json()

# These fields may be null
if order['order_details']['size']:
    print(f"Size: {order['order_details']['size']}")

if order.get('tracking_url'):
    print(f"Track: {order['tracking_url']}")

if order.get('rating'):
    print(f"Rating: {order['rating']}/5")

Next Steps