وب سرویس سیبا

مستندات وب‌سرویس API نرم‌افزار حسابداری سیبا

در صورتی که برنامه نویس هستید و قصد دارید از اطلاعات موجود در نرم‌افزار حسابداری سیبا استفاده نمایید، بهترین راه انجام این کار استفاده از وب سرویس است. هر وب سرویس مستنداتی دارد که در صورت وجود، کمک شایانی به استفاده از متدها و اطلاع از خطاهای اعلام شده خواهد کرد. وب سرویس یک زبان بین المللی است که بدون درنظر گرفتن زبان برنامه نویسی پروژه شما، امکانات بسیاری را در اختیار شما قرار خواهد داد.

Simplified API plugin icon in clay

محصولات (Products)

عملیات مربوط به کالاها، گروه‌ها، واحدها، بارکد و انبار

محصولات

دریافت لیست محصولات همراه با فیلتر

/api/products

GET

Parameters

مشخصه

نوع

ارسال

توضیح

name

string

اختیاری

نام محصول

code

string

اختیاری

کد محصول


curl -X GET "http://localhost:3900/api/products?name=test&code=123"

using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/products?name=test&code=123";

        var response = await client.GetAsync(url);
        var content = await response.Content.ReadAsStringAsync();

        Console.WriteLine(content);
    }
}

fetch('http://localhost:3900/api/products?name=test&code=123', {
  method: 'GET'
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));

import requests
url = "http://localhost:3900/api/products"
params = {
    "name": "test",
    "code": "123"
}
response = requests.get(url, params=params)
print(response.json())

<?php

$url = "http://localhost:3900/api/products?name=test&code=123";

$response = file_get_contents($url);
echo $response;

?>
200

لیست محصولات

500

خطای سرور

ایجاد محصول

/api/products

POST

* Request body

{
  "name": "string",
  "code": "string",
  "unitId": 0,
  "groupId": 0
}

curl -X POST "http://localhost:3900/api/products" \
  -H "Content-Type: application/json" \
  -d '{
        "name": "string",
        "code": "string",
        "unitId": 0,
        "groupId": 0
      }'

using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/products";

        var json = @"{
            ""name"": ""string"",
            ""code"": ""string"",
            ""unitId"": 0,
            ""groupId"": 0
        }";

        var content = new StringContent(json, Encoding.UTF8, "application/json");

        var response = await client.PostAsync(url, content);
        var result = await response.Content.ReadAsStringAsync();

        System.Console.WriteLine(result);
    }
}

fetch("http://localhost:3900/api/products", {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    name: "string",
    code: "string",
    unitId: 0,
    groupId: 0
  })
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));

import requests

url = "http://localhost:3900/api/products"

payload = {
    "name": "string",
    "code": "string",
    "unitId": 0,
    "groupId": 0
}

response = requests.post(url, json=payload)
print(response.text)


<?php

$url = "http://localhost:3900/api/products";

$data = array(
    "name" => "string",
    "code" => "string",
    "unitId" => 0,
    "groupId" => 0
);

$options = array(
    "http" => array(
        "header"  => "Content-Type: application/json\r\n",
        "method"  => "POST",
        "content" => json_encode($data)
    )
);

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

echo $result;

?>

200

محصول ایجاد شد

500

خطای سرور

ویرایش محصول

/api/products​

PUT

* Request body

{
  "productId": 0,
  "productCode": 0,
  "productName": "string",
  "productSubUnitId": 0,
  "groupId": 0,
  "totalQuantity": 0,
  "active": true,
  "buyPrice": 0,
  "sellPrice": 0,
  "orderPoint": 0,
  "comment": "string"
}

curl -X PUT "http://localhost:3900/api/products" \
  -H "Content-Type: application/json" \
  -d '{
        "productId": 0,
        "productCode": 0,
        "productName": "string",
        "productSubUnitId": 0,
        "groupId": 0,
        "totalQuantity": 0,
        "active": true,
        "buyPrice": 0,
        "sellPrice": 0,
        "orderPoint": 0,
        "comment": "string"
      }'

using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/products";

        var json = @"{
            ""productId"": 0,
            ""productCode"": 0,
            ""productName"": ""string"",
            ""productSubUnitId"": 0,
            ""groupId"": 0,
            ""totalQuantity"": 0,
            ""active"": true,
            ""buyPrice"": 0,
            ""sellPrice"": 0,
            ""orderPoint"": 0,
            ""comment"": ""string""
        }";

        var content = new StringContent(json, Encoding.UTF8, "application/json");

        var response = await client.PutAsync(url, content);
        var result = await response.Content.ReadAsStringAsync();

        System.Console.WriteLine(result);
    }
}

fetch("http://localhost:3900/api/products", {
  method: "PUT",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    productId: 0,
    productCode: 0,
    productName: "string",
    productSubUnitId: 0,
    groupId: 0,
    totalQuantity: 0,
    active: true,
    buyPrice: 0,
    sellPrice: 0,
    orderPoint: 0,
    comment: "string"
  })
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));

import requests

url = "http://localhost:3900/api/products"

payload = {
    "productId": 0,
    "productCode": 0,
    "productName": "string",
    "productSubUnitId": 0,
    "groupId": 0,
    "totalQuantity": 0,
    "active": True,
    "buyPrice": 0,
    "sellPrice": 0,
    "orderPoint": 0,
    "comment": "string"
}

response = requests.put(url, json=payload)
print(response.text)

<?php

$url = "http://localhost:3900/api/products";

$data = array(
    "productId" => 0,
    "productCode" => 0,
    "productName" => "string",
    "productSubUnitId" => 0,
    "groupId" => 0,
    "totalQuantity" => 0,
    "active" => true,
    "buyPrice" => 0,
    "sellPrice" => 0,
    "orderPoint" => 0,
    "comment" => "string"
);

$options = array(
    "http" => array(
        "header"  => "Content-Type: application/json\r\n",
        "method"  => "PUT",
        "content" => json_encode($data)
    )
);

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

echo $result;
?>

200

محصول ویرایش شد

400

داده‌های ارسالی نامعتبر

404

کالا یافت نشد

حذف محصول

/api/products​

DELETE

Parameters

مشخصه

نوع

ارسال

توضیح

productId

integer

اجباری

شناسه محصول برای حذف


curl -X DELETE "http://localhost:3900/api/products?productId=123"

using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/products?productId=123";

        var response = await client.DeleteAsync(url);
        var result = await response.Content.ReadAsStringAsync();

        System.Console.WriteLine(result);
    }
}

fetch("http://localhost:3900/api/products?productId=123", {
  method: "DELETE"
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));


import requests

url = "http://localhost:3900/api/products"

params = {
    "productId": 123
}

response = requests.delete(url, params=params)
print(response.text)

<?php

$url = "http://localhost:3900/api/products?productId=123";

$options = array(
    "http" => array(
        "method"  => "DELETE"
    )
);

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

echo $result;

?>

200

محصول حذف شد

500

خطای سرور

دریافت تصویر محصول

/api/products/image/{id}

GET

Parameters

مشخصه

نوع

ارسال

توضیح

id

integer

اجباری

شناسه کالا

* بازگرداندن تصویر پیش‌فرض کالا بر اساس شناسه؛ اگر تصویر در دیتابیس ذخیره شده باشد بایت‌ها برگردانده می‌شود و در غیر این صورت فایل از دیسک ارسال می‌شود.


