API Documentation Overview

1. Get Account Details

Endpoint: GET /api/v1/account/details

Description: Retrieves details of the authenticated account (Bearer token).

2. Get All Items

Endpoint: GET /api/v1/items

Description: Retrieves items (requires items:read scope).

3. Get An Item Details

Endpoint: GET /api/v1/items/{item_id}

Description: Retrieves details of a specific item (requires items:read scope).

4. Purchase Validation

Endpoint: POST /api/v1/purchases/verify

Description: Validate a purchase code and returns details about the purchase if valid.

5. Purchases (Buyer)

Endpoint: GET /api/v1/purchases

Description: List authenticated buyer purchases.

6. Sales (Author)

Endpoint: GET /api/v1/sales

Description: List authenticated author sales history.

7. Statements

Endpoint: GET /api/v1/statements

Description: List authenticated user financial statement transactions.

8. Downloads

Endpoint: POST /api/v1/purchases/{code}/download

Description: Issue a short-lived download link for an eligible purchase.

9. Favorites

Endpoints: GET /api/v1/favorites, POST /api/v1/favorites, Delete /api/v1/favorites/{item_id}

10. Catalog & Stats

Endpoints: GET /api/v1/catalog/items, GET /api/v1/catalog/categories, GET /api/v1/stats/summary

Authentication

Navigate to Workspace Settings

The user should first log in to their account on the platform. Then, they can navigate to the "Settings" section of their workspace.

Create a Personal Access Token

Go to Workspace → Author Tools → API Token Key. Create a token with only the permissions you need, then copy the token when shown.

Use the Authorization Header

Include the token in the Authorization header:

Authorization: Bearer <token>

Scopes and least privilege

Select only the scopes you need. Tokens are scoped and can be revoked at any time.

Legacy API Key (Deprecated)

Legacy api_key and X-API-Key are deprecated and will be removed. Use bearer tokens.

Rate Limiting: Requests may be rate limited. If you receive HTTP 429, check the Retry-After response header for the wait time before retrying.

Secure your token

Keep tokens secret; avoid client-side exposure. Rotate/revoke as needed, and store server-side in secure configs or vaults.

Auth Check (Ping)

Use this to verify your token works and scopes are correct.

Endpoint

GET
/api/v1/account/details

Authentication

Authorization: Bearer <token>

Required scope: user:account

Errors & Rate Limits

Standard error payloads and rate limiting behavior.

Error model

{
  "status": "error",
  "code": 403,
  "msg": "Forbidden",
  "correlation_id": "2f8b0e2a-..."
}

Rate Limiting

On HTTP 429 responses, check:

  • Retry-After — seconds to wait before retrying
  • X-Correlation-ID — present on errors for tracing

Get Account Details

Retrieves details of the authenticated account (Bearer token)

Endpoint

GET
/api/v1/account/details

Authentication

Send your token using the Authorization header:

Authorization: Bearer <token>

Responses

Success Response:

{
    "status": "success",
    "data": {
        "name": {
            "firstname": "John",
            "lastname": "Doe",
            "full_name": "John Doe"
        },
        "username": "johndoe",
        "email": "[email protected]",
        "balance": 100.00,
        "currency": "USD",
        "profile": {
            "heading": "Profile Heading",
            "description": "Profile Description",
            "contact": {
                "email": "[email protected]"
            },
            "social_links": [
                "facebook": "/",
                "x": "/",
                // etc...
            ],
            "media": {
                "avatar": "https://example.com/avatar.jpg",
                "cover": "https://example.com/cover.jpg"
            }
        },
        "registered_at": "2024-04-27T12:00:00Z"
    }
}

Error Response:

{
    "status": "error",
    "msg": "Invalid request"
}

Get All Items

Retrieves all items associated with the provided API key

Endpoint

GET
https://codefyx.com/api/items/all

Authentication

Send your token using the Authorization header:

Authorization: Bearer <token>

Responses

Success Response:

{
    "status": "success",
    "items": [
        {
            "id": 1,
            "name": "Sample Item",
            "description": "This is a sample item",
            "category": "Category Name",
            "sub_category": "Subcategory Name",
            "options": ["option1", "option2"],
            "version": 1.0.0,
            "demo_link": "https://example.com/demo",
            "tags": ["tag1", "tag2"],
            "media": {
                "thumbnail": "https://example.com/thumbnail.png",
                "preview_image": "https://example.com/preview.jpg", // This is not included for audio items
                "preview_video": "https://example.com/video.mp4", // This is only included for video items
                "preview_audio": "https://example.com/audio.mp3", // This is only included for audio items
                "screenshots": [ // This is only included if item has screenshots
                    "https://example.com/screenshot1.jpg",
                    "https://example.com/screenshot2.jpg"
                ],
            },
            "price": {
                "regular": 19.99,
                "extended": 29.99
            },
            "currency": "USD",
            "published_at": "2024-04-27T12:00:00Z"
        },
        {
            // Next item...
        }
    ]
}

