#Get Products API.

The following endpoint enables merchants to access information about their products, facilitating management and retrieval of product-related data. It supports filtering and pagination options, making it a valuable tool for managing product information efficiently.

https://api.fatora.io/v1/products
curl --location --request GET 'https://api.fatora.io/v1/products?page=1&page_size=20' \
--header 'api_key: E4B73FEE-F492-4607-A38D-852B0EBC91C9' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.fatora.io/v1/products?page=1&page_size=20',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_HTTPHEADER => array(
    'api_key: E4B73FEE-F492-4607-A38D-852B0EBC91C9',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
// Define the API endpoint URL.
string apiUrl = "https://api.fatora.io/v1/products?page=1&page_size=20";

// Define the API key.
string apiKey = "E4B73FEE-F492-4607-A38D-852B0EBC91C9";

// Create a WebRequest.
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(apiUrl);

// Set the request method to GET.
request.Method = "GET";

// Set the API key header.
request.Headers.Add("api_key", apiKey);

// Set the request content type.
request.ContentType = "application/json";

try
{
    // Get the response.
    using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
    {
        if (response.StatusCode == HttpStatusCode.OK)
        {
            // Read the response data.
            using (var responseStream = response.GetResponseStream())
            using (var reader = new StreamReader(responseStream))
            {
                string responseContent = reader.ReadToEnd();
                Console.WriteLine("API Response: " + responseContent);
            }
        }
        else
        {
            Console.WriteLine("API Request failed with status code: " + response.StatusCode);
        }
    }
}
catch (WebException ex)
{
    Console.WriteLine("API Request failed with an exception: " + ex.Message);
}
{
    "status": "SUCCESS",
    "products": [{
        "id": 123,
        "name": "Sample Item1",
        "price": 19.99,
        "sku": "SKU123",
        "image": "https://example.com/sample-image.jpg",
        "description": "This is a sample item description.",
        "creation_date": "2023-09-30T12:00:00",
        "currency": "QAR",
        "category": ["Category1", "Category2"],
        "qr_code": "https://api.qrserver.com/v1/create-qr-code/?data=sampleQRcode&size=50x50",
        "link": "https://example.com/sample-link",
        "status": "Active",
        "language": "en",
        "setting": {
            "is_public": true,
            "is_limited": false,
            "is_casheir": true,
            "max_count": 100.5,
            "max_order": 10
        }
    },
    {
        "id": 4334,
        "name": "Sample Item2",
        "price": 19.99,
        "sku": "SKU4334",
        "image": "https://example.com/sample-image.jpg",
        "description": "This is a sample item description.",
        "creation_date": "2023-09-30T12:00:00",
        "currency": "QAR",
        "category": ["Category1", "Category2"],
        "qr_code": "https://api.qrserver.com/v1/create-qr-code/?data=sampleQRcode&size=50x50",
        "link": "https://example.com/sample-link",
        "status": "Active",
        "language": "en",
        "setting": {
            "is_public": true,
            "is_limited": false,
            "is_casheir": true,
            "max_count": 100.5,
            "max_order": 10
        }
    },
    {
        "id": 4354,
        "name": "Sample Item3",
        "price": 19.99,
        "sku": "SKU4354",
        "image": "https://example.com/sample-image.jpg",
        "description": "This is a sample item description.",
        "creation_date": "2023-09-30T12:00:00",
        "currency": "QAR",
        "category": ["Category1", "Category2"],
        "qr_code": "https://api.qrserver.com/v1/create-qr-code/?data=sampleQRcode&size=50x50",
        "link": "https://example.com/sample-link",
        "status": "Active",
        "language": "en",
        "setting": {
            "is_public": true,
            "is_limited": false,
            "is_casheir": true,
            "max_count": 100.5,
            "max_order": 10
        }
    }
    ]
    ,
    "total": 203,
    "page_size": 20,
    "page": 1
}

Try it now: Get Products API

Header Parameters

Header Value
api_key REQUIRED Use the valid API key of your Fatora account. Read more information about Authentication.
Content-Type REQUIRED application/json

Query Parameters

Parameter Description
q OPTIONAL string The quantity you want to use for filtering (if needed).
status OPTIONAL string Status of products: "online," "offline," or "cashier" (if needed).
page OPTIONAL int The page number for pagination.
page_size OPTIONAL int The page size for pagination.
from OPTIONAL DateTime The start date for filtering products created on or after this date.
to OPTIONAL DateTime The end date for filtering products created on or before this date.
Id OPTIONAL int Unique identifier for filtering products by their ID.
sku OPTIONAL string Stock Keeping Unit (SKU) for filtering products.
is_cashier OPTIONAL bool Boolean value for filtering products that are cashiers.
is_public OPTIONAL bool Boolean value for filtering products that are public.
category OPTIONAL string string value for filtering products based on their category.
min OPTIONAL int Minimum value for filtering products.
max OPTIONAL int Maximum value for filtering products.

Response

HTTP Status Code: 200 OK - The products information has been successfully retrieved.

Response Schema: application/json
status string the status of response.
SUCCESS
products array of product objects:
  • id: int the id of item
  • name: string the full name of item
  • sku: string the SKU of item
  • price: decimal the price of item
  • image: string the image URL of item
  • description: string the description of item
  • creation_date: date the creation date of item
  • currency: string the currency of item
  • category: string[] an array of categories of item
  • qr_code: string the QR code URL of item
  • link: string the link URL of item
  • status: string the status of item
  • language: string the language of item
  • setting: object the settings of the item:
    • is_public: bool is the item public
    • is_limited: bool is the item limited
    • is_casheir: bool is the item for cashier
    • max_count: decimal the maximum count of the item
    • max_order: int the maximum order of the item
page int the current page number.
1
page_size int the number of items per page.
20
total int the total number of products.
2

Otherwise if there was a problem with your request, you'll receive an error response such as 400 status code, and the response will include an error object describing why this request failed.

Response Schema: application/json
status string The status of response.
error object:
  • error_code string, the naumber of error: e.g: 400, For more information
    see Response Code
  • description string, the description of error: e.g: bad request
technical-support

🛠️ Technical Support