curl -X GET "http://localhost:3900/api/products/image/456"


using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/products/image/456"; // شناسه کالا را اینجا جایگزین کنید

        var response = await client.GetAsync(url);

        // در اینجا می‌توانید با response.Content.ReadAsByteArrayAsync() بایت‌های تصویر را بخوانید
        // یا response.Content.ReadAsStreamAsync() جریان تصویر را بگیرید
        if (response.IsSuccessStatusCode)
        {
            var imageBytes = await response.Content.ReadAsByteArrayAsync();
            // حالا می‌توانید با imageBytes کاری انجام دهید (مثلاً ذخیره یا نمایش)
            System.IO.File.WriteAllBytes("product_image.jpg", imageBytes); // مثال: ذخیره تصویر
        }
        else
        {
            System.Console.WriteLine($"Error: {response.StatusCode}");
        }
    }
}


fetch("http://localhost:3900/api/products/image/456") // شناسه کالا را اینجا جایگزین کنید
  .then(response => {
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    return response.blob(); // یا response.arrayBuffer() اگر نیاز به بایت دارید
  })
  .then(blob => {
    // در اینجا می‌توانید با blob کاری انجام دهید (مثلاً نمایش در تگ img یا ذخیره)
    const imageUrl = URL.createObjectURL(blob);
    // مثال: نمایش در تگ img با id="productImage"
    // const imgElement = document.getElementById('productImage');
    // imgElement.src = imageUrl;

    // یا مثال: دانلود تصویر
    const link = document.createElement('a');
    link.href = imageUrl;
    link.download = 'product_image.jpg'; // نام فایل دانلود
    document.body.appendChild(link);
    link.click();
    document.body.removeChild(link);
  })
  .catch(err => console.error(err));


import requests

url = "http://localhost:3900/api/products/image/456" # شناسه کالا را اینجا جایگزین کنید

response = requests.get(url, stream=True)

if response.status_code == 200:
    with open("product_image.jpg", "wb") as f:
        for chunk in response.iter_content(chunk_size=8192):
            f.write(chunk)
    print("Image downloaded successfully as product_image.jpg")
else:
    print(f"Error: {response.status_code}")


<?php


$productId = 456; // شناسه کالا را اینجا جایگزین کنید
$url = "http://localhost:3900/api/products/image/{$productId}";

// برای دریافت تصویر به صورت بایت و ذخیره آن
$imageData = file_get_contents($url);

if ($imageData !== false) {
    // مثال: ذخیره تصویر در فایل
    file_put_contents("product_image.jpg", $imageData);
    echo "Image downloaded successfully as product_image.jpg";
} else {
    echo "Error downloading image.";
}

// اگر نیاز دارید که هدرهای HTTP را هم بررسی کنید، از cURL استفاده کنید:
/*
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0); // اگر هدرها را نمی خواهید
$imageData = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($http_code == 200) {
    file_put_contents("product_image.jpg", $imageData);
    echo "Image downloaded successfully as product_image.jpg";
} else {
    echo "Error downloading image. HTTP Code: " . $http_code;
}
*/

?>
200

تصویر کالا (باینری)

400

شناسه نامعتبر

404

تصویر کالا یافت نشد

500

خطای سرور

گروه کالا

دریافت لیست گروه‌های کالا

/api/products/group

GET


curl -X GET "http://localhost:3900/api/products/group"

using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/products/group";

        var response = await client.GetAsync(url);
        var content = await response.Content.ReadAsStringAsync();

        Console.WriteLine(content);
    }
}

fetch('http://localhost:3900/api/products/group', {
  method: 'GET'
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));

import requests
url = "http://localhost:3900/api/products/group"
response = requests.get(url, params=params)
print(response.json())

<?php
$url = "http://localhost:3900/api/products/group";
$response = file_get_contents($url);
echo $response;
?>
200

لیست گروه‌ها

500

خطای سرور

ایجاد گروه کالا

/api/products/group

POST

* Request body

{
  "groupName": "string",
  "parentId": 0
}

curl -X POST "http://localhost:3900/api/products/group" \
  -H "Content-Type: application/json" \
  -d '{
        "groupName": "string",
        "parentId": 0
      }'

using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/products/group";

        var json = @"{
            ""groupName"": ""string"",
            ""parentId"": 0
        }";

        var content = new StringContent(json, Encoding.UTF8, "application/json");

        var response = await client.PostAsync(url, content);
        var result = await response.Content.ReadAsStringAsync();

        System.Console.WriteLine(result);
    }
}

fetch("http://localhost:3900/api/products/group", {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    groupName: "string",
    parentId: 0
  })
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));

import requests

url = "http://localhost:3900/api/products/group"

payload = {
    "groupName": "string",
    "parentId": 0
}

response = requests.post(url, json=payload)
print(response.text)


<?php

$url = "http://localhost:3900/api/products/group";

$data = array(
    "groupName" => "string",
    "parentId" => 0
);

$options = array(
    "http" => array(
        "header"  => "Content-Type: application/json\r\n",
        "method"  => "POST",
        "content" => json_encode($data)
    )
);

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

echo $result;

?>

200

گروه ایجاد شد

500

خطای سرور

ویرایش گروه کالا

/api/products/group​

PUT

* Request body

{
  "groupId": 0,
  "groupName": "string",
  "parentId": 0
}

curl -X PUT "http://localhost:3900/api/products/group" \
  -H "Content-Type: application/json" \
  -d '{
        "groupId": 0,
        "groupName": "string",
        "parentId": 0
      }'

using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/products/group";

        var json = @"{
            ""groupId"": 0,
            ""groupName"": ""string"",
            ""parentId"": 0
        }";

        var content = new StringContent(json, Encoding.UTF8, "application/json");

        var response = await client.PutAsync(url, content);
        var result = await response.Content.ReadAsStringAsync();

        System.Console.WriteLine(result);
    }
}

fetch("http://localhost:3900/api/products/group", {
  method: "PUT",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    groupId: 0,
    groupName: "string",
    parentId: 0
  })
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));

import requests

url = "http://localhost:3900/api/products/group"

payload = {
    "groupId": 0,
    "groupName": "string",
    "parentId": 0
}

response = requests.put(url, json=payload)
print(response.text)

<?php

$url = "http://localhost:3900/api/products/group";

$data = array(
    "groupId" => 0,
    "groupName" => "string",
    "parentId" => 0
);

$options = array(
    "http" => array(
        "header"  => "Content-Type: application/json\r\n",
        "method"  => "PUT",
        "content" => json_encode($data)
    )
);

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

echo $result;
?>

200

گروه ویرایش شد

500

خطای سرور

حذف گروه کالا

/api/products/group​

DELETE

Parameters

مشخصه

نوع

ارسال

توضیح

id

integer

اجباری

شناسه گروه برای حذف


curl -X DELETE "http://localhost:3900/api/products/group?id=123"

using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/products/group?id=123";

        var response = await client.DeleteAsync(url);
        var result = await response.Content.ReadAsStringAsync();

        System.Console.WriteLine(result);
    }
}

fetch("http://localhost:3900/api/products/group?id=123", {
  method: "DELETE"
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));


