{"id":7320,"date":"2026-05-20T16:24:16","date_gmt":"2026-05-20T09:24:16","guid":{"rendered":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/?p=7320"},"modified":"2026-05-21T11:04:20","modified_gmt":"2026-05-21T04:04:20","slug":"api_purchase","status":"publish","type":"post","link":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/api_purchase\/","title":{"rendered":"Purchase Module"},"content":{"rendered":"<h5><strong>SKYBIZ API \u2014 Purchase Module<\/strong><\/h5>\n<h3><strong>Purchase<\/strong><\/h3>\n<p class=\"font-claude-response-body break-words whitespace-normal leading-[1.7]\">The Purchase module allows you to retrieve and create purchase invoice records in your SKYBIZ account. Supports both <strong>read<\/strong> and <strong>create<\/strong> operations.<\/p>\n<p class=\"font-claude-response-body break-words whitespace-normal leading-[1.7]\"><strong>Endpoint:<\/strong> <code class=\"bg-text-200\/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]\">\/apiv2\/modules\/purchase.php<\/code><\/p>\n<p class=\"font-claude-response-body break-words whitespace-normal leading-[1.7]\"><strong>Required Permissions:<\/strong> Purchase \u2014 Read, Purchase \u2014 Create<\/p>\n<p class=\"font-claude-response-body break-words whitespace-normal leading-[1.7]\"><strong>Allowed DocTypes:<\/strong> <code class=\"bg-text-200\/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]\">SupInv<\/code> (Invoice), <code class=\"bg-text-200\/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]\">SupCN<\/code> (Credit Note), <code class=\"bg-text-200\/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]\">SupDN<\/code> (Debit Note)<\/p>\n<hr \/>\n<h3><strong>Read Purchase<\/strong><\/h3>\n<p class=\"font-claude-response-body break-words whitespace-normal leading-[1.7]\">Retrieves purchase invoices created within the given date range. Returns all fields \u2014 no field filtering or custom filters are supported for this module.<\/p>\n<h4>Base Request Structure<\/h4>\n<pre>{\r\n  \"api_key\": \"your-api-key\",\r\n  \"api_secret\": \"your-api-secret\",\r\n  \"action\": \"read\",\r\n  \"date_from\": \"YYYY-MM-DD\",\r\n  \"date_to\": \"YYYY-MM-DD\"\r\n}<\/pre>\n<h4>Request Parameters<\/h4>\n<div class=\"overflow-x-auto w-full px-2 mb-6\">\n<table class=\"min-w-full border-collapse text-sm leading-[1.7] whitespace-normal\">\n<thead class=\"text-left\">\n<tr>\n<th class=\"text-text-100 border-b-0.5 border-border-300\/60 py-2 pr-4 align-top font-bold\" scope=\"col\">Parameter<\/th>\n<th class=\"text-text-100 border-b-0.5 border-border-300\/60 py-2 pr-4 align-top font-bold\" scope=\"col\">Description<\/th>\n<th class=\"text-text-100 border-b-0.5 border-border-300\/60 py-2 pr-4 align-top font-bold\" scope=\"col\">Required<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>api_key<\/code><\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Your API key<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Yes<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>api_secret<\/code><\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Your API secret<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Yes<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>action<\/code><\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Must be <code>\"read\"<\/code><\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Yes<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>date_from<\/code><\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Start date (YYYY-MM-DD)<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Yes<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>date_to<\/code><\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">End date (YYYY-MM-DD). Max 31 days range.<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Yes<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h4>Date Rules<\/h4>\n<ul>\n<li>Format must be <code>YYYY-MM-DD<\/code> \u2014 e.g. <code>\"2026-04-01\"<\/code><\/li>\n<li>Maximum range is <strong>31 days<\/strong><\/li>\n<li><code>date_from<\/code> cannot be after <code>date_to<\/code><\/li>\n<\/ul>\n<hr \/>\n<h3><strong>Available Fields (Read Only)<\/strong><\/h3>\n<p class=\"font-claude-response-body break-words whitespace-normal leading-[1.7]\">The Purchase module returns all fields. Field filtering is not supported for this module.<\/p>\n<div class=\"overflow-x-auto w-full px-2 mb-6\">\n<p><code>CurCode<\/code>stringCurrency code<\/p>\n<table class=\"min-w-full border-collapse text-sm leading-[1.7] whitespace-normal\">\n<thead class=\"text-left\">\n<tr>\n<th>Field<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>Doc1No<\/code><\/td>\n<td>string<\/td>\n<td>Primary document number<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>Doc2No<\/code> \/ <code>Doc3No<\/code><\/td>\n<td>string<\/td>\n<td>Reference document numbers<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>D_ate<\/code><\/td>\n<td>string<\/td>\n<td>Document date<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>CusCode<\/code><\/td>\n<td>string<\/td>\n<td>Supplier code<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>CurRate1<\/code><\/td>\n<td>float<\/td>\n<td>Exchange rate<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>TermCode<\/code><\/td>\n<td>integer<\/td>\n<td>Payment term code<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>HCNetAmt<\/code><\/td>\n<td>float<\/td>\n<td>Home currency net amount<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>HCDtTax<\/code><\/td>\n<td>float<\/td>\n<td>Home currency detail tax total<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>DocType<\/code><\/td>\n<td>string<\/td>\n<td>Document type \u2014 <code>SupInv<\/code>, <code>SupCN<\/code>, <code>SupDN<\/code><\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>DueDate<\/code><\/td>\n<td>string<\/td>\n<td>Payment due date<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>PostedYN<\/code><\/td>\n<td>string<\/td>\n<td>Flag \u2014 whether document is posted<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>ApprovedYN<\/code><\/td>\n<td>string<\/td>\n<td>Flag \u2014 whether document is approved<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>ItemCode<\/code><\/td>\n<td>string<\/td>\n<td>Item, other charge, or GL account code<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>Description<\/code><\/td>\n<td>string<\/td>\n<td>Line item description<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>Description2<\/code><\/td>\n<td>string<\/td>\n<td>Secondary line description<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>Qty<\/code><\/td>\n<td>float<\/td>\n<td>Quantity<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>FactorQty<\/code><\/td>\n<td>float<\/td>\n<td>UOM conversion factor<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>UOM<\/code><\/td>\n<td>string<\/td>\n<td>Unit of measure<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p class=\"font-claude-response-body break-words whitespace-normal leading-[1.7]\"><em>(Additional fields continue below)<\/em><\/p>\n<div class=\"overflow-x-auto w-full px-2 mb-6\"><code>OCRate<\/code>floatOther charge rate<br \/>\n<code>FinCatCode<\/code>stringFinancial category code<br \/>\n<code>LineNo<\/code>integerLine number<\/p>\n<table class=\"min-w-full border-collapse text-sm leading-[1.7] whitespace-normal\">\n<thead class=\"text-left\">\n<tr>\n<th>Field<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>UOMSingular<\/code><\/td>\n<td>string<\/td>\n<td>Singular form of the UOM<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>HCUnitCost<\/code><\/td>\n<td>float<\/td>\n<td>Home currency unit cost<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>HCLineAmt<\/code><\/td>\n<td>float<\/td>\n<td>Home currency line total<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>HCDiscount<\/code><\/td>\n<td>float<\/td>\n<td>Home currency discount amount<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>DisRate1<\/code><\/td>\n<td>float<\/td>\n<td>Discount rate<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>HCTax<\/code><\/td>\n<td>float<\/td>\n<td>Home currency tax amount<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>TaxRate1<\/code><\/td>\n<td>float<\/td>\n<td>Tax rate<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>DetailTaxCode<\/code><\/td>\n<td>string<\/td>\n<td>Tax code for the line<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>BlankLine<\/code><\/td>\n<td>string<\/td>\n<td>Line type \u2014 <code>\"0\"<\/code> Stock Item, <code>\"4\"<\/code> Other Charge, <code>\"6\"<\/code> GL Account<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>BranchCode<\/code><\/td>\n<td>string<\/td>\n<td>Branch code<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>DepartmentCode<\/code><\/td>\n<td>string<\/td>\n<td>Department code<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>ProjectCode<\/code><\/td>\n<td>string<\/td>\n<td>Project code<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>LocationCode<\/code><\/td>\n<td>string<\/td>\n<td>Stock location code<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>WarrantyDate<\/code><\/td>\n<td>string<\/td>\n<td>Warranty date<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>GRNNo<\/code><\/td>\n<td>string<\/td>\n<td>GRN reference number<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>PORunNo<\/code><\/td>\n<td>integer<\/td>\n<td>PO run number<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>PONO<\/code><\/td>\n<td>string<\/td>\n<td>PO number<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>LandingCost<\/code><\/td>\n<td>float<\/td>\n<td>Landing cost<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>OCCode<\/code><\/td>\n<td>string<\/td>\n<td>Other charge code<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>OCAmt<\/code><\/td>\n<td>float<\/td>\n<td>Other charge amount<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>GLCode<\/code><\/td>\n<td>string<\/td>\n<td>GL account code<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>ItemBatch<\/code><\/td>\n<td>string<\/td>\n<td>Item batch number<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<hr \/>\n<h3><strong>Example 1 \u2014 Get All Purchase (All Fields)<\/strong><\/h3>\n<p class=\"font-claude-response-body break-words whitespace-normal leading-[1.7]\">This request returns all purchase invoice fields for invoices created between April 1, 2026 and April 30, 2026.<\/p>\n<h4>Request<\/h4>\n<pre>{\r\n  \"api_key\": \"your-api-key\",\r\n  \"api_secret\": \"your-api-secret\",\r\n  \"action\": \"read\",\r\n  \"date_from\": \"2026-04-01\",\r\n  \"date_to\": \"2026-04-30\"\r\n}<\/pre>\n<h4>Sample Code for making an API READ request using php<\/h4>\n<pre>&lt;?php\r\nheader('Content-Type: application\/json');\r\n\r\n\/\/ ============================================================\r\n\/\/ STEP 1: CONFIGURATION\r\n\/\/ ============================================================\r\n\r\n$API_KEY = \"your-api-key\";\r\n$API_SECRET = \"your-api-secret\";\r\n$ACTION = \"read\";\r\n\r\n\/\/ Date range (required for all endpoints, max 31 days)\r\n$DATE_FROM = \"2026-04-01\";\r\n$DATE_TO = \"2026-04-30\";\r\n\r\n\/\/ ============================================================\r\n\/\/ STEP 2: ENDPOINT\r\n\/\/ ============================================================\r\n\r\n$BASE_URL = \"https:\/\/domain-name\/01\/clientportal\/apiv2\/modules\"; \/\/(replace it with your skybiz domain name url)\r\n$ENDPOINT = \"purchase.php\";\r\n\r\n\/\/ ============================================================\r\n\/\/ STEP 3: REQUEST PARAMETERS\r\n\/\/ ============================================================\r\n\r\n$requestParams = [\r\n    \"date_from\" =&gt; $DATE_FROM,\r\n    \"date_to\" =&gt; $DATE_TO\r\n];\r\n\r\n\/\/ ============================================================\r\n\/\/ STEP 4: BUILD PAYLOAD\r\n\/\/ ============================================================\r\n\r\n$payload = array_merge(\r\n    [\r\n        \"api_key\" =&gt; $API_KEY,\r\n        \"api_secret\" =&gt; $API_SECRET,\r\n        \"action\" =&gt; $ACTION\r\n    ],\r\n    $requestParams\r\n);\r\n\r\n\/\/ ============================================================\r\n\/\/ STEP 5: SEND REQUEST\r\n\/\/ ============================================================\r\n\r\n$url = rtrim($BASE_URL, '\/') . '\/' . ltrim($ENDPOINT, '\/');\r\n\r\n$ch = curl_init($url);\r\n\r\ncurl_setopt_array($ch, [\r\n    CURLOPT_RETURNTRANSFER =&gt; true,\r\n    CURLOPT_POST =&gt; true,\r\n    CURLOPT_POSTFIELDS =&gt; http_build_query($payload),\r\n    CURLOPT_TIMEOUT =&gt; 30,\r\n]);\r\n\r\n$response = curl_exec($ch);\r\n\r\n\/\/ ============================================================\r\n\/\/ STEP 6: HANDLE CURL ERROR\r\n\/\/ ============================================================\r\n\r\nif ($response === false) {\r\n    echo json_encode([\r\n        \"status\" =&gt; \"error\",\r\n        \"timestamp\" =&gt; date(\"c\"),\r\n        \"request_id\" =&gt; uniqid(\"req_\"),\r\n        \"message\" =&gt; curl_error($ch)\r\n    ], JSON_PRETTY_PRINT);\r\n    curl_close($ch);\r\n    exit;\r\n}\r\n\r\n$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);\r\ncurl_close($ch);\r\n\r\n\/\/ ============================================================\r\n\/\/ STEP 7: DECODE RESPONSE\r\n\/\/ ============================================================\r\n\r\n$result = json_decode($response, true);\r\n\r\nif (!$result) {\r\n    echo json_encode([\r\n        \"status\" =&gt; \"error\",\r\n        \"timestamp\" =&gt; date(\"c\"),\r\n        \"request_id\" =&gt; uniqid(\"req_\"),\r\n        \"message\" =&gt; \"Invalid JSON from API\",\r\n        \"raw_response\" =&gt; $response\r\n    ], JSON_PRETTY_PRINT);\r\n    exit;\r\n}\r\n\r\n\/\/ ============================================================\r\n\/\/ STEP 8: RETURN CLEAN JSON FORMAT\r\n\/\/ ============================================================\r\n\r\necho json_encode([\r\n    \"status\" =&gt; $result['status'] ?? \"error\",\r\n    \"timestamp\" =&gt; date(\"c\"),\r\n    \"request_id\" =&gt; $result['request_id'] ?? uniqid(\"req_\"),\r\n    \"data\" =&gt; $result['data'] ?? null,\r\n    \"message\" =&gt; $result['message'] ?? null\r\n], JSON_PRETTY_PRINT);<\/pre>\n<h4>Response (Success)<\/h4>\n<pre>{\r\n  \"status\": \"response\",\r\n  \"timestamp\": \"2026-04-30T04:07:04+00:00\",\r\n  \"request_id\": \"req_69f2d56891e57\",\r\n  \"data\": {\r\n    \"requested_by\": \"your-api-key\",\r\n    \"mode\": \"2\",\r\n    \"date_range\": {\r\n      \"from\": \"2026-04-01\",\r\n      \"to\": \"2026-04-30\",\r\n      \"days\": 30\r\n    },\r\n    \"total_returned\": 2,\r\n    \"data\": [\r\n      {\r\n        \"Doc1No\": \"PINV-001\",\r\n        \"CusCode\": \"SUPP001\",\r\n        \"DocType\": \"SupInv\",\r\n        \"HCNetAmt\": 1500.00,\r\n        \"HCDtTax\": 120.00,\r\n        \"D_ate\": \"2026-04-15\"\r\n      },\r\n      {\r\n        \"Doc1No\": \"PINV-002\",\r\n        \"CusCode\": \"SUPP002\",\r\n        \"DocType\": \"SupInv\",\r\n        \"HCNetAmt\": 2500.00,\r\n        \"HCDtTax\": 200.00,\r\n        \"D_ate\": \"2026-04-20\"\r\n      }\r\n    ]\r\n  }\r\n}<\/pre>\n<hr \/>\n<h3><strong>Postman Steps \u2014 READ Request<\/strong><\/h3>\n<ol>\n<li>Set method to <strong>POST<\/strong><\/li>\n<\/ol>\n<p><a href=\"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7323\" src=\"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase1.png\" alt=\"\" width=\"1226\" height=\"408\" srcset=\"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase1.png 1226w, https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase1-300x100.png 300w, https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase1-1024x341.png 1024w, https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase1-768x256.png 768w, https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase1-150x50.png 150w\" sizes=\"auto, (max-width: 1226px) 100vw, 1226px\" \/><\/a><\/p>\n<p>2. Enter URL: <code class=\"bg-text-200\/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]\">https:\/\/your-domain\/01\/clientportal\/apiv2\/modules\/purchase.php<\/code><\/p>\n<p><a href=\"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7324\" src=\"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase2.png\" alt=\"\" width=\"1229\" height=\"339\" srcset=\"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase2.png 1229w, https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase2-300x83.png 300w, https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase2-1024x282.png 1024w, https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase2-768x212.png 768w, https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase2-150x41.png 150w\" sizes=\"auto, (max-width: 1229px) 100vw, 1229px\" \/><\/a><\/p>\n<p>3. Set header: <code class=\"bg-text-200\/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]\">Content-Type: application\/json<\/code><\/p>\n<p><a href=\"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7325\" src=\"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase3.png\" alt=\"\" width=\"1227\" height=\"343\" srcset=\"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase3.png 1227w, https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase3-300x84.png 300w, https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase3-1024x286.png 1024w, https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase3-768x215.png 768w, https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase3-150x42.png 150w\" sizes=\"auto, (max-width: 1227px) 100vw, 1227px\" \/><\/a><\/p>\n<p>4. Under <strong>Body<\/strong>, select <strong>raw<\/strong> and format <strong>JSON<\/strong><\/p>\n<p><a href=\"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7326\" src=\"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase4.png\" alt=\"\" width=\"1223\" height=\"381\" srcset=\"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase4.png 1223w, https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase4-300x93.png 300w, https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase4-1024x319.png 1024w, https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase4-768x239.png 768w, https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase4-150x47.png 150w\" sizes=\"auto, (max-width: 1223px) 100vw, 1223px\" \/><\/a><\/p>\n<p>5. Paste your request payload and click <strong>Send<\/strong><\/p>\n<p><a href=\"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7327\" src=\"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase5.png\" alt=\"\" width=\"1222\" height=\"935\" srcset=\"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase5.png 1222w, https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase5-300x230.png 300w, https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase5-1024x784.png 1024w, https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase5-768x588.png 768w, https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase5-150x115.png 150w\" sizes=\"auto, (max-width: 1222px) 100vw, 1222px\" \/><\/a><\/p>\n<hr \/>\n<h3><strong>Create Purchase Invoice<\/strong><\/h3>\n<p class=\"font-claude-response-body break-words whitespace-normal leading-[1.7]\">Creates one or more purchase invoice records. All documents are validated before any are saved. If any document fails, the entire batch is rejected.<\/p>\n<h4>Compulsory Fields \u2014 Header<\/h4>\n<div class=\"overflow-x-auto w-full px-2 mb-6\">\n<table class=\"min-w-full border-collapse text-sm leading-[1.7] whitespace-normal\">\n<thead class=\"text-left\">\n<tr>\n<th>Field<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>Doc1No<\/code><\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Unique document number. Must not already exist.<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>CusCode<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Supplier code. Must exist in SKYBIZ (FinCatCode = &#8216;B70&#8217;).<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>DocType<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Document type \u2014 <code>SupInv<\/code>, <code>SupCN<\/code>, <code>SupDN<\/code>, or <code>PurRet<\/code><\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>HCNetAmt<\/code><\/td>\n<td>float<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Net amount before tax. Must equal sum of all item <code>HCLineAmt<\/code>.<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>HCDtTax<\/code><\/td>\n<td>float<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Total tax amount. Must equal sum of all item <code>HCTax<\/code>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h4>Compulsory Fields \u2014 Items<\/h4>\n<div class=\"overflow-x-auto w-full px-2 mb-6\">\n<p><code>FactorQty<\/code>floatUOM conversion factor. Usually same as <code>Qty<\/code>. Must be greater than 0.<\/p>\n<table class=\"min-w-full border-collapse text-sm leading-[1.7] whitespace-normal\">\n<thead class=\"text-left\">\n<tr>\n<th>Field<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>ItemCode<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Item code. Must exist in SKYBIZ (stock item, other charge, or GL account based on BlankLine).<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>Description<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Item description (max 255 characters)<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>Qty<\/code><\/td>\n<td>float<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Quantity. Must be greater than 0 for stock items and other charges.<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>UOM<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Unit of measure. Must exist in SKYBIZ UOM table.<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>HCUnitCost<\/code><\/td>\n<td>float<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Unit price. Must be greater than 0 for stock items.<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>HCLineAmt<\/code><\/td>\n<td>float<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Line total. Must equal <code>Qty \u00d7 HCUnitCost<\/code>.<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>BlankLine<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Line type \u2014 <code>\"0\"<\/code> Stock Item, <code>\"4\"<\/code> Other Charge, <code>\"6\"<\/code> GL Account<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h4>Optional Fields \u2014 Header<\/h4>\n<div class=\"overflow-x-auto w-full px-2 mb-6\">\n<table class=\"min-w-full border-collapse text-sm leading-[1.7] whitespace-normal\">\n<thead class=\"text-left\">\n<tr>\n<th>Field<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>Doc2No<\/code> \/ <code>Doc3No<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Reference document numbers<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>D_ate<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Document date in <code>YYYY-MM-DD<\/code> format. Defaults to today.<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>CurCode<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Currency code. Default: <code>MYR<\/code>. Must exist in SKYBIZ if provided.<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>CurRate1<\/code><\/td>\n<td>float<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Exchange rate. Default: <code>1<\/code>. Must be greater than 0 if provided.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h4>Optional Fields \u2014 Items<\/h4>\n<div class=\"overflow-x-auto w-full px-2 mb-6\"><code>TaxRate1<\/code>floatTax rate in percent \u2014 e.g. <code>8<\/code>. If provided, HCTax is validated.<br \/>\n<code>PONO<\/code>stringPO number<br \/>\n<code>OCAmt<\/code>floatOther charge amount<\/p>\n<table class=\"min-w-full border-collapse text-sm leading-[1.7] whitespace-normal\">\n<thead class=\"text-left\">\n<tr>\n<th>Field<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>Description2<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Second description line (max 255 characters)<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>UOMSingular<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Singular form of UOM (auto-populated from UOM if empty)<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>HCDiscount<\/code> \/ <code>DisRate1<\/code><\/td>\n<td>float<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Discount amount and discount rate (%)<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>HCTax<\/code><\/td>\n<td>float<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Tax amount for this line. Must equal <code>HCLineAmt \u00d7 (TaxRate1 \/ 100)<\/code> if TaxRate1 &gt; 0.<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>DetailTaxCode<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Tax code. If provided, must exist in SKYBIZ with TaxType &#8216;2&#8217; or &#8216;3&#8217;.<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>BranchCode<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Branch code. If provided, must exist in SKYBIZ branch table.<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>DepartmentCode<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Department code. If provided, must exist in SKYBIZ department table.<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>ProjectCode<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Project code. If provided, must exist in SKYBIZ project table.<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>LocationCode<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Stock location code. If provided, must exist in SKYBIZ location table.<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>WarrantyDate<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Warranty date in <code>YYYY-MM-DD<\/code> format<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>GRNNo<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">GRN reference number<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>PORunNo<\/code><\/td>\n<td>integer<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">PO run number<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>LandingCost<\/code><\/td>\n<td>float<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Landing cost<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>OCCode<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Other charge code. If provided, must exist in SKYBIZ.<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>OCRate<\/code><\/td>\n<td>float<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Other charge rate<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>GLCode<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">GL account code. If provided, must exist in SKYBIZ.<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>FinCatCode<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Financial category code<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>DUD1<\/code> to <code>DUD6<\/code><\/td>\n<td>string<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">User-defined detail fields 1 through 6 (max 40 characters each)<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>LineNo<\/code><\/td>\n<td>integer<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Line sequence number. Auto-assigned if omitted.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h4>BlankLine Values<\/h4>\n<div class=\"overflow-x-auto w-full px-2 mb-6\">\n<table class=\"min-w-full border-collapse text-sm leading-[1.7] whitespace-normal\">\n<thead class=\"text-left\">\n<tr>\n<th>Value<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>\"0\"<\/code><\/td>\n<td>Stock Item<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Item code must exist. HCUnitCost must be &gt; 0.<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>\"4\"<\/code><\/td>\n<td>Other Charge<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Item code must exist.<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>\"6\"<\/code><\/td>\n<td>GL Account<\/td>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\">Item code must exist (GL account table).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div class=\"callout callout-warning\" style=\"background: #fffbeb; border-left: 4px solid #f59e0b; padding: 12px 16px; margin: 16px 0;\">\n<p style=\"margin: 0;\">\u26a0\ufe0f <strong>Amount Validation Rules:<\/strong> SKYBIZ validates that <code>HCLineAmt = Qty \u00d7 HCUnitCost<\/code> and that the sum of all item <code>HCLineAmt<\/code> values matches the document header <code>HCNetAmt<\/code>. Mismatches will cause the entire document to fail.<\/p>\n<\/div>\n<h4>Base Create Request Structure<\/h4>\n<pre>{\r\n  \"api_key\": \"your-api-key\",\r\n  \"api_secret\": \"your-api-secret\",\r\n  \"action\": \"create\",\r\n  \"purchase_data\": {\r\n    \"documents\": [\r\n      {\r\n        \"Doc1No\": \"PINV-001\",\r\n        \"CusCode\": \"SUPP001\",\r\n        \"DocType\": \"SupInv\",\r\n        \"D_ate\": \"2026-05-20\",\r\n        \"HCNetAmt\": 550.00,\r\n        \"HCDtTax\": 44.00,\r\n        \"CurCode\": \"RM\",\r\n        \"CurRate1\": 1,\r\n        \"items\": [\r\n          {\r\n            \"ItemCode\": \"ITEM001\",\r\n            \"Description\": \"Raw Material A\",\r\n            \"Qty\": 10,\r\n            \"FactorQty\": 1,\r\n            \"UOM\": \"Piece\",\r\n            \"HCUnitCost\": 50.00,\r\n            \"HCLineAmt\": 500.00,\r\n            \"BlankLine\": \"0\",\r\n            \"HCTax\": 40.00,\r\n            \"TaxRate1\": 8,\r\n            \"LineNo\": 1\r\n          }\r\n        ]\r\n      }\r\n    ]\r\n  }\r\n}<\/pre>\n<h4>Sample Code for making an API CREATE request using php<\/h4>\n<pre>&lt;?php\r\nheader('Content-Type: application\/json');\r\n\r\n\/\/ ============================================================\r\n\/\/ STEP 1: CONFIGURATION\r\n\/\/ ============================================================\r\n\r\n$API_KEY = \"your-api-key\";\r\n$API_SECRET = \"your-api-secret\";\r\n$ACTION = \"create\";\r\n\r\n\/\/ ============================================================\r\n\/\/ STEP 2: ENDPOINT\r\n\/\/ ============================================================\r\n\r\n$BASE_URL = \"https:\/\/domain-name\/01\/clientportal\/apiv2\/modules\"; \/\/(replace it with your skybiz domain name url)\r\n$ENDPOINT = \"purchase.php\";\r\n\r\n\/\/ ============================================================\r\n\/\/ STEP 3: DATA KEY\r\n\/\/ ============================================================\r\n\r\n$DATA_KEY = \"purchase_data\";\r\n\r\n\/\/ ============================================================\r\n\/\/ STEP 4: BUILD YOUR DOCUMENTS ARRAY\r\n\/\/ ============================================================\r\n\r\n$DOCUMENTS = [];\r\n\r\n\/\/ --- Purchase example ---\r\n$DOCUMENTS[] = [\r\n    \"Doc1No\" =&gt; \"PINV-001\",\r\n    \"CusCode\" =&gt; \"SUPP001\",\r\n    \"DocType\" =&gt; \"SupInv\",\r\n    \"D_ate\" =&gt; \"2026-05-20\",\r\n    \"HCNetAmt\" =&gt; 550.00,\r\n    \"HCDtTax\" =&gt; 44.00,\r\n    \"CurCode\" =&gt; \"RM\",\r\n    \"CurRate1\" =&gt; 1,\r\n    \"items\" =&gt; [\r\n        [\r\n            \"ItemCode\" =&gt; \"ITEM001\",\r\n            \"Description\" =&gt; \"Raw Material A\",\r\n            \"Qty\" =&gt; 10,\r\n            \"FactorQty\" =&gt; 1,\r\n            \"UOM\" =&gt; \"Piece\",\r\n            \"HCUnitCost\" =&gt; 50.00,\r\n            \"HCLineAmt\" =&gt; 500.00,\r\n            \"BlankLine\" =&gt; \"0\",\r\n            \"HCTax\" =&gt; 40.00,\r\n            \"TaxRate1\" =&gt; 8,\r\n            \"LineNo\" =&gt; 1\r\n        ]\r\n    ]\r\n];\r\n\r\n\/\/ ============================================================\r\n\/\/ STEP 5: CLIENT-SIDE COUNT CHECK (Please do not modify this)\r\n\/\/ ============================================================\r\n\r\n$totalDocuments = 0;\r\n\r\nforeach ($DOCUMENTS as $document) {\r\n    $totalDocuments++;\r\n\r\n    if (empty($document['Doc1No'])) {\r\n        echo json_encode([\r\n            \"status\" =&gt; \"REJECTED_BY_CLIENT\",\r\n            \"timestamp\" =&gt; date(\"c\"),\r\n            \"request_id\" =&gt; uniqid(\"req_\"),\r\n            \"message\" =&gt; \"CLIENT-SIDE REJECTION: Document at position {$totalDocuments} has empty Doc1No\",\r\n            \"action_required\" =&gt; \"Fix the document before sending to server\"\r\n        ], JSON_PRETTY_PRINT);\r\n        exit;\r\n    }\r\n}\r\n\r\nif ($totalDocuments &gt; 500) {\r\n    echo json_encode([\r\n        \"status\" =&gt; \"REJECTED_BY_CLIENT\",\r\n        \"timestamp\" =&gt; date(\"c\"),\r\n        \"request_id\" =&gt; uniqid(\"req_\"),\r\n        \"message\" =&gt; \"CLIENT-SIDE REJECTION: You have {$totalDocuments} documents. Maximum is 500.\",\r\n        \"your_document_count\" =&gt; $totalDocuments,\r\n        \"max_allowed\" =&gt; 500,\r\n        \"action_required\" =&gt; \"Reduce your documents to 500 or less BEFORE sending to server\"\r\n    ], JSON_PRETTY_PRINT);\r\n    exit;\r\n}\r\n\r\necho \"=== CLIENT-SIDE VALIDATION ===\\n\";\r\necho \"Looped through all {$totalDocuments} documents one by one\\n\";\r\necho \"All documents passed client validation\\n\";\r\necho \"Document count: {$totalDocuments} (max 500)\\n\";\r\necho \"Sending to server...\\n\\n\";\r\n\r\n\/\/ ============================================================\r\n\/\/ STEP 6: SEND REQUEST\r\n\/\/ ============================================================\r\n\r\n$url = rtrim($BASE_URL, '\/') . '\/' . ltrim($ENDPOINT, '\/');\r\n\r\n$payload = [\r\n    \"api_key\" =&gt; $API_KEY,\r\n    \"api_secret\" =&gt; $API_SECRET,\r\n    \"action\" =&gt; $ACTION,\r\n    $DATA_KEY =&gt; [\"documents\" =&gt; $DOCUMENTS]\r\n];\r\n\r\n$ch = curl_init($url);\r\n\r\ncurl_setopt_array($ch, [\r\n    CURLOPT_RETURNTRANSFER =&gt; true,\r\n    CURLOPT_POST =&gt; true,\r\n    CURLOPT_POSTFIELDS =&gt; json_encode($payload),\r\n    CURLOPT_HTTPHEADER =&gt; ['Content-Type: application\/json'],\r\n    CURLOPT_TIMEOUT =&gt; 120,\r\n]);\r\n\r\n$response = curl_exec($ch);\r\n\r\n\/\/ ============================================================\r\n\/\/ STEP 7: HANDLE CURL ERROR\r\n\/\/ ============================================================\r\n\r\nif ($response === false) {\r\n    echo json_encode([\r\n        \"status\" =&gt; \"error\",\r\n        \"timestamp\" =&gt; date(\"c\"),\r\n        \"request_id\" =&gt; uniqid(\"req_\"),\r\n        \"message\" =&gt; curl_error($ch)\r\n    ], JSON_PRETTY_PRINT);\r\n    curl_close($ch);\r\n    exit;\r\n}\r\n\r\n$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);\r\ncurl_close($ch);\r\n\r\n\/\/ ============================================================\r\n\/\/ STEP 8: DECODE RESPONSE\r\n\/\/ ============================================================\r\n\r\n$result = json_decode($response, true);\r\n\r\nif (!$result) {\r\n    echo json_encode([\r\n        \"status\" =&gt; \"error\",\r\n        \"timestamp\" =&gt; date(\"c\"),\r\n        \"request_id\" =&gt; uniqid(\"req_\"),\r\n        \"message\" =&gt; \"Invalid JSON from API\",\r\n        \"raw_response\" =&gt; $response\r\n    ], JSON_PRETTY_PRINT);\r\n    exit;\r\n}\r\n\r\n\/\/ ============================================================\r\n\/\/ STEP 9: RETURN CLEAN JSON FORMAT\r\n\/\/ ============================================================\r\n\r\necho \"=== SERVER RESPONSE ===\\n\";\r\necho json_encode([\r\n    \"status\" =&gt; $result['status'] ?? \"error\",\r\n    \"timestamp\" =&gt; date(\"c\"),\r\n    \"request_id\" =&gt; $result['request_id'] ?? uniqid(\"req_\"),\r\n    \"data\" =&gt; $result['data'] ?? null,\r\n    \"message\" =&gt; $result['message'] ?? null\r\n], JSON_PRETTY_PRINT);<\/pre>\n<h4>Response (Success)<\/h4>\n<pre>{\r\n  \"status\": \"response\",\r\n  \"timestamp\": \"2026-05-20T10:30:00+08:00\",\r\n  \"request_id\": \"req_69fc0070d83cf\",\r\n  \"data\": {\r\n    \"requested_by\": \"your-api-key\",\r\n    \"mode\": \"2\",\r\n    \"summary\": {\r\n      \"total_documents\": 1,\r\n      \"inserted\": 1,\r\n      \"failed\": 0\r\n    },\r\n    \"successful_documents\": [\"PINV-001\"],\r\n    \"failed_documents\": [],\r\n    \"fail_details\": {\r\n      \"compulsory_fields_missing\": [],\r\n      \"duplicate_documents\": [],\r\n      \"invalid_suppliers\": [],\r\n      \"invalid_items\": [],\r\n      \"invalid_tax_codes\": [],\r\n      \"invalid_locations\": [],\r\n      \"invalid_departments\": [],\r\n      \"invalid_projects\": [],\r\n      \"invalid_branches\": [],\r\n      \"invalid_currencies\": [],\r\n      \"invalid_uoms\": [],\r\n      \"amount_mismatch\": [],\r\n      \"validation_errors\": []\r\n    }\r\n  }\r\n}<\/pre>\n<h4>Response (Error \u2014 Duplicate Document)<\/h4>\n<pre>{\r\n  \"status\": \"response\",\r\n  \"timestamp\": \"2026-05-20T10:30:00+08:00\",\r\n  \"request_id\": \"req_69fc03e446a20\",\r\n  \"data\": {\r\n    \"requested_by\": \"your-api-key\",\r\n    \"mode\": \"2\",\r\n    \"summary\": {\r\n      \"total_documents\": 1,\r\n      \"inserted\": 0,\r\n      \"failed\": 1\r\n    },\r\n    \"successful_documents\": [],\r\n    \"failed_documents\": [\"PINV-001\"],\r\n    \"fail_details\": {\r\n      \"duplicate_documents\": [\"PINV-001\"],\r\n      \"invalid_currencies\": [],\r\n      \"invalid_uoms\": [],\r\n      \"amount_mismatch\": [],\r\n      \"validation_errors\": {}\r\n    }\r\n  }\r\n}<\/pre>\n<hr \/>\n<h3><strong>Error Responses<\/strong><\/h3>\n<h4>Missing Date Range (READ)<\/h4>\n<pre>{\r\n  \"status\": \"error\",\r\n  \"timestamp\": \"2026-04-07T10:46:15+08:00\",\r\n  \"request_id\": \"req_6612f3b9c21a7\",\r\n  \"message\": \"date_from and date_to are required\"\r\n}<\/pre>\n<h4>Invalid Date Format<\/h4>\n<pre>{\r\n  \"status\": \"error\",\r\n  \"timestamp\": \"2026-04-07T10:46:15+08:00\",\r\n  \"request_id\": \"req_6612f3b9c21a7\",\r\n  \"message\": \"Invalid date format. Use YYYY-MM-DD format.\"\r\n}<\/pre>\n<h4>Date Range Exceeds 31 Days<\/h4>\n<pre>{\r\n  \"status\": \"error\",\r\n  \"timestamp\": \"2026-04-07T10:46:15+08:00\",\r\n  \"request_id\": \"req_6612f3b9c21a7\",\r\n  \"message\": \"Date range cannot exceed 31 days.\"\r\n}<\/pre>\n<h4>Invalid DocType (CREATE)<\/h4>\n<pre>{\r\n  \"status\": \"error\",\r\n  \"timestamp\": \"2026-04-07T10:46:15+08:00\",\r\n  \"request_id\": \"req_6612f3b9c21a7\",\r\n  \"message\": \"Invalid DocType 'XXX'. Allowed: SupInv, SupCN, SupDN, PurRet\"\r\n}<\/pre>\n<h4>Missing Compulsory Fields (CREATE)<\/h4>\n<pre>{\r\n  \"status\": \"response\",\r\n  \"timestamp\": \"2026-05-20T10:30:00+08:00\",\r\n  \"request_id\": \"req_123456\",\r\n  \"data\": {\r\n    \"summary\": {\r\n      \"total_documents\": 1,\r\n      \"inserted\": 0,\r\n      \"failed\": 1\r\n    },\r\n    \"failed_documents\": [\"PINV-001\"],\r\n    \"fail_details\": {\r\n      \"compulsory_fields_missing\": [\r\n        \"Document 1 (Doc1No: PINV-001): Missing header fields - CusCode, HCNetAmt, HCDtTax, DocType\"\r\n      ]\r\n    }\r\n  }\r\n}<\/pre>\n<h4>Invalid Supplier Code (CREATE)<\/h4>\n<pre>{\r\n  \"status\": \"response\",\r\n  \"timestamp\": \"2026-05-20T10:30:00+08:00\",\r\n  \"request_id\": \"req_123456\",\r\n  \"data\": {\r\n    \"summary\": {\r\n      \"total_documents\": 1,\r\n      \"inserted\": 0,\r\n      \"failed\": 1\r\n    },\r\n    \"failed_documents\": [\"PINV-001\"],\r\n    \"fail_details\": {\r\n      \"invalid_suppliers\": [\r\n        {\r\n          \"supplier_code\": \"INVALID\",\r\n          \"document_no\": \"PINV-001\",\r\n          \"error\": \"Supplier Code 'INVALID' does not exist\"\r\n        }\r\n      ]\r\n    }\r\n  }\r\n}<\/pre>\n<h4>Invalid Item Code (CREATE)<\/h4>\n<pre>{\r\n  \"status\": \"response\",\r\n  \"timestamp\": \"2026-05-20T10:30:00+08:00\",\r\n  \"request_id\": \"req_123456\",\r\n  \"data\": {\r\n    \"summary\": {\r\n      \"total_documents\": 1,\r\n      \"inserted\": 0,\r\n      \"failed\": 1\r\n    },\r\n    \"failed_documents\": [\"PINV-001\"],\r\n    \"fail_details\": {\r\n      \"invalid_items\": [\r\n        {\r\n          \"item_code\": \"INVALID\",\r\n          \"document_no\": \"PINV-001\",\r\n          \"line_no\": 1,\r\n          \"blank_line_type\": \"0 (Stock Item)\"\r\n        }\r\n      ]\r\n    }\r\n  }\r\n}<\/pre>\n<h4>Invalid UOM Code (CREATE)<\/h4>\n<pre>{\r\n  \"status\": \"response\",\r\n  \"timestamp\": \"2026-05-20T10:30:00+08:00\",\r\n  \"request_id\": \"req_123456\",\r\n  \"data\": {\r\n    \"summary\": {\r\n      \"total_documents\": 1,\r\n      \"inserted\": 0,\r\n      \"failed\": 1\r\n    },\r\n    \"failed_documents\": [\"PINV-001\"],\r\n    \"fail_details\": {\r\n      \"invalid_uoms\": [\r\n        {\r\n          \"uom_code\": \"INVALID\",\r\n          \"document_no\": \"PINV-001\",\r\n          \"line_no\": 1,\r\n          \"error\": \"UOM code 'INVALID' does not exist\"\r\n        }\r\n      ]\r\n    }\r\n  }\r\n}<\/pre>\n<h4>Invalid Currency Code (CREATE)<\/h4>\n<pre>{\r\n  \"status\": \"response\",\r\n  \"timestamp\": \"2026-05-20T10:30:00+08:00\",\r\n  \"request_id\": \"req_123456\",\r\n  \"data\": {\r\n    \"summary\": {\r\n      \"total_documents\": 1,\r\n      \"inserted\": 0,\r\n      \"failed\": 1\r\n    },\r\n    \"failed_documents\": [\"PINV-001\"],\r\n    \"fail_details\": {\r\n      \"invalid_currencies\": [\r\n        \"Document 1 (Doc1No: PINV-001): Currency code 'INVALID' does not exist\"\r\n      ]\r\n    }\r\n  }\r\n}<\/pre>\n<h4>Amount Mismatch \u2014 Line Level (CREATE)<\/h4>\n<pre>{\r\n  \"status\": \"response\",\r\n  \"timestamp\": \"2026-05-20T10:30:00+08:00\",\r\n  \"request_id\": \"req_123456\",\r\n  \"data\": {\r\n    \"summary\": {\r\n      \"total_documents\": 1,\r\n      \"inserted\": 0,\r\n      \"failed\": 1\r\n    },\r\n    \"failed_documents\": [\"PINV-001\"],\r\n    \"fail_details\": {\r\n      \"amount_mismatch\": {\r\n        \"PINV-001\": [\r\n          {\r\n            \"line_no\": 1,\r\n            \"item_code\": \"ITEM001\",\r\n            \"provided_hclineamt\": \"100.00\",\r\n            \"expected_hclineamt\": \"500.00\",\r\n            \"error\": \"HCLineAmt does not match Qty \u00d7 HCUnitCost\"\r\n          }\r\n        ]\r\n      }\r\n    }\r\n  }\r\n}<\/pre>\n<h4>Amount Mismatch \u2014 Header Level (CREATE)<\/h4>\n<pre>{\r\n  \"status\": \"response\",\r\n  \"timestamp\": \"2026-05-20T10:30:00+08:00\",\r\n  \"request_id\": \"req_123456\",\r\n  \"data\": {\r\n    \"summary\": {\r\n      \"total_documents\": 1,\r\n      \"inserted\": 0,\r\n      \"failed\": 1\r\n    },\r\n    \"failed_documents\": [\"PINV-001\"],\r\n    \"fail_details\": {\r\n      \"amount_mismatch\": {\r\n        \"PINV-001\": [\r\n          \"Header HCNetAmt (100.00) does not match sum of HCLineAmt (500.00)\"\r\n        ]\r\n      }\r\n    }\r\n  }\r\n}<\/pre>\n<h4>No Read Permission<\/h4>\n<pre>{\r\n  \"status\": \"error\",\r\n  \"timestamp\": \"2026-04-07T10:46:15+08:00\",\r\n  \"request_id\": \"req_6612f3b9c21a7\",\r\n  \"message\": \"Purchase read permission denied\"\r\n}<\/pre>\n<h4>No Create Permission<\/h4>\n<pre>{\r\n  \"status\": \"error\",\r\n  \"timestamp\": \"2026-05-20T10:30:00+08:00\",\r\n  \"request_id\": \"req_123456\",\r\n  \"message\": \"Purchase create permission denied\"\r\n}<\/pre>\n<hr \/>\n<h3><strong>Common Errors \u2014 Purchase Module<\/strong><\/h3>\n<div class=\"overflow-x-auto w-full px-2 mb-6\">\n<p><code>\"Currency code 'X' does not exist\"<\/code>Invalid currency code (CREATE)Use a valid currency code (e.g., RM, SGD, USD)<\/p>\n<table class=\"min-w-full border-collapse text-sm leading-[1.7] whitespace-normal\">\n<thead class=\"text-left\">\n<tr>\n<th>Error Message<\/th>\n<th>Cause<\/th>\n<th>Fix<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>\"date_from and date_to are required\"<\/code><\/td>\n<td>Missing date range (READ only)<\/td>\n<td>Add both fields to your request<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>\"Invalid date format. Use YYYY-MM-DD format.\"<\/code><\/td>\n<td>Wrong date format<\/td>\n<td>Use YYYY-MM-DD \u2014 e.g. <code>\"2026-04-01\"<\/code><\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>\"Date range cannot exceed 31 days.\"<\/code><\/td>\n<td>Date range too wide<\/td>\n<td>Narrow range to 31 days or fewer<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>\"Invalid DocType 'XXX'. Allowed: SupInv, SupCN, SupDN, PurRet\"<\/code><\/td>\n<td>Wrong DocType in CREATE request<\/td>\n<td>Use one of the allowed DocTypes<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>\"Missing fields - ItemCode, Description, Qty, FactorQty, UOM, HCUnitCost, HCLineAmt, BlankLine\"<\/code><\/td>\n<td>Compulsory item fields not provided (CREATE)<\/td>\n<td>Include all required fields for each item<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>\"UOM code 'X' does not exist\"<\/code><\/td>\n<td>Invalid Unit of Measure (CREATE)<\/td>\n<td>Check the UOM exists in SKYBIZ (singular or plural form)<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>\"Supplier Code 'X' does not exist\"<\/code><\/td>\n<td>Invalid supplier code<\/td>\n<td>Check the supplier code exists in SKYBIZ (FinCatCode = &#8216;B70&#8217;)<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>\"ItemCode 'X' does not exist\"<\/code><\/td>\n<td>Invalid item code<\/td>\n<td>Check the item code exists in SKYBIZ (stock item, other charge, or GL account based on BlankLine)<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>\"HCLineAmt does not match Qty \u00d7 HCUnitCost\"<\/code><\/td>\n<td>Amount calculation mismatch (CREATE)<\/td>\n<td>Ensure <code>HCLineAmt = Qty \u00d7 HCUnitCost<\/code> (tolerance: \u00b10.01)<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>\"Header HCNetAmt does not match sum of HCLineAmt\"<\/code><\/td>\n<td>Header total doesn&#8217;t match item totals (CREATE)<\/td>\n<td>Set <code>HCNetAmt<\/code> to the sum of all item <code>HCLineAmt<\/code> (tolerance: \u00b10.01)<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>\"HCTax does not match HCLineAmt \u00d7 TaxRate1%\"<\/code><\/td>\n<td>Tax calculation mismatch (CREATE)<\/td>\n<td>Ensure <code>HCTax = HCLineAmt \u00d7 (TaxRate1 \/ 100)<\/code> (tolerance: \u00b10.01) when TaxRate1 &gt; 0<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>\"Document already exists\"<\/code><\/td>\n<td>Duplicate <code>Doc1No<\/code> (CREATE)<\/td>\n<td>Use a unique <code>Doc1No<\/code> for each document<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>\"Qty must be greater than 0 for Stock Item\"<\/code><\/td>\n<td>Quantity is zero or negative for stock item (CREATE)<\/td>\n<td>Set <code>Qty<\/code> to a positive number greater than 0<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>\"HCUnitCost must be greater than 0 for stock items\"<\/code><\/td>\n<td>Unit cost is zero or negative for stock item (CREATE)<\/td>\n<td>Set <code>HCUnitCost<\/code> to a positive number greater than 0<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>\"FactorQty must be greater than 0\"<\/code><\/td>\n<td>Factor quantity is zero or negative (CREATE)<\/td>\n<td>Set <code>FactorQty<\/code> to a positive number (default is 1)<\/td>\n<\/tr>\n<tr>\n<td class=\"border-b-0.5 border-border-300\/30 py-2 pr-4 align-top\"><code>\"Purchase read permission denied\"<\/code><\/td>\n<td>No read permission for Purchase module<\/td>\n<td>Enable read permission in portal by contacting your SkyBiz Admin<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>SKYBIZ API \u2014 Purchase Module Purchase The Purchase module allows you to retrieve and create purchase invoice records in your SKYBIZ account. Supports both read and create operations. Endpoint: \/apiv2\/modules\/purchase.php Required Permissions: Purchase \u2014 Read, Purchase \u2014 Create Allowed DocTypes: SupInv (Invoice), SupCN (Credit Note), SupDN (Debit Note) Read Purchase Retrieves purchase invoices created within ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/api_purchase\/\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[213,222],"tags":[],"class_list":["post-7320","post","type-post","status-publish","format-standard","hentry","category-10-api-documentation","category-1008-purchase"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Purchase Module - SKYBIZ Cloud ERP Support<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Purchase Module - SKYBIZ Cloud ERP Support\" \/>\n<meta property=\"og:description\" content=\"SKYBIZ API \u2014 Purchase Module Purchase The Purchase module allows you to retrieve and create purchase invoice records in your SKYBIZ account. Supports both read and create operations. Endpoint: \/apiv2\/modules\/purchase.php Required Permissions: Purchase \u2014 Read, Purchase \u2014 Create Allowed DocTypes: SupInv (Invoice), SupCN (Credit Note), SupDN (Debit Note) Read Purchase Retrieves purchase invoices created within ..Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/api_purchase\/\" \/>\n<meta property=\"og:site_name\" content=\"SKYBIZ Cloud ERP Support\" \/>\n<meta property=\"article:published_time\" content=\"2026-05-20T09:24:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-21T04:04:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1226\" \/>\n\t<meta property=\"og:image:height\" content=\"408\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"team 03\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"team 03\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/api_purchase\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/api_purchase\\\/\"},\"author\":{\"name\":\"team 03\",\"@id\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/#\\\/schema\\\/person\\\/f3a2bcb10e55b23238c1b160bb06d9a9\"},\"headline\":\"Purchase Module\",\"datePublished\":\"2026-05-20T09:24:16+00:00\",\"dateModified\":\"2026-05-21T04:04:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/api_purchase\\\/\"},\"wordCount\":1099,\"image\":{\"@id\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/api_purchase\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/api_purchase1.png\",\"articleSection\":[\"10. API Documentation\",\"1008. Purchase\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/api_purchase\\\/\",\"url\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/api_purchase\\\/\",\"name\":\"Purchase Module - SKYBIZ Cloud ERP Support\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/api_purchase\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/api_purchase\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/api_purchase1.png\",\"datePublished\":\"2026-05-20T09:24:16+00:00\",\"dateModified\":\"2026-05-21T04:04:20+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/#\\\/schema\\\/person\\\/f3a2bcb10e55b23238c1b160bb06d9a9\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/api_purchase\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/api_purchase\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/api_purchase\\\/#primaryimage\",\"url\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/api_purchase1.png\",\"contentUrl\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/api_purchase1.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/api_purchase\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Purchase Module\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/#website\",\"url\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/\",\"name\":\"SKYBIZ Cloud ERP Support\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/#\\\/schema\\\/person\\\/f3a2bcb10e55b23238c1b160bb06d9a9\",\"name\":\"team 03\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ed4575e459e48798469dd7ea3f93c83386ac432dd3bfebbf7d56837d067cbb88?s=96&d=blank&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ed4575e459e48798469dd7ea3f93c83386ac432dd3bfebbf7d56837d067cbb88?s=96&d=blank&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ed4575e459e48798469dd7ea3f93c83386ac432dd3bfebbf7d56837d067cbb88?s=96&d=blank&r=g\",\"caption\":\"team 03\"},\"sameAs\":[\"http:\\\/\\\/skybiz.com.my\"],\"url\":\"https:\\\/\\\/aisupport.skybizglobal.com\\\/skybizclouderp\\\/author\\\/team03skybiz-com-my\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Purchase Module - SKYBIZ Cloud ERP Support","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"Purchase Module - SKYBIZ Cloud ERP Support","og_description":"SKYBIZ API \u2014 Purchase Module Purchase The Purchase module allows you to retrieve and create purchase invoice records in your SKYBIZ account. Supports both read and create operations. Endpoint: \/apiv2\/modules\/purchase.php Required Permissions: Purchase \u2014 Read, Purchase \u2014 Create Allowed DocTypes: SupInv (Invoice), SupCN (Credit Note), SupDN (Debit Note) Read Purchase Retrieves purchase invoices created within ..Read more","og_url":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/api_purchase\/","og_site_name":"SKYBIZ Cloud ERP Support","article_published_time":"2026-05-20T09:24:16+00:00","article_modified_time":"2026-05-21T04:04:20+00:00","og_image":[{"width":1226,"height":408,"url":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase1.png","type":"image\/png"}],"author":"team 03","twitter_card":"summary_large_image","twitter_misc":{"Written by":"team 03","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/api_purchase\/#article","isPartOf":{"@id":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/api_purchase\/"},"author":{"name":"team 03","@id":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/#\/schema\/person\/f3a2bcb10e55b23238c1b160bb06d9a9"},"headline":"Purchase Module","datePublished":"2026-05-20T09:24:16+00:00","dateModified":"2026-05-21T04:04:20+00:00","mainEntityOfPage":{"@id":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/api_purchase\/"},"wordCount":1099,"image":{"@id":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/api_purchase\/#primaryimage"},"thumbnailUrl":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase1.png","articleSection":["10. API Documentation","1008. Purchase"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/api_purchase\/","url":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/api_purchase\/","name":"Purchase Module - SKYBIZ Cloud ERP Support","isPartOf":{"@id":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/#website"},"primaryImageOfPage":{"@id":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/api_purchase\/#primaryimage"},"image":{"@id":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/api_purchase\/#primaryimage"},"thumbnailUrl":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase1.png","datePublished":"2026-05-20T09:24:16+00:00","dateModified":"2026-05-21T04:04:20+00:00","author":{"@id":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/#\/schema\/person\/f3a2bcb10e55b23238c1b160bb06d9a9"},"breadcrumb":{"@id":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/api_purchase\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/api_purchase\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/api_purchase\/#primaryimage","url":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase1.png","contentUrl":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-content\/uploads\/2026\/05\/api_purchase1.png"},{"@type":"BreadcrumbList","@id":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/api_purchase\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/"},{"@type":"ListItem","position":2,"name":"Purchase Module"}]},{"@type":"WebSite","@id":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/#website","url":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/","name":"SKYBIZ Cloud ERP Support","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/#\/schema\/person\/f3a2bcb10e55b23238c1b160bb06d9a9","name":"team 03","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ed4575e459e48798469dd7ea3f93c83386ac432dd3bfebbf7d56837d067cbb88?s=96&d=blank&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ed4575e459e48798469dd7ea3f93c83386ac432dd3bfebbf7d56837d067cbb88?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ed4575e459e48798469dd7ea3f93c83386ac432dd3bfebbf7d56837d067cbb88?s=96&d=blank&r=g","caption":"team 03"},"sameAs":["http:\/\/skybiz.com.my"],"url":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/author\/team03skybiz-com-my\/"}]}},"_links":{"self":[{"href":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-json\/wp\/v2\/posts\/7320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-json\/wp\/v2\/comments?post=7320"}],"version-history":[{"count":5,"href":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-json\/wp\/v2\/posts\/7320\/revisions"}],"predecessor-version":[{"id":7337,"href":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-json\/wp\/v2\/posts\/7320\/revisions\/7337"}],"wp:attachment":[{"href":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-json\/wp\/v2\/media?parent=7320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-json\/wp\/v2\/categories?post=7320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aisupport.skybizglobal.com\/skybizclouderp\/wp-json\/wp\/v2\/tags?post=7320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}