Autoenhance.ai
  • Overview
  • Getting Started
    • Obtaining an API key
    • Quickstart
      • Single Image
      • HDR Brackets
    • Code Examples
      • JavaScript
        • Uploading Single Bracket
        • Uploading HDR
        • Uploading 360
      • API Integrations Repository
  • SDKs
    • Web (Beta)
      • Changelog
    • JavaScript
      • Changelog
    • Python
      • Changelog
  • File & Camera Guidelines
    • File Formats
    • Metadata
    • 360
    • Lens Correction
  • Images
    • Managing Images
      • Creating & Uploading
      • Reprocessing
      • Retrieveing
      • Deleting
      • Reporting
    • Settings
      • Enhancement Style
      • Sky Replacement
      • Lens Correction
      • Vertical Correction
      • Window Pull
      • Auto Privacy
      • Usage Example
    • Downloading Images
      • Original
      • Preview
      • Enhanced
  • Orders
    • Managing Orders
      • Creating
      • Editing
      • Retrieving
      • Listing and Pagination
      • Deleting
    • Grouping Brackets and Processing Orders
  • Webhooks
  • API Versions
  • AI Versions
  • Links
    • API Specification
    • Support
Powered by GitBook
On this page
  1. Orders
  2. Managing Orders

Listing and Pagination

The orders endpoint allows you to retrieve your orders with support for pagination using an offset. This enables you to efficiently navigate through large sets of orders. The endpoint supports per_page and offset query parameters. To retrieve orders with pagination, you must provide a valid API key.

Retrieving a list of orders with a set per page limit

const apiKey = "YOUR_API_KEY";
const perPage = 16;

const getOrders = async (perPage, apiKey) => {
    const getOrdersResponse = await fetch(
      `https://api.autoenhance.ai/v3/orders?per_page=${perPage}`,
      { 
        method: "GET",
        headers:{
          "x-api-key": apiKey,  
        }
      }
    );

    const { orders, pagination } = await getOrdersResponse.json();
}
import requests

api_key = "YOUR_API_KEY"
per_page = 16

def get_orders(per_page, api_key):
    url = f"https://api.autoenhance.ai/v3/orders?per_page={per_page}"
    headers = {
        "x-api-key": api_key
    }
    
    response = requests.get(url, headers=headers)
    response_data = response.json()
    
    orders = response_data.get('orders')
    pagination = response_data.get('pagination')
    
    return orders, pagination
$apiKey = "YOUR_API_KEY";
$perPage = 16;

function get_orders($perPage, $apiKey) {
    $url = "https://api.autoenhance.ai/v3/orders?per_page=$perPage";

    $options = array(
        'http' => array(
            'header'  => "Content-Type: application/json\r\n" .
                         "x-api-key: $apiKey",
            'method'  => 'GET'
        )
    );

    $context = stream_context_create($options);
    $result = file_get_contents($url, false, $context);

    if ($result === FALSE) {
        return 'Error fetching orders';
    }

    $orders_data = json_decode($result, true);
    return $orders_data;
}
curl -X GET \
  'https://api.autoenhance.ai/v3/orders?per_page=16' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY'

As you can see, the response returns an orders, and pagination object. The orders object contains the list of your orders, and pagination contains two values: per_page, and next_offset.

Retrieving a paginated list of orders

If you want to load more orders with a pagination (next batch of orders without the initial orders that you've already fetched), you will need to use the next_offset value in your next request.

The value next_offset is returned from in the object that is returned from retrieving a list of orders with a set per page limit

const apiKey = "YOUR_API_KEY";
const pagination = { per_page:16, next_offset:"string" };

const loadMoreOrders = async (perPage, nextOffset, apiKey) => {
    const loadMoreOrdersResponse = await fetch(
      `https://api.autoenhance.ai/v3/orders?per_page=${perPage}&offset=${nextOffset}`,
      { 
        method: "GET",
        headers:{
          "x-api-key": apiKey,  
        }
      }
    );

    const { orders, pagination } = await getOrdersResponse.json();
}
import requests

api_key = "YOUR_API_KEY"
per_page = 16
next_offset = "string"

def load_more_orders(per_page, next_offset, api_key):
    url = f"https://api.autoenhance.ai/v3/orders?per_page={per_page}&offset={next_offset}"
    headers = {
        "x-api-key": api_key
    }
    
    response = requests.get(url, headers=headers)
    response_data = response.json()
    
    orders = response_data.get('orders')
    pagination = response_data.get('pagination')
    
    return orders, pagination
$apiKey = "YOUR_API_KEY";
$perPage = 16;
$nextOffset = "";

function load_more_orders($perPage, $nextOffset, $apiKey) {
    $url = "https://api.autoenhance.ai/v3/orders?per_page=$perPage&offset=$nextOffset";

    $options = array(
        'http' => array(
            'header'  => "Content-Type: application/json\r\n" .
                         "x-api-key: $apiKey",
            'method'  => 'GET'
        )
    );

    $context = stream_context_create($options);
    $result = file_get_contents($url, false, $context);

    if ($result === FALSE) {
        return 'Error loading more orders';
    }

    $response_data = json_decode($result, true);
    return $response_data;
}
curl -X GET \
  'https://api.autoenhance.ai/v3/orders?per_page=16&offset=' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY'

Important note The response will always return pagination object with values that will enable you to fetch next batch of orders if you still have more orders to fetch.

Specification

PreviousRetrievingNextDeleting

Last updated 11 months ago

List Orders

get

Lists the orders for the current user.

Authorizations
Query parameters
offsetstringOptional

The offset token used to indicate which page of results to use.

Default: 0
per_pageinteger ยท max: 15Optional

The amount of items to be loaded per page of results. The final response may have a smaller number than requested if too large.

Default: 5
Responses
200
Successful response
application/json
401
Authentication error
application/json
422
Validation error
application/json
get
GET /v3/orders/ HTTP/1.1
Host: api.autoenhance.ai
x-api-key: YOUR_API_KEY
Accept: */*
{
  "orders": [
    {
      "created_at": "2025-05-22T09:57:47.423Z",
      "images": [
        {
          "ai_version": "text",
          "cloud_type": "CLEAR",
          "date_added": 1,
          "downloaded": true,
          "enhance": true,
          "enhance_type": "property",
          "image_id": "123e4567-e89b-12d3-a456-426614174000",
          "image_name": "text",
          "lens_correction": true,
          "metadata": {
            "ANY_ADDITIONAL_PROPERTY": "anything"
          },
          "order_id": null,
          "privacy": true,
          "rating": 1,
          "scene": "text",
          "sky_replacement": true,
          "status": null,
          "status_reason": null,
          "upscale": true,
          "user_id": null,
          "vertical_correction": true,
          "window_pull": true,
          "ANY_ADDITIONAL_PROPERTY": "anything"
        }
      ],
      "is_deleted": true,
      "is_merging": true,
      "is_processing": true,
      "last_updated_at": "2025-05-22T09:57:47.423Z",
      "name": "text",
      "order_id": "text",
      "status": null,
      "total_images": 1
    }
  ],
  "pagination": {
    "next_offset": "text",
    "per_page": 5
  }
}
  • Retrieving a list of orders with a set per page limit
  • Retrieving a paginated list of orders
  • Specification
  • GETList Orders