import requests

url = "http://localhost:3900/api/products/group"

params = {
    "id": 123
}

response = requests.delete(url, params=params)
print(response.text)

<?php

$url = "http://localhost:3900/api/products/group?id=123";

$options = array(
    "http" => array(
        "method"  => "DELETE"
    )
);

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

echo $result;

?>

200

گروه حذف شد

500

خطای سرور

واحدها

دریافت لیست واحدها

/api/products/unit​

GET


curl -X GET "http://localhost:3900/api/products/unit​"

using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/products/unit​";

        var response = await client.GetAsync(url);
        var content = await response.Content.ReadAsStringAsync();

        Console.WriteLine(content);
    }
}

fetch('http://localhost:3900/api/products/unit​', {
  method: 'GET'
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));

import requests
url = "http://localhost:3900/api/products/unit​"

response = requests.get(url, params=params)
print(response.json())

<?php

$url = "http://localhost:3900/api/products/unit​";

$response = file_get_contents($url);
echo $response;

?>

200

لیست واحدها

500

خطای سرور

تعریف واحد جدید

/api/products/unit​

POST

* Request body

{
  "unitName": "string"
}

curl -X POST "http://localhost:3900/api/products/unit​" \
  -H "Content-Type: application/json" \
  -d '{
        "unitName": "string"
      }'

using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/products/unit​";

        var json = @"{
            ""unitName"": ""string""
        }";

        var content = new StringContent(json, Encoding.UTF8, "application/json");

        var response = await client.PostAsync(url, content);
        var result = await response.Content.ReadAsStringAsync();

        System.Console.WriteLine(result);
    }
}

fetch("http://localhost:3900/api/products/unit​", {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    unitName: "string"
  })
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));

import requests

url = "http://localhost:3900/api/products/unit​"

payload = {
    "unitName": "string"
}

response = requests.post(url, json=payload)
print(response.text)


<?php

$url = "http://localhost:3900/api/products/unit​";

$data = array(
    "unitName" => "string"
);

$options = array(
    "http" => array(
        "header"  => "Content-Type: application/json\r\n",
        "method"  => "POST",
        "content" => json_encode($data)
    )
);

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

echo $result;

?>

200

واحد با موفقیت ایجاد شد

500

خطای سرور

ویرایش واحد

/api/products/unit​

PUT

* Request body

{
  "unitId": 0,
  "unitName": "string"
}

curl -X PUT "http://localhost:3900/api/products/unit" \
  -H "Content-Type: application/json" \
  -d '{
        "unitId": 0,
        "unitName": "string"
      }'

using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/products/unit";

        var json = @"{
            ""unitId"": 0,
            ""unitName"": ""string""
        }";

        var content = new StringContent(json, Encoding.UTF8, "application/json");

        var response = await client.PutAsync(url, content);
        var result = await response.Content.ReadAsStringAsync();

        System.Console.WriteLine(result);
    }
}

fetch("http://localhost:3900/api/products/unit", {
  method: "PUT",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    unitId: 0,
    unitName: "string"
  })
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));

import requests

url = "http://localhost:3900/api/products/unit"

payload = {
    "unitId": 0,
    "unitName": "string"
}

response = requests.put(url, json=payload)
print(response.text)

<?php

$url = "http://localhost:3900/api/products/unit";

$data = array(
    "unitId" => 0,
    "unitName" => "string"
);

$options = array(
    "http" => array(
        "header"  => "Content-Type: application/json\r\n",
        "method"  => "PUT",
        "content" => json_encode($data)
    )
);

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

echo $result;
?>

200

واحد ویرایش شد

500

خطای سرور

حذف واحد

/api/products/unit​

DELETE

Parameters

مشخصه

نوع

ارسال

توضیح

id

integer

اجباری

شناسه واحد


curl -X DELETE "http://localhost:3900/api/products/unit?id=123"

using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/products/unit?id=123";

        var response = await client.DeleteAsync(url);
        var result = await response.Content.ReadAsStringAsync();

        System.Console.WriteLine(result);
    }
}

fetch("http://localhost:3900/api/products/unit?id=123", {
  method: "DELETE"
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));


import requests

url = "http://localhost:3900/api/products/unit"

params = {
    "id": 123
}

response = requests.delete(url, params=params)
print(response.text)

<?php

$url = "http://localhost:3900/api/products/unit?id=123";

$options = array(
    "http" => array(
        "method"  => "DELETE"
    )
);

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

echo $result;

?>

200

واحد حذف شد

500

خطای سرور

بارکد

دریافت بارکدها یا اطلاعات مرتبط

/api/products/barcode

GET


curl -X GET "http://localhost:3900/api/products/barcode"

using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/products/barcode";

        var response = await client.GetAsync(url);
        var content = await response.Content.ReadAsStringAsync();

        Console.WriteLine(content);
    }
}

fetch('http://localhost:3900/api/products/barcode', {
  method: 'GET'
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));

import requests
url = "http://localhost:3900/api/products/barcode"

response = requests.get(url, params=params)
print(response.json())

<?php

$url = "http://localhost:3900/api/products/barcode";

$response = file_get_contents($url);
echo $response;

?>
200

لیست بارکدها

500

خطای سرور

افزودن بارکد به کالا

/api/products/barcode

POST

* Request body

{
  "productId": 0,
  "barcode": "string"
}

curl -X POST "http://localhost:3900/api/products/barcode" \
  -H "Content-Type: application/json" \
  -d '{
        "barcode": "string",
        "productId": 0
      }'

using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/products/barcode";

        var json = @"{
            ""barcode"": ""string"",
            ""productId"": 0
        }";

        var content = new StringContent(json, Encoding.UTF8, "application/json");

        var response = await client.PostAsync(url, content);
        var result = await response.Content.ReadAsStringAsync();

        System.Console.WriteLine(result);
    }
}

fetch("http://localhost:3900/api/products/barcode", {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    barcode: "string",
    barcode: 0
  })
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));

import requests

url = "http://localhost:3900/api/products/barcode"

payload = {
    "barcode": "string",
    "productId": 0
}

response = requests.post(url, json=payload)
print(response.text)


<?php

$url = "http://localhost:3900/api/products/barcode";

$data = array(
    "barcode" => "string",
    "productId" => 0
);

$options = array(
    "http" => array(
        "header"  => "Content-Type: application/json\r\n",
        "method"  => "POST",
        "content" => json_encode($data)
    )
);

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

echo $result;

?>

200

بارکد ایجاد شد

500

خطای سرور

حذف گروه کالا

/api/products/barcode​

DELETE

Parameters

مشخصه

نوع

ارسال

توضیح

id

integer

اجباری

شناسه بارکد برای حذف


curl -X DELETE "http://localhost:3900/api/products/barcode?id=123"

using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/products/barcode?id=123";

        var response = await client.DeleteAsync(url);
        var result = await response.Content.ReadAsStringAsync();

        System.Console.WriteLine(result);
    }
}

fetch("http://localhost:3900/api/products/barcode?id=123", {
  method: "DELETE"
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));


import requests

url = "http://localhost:3900/api/products/barcode"

params = {
    "id": 123
}

response = requests.delete(url, params=params)
print(response.text)

<?php

$url = "http://localhost:3900/api/products/barcode?id=123";

