Docs
Introduction

Documentation

Learn how to integrate ConnectX into your application.

Products API Overview

Learn how to interact with the ConnectX Products API

The Products API allows you to manage products in your ConnectX store. You can create, read, update, and delete products using simple HTTP requests.

All API requests require authentication using an API key. Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

All API endpoints are relative to the base URL:

https://connectx-backend-4o0i.onrender.com/api

Products

  • GET /products/ - List all products
  • POST /products/ - Create a new product

Get a list of all products

Command

curl -X GET 'https://connectx-backend-4o0i.onrender.com/api/products/?filter_type=public' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json'

Response

{
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "Smartphone X",
      "description": "Latest model smartphone with advanced features",
      "sku": "SP-X-001",
      "base_price": 999.99,
      "category": "electronics",
      "owner": "123e4567-e89b-12d3-a456-426614174001",
      "is_public": true,
      "created_at": "2024-01-01T00:00:00Z",
      "updated_at": "2024-01-01T00:00:00Z"
    },
    {
      "id": "123e4567-e89b-12d3-a456-426614174002",
      "name": "Laptop Pro",
      "description": "High-performance laptop for professionals",
      "sku": "LP-P-001",
      "base_price": 1499.99,
      "category": "electronics",
      "owner": "123e4567-e89b-12d3-a456-426614174001",
      "is_public": true,
      "created_at": "2024-01-01T00:00:00Z",
      "updated_at": "2024-01-01T00:00:00Z"
    }
  ]
}

Create a new product

Command

curl -X POST 'https://connectx-backend-4o0i.onrender.com/api/products/' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "New Smartphone",
    "description": "Latest model with advanced features",
    "sku": "SP-NEW-001",
    "base_price": 899.99,
    "category": "electronics",
    "is_public": true
  }'

Response

{
  "id": "123e4567-e89b-12d3-a456-426614174003",
  "name": "New Smartphone",
  "description": "Latest model with advanced features",
  "sku": "SP-NEW-001",
  "base_price": 899.99,
  "category": "electronics",
  "owner": "123e4567-e89b-12d3-a456-426614174001",
  "is_public": true,
  "created_at": "2024-01-01T00:00:00Z",
  "updated_at": "2024-01-01T00:00:00Z"
}