Get Started with Connect2Print API

Follow this guide to make your first API request in under 5 minutes

Prerequisites

Before you start, you'll need:

Don't have an account yet? Sign up for free

Step 1: Create your first API key

API keys are used to authenticate your requests. Follow these steps to create one:

  1. Log in to your Connect2Print admin panel
  2. Navigate to Settings → API Keys
  3. Click the "Create New API Key" button
  4. Select Test Mode for development
  5. Choose the required permissions (scopes):
    • orders:read - View orders
    • customers:read - View customers
    • products:read - View products
  6. Click "Save" and copy your new API key

Important: Your API key is shown only once. Store it securely and never share it publicly.

Test API keys start with c2p_test_ and Live keys start with c2p_live_.

Step 2: Make your first request

Let's test the API by fetching a list of your orders. Here are examples in different languages:

curl -X GET "https://app1.connect2print.com/api/v1/orders" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
// Using cURL in PHP
$apiKey = 'YOUR_API_KEY';
$ch = curl_init('https://app1.connect2print.com/api/v1/orders');

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer {$apiKey}",
        'Content-Type: application/json',
    ],
]);

$response = curl_exec($ch);
$data = json_decode($response, true);

curl_close($ch);
print_r($data);
// Using fetch in Node.js
const apiKey = 'YOUR_API_KEY';

const response = await fetch('https://app1.connect2print.com/api/v1/orders', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${apiKey}`,
    'Content-Type': 'application/json'
  }
});

const data = await response.json();
console.log(data);
# Using requests library
import requests

api_key = 'YOUR_API_KEY'
url = 'https://app1.connect2print.com/api/v1/orders'

headers = {
    'Authorization': f'Bearer {api_key}',
    'Content-Type': 'application/json'
}

response = requests.get(url, headers=headers)
data = response.json()

print(data)

Step 3: Understanding the response

All API responses follow a consistent structure:

Success response

A successful response contains:

{
  "success": true,
  "data": [
    {
      "id": 123,
      "order_number": "ORD-2024-001",
      "status": "processing",
      "total": 499.00,
      "created_at": "2024-01-15T10:30:00Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "per_page": 20,
    "total": 1,
    "total_pages": 1
  }
}

Error response

If something goes wrong, you'll get:

{
  "success": false,
  "error": {
    "code": "unauthorized",
    "message": "Invalid API key"
  }
}

Step 4: Handle pagination

List endpoints return data in pages. Use these parameters to navigate:

Example with pagination

curl -X GET "https://app1.connect2print.com/api/v1/orders?page=2&per_page=50" \
  -H "Authorization: Bearer YOUR_API_KEY"

Pagination metadata

The response includes pagination information in the meta object:

"meta": {
  "current_page": 2,
  "per_page": 50,
  "total": 347,
  "total_pages": 7
}

Next Steps

Now that you've made your first API request, you're ready to explore more:

Browse Full API Reference

Explore all available endpoints in our interactive API documentation

View API Reference →

Learn about Authentication

Dive deeper into API keys, scopes, and security

Authentication Guide →

Set up Webhooks

Receive real-time notifications about events in your system

Webhooks Guide →

See Code Examples

Copy-and-paste examples for common operations

Code Examples →

Need Help?

If you run into any issues or have questions, we're here to help.