$options = array(
    "http" => array(
        "method"  => "DELETE"
    )
);

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

echo $result;

?>

200

بارکد حذف شد

500

خطای سرور

انبار

دریافت لیست انبارها

/api/products/warehouse

GET


curl -X GET "http://localhost:3900/api/products/warehouse"

using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/products/warehouse";

        var response = await client.GetAsync(url);
        var content = await response.Content.ReadAsStringAsync();

        Console.WriteLine(content);
    }
}

fetch('http://localhost:3900/api/products/warehouse', {
  method: 'GET'
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));

import requests
url = "http://localhost:3900/api/products/warehouse"

response = requests.get(url, params=params)
print(response.json())

<?php

$url = "http://localhost:3900/api/products/warehouse";

$response = file_get_contents($url);
echo $response;

?>
200

لیست انبارها

500

خطای سرور

ایجاد انبار

/api/products/warehouse

POST

* Request body

{
  "warehouseName": "string"
}

curl -X POST "http://localhost:3900/api/products/warehouse" \
  -H "Content-Type: application/json" \
  -d '{
        "warehouseName": "string"
      }'

using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/products/warehouse";

        var json = @"{
            ""warehouseName"": ""string""
        }";

        var content = new StringContent(json, Encoding.UTF8, "application/json");

        var response = await client.PostAsync(url, content);
        var result = await response.Content.ReadAsStringAsync();

        System.Console.WriteLine(result);
    }
}

fetch("http://localhost:3900/api/products/warehouse", {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    warehouseName: "string"
  })
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));

import requests

url = "http://localhost:3900/api/products/warehouse"

payload = {
    "warehouseName": "string"
}

response = requests.post(url, json=payload)
print(response.text)


<?php

$url = "http://localhost:3900/api/products/warehouse";

$data = array(
    "warehouseName" => "string"
);

$options = array(
    "http" => array(
        "header"  => "Content-Type: application/json\r\n",
        "method"  => "POST",
        "content" => json_encode($data)
    )
);

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

echo $result;

?>

200

انبار ایجاد شد

500

خطای سرور

حذف انبار

/api/products/warehouse​

DELETE

Parameters

مشخصه

نوع

ارسال

توضیح

warehouseCode

integer

اجباری

شناسه انبار برای حذف


curl -X DELETE "http://localhost:3900/api/products/warehouse?warehouseCode=123"

using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/products/warehouse?warehouseCode=123";

        var response = await client.DeleteAsync(url);
        var result = await response.Content.ReadAsStringAsync();

        System.Console.WriteLine(result);
    }
}

fetch("http://localhost:3900/api/products/warehouse?warehouseCode=123", {
  method: "DELETE"
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));


import requests

url = "http://localhost:3900/api/products/warehouse"

params = {
    "warehouseCode": 123
}

response = requests.delete(url, params=params)
print(response.text)

<?php

$url = "http://localhost:3900/api/products/warehouse?warehouseCode=123";

$options = array(
    "http" => array(
        "method"  => "DELETE"
    )
);

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

echo $result;

?>

200

انبار حذف شد

500

خطای سرور

مشتریان (Customers)

مدیریت مشتریان و گروه‌های مشتری

مشتریان

دریافت لیست مشتریان همراه با فیلتر

/api/customers

GET

Parameters

مشخصه

نوع

ارسال

توضیح

customerCode

integer

اختیاری

کد مشتری

tel

string

اختیاری

شماره تلفن مشتری

name

string

اختیاری

نام مشتری


curl -X GET "http://localhost:3900/api/customers?customerCode=123&tel=09111111111&name=test"

using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/customers?customerCode=123&tel=09111111111&name=test";

        var response = await client.GetAsync(url);
        var content = await response.Content.ReadAsStringAsync();

        Console.WriteLine(content);
    }
}

fetch('http://localhost:3900/api/customers?customerCode=123&tel=09111111111&name=test', {
  method: 'GET'
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));

import requests
url = "http://localhost:3900/api/customers"
params = {
    "customerCode": 123,
    "tel": "09111111111",
    "name": "test"
}
response = requests.get(url, params=params)
print(response.json())

<?php

$url = "http://localhost:3900/api/customers?customerCode=123&tel=09111111111&name=test";

$response = file_get_contents($url);
echo $response;

?>
200

لیست مشتریان

Example Value Schema

{
  "success": true,
  "errCode": 0,
  "errMsg": "string",
  "data": {
    "customer": [
      {
        "id": 0,
        "customerCode": "string",
        "fullName": "string",
        "address": "string",
        "firstName": "string",
        "lastName": "string",
        "birthDate": "string",
        "province": "string",
        "city": "string",
        "cashCredit": 0,
        "chequeCredit": 0,
        "prefix": "string",
        "isActive": true,
        "tel": "string",
        "groupId": 0,
        "visitorPercent": 0,
        "visitor": true,
        "courierStatus": true,
        "buyPriceLevel": 0,
        "sellPriceLevel": 0,
        "email": "string",
        "comment": "string",
        "economicCode": "string",
        "nationalCode": "string",
        "bankAccountNo": "string",
        "cardNo": "string",
        "companyName": "string",
        "companyAddress": "string",
        "postalCode": "string",
        "initialBalance": 0
      }
    ]
  }
}
500

خطای سرور

ایجاد مشتری جدید

/api/customers

POST

* Request body

{
  "customerCode": 0,
  "address": "string",
  "firstName": "string",
  "lastName": "string",
  "birthDate": "1364/09/14",
  "province": "string",
  "city": "string",
  "prefix": "string",
  "isActive": true,
  "tel": "string",
  "groupId": 0,
  "visitorPercent": 0,
  "visitor": true,
  "courierStatus": true,
  "buyPriceLevel": 0,
  "sellPriceLevel": 0,
  "email": "string",
  "comment": "string",
  "economicCode": "string",
  "nationalCode": "string",
  "cardNo": "string",
  "companyName": "string",
  "companyAddress": "string",
  "postalCode": "string",
  "initialBalance": 0
}

curl -X POST "http://localhost:3900/api/customers" \
  -H "Content-Type: application/json" \
  -d '{
        "customerCode": 0,
        "address": "string",
        "firstName": "string",
        "lastName": "string",
        "birthDate": "1364/09/14",
        "province": "string",
        "city": "string",
        "prefix": "string",
        "isActive": true,
        "tel": "string",
        "groupId": 0,
        "visitorPercent": 0,
        "visitor": true,
        "courierStatus": true,
        "buyPriceLevel": 0,
        "sellPriceLevel": 0,
        "email": "string",
        "comment": "string",
        "economicCode": "string",
        "nationalCode": "string",
        "cardNo": "string",
        "companyName": "string",
        "companyAddress": "string",
        "postalCode": "string",
        "initialBalance": 0
      }'

using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/customers";

        var json = @"{
            ""customerCode"": 0,
            ""address"": ""string"",
            ""firstName"": ""string"",
            ""lastName"": ""string"",
            ""birthDate"": ""1364/09/14"",
            ""province"": ""string"",
            ""city"": ""string"",
            ""prefix"": ""string"",
            ""isActive"": true,
            ""tel"": ""string"",
            ""groupId"": 0,
            ""visitorPercent"": 0,
            ""visitor"": true,
            ""courierStatus"": true,
            ""buyPriceLevel"": 0,
            ""sellPriceLevel"": 0,
            ""email"": ""string"",
            ""comment"": ""string"",
            ""economicCode"": ""string"",
            ""nationalCode"": ""string"",
            ""cardNo"": ""string"",
            ""companyName"": ""string"",
            ""companyAddress"": ""string"",
            ""postalCode"": ""string"",
            ""initialBalance"": 0
        }";

        var content = new StringContent(json, Encoding.UTF8, "application/json");

        var response = await client.PostAsync(url, content);
        var result = await response.Content.ReadAsStringAsync();

        System.Console.WriteLine(result);
    }
}

fetch("http://localhost:3900/api/customers", {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    customerCode: 0,
    address: "string",
    firstName: "string",
    lastName: "string",
    birthDate: "1364/09/14",
    province: "string",
    city: "string",
    prefix: "string",
    isActive: true,
    tel: "string",
    groupId: 0,
    visitorPercent: 0,
    visitor: true,
    courierStatus: true,
    buyPriceLevel: 0,
    sellPriceLevel: 0,
    email: "string",
    comment: "string",
    economicCode: "string",
    nationalCode: "string",
    cardNo: "string",
    companyName: "string",
    companyAddress: "string",
    postalCode: "string",
    initialBalance: 0
  })
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));

import requests

url = "http://localhost:3900/api/customers"

payload = {
    "barcode": "string",
      "address": "string",
      "firstName": "string",
      "lastName": "string",
      "birthDate": "1364/09/14",
      "province": "string",
      "city": "string",
      "prefix": "string",
      "isActive": true,
      "tel": "string",
      "groupId": 0,
      "visitorPercent": 0,
      "visitor": true,
      "courierStatus": true,
      "buyPriceLevel": 0,
      "sellPriceLevel": 0,
      "email": "string",
      "comment": "string",
      "economicCode": "string",
      "nationalCode": "string",
      "cardNo": "string",
      "companyName": "string",
      "companyAddress": "string",
      "postalCode": "string",
      "initialBalance": 0
}

response = requests.post(url, json=payload)
print(response.text)


<?php

$url = "http://localhost:3900/api/customers";

$data = array(
    "customerCode" => "string",
    "address" => "string",
    "firstName" => "string",
    "lastName" => "string",
    "birthDate" => "1364/09/14",
    "province" => "string",
    "city" => "string",
    "prefix" => "string",
    "isActive" => true,
    "tel" => "string",
    "groupId" => 0,
    "visitorPercent" => 0,
    "visitor" => true,
    "courierStatus" => true,
    "buyPriceLevel" => 0,
    "sellPriceLevel" => 0,
    "email" => "string",
    "comment" => "string",
    "economicCode" => "string",
    "nationalCode" => "string",
    "cardNo" => "string",
    "companyName" => "string",
    "companyAddress" => "string",
    "postalCode" => "string",
    "initialBalance" => 0
);

$options = array(
    "http" => array(
        "header"  => "Content-Type: application/json\r\n",
        "method"  => "POST",
        "content" => json_encode($data)
    )
);

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

echo $result;

?>

200

مشتری با موفقیت ایجاد شد

400

خطای اعتبارسنجی

500

خطای سرور

ویرایش اطلاعات مشتری

/api/customers​

PUT

* Request body

{
  "customerId": 0,
  "customerCode": 0,
  "address": "string",
  "firstName": "string",
  "lastName": "string",
  "birthDate": "1364/09/14",
  "province": "string",
  "city": "string",
  "prefix": "string",
  "isActive": true,
  "tel": "string",
  "groupId": 0,
  "visitorPercent": 0,
  "visitor": true,
  "courierStatus": true,
  "buyPriceLevel": 0,
  "sellPriceLevel": 0,
  "email": "string",
  "comment": "string",
  "economicCode": "string",
  "nationalCode": "string",
  "cardNo": "string",
  "companyName": "string",
  "companyAddress": "string",
  "postalCode": "string",
  "initialBalance": 0
}

curl -X PUT "http://localhost:3900/api/customers" \
  -H "Content-Type: application/json" \
  -d '{
        "customerCode": 0,
        "address": "string",
        "firstName": "string",
        "lastName": "string",
        "birthDate": "1364/09/14",
        "province": "string",
        "city": "string",
        "prefix": "string",
        "isActive": true,
        "tel": "string",
        "groupId": 0,
        "visitorPercent": 0,
        "visitor": true,
        "courierStatus": true,
        "buyPriceLevel": 0,
        "sellPriceLevel": 0,
        "email": "string",
        "comment": "string",
        "economicCode": "string",
        "nationalCode": "string",
        "cardNo": "string",
        "companyName": "string",
        "companyAddress": "string",
        "postalCode": "string",
        "initialBalance": 0
      }'

using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/customers";

        var json = @"{
            ""customerCode"": 0,
            ""address"": ""string"",
            ""firstName"": ""string"",
            ""lastName"": ""string"",
            ""birthDate"": ""1364/09/14"",
            ""province"": ""string"",
            ""city"": ""string"",
            ""prefix"": ""string"",
            ""isActive"": true,
            ""tel"": ""string"",
            ""groupId"": 0,
            ""visitorPercent"": 0,
            ""visitor"": true,
            ""courierStatus"": true,
            ""buyPriceLevel"": 0,
            ""sellPriceLevel"": 0,
            ""email"": ""string"",
            ""comment"": ""string"",
            ""economicCode"": ""string"",
            ""nationalCode"": ""string"",
            ""cardNo"": ""string"",
            ""companyName"": ""string"",
            ""companyAddress"": ""string"",
            ""postalCode"": ""string"",
            ""initialBalance"": 0
        }";

        var content = new StringContent(json, Encoding.UTF8, "application/json");

        var response = await client.PutAsync(url, content);
        var result = await response.Content.ReadAsStringAsync();

        System.Console.WriteLine(result);
    }
}

fetch("http://localhost:3900/api/customers", {
  method: "PUT",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    customerCode: 0,
    address: "string",
    firstName: "string",
    lastName: "string",
    birthDate: "1364/09/14",
    province: "string",
    city: "string",
    prefix: "string",
    isActive: true,
    tel: "string",
    groupId: 0,
    visitorPercent: 0,
    visitor: true,
    courierStatus: true,
    buyPriceLevel: 0,
    sellPriceLevel: 0,
    email: "string",
    comment: "string",
    economicCode: "string",
    nationalCode: "string",
    cardNo: "string",
    companyName: "string",
    companyAddress: "string",
    postalCode: "string",
    initialBalance: 0
  })
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));

import requests

url = "http://localhost:3900/api/customers"

payload = {
    "barcode": "string",
      "address": "string",
      "firstName": "string",
      "lastName": "string",
      "birthDate": "1364/09/14",
      "province": "string",
      "city": "string",
      "prefix": "string",
      "isActive": true,
      "tel": "string",
      "groupId": 0,
      "visitorPercent": 0,
      "visitor": true,
      "courierStatus": true,
      "buyPriceLevel": 0,
      "sellPriceLevel": 0,
      "email": "string",
      "comment": "string",
      "economicCode": "string",
      "nationalCode": "string",
      "cardNo": "string",
      "companyName": "string",
      "companyAddress": "string",
      "postalCode": "string",
      "initialBalance": 0
}

response = requests.put(url, json=payload)
print(response.text)

<?php

$url = "http://localhost:3900/api/customers";

$data = array(
    "customerCode" => "string",
    "address" => "string",
    "firstName" => "string",
    "lastName" => "string",
    "birthDate" => "1364/09/14",
    "province" => "string",
    "city" => "string",
    "prefix" => "string",
    "isActive" => true,
    "tel" => "string",
    "groupId" => 0,
    "visitorPercent" => 0,
    "visitor" => true,
    "courierStatus" => true,
    "buyPriceLevel" => 0,
    "sellPriceLevel" => 0,
    "email" => "string",
    "comment" => "string",
    "economicCode" => "string",
    "nationalCode" => "string",
    "cardNo" => "string",
    "companyName" => "string",
    "companyAddress" => "string",
    "postalCode" => "string",
    "initialBalance" => 0
);

$options = array(
    "http" => array(
        "header"  => "Content-Type: application/json\r\n",
        "method"  => "PUT",
        "content" => json_encode($data)
    )
);

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

echo $result;
?>

200

مشتری ویرایش شد

400

خطا در داده‌ها

500

خطای سرور

حذف مشتری

/api/customers​

DELETE

* Request body

{
  "customerId": 0
}

curl -X DELETE "http://localhost:3900/api/customers?customerId=123"

using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/customers?customerId=123";

        var response = await client.DeleteAsync(url);
        var result = await response.Content.ReadAsStringAsync();

        System.Console.WriteLine(result);
    }
}

fetch("http://localhost:3900/api/customers?customerId=123", {
  method: "DELETE"
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));


import requests

url = "http://localhost:3900/api/customers"

params = {
    "customerId": 123
}

response = requests.delete(url, params=params)
print(response.text)

<?php

$url = "http://localhost:3900/api/customers?customerId=123";

$options = array(
    "http" => array(
        "method"  => "DELETE"
    )
);

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

echo $result;

?>

200

مشتری حذف شد

500

خطای سرور

گروه مشتری

دریافت لیست گروه‌های مشتری

/api/customers/group

GET


curl -X GET "http://localhost:3900/api/customers/group"

using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/customers/group";

        var response = await client.GetAsync(url);
        var content = await response.Content.ReadAsStringAsync();

        Console.WriteLine(content);
    }
}

fetch('http://localhost:3900/api/customers/group', {
  method: 'GET'
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));

import requests
url = "http://localhost:3900/api/customers/group"

response = requests.get(url, params=params)
print(response.json())

<?php

$url = "http://localhost:3900/api/customers/group";

$response = file_get_contents($url);
echo $response;

?>
200

دریافت موفق

500

خطای سرور

ایجاد گروه مشتری

/api/customers/group

POST

* Request body

{
  "groupName": "string",
  "parentId": 0
}

curl -X POST "http://localhost:3900/api/customers/group" \
  -H "Content-Type: application/json" \
  -d '{
        "groupName": "string",
        "parentId": 0
      }'

using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/customers/group";

        var json = @"{
            ""groupName"": ""string"",
            ""parentId"": 0
        }";

        var content = new StringContent(json, Encoding.UTF8, "application/json");

        var response = await client.PostAsync(url, content);
        var result = await response.Content.ReadAsStringAsync();

        System.Console.WriteLine(result);
    }
}

fetch("http://localhost:3900/api/customers/group", {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    groupName: "string",
    parentId: 0
  })
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));

import requests

url = "http://localhost:3900/api/customers/group"

payload = {
      "groupName": "string",
      "parentId": 0
}

response = requests.post(url, json=payload)
print(response.text)


<?php

$url = "http://localhost:3900/api/customers/group";

$data = array(
    "groupName" => "string",
    "parentId" => 0
);

$options = array(
    "http" => array(
        "header"  => "Content-Type: application/json\r\n",
        "method"  => "POST",
        "content" => json_encode($data)
    )
);

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

echo $result;

?>

200

گروه ایجاد شد

500

خطای سرور

ویرایش گروه مشتری

/api/customers/group

PUT

* Request body

{
  "groupId": 0,
  "groupName": "string",
  "parentId": 0
}

curl -X PUT "http://localhost:3900/api/customers/group" \
  -H "Content-Type: application/json" \
  -d '{
        "groupId": 0,
        "groupName": "string",
        "parentId": 0
      }'

using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/customers/group";

        var json = @"{
            ""groupId"": 0,
            ""groupName"": ""string"",
            ""parentId"": 0
        }";

        var content = new StringContent(json, Encoding.UTF8, "application/json");

        var response = await client.PutAsync(url, content);
        var result = await response.Content.ReadAsStringAsync();

        System.Console.WriteLine(result);
    }
}

fetch("http://localhost:3900/api/customers/group", {
  method: "PUT",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    groupId: 0,
    groupName: "string",
    parentId: 0
  })
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));

import requests

url = "http://localhost:3900/api/customers/group"

payload = {
    "groupId": 0,
      "address": "string",
      "groupName": "string",
      "parentId": 0
}

response = requests.put(url, json=payload)
print(response.text)

<?php

$url = "http://localhost:3900/api/customers/group";

$data = array(
    "groupId" => 0,
    "groupName" => "string",
    "parentId" => 0
);

$options = array(
    "http" => array(
        "header"  => "Content-Type: application/json\r\n",
        "method"  => "PUT",
        "content" => json_encode($data)
    )
);

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

echo $result;
?>

200

گروه ویرایش شد

400

داده‌های ارسالی نامعتبر

500

خطای سرور

حذف گروه مشتری

/api/customers/group

DELETE

Parameters

مشخصه

نوع

ارسال

توضیح

groupId

integer

اجباری

شناسه گروه برای حذف


curl -X DELETE "http://localhost:3900/api/customers/group?groupId=123"

using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/customers?groupId=123";

        var response = await client.DeleteAsync(url);
        var result = await response.Content.ReadAsStringAsync();

        System.Console.WriteLine(result);
    }
}

fetch("http://localhost:3900/api/customers/group?customerId=123", {
  method: "DELETE"
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));


import requests

url = "http://localhost:3900/api/customers/group"

params = {
    "groupId": 123
}

response = requests.delete(url, params=params)
print(response.text)

<?php

$url = "http://localhost:3900/api/customers/group?groupId=123";

$options = array(
    "http" => array(
        "method"  => "DELETE"
    )
);

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

echo $result;

?>

200

حذف گروه با موفقیت انجام شد

500

خطای سرور

شماره تلفن

دریافت شماره‌های تلفن یک مشتری

/api/customers/tel

GET

Parameters

مشخصه

نوع

ارسال

توضیح

customerId

integer

اجباری

شناسه مشتری


curl -X GET "http://localhost:3900/api/customers/tel?customerId=123"

using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/customers/tel?customerId=123";

        var response = await client.GetAsync(url);
        var content = await response.Content.ReadAsStringAsync();

        Console.WriteLine(content);
    }
}

fetch('http://localhost:3900/api/customers/tel?customerId=123', {
  method: 'GET'
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));

import requests
url = "http://localhost:3900/api/customers/tel"
params = {
    "customerId": 123,
    "tel": "09111111111",
    "name": "test"
}
response = requests.get(url, params=params)
print(response.json())