Error Response:

{
    "status": "error",
    "msg": "No items found"
}

Get An Item Details

Retrieves details of a specific item based on the provided item ID and API key.

Endpoint

GET
https://codefyx.com/api/items/item

Authentication

Send your token using the Authorization header:

Authorization: Bearer <token>

Parameters

  • item_id: The ID of the item to retrieve (Required)

Responses

Success Response:

{
    "status": "success",
    "item": {
        "id": 1,
        "name": "Sample Item",
        "description": "This is a sample item",
        "category": "Category Name",
        "sub_category": "Subcategory Name",
        "options": ["option1", "option2"],
        "version": 1.0.0,
        "demo_link": "https://example.com/demo",
        "tags": ["tag1", "tag2"],
        "media": {
            "thumbnail": "https://example.com/thumbnail.png",
            "preview_image": "https://example.com/preview.jpg", // This is not included for audio items
            "preview_video": "https://example.com/video.mp4", // This is only included for video items
            "preview_audio": "https://example.com/audio.mp3", // This is only included for audio items
            "screenshots": [ // This is only included if item has screenshots
                "https://example.com/screenshot1.jpg",
                "https://example.com/screenshot2.jpg"
            ],
        },
        "price": {
            "regular": 19.99,
            "extended": 29.99
        },
        "currency": "USD",
        "published_at": "2024-04-27T12:00:00Z"
    }
}

Error Response:

{
    "status": "error",
    "msg": "Item Not Found"
}

Purchase Validation

Validate a purchase code and returns details about the purchase if valid.

Endpoint

POST
/api/v1/purchases/verify

Parameters

  • Authorization: Bearer <token> (Required).
  • purchase_code: The purchase code to validate (Required).

Responses

Success Response:

{
    "status": "success",
    "data": {
        "purchase": {
            "purchase_code": "abcdefghijklmnopqrstuvwxyz123456789",
            "license_type": "Regular",
            "price": 19.99,
            "currency": "USD",
            "item": {
                "id": 1,
                "name": "Sample Item",
                "description": "This is a sample item",
                "category": "Category Name",
                "sub_category": "Subcategory Name",
                "options": ["option1", "option2"],
                "version": 1.0.0,
                "demo_link": "https://example.com/demo",
                "tags": ["tag1", "tag2"],
                "media": {
                    "thumbnail": "https://example.com/thumbnail.png",
                    "preview_image": "https://example.com/preview.jpg", // This is not included for audio items
                    "preview_video": "https://example.com/video.mp4", // This is only included for video items
                    "preview_audio": "https://example.com/audio.mp3", // This is only included for audio items
                    "screenshots": [ This is only included if item has screenshots
                        "https://example.com/screenshot1.jpg",
                        "https://example.com/screenshot2.jpg"
                    ],
                },
                "price": {
                    "regular": 19.99,
                    "extended": 29.99
                },
                "currency": "USD",
                "published_at": "2024-04-27T12:00:00Z"
            },
            "supported_until": "2024-04-27T12:00:00Z", // This will not exist if support is disabled or its not supported
            "downloaded": false,
            "date": "2024-04-27T12:00:00Z"
        }
    }
}

Error Response:

{
    "status": "error",
    "msg": "Invalid purchase code"
}

List Purchases

Returns paginated purchases for the authenticated buyer.

Endpoint

GET
/api/v1/purchases

Authentication

Authorization: Bearer <token>

Required scope: purchase:list

Get Purchase Details

Returns a single purchase by code.

Endpoint

GET
/api/v1/purchases/{code}

Authentication

Authorization: Bearer <token>

Required scopes: purchase:list, purchase:verify

Download Purchased Item

Issues a short-lived signed URL for an eligible purchase.

Endpoint

POST
/api/v1/purchases/{code}/download

Authentication

Authorization: Bearer <token>

Required scope: download:purchase

Favorites API

Manage user favorites (collections).

Endpoints

  • GET /api/v1/favorites — List favorites (scope: user:collections)
  • POST /api/v1/favorites — Add to favorites (scope: user:favourite_collection_add)
  • Delete /api/v1/favorites/{item_id} — Remove from favorites (scope: user:collections)

Authentication

Authorization: Bearer <token>

Catalog API

Public catalog endpoints (no auth).

Endpoints

  • GET /api/v1/catalog/items — Search/list items
  • GET /api/v1/catalog/categories — List categories

Stats API

Aggregate counters available to authenticated users with stats:read.

Endpoint

GET
/api/v1/stats/summary

Authentication

Authorization: Bearer <token>

Required scope: stats:read