مستندات فنی وب‌سرویس (API v1)

var client = new RestClient("https://web.anbaronline.ir/api/v1/GetAllStock?
token=Po3bExGM8UmgfAgWaBcNxg&store=Product");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
   $(document).ready(function () {
        var token = "Po3bExGM8UmgfAgWaBcNxg";
        var store = "Product";

        $.ajax({
            type: "Get",
            url: "https://web.anbaronline.ir/api/v1/GetAllStock",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            data: { token: token, store: store },
            success: function (data) {
               //do something
            },
            error: function (msg) { 
               //error
            }
        });
    });
Show total inventory (GetAllStock):
https://web.anbaronline.ir/api/v1/GetAllStock
parameters 	Data Type
token		string
store		string
setUrl('https://web.anbaronline.ir/api/v1/GetAllStock?
token=Po3bExGM8UmgfAgWaBcNxg&store=Product');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
    'follow_redirects' => TRUE
));
   try {
       $response = $request->send();
       if ($response->getStatus() == 200) {
           echo $response->getBody();
       }
       else {
           echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
           $response->getReasonPhrase();
       }
   }
   catch(HTTP_Request2_Exception $e) {
       echo 'Error: ' . $e->getMessage();
                                    

فهرست اندپوینت‌ها (EndPoints)

GET
دریافت زمان سرور (GetTime)

جهت تست اتصال اولیه (نیاز به توکن ندارد).

/api/v1/GetTime
GET
لیست انبارها (GetAllStorage)

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

/api/v1/GetAllStorage
GET
لیست کالاها (GetAllProduct)
/api/v1/GetAllProduct?storageGuid=...
پارامترنوعتوضیح
storageGuidGuidاختیاری - فیلتر کالاها بر اساس انبار
GET
موجودی یک کالا (GetStock)
/api/v1/GetStock?productGuid=...&storageGuid=...
پارامترنوعالزامیتوضیح
productGuidGuidبلهشناسه امن کالا
storageGuidGuidخیرشناسه انبار مشخص
GET
موجودی کل انبار (GetAllStock)
/api/v1/GetAllStock?storageGuid=...
پارامترنوعتوضیح
storageGuidGuidاختیاری - انبار خاص یا کل انبارها
POST
ثبت مشتری یا تامین‌کننده (AddCustomer)
/api/v1/AddCustomer

ارسال اطلاعات به صورت JSON در Body (فیلد اجباری: Name)

POST
ثبت فرم ورود/خروج کالا (AddForm)
/api/v1/AddForm

ارسال فاکتور/حواله انبار همراه با آرایه‌ای از اقلام Items (شامل ProductGuid، Qty، Fee).