<?php

$url = "http://localhost:3900/api/customers/tel?customerId=123";

$response = file_get_contents($url);
echo $response;

?>
200

دریافت موفق

500

خطای سرور

افزودن شماره تلفن برای مشتری

/api/customers/tel

POST

Parameters

مشخصه

نوع

ارسال

توضیح

customerId 

integer

اجباری

شناسه مشتری

tel 

string

اجباری

شماره تلفن

caption

string

اجباری

توضیحات اختیاری برای شماره



curl -X POST "http://localhost:3900/api/customers/tel?customerId=123&tel=09120000000&caption=test"



using System.Net.Http;
using System.Threading.Tasks;
class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var customerId = 123;
        var tel = "09120000000";
        var caption = "test";
        var url = $"http://localhost:3900/api/customers/tel?customerId={customerId}&tel={tel}&caption={caption}";
        var response = await client.PostAsync(url, null); 
        var result = await response.Content.ReadAsStringAsync();
        System.Console.WriteLine(result);
    }
}

const customerId = 123;
const tel = "09120000000";
const caption = "test";
fetch(`http://localhost:3900/api/customers/tel?customerId=${customerId}&tel=${tel}&caption=${caption}`, {
  method: "POST"
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));

import requests
url = "http://localhost:3900/api/customers/tel"
params = {
    "customerId": 123,
    "tel": "09120000000",
    "caption": "test"
}
response = requests.post(url, params=params)
print(response.text)

<?php
$url = "http://localhost:3900/api/customers/tel?customerId=>123&tel=>09111111111&caption=>string";
$options = array(
    "http" => array(
        "header"  => "Content-Type: application/json\r\n",
        "method"  => "POST"
    )
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo $result;
?>

201

شماره تلفن اضافه شد

500

خطای سرور

حذف شماره تلفن مشتری

/api/customers/tel

DELETE

Parameters

مشخصه

نوع

ارسال

توضیح

telId

integer

اجباری

شماره تلفن برای حذف


curl -X DELETE "http://localhost:3900/api/customers/tel?telId=123"

using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/customers/tel?telId=123";

        var response = await client.DeleteAsync(url);
        var result = await response.Content.ReadAsStringAsync();

        System.Console.WriteLine(result);
    }
}

fetch("http://localhost:3900/api/customers/tel?telId=123", {
  method: "DELETE"
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));


import requests

url = "http://localhost:3900/api/customers/tel"

params = {
    "telId": 123
}

response = requests.delete(url, params=params)
print(response.text)

<?php

$url = "http://localhost:3900/api/customers/tel?telId=123";

$options = array(
    "http" => array(
        "method"  => "DELETE"
    )
);

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

echo $result;

?>

200

حذف با موفقیت انجام شد

500

خطای سرور

فاکتور (Factors)

عملیات فاکتورها، صدور و مدیریت آیتم‌های فاکتور

فاکتور

ثبت فاکتور جدید (ایجاد رکورد فاکتور)

/api/factors

POST

* Request body

{
  "invoiceType": 2,
  "invoiceDate": "2025-09-03",
  "invoiceTime": "10:30:00",
  "invoiceNo": 12345,
  "personId": 1,
  "discount": 0,
  "info": "فاکتور فروش نمونه",
  "userId": 1,
  "discountItem": 0,
  "servicePerc": 0,
  "roundPrice": 0,
  "details": [
    {
      "itemId": 101,
      "itemType": 0,
      "quantity": 2,
      "quantity1": 1,
      "quantity2": 1,
      "price": 50000,
      "sumPrice": 100000,
      "info": "کالا نمونه",
      "warehouseCode": 10,
      "discount": 0,
      "quantityStr": "2 عدد",
      "taxPerc": 9,
      "feePerc": 0
    },
    {
      "itemId": 102,
      "itemType": 1,
      "quantity": 1,
      "quantity1": 1,
      "quantity2": 0,
      "price": 20000,
      "sumPrice": 20000,
      "info": "خدمت نمونه",
      "warehouseCode": 0,
      "discount": 0,
      "quantityStr": "1 واحد",
      "taxPerc": 0,
      "feePerc": 0
    }
  ]
}


curl -X POST "http://localhost:3900/api/factors" \
  -H "Content-Type: application/json" \
  -d '{
    "invoiceType": 2,
    "invoiceDate": "2025-09-03",
    "invoiceTime": "10:30:00",
    "invoiceNo": 12345,
    "personId": 1,
    "discount": 0,
    "info": "فاکتور فروش نمونه",
    "userId": 1,
    "discountItem": 0,
    "servicePerc": 0,
    "roundPrice": 0,
    "details": [
      {
        "itemId": 101,
        "itemType": 0,
        "quantity": 2,
        "quantity1": 1,
        "quantity2": 1,
        "price": 50000,
        "sumPrice": 100000,
        "info": "کالا نمونه",
        "warehouseCode": 10,
        "discount": 0,
        "quantityStr": "2 عدد",
        "taxPerc": 9,
        "feePerc": 0
      },
      {
        "itemId": 102,
        "itemType": 1,
        "quantity": 1,
        "quantity1": 1,
        "quantity2": 0,
        "price": 20000,
        "sumPrice": 20000,
        "info": "خدمت نمونه",
        "warehouseCode": 0,
        "discount": 0,
        "quantityStr": "1 واحد",
        "taxPerc": 0,
        "feePerc": 0
      }
    ]
  }'


using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/factors";

        var json = @"{
            ""invoiceType"": 2,
            ""invoiceDate"": ""2025-09-03"",
            ""invoiceTime"": ""10:30:00"",
            ""invoiceNo"": 12345,
            ""personId"": 1,
            ""discount"": 0,
            ""info"": ""فاکتور فروش نمونه"",
            ""userId"": 1,
            ""discountItem"": 0,
            ""servicePerc"": 0,
            ""roundPrice"": 0,
            ""details"": [
                {
                    ""itemId"": 101,
                    ""itemType"": 0,
                    ""quantity"": 2,
                    ""quantity1"": 1,
                    ""quantity2"": 1,
                    ""price"": 50000,
                    ""sumPrice"": 100000,
                    ""info"": ""کالا نمونه"",
                    ""warehouseCode"": 10,
                    ""discount"": 0,
                    ""quantityStr"": ""2 عدد"",
                    ""taxPerc"": 9,
                    ""feePerc"": 0
                },
                {
                    ""itemId"": 102,
                    ""itemType"": 1,
                    ""quantity"": 1,
                    ""quantity1"": 1,
                    ""quantity2"": 0,
                    ""price"": 20000,
                    ""sumPrice"": 20000,
                    ""info"": ""خدمت نمونه"",
                    ""warehouseCode"": 0,
                    ""discount"": 0,
                    ""quantityStr"": ""1 واحد"",
                    ""taxPerc"": 0,
                    ""feePerc"": 0
                }
            ]
        }";
        var content = new StringContent(json, Encoding.UTF8, "application/json");
        var response = await client.PostAsync(url, content);
        var result = await response.Content.ReadAsStringAsync();
        System.Console.WriteLine(result);
    }
}

