Getting Started with RackNap API

Quick start guide to begin integrating with RackNap APIs.


Prerequisites

  1. RackNap Account — Sign up at https://racknap.com
  2. API Key — Generate from your account settings (Dashboard → API Keys)
  3. HTTP Client — cURL, Postman, or your favorite language's HTTP library

1. Generate an API Key

  1. Log in to your RackNap dashboard
  2. Navigate to Settings → API Keys
  3. Click Create API Key
  4. Name it (e.g., "Development", "Production")
  5. Copy the key and store it securely (shown only once)
Security Note: Treat API keys like passwords. Never commit them to version control.

2. Make Your First Request

Using cURL

curl -X GET "https://api.racknap.com/v1/invoices?limit=10" \
  -H "Authorization: Bearer your_api_key_here" \
  -H "Content-Type: application/json"

Using Python

import requests

headers = {
    "Authorization": "Bearer your_api_key_here",
    "Content-Type": "application/json"
}

response = requests.get(
    "https://api.racknap.com/v1/invoices",
    params={"limit": 10},
    headers=headers
)

print(response.json())

Using JavaScript

const apiKey = "your_api_key_here";

fetch("https://api.racknap.com/v1/invoices?limit=10", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json"
  }
})
.then(res => res.json())
.then(data => console.log(data));

3. Understanding the Response

All API responses follow a consistent format:

{
  "success": true,
  "code": 200,
  "data": [
    {
      "id": "inv_8392ae4c",
      "customerId": "cust_3d8f4a2b",
      "amount": 1250.00,
      "status": "PAID"
    }
  ],
  "pagination": {
    "total": 250,
    "offset": 0,
    "limit": 10,
    "hasMore": true
  },
  "meta": {
    "timestamp": "2026-06-02T14:32:10Z",
    "requestId": "req_xyz789"
  }
}

Key Fields:

4. Common Workflows

Retrieve Customer Invoices

curl -X GET "https://api.racknap.com/v1/invoices?customerId=cust_3d8f4a2b" \
  -H "Authorization: Bearer your_api_key_here"

Create an Invoice

curl -X POST "https://api.racknap.com/v1/invoices" \
  -H "Authorization: Bearer your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "customerId": "cust_3d8f4a2b",
    "items": [
      {
        "description": "Microsoft 365 (5 seats)",
        "quantity": 5,
        "unitPrice": 250.00
      }
    ],
    "dueDate": "2026-06-15"
  }'

5. Error Handling

Always check the success field and handle errors:

response = requests.get(
    "https://api.racknap.com/v1/invoices/inv_invalid",
    headers=headers
)

data = response.json()

if not data["success"]:
    error = data["error"]
    print(f"Error: {error['message']}")
    print(f"Type: {error['type']}")
    print(f"Request ID: {data['meta']['requestId']}")
else:
    print(data["data"])

6. Rate Limiting

RackNap API allows 1000 requests per minute per account.

Check these headers in responses:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 998
X-RateLimit-Reset: 1654256400

If rate-limited (429), wait until the X-RateLimit-Reset timestamp.

7. Interactive Playground

Use the API Playground to:

8. Next Steps

  1. Explore endpoints — Read Invoices API, Customers API
  2. Review workflows — See common patterns
  3. Set up webhooks — Get notified of events in real-time
  4. Integrate SDKs — Use official libraries for your language

Useful Links

Support

Include your requestId (from API responses) when reporting issues for faster resolution.