Quick Start

This guide walks a partner through end-to-end FriSay Web API integration: API key, catalog, products, orders, shipping, and invoices.

Test site: https://fyazilim.com/fshop/admin — user admin@fyazilim.com / admin123. Create an API key under Admin → API. See Introduction for more.

Step by step

  1. Enable Web API in the admin panel and create a key with the right scopes (product / order read-write, etc.). See Authentication.
  2. List categories and brands; when creating products you can use IDs or names. See List Categories, List Brands.
  3. Create a product (name, category, brand, and price are required), then upload an image. See Add Product, Upload Product Image, List Products.
  4. Poll orders on a schedule (page is 0-based); filter by status and date. See List Orders.
  5. When shipping, update status and send carrier + tracking number. See Update Order Status.
  6. After shipment, attach a public invoice URL to the order. See Order Invoice.

Recommended flow

StepActionEndpoint / page
1 API key + scopes authentication
2 Discover categories / brands GET /categories, GET /brands
3 Create product + image add-productPOST /products/{id}/image
4 Poll orders list-orders (page=0)
5 Status + cargo tracking update-order-status
6 Invoice URL order-invoice
Important: Order, category, and brand lists use 0-based page numbers; the product list uses 1-based pages. See API Conventions.

Related pages

PHP
<?php

$baseUrl = 'https://example.com/api/v1';
$apiKey  = 'YOUR_API_KEY';

function apiRequest($method, $url, $apiKey, $data = null)
{
    $ch = curl_init();
    $headers = [
        'X-API-Key: ' . trim($apiKey),
        'Accept: application/json',
    ];
    if ($data !== null) {
        $headers[] = 'Content-Type: application/json';
    }
    curl_setopt_array($ch, [
        CURLOPT_URL => $url,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_CUSTOMREQUEST => $method,
        CURLOPT_HTTPHEADER => $headers,
        CURLOPT_SSL_VERIFYPEER => true,
    ]);
    if ($data !== null) {
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data, JSON_UNESCAPED_UNICODE));
    }
    $response = curl_exec($ch);
    $httpCode = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
    $error = curl_error($ch);
    curl_close($ch);
    $decoded = json_decode((string) $response, true);
    return [
        'http_code' => $httpCode,
        'curl_error' => $error,
        'response' => is_array($decoded) ? $decoded : $response,
    ];
}

// 1) List categories (0-based page)
$categories = apiRequest('GET', $baseUrl . '/categories?page=0&size=50&active=1', $apiKey);

// 2) Create a simple product
$created = apiRequest('POST', $baseUrl . '/products', $apiKey, [
    'name' => 'API Demo Product',
    'category' => 'Test Category',
    'brand' => 'Test Brand',
    'price' => 149.90,
    'stock' => 20,
    'active' => 1,
    'stock_code' => 'DEMO-001',
]);
$productId = (int) ($created['response']['data']['id'] ?? 0);

// 3) List recent picking orders (0-based page)
$orders = apiRequest(
    'GET',
    $baseUrl . '/orders?page=0&size=20&status=2&date_from=2026-06-01',
    $apiKey
);

print_r([
    'categories_http' => $categories['http_code'],
    'product_id' => $productId,
    'orders_http' => $orders['http_code'],
]);
cURL
# 1) Smoke test — categories
curl -s -H "X-API-Key: YOUR_API_KEY" -H "Accept: application/json" \
  "https://example.com/api/v1/categories?page=0&size=20"

# 2) Create product
curl -s -X POST \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "name": "API Demo Product",
    "category": "Test Category",
    "brand": "Test Brand",
    "price": 149.90,
    "stock": 20,
    "active": 1,
    "stock_code": "DEMO-001"
  }' \
  "https://example.com/api/v1/products"

# 3) List picking orders (page is 0-based)
curl -s -H "X-API-Key: YOUR_API_KEY" -H "Accept: application/json" \
  "https://example.com/api/v1/orders?page=0&size=20&status=2&date_from=2026-06-01"

# 4) Mark shipped + cargo (replace 15 with order id)
curl -s -X PATCH \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status":3,"cargoCompany":"Yurtiçi Kargo","trackingNumber":"YT123456789"}' \
  "https://example.com/api/v1/orders/15"

# 5) Attach invoice URL
curl -s -X POST \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/fatura.pdf","name":"Invoice"}' \
  "https://example.com/api/v1/orders/15/invoice"