const url = "http://localhost:3900/api/factors";
const data = {
  invoiceType: 2,
  invoiceDate: "2025-09-03",
  invoiceTime: "10:30:00",
  invoiceNo: 12345,
  personId: 1,
  discount: 0,
  info: "فاکتور فروش نمونه",
  userId: 1,
  discountItem: 0,
  servicePerc: 0,
  roundPrice: 0,
  details: [
    {
      itemId: 101,
      itemType: 0,
      quantity: 2,
      quantity1: 1,
      quantity2: 1,
      price: 50000,
      sumPrice: 100000,
      info: "کالا نمونه",
      warehouseCode: 10,
      discount: 0,
      quantityStr: "2 عدد",
      taxPerc: 9,
      feePerc: 0
    },
    {
      itemId: 102,
      itemType: 1,
      quantity: 1,
      quantity1: 1,
      quantity2: 0,
      price: 20000,
      sumPrice: 20000,
      info: "خدمت نمونه",
      warehouseCode: 0,
      discount: 0,
      quantityStr: "1 واحد",
      taxPerc: 0,
      feePerc: 0
    }
  ]
};

fetch(url, {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify(data)
})
  .then(res => res.json())
  .then(result => console.log(result))
  .catch(err => console.error(err));

import requests
url = "http://localhost:3900/api/factors"
data = {
    "invoiceType": 2,
    "invoiceDate": "2025-09-03",
    "invoiceTime": "10:30:00",
    "invoiceNo": 12345,
    "personId": 1,
    "discount": 0,
    "info": "فاکتور فروش نمونه",
    "userId": 1,
    "discountItem": 0,
    "servicePerc": 0,
    "roundPrice": 0,
    "details": [
        {
            "itemId": 101,
            "itemType": 0,
            "quantity": 2,
            "quantity1": 1,
            "quantity2": 1,
            "price": 50000,
            "sumPrice": 100000,
            "info": "کالا نمونه",
            "warehouseCode": 10,
            "discount": 0,
            "quantityStr": "2 عدد",
            "taxPerc": 9,
            "feePerc": 0
        },
        {
            "itemId": 102,
            "itemType": 1,
            "quantity": 1,
            "quantity1": 1,
            "quantity2": 0,
            "price": 20000,
            "sumPrice": 20000,
            "info": "خدمت نمونه",
            "warehouseCode": 0,
            "discount": 0,
            "quantityStr": "1 واحد",
            "taxPerc": 0,
            "feePerc": 0
        }
    ]
}

response = requests.post(url, json=data)
print(response.text)

<?php
$url = "http://localhost:3900/api/factors";
$data = array(
    "invoiceType" => 2,
    "invoiceDate" => "2025-09-03",
    "invoiceTime" => "10:30:00",
    "invoiceNo" => 12345,
    "personId" => 1,
    "discount" => 0,
    "info" => "فاکتور فروش نمونه",
    "userId" => 1,
    "discountItem" => 0,
    "servicePerc" => 0,
    "roundPrice" => 0,
    "details" => array(
        array(
            "itemId" => 101,
            "itemType" => 0,
            "quantity" => 2,
            "quantity1" => 1,
            "quantity2" => 1,
            "price" => 50000,
            "sumPrice" => 100000,
            "info" => "کالا نمونه",
            "warehouseCode" => 10,
            "discount" => 0,
            "quantityStr" => "2 عدد",
            "taxPerc" => 9,
            "feePerc" => 0
        ),
        array(
            "itemId" => 102,
            "itemType" => 1,
            "quantity" => 1,
            "quantity1" => 1,
            "quantity2" => 0,
            "price" => 20000,
            "sumPrice" => 20000,
            "info" => "خدمت نمونه",
            "warehouseCode" => 0,
            "discount" => 0,
            "quantityStr" => "1 واحد",
            "taxPerc" => 0,
            "feePerc" => 0
        )
    )
);
$options = array(
    "http" => array(
        "header"  => "Content-Type: application/json\r\n",
        "method"  => "POST",
        "content" => json_encode($data, JSON_UNESCAPED_UNICODE)
    )
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo $result;
?>

200

فاکتور ایجاد شد

500

خطای سرور

کاربران (Users)

مدیریت کاربران، احراز هویت و نشست‌ها

کاربران

دریافت لیست کاربران

/api/users

GET


curl -X GET "http://localhost:3900/api/users"

using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/users";

        var response = await client.GetAsync(url);
        var content = await response.Content.ReadAsStringAsync();

        Console.WriteLine(content);
    }
}

fetch('http://localhost:3900/api/users', {
  method: 'GET'
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));

import requests
url = "http://localhost:3900/api/users"

response = requests.get(url, params=params)
print(response.json())

<?php

$url = "http://localhost:3900/api/users";

$response = file_get_contents($url);
echo $response;

?>
200

لیست کاربران

500

خطای سرور

صندوق (Cash Register)

مدیریت صندوق‌ها (صندوق نقدی / cash registers) و موجودی اولیه

صندوق

دریافت لیست صندوق‌ها

/api/cashRegister

GET


curl -X GET "http://localhost:3900/api/cashRegister"

using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/cashRegister";

        var response = await client.GetAsync(url);
        var content = await response.Content.ReadAsStringAsync();

        Console.WriteLine(content);
    }
}

fetch('http://localhost:3900/api/cashRegister', {
  method: 'GET'
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));

import requests
url = "http://localhost:3900/api/cashRegister"

response = requests.get(url, params=params)
print(response.json())

<?php

$url = "http://localhost:3900/api/cashRegister";

$response = file_get_contents($url);
echo $response;

?>
200

لیست مشتریان

500

خطای سرور

بانک‌ها (Banks)

مدیریت حساب‌های بانکی و اطلاعات مربوط به بانک

بانک

دریافت لیست حساب‌های بانکی

/api/banks

GET


curl -X GET "http://localhost:3900/api/banks"

using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/banks";

        var response = await client.GetAsync(url);
        var content = await response.Content.ReadAsStringAsync();

        Console.WriteLine(content);
    }
}

fetch('http://localhost:3900/api/banks', {
  method: 'GET'
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));

import requests
url = "http://localhost:3900/api/banks"

response = requests.get(url, params=params)
print(response.json())

<?php

$url = "http://localhost:3900/api/banks";

$response = file_get_contents($url);
echo $response;

?>
200

لیست حساب‌ها

500

خطای سرور

تاریخچه (History)

مشاهده لاگ‌ها، سوابق عملیات و تاریخچه سیستم

تاریخچه

دریافت لاگ‌ها یا تاریخچه

/api/history

GET

Parameters

مشخصه

نوع

ارسال

توضیح

userId

integer

اختیاری

فیلتر بر اساس شناسه کاربر


curl -X GET "http://localhost:3900/api/history?userId=123"

using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "http://localhost:3900/api/history?userId=123";

        var response = await client.GetAsync(url);
        var content = await response.Content.ReadAsStringAsync();

        Console.WriteLine(content);
    }
}

fetch('http://localhost:3900/api/history?userId=123', {
  method: 'GET'
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));

import requests
url = "http://localhost:3900/api/history"
params = {
    "userId": 123
}
response = requests.get(url, params=params)
print(response.json())

<?php

$url = "http://localhost:3900/api/history?userId=123";

$response = file_get_contents($url);
echo $response;

?>
200

تاریخچه یافت شد

500

خطای سرور