-
Notifications
You must be signed in to change notification settings - Fork 0
API Usage Purchase
This page explains how third-party systems should call Purchase APIs in SimBiz 6 API V3.
https://<host>/api/v3
All purchase endpoints are protected.
Required headers:
Authorization: Bearer <token>
How to get token:
-
date_fromanddate_to:YYYY-MM-DD -
updated_fromandupdated_to:YYYY-MM-DD HH:MM:SS
| No. | Endpoint | Method | Purpose | Required Permission Scope |
|---|---|---|---|---|
| 1 | /api/v3/purchase-orders |
GET | List purchase orders | purchase.order.read |
| 2 | /api/v3/purchase-orders/{id} |
GET | Get purchase order by id | purchase.order.read |
| 3 | /api/v3/purchase-orders |
POST | Create purchase order | purchase.order.write |
| No. | Endpoint | Method | Purpose | Required Permission Scope |
|---|---|---|---|---|
| 4 | /api/v3/purchase-invoices |
GET | List purchase invoices | purchase.invoice.read |
| 5 | /api/v3/purchase-invoices/{id} |
GET | Get purchase invoice by id | purchase.invoice.read |
| 6 | /api/v3/purchase-invoices |
POST | Create purchase invoice | purchase.invoice.write |
| 7 | /api/v3/purchase-invoices/{documentNo}/void |
POST | Void purchase invoice | purchase.invoice.void |
| No. | Endpoint | Method | Purpose | Required Permission Scope |
|---|---|---|---|---|
| 8 | /api/v3/creditor-debit-notes |
GET | List creditor debit notes | purchase.creditor_debit_note.read |
| 9 | /api/v3/creditor-debit-notes/{id} |
GET | Get creditor debit note by id | purchase.creditor_debit_note.read |
| 10 | /api/v3/creditor-debit-notes |
POST | Create creditor debit note | purchase.creditor_debit_note.write |
| No. | Endpoint | Method | Purpose | Required Permission Scope |
|---|---|---|---|---|
| 11 | /api/v3/creditor-credit-notes |
GET | List creditor credit notes | purchase.creditor_credit_note.read |
| 12 | /api/v3/creditor-credit-notes/{id} |
GET | Get creditor credit note by id | purchase.creditor_credit_note.read |
| 13 | /api/v3/creditor-credit-notes |
POST | Create creditor credit note | purchase.creditor_credit_note.write |
| No. | Endpoint | Method | Purpose | Required Permission Scope |
|---|---|---|---|---|
| 14 | /api/v3/payment-vouchers |
GET | List payment vouchers | purchase.payment_voucher.read |
| 15 | /api/v3/payment-vouchers/{id} |
GET | Get payment voucher by id | purchase.payment_voucher.read |
| 16 | /api/v3/payment-vouchers |
POST | Create payment voucher | purchase.payment_voucher.write |
| 17 | /api/v3/payment-vouchers/{documentNo}/void |
POST | Void payment voucher | purchase.payment_voucher.void |
| Parameter | Type | Required | Notes |
|---|---|---|---|
page |
int | No | default 1
|
per_page |
int | No | default 50, max 200
|
all |
string | No |
1/true/yes to return non-paginated list |
paginate |
string | No | alternative pagination toggle |
q |
string | No | search by document no/ref no/BP no/BP name |
document_id |
string | No | exact document id |
document_no |
string | No | exact document no |
document_refno |
string | No | exact reference no |
document_status |
string | No | accepted: D (Draft), CO (Completed), V (Voided) |
branch_id |
string | No | exact branch id |
branch_code |
string | No | exact branch code |
bpartner_id |
string | No | exact supplier id |
bpartner_no |
string | No | exact supplier no |
bpartner_name |
string | No | partial supplier name |
currency_code |
string | No | exact currency code |
date_from |
date | No | start document date |
date_to |
date | No | end document date |
updated_from |
datetime | No | start updated datetime |
updated_to |
datetime | No | end updated datetime |
organization_id |
string | No | exact organization id |
org_id |
string | No | alias of organization_id
|
organization_code |
string | No | exact organization code |
org_code |
string | No | alias of organization_code
|
| Field | Type | Notes |
|---|---|---|
data[] |
array | document rows |
data[].organization_id |
string | org id |
data[].organization_code |
string | org code |
data[].organization_name |
string | org name |
data[].branch_id |
string | branch id |
data[].branch_code |
string | branch code |
data[].branch_name |
string | branch name |
data[].document_id |
string | document id |
data[].document_no |
string | document no |
data[].document_date |
date string | YYYY-MM-DD |
data[].document_type |
string | document type code |
data[].document_type_name |
string | type label |
data[].document_status |
string | status code |
data[].document_status_label |
string | status label |
data[].workflow_status_label |
string | workflow label |
data[].bpartner_id |
string | supplier id |
data[].bpartner_no |
string | supplier no |
data[].bpartner_name |
string | supplier name |
data[].currency_code |
string | currency code |
data[].currency_name |
string | currency name |
data[].currency_rate |
string/number | currency rate |
data[].document_refno |
string | reference no |
data[].total_amount |
string/number | total amount |
data[].total_tax_amount |
string/number | total tax amount |
data[].total_nett_amount |
string/number | nett total amount |
data[].line_count |
int | number of document lines |
data[].lines[] |
array | line details |
data[].lines[].document_line_id |
string | line id |
data[].lines[].line_seq_no |
string/int | line sequence |
data[].lines[].item_id |
string | item id |
data[].lines[].item_code |
string | item code |
data[].lines[].item_name |
string | item name |
data[].lines[].quantity |
string/number | quantity |
data[].lines[].uom_id |
string | uom id |
data[].lines[].uom_code |
string | uom code |
data[].lines[].unit_price |
string/number | unit price |
data[].lines[].discount |
string/number | discount |
data[].lines[].subtotal |
string/number | line subtotal |
data[].lines[].tax_amount |
string/number | line tax amount |
data[].lines[].nett_total |
string/number | line nett total |
data[].lines[].location_id |
string | line location id |
data[].lines[].location_code |
string | line location code |
data[].lines[].location_name |
string | line location name |
data[].lines[].tax_id |
string | line tax id |
data[].lines[].tax_code |
string | line tax code |
data[].lines[].tax_rate |
string/number | line tax rate |
data[].updated |
datetime string | YYYY-MM-DD HH:MM:SS |
meta.filters |
object | applied filters only |
meta.pagination |
object/null | pagination info or null
|
meta.execute_time_ms |
int | execution time in ms |
meta.request_time |
datetime string | request timestamp |
meta.response_time |
datetime string | response timestamp |
| Field | Type | Notes |
|---|---|---|
data |
object | document header + lines |
data.organization_id |
string | org id |
data.organization_code |
string | org code |
data.organization_name |
string | org name |
data.branch_id |
string | branch id |
data.branch_code |
string | branch code |
data.branch_name |
string | branch name |
data.document_id |
string | document id |
data.document_no |
string | document no |
data.document_date |
date string | YYYY-MM-DD |
data.document_type |
string | document type code |
data.document_type_name |
string | type label |
data.document_status |
string | status code |
data.document_status_label |
string | status label |
data.workflow_status_label |
string | workflow label |
data.bpartner_id |
string | supplier id |
data.bpartner_no |
string | supplier no |
data.bpartner_name |
string | supplier name |
data.currency_code |
string | currency code |
data.currency_name |
string | currency name |
data.currency_rate |
string/number | currency rate |
data.document_refno |
string | reference no |
data.shortremarks |
string | remarks |
data.total_amount |
string/number | total amount |
data.total_tax_amount |
string/number | total tax amount |
data.total_nett_amount |
string/number | nett total |
data.updated |
datetime string | YYYY-MM-DD HH:MM:SS |
data.lines[] |
array | line details |
data.lines[].document_line_id |
string | line id |
data.lines[].line_seq_no |
string/int | line sequence |
data.lines[].item_id |
string | item id |
data.lines[].item_code |
string | item code |
data.lines[].item_name |
string | item name |
data.lines[].quantity |
string/number | quantity |
data.lines[].uom_id |
string | uom id |
data.lines[].uom_code |
string | uom code |
data.lines[].unit_price |
string/number | unit price |
data.lines[].discount |
string/number | discount |
data.lines[].subtotal |
string/number | line subtotal |
data.lines[].tax_amount |
string/number | line tax amount |
data.lines[].nett_total |
string/number | line nett total |
data.lines[].location_id |
string | line location id |
data.lines[].location_code |
string | line location code |
data.lines[].location_name |
string | line location name |
data.lines[].tax_id |
string | line tax id |
data.lines[].tax_code |
string | line tax code |
data.lines[].tax_rate |
string/number | line tax rate |
meta.execute_time_ms |
int | execution time in ms |
meta.request_time |
datetime string | request timestamp |
meta.response_time |
datetime string | response timestamp |
| Field | Required | Accepted Value / Format | Notes |
|---|---|---|---|
headerarr |
Yes | object | document header |
headerarr.organization_id |
No | valid org id/code | |
headerarr.organization_code |
No | valid org id/code | |
headerarr.document_date |
No | YYYY-MM-DD |
optional |
headerarr.document_status |
No |
D / CO (based on process) |
optional |
headerarr.bpartner_id |
No | valid id/no | |
headerarr.bpartner_no |
No | valid id/no | |
headerarr.currency_code |
No | valid currency code | optional |
linearr |
Yes | array | minimum 1 row recommended |
linearr[].item_id |
No | valid id/code | |
linearr[].item_code |
No | valid id/code | |
linearr[].quantity |
No | decimal string > 0 | |
linearr[].uom_code |
No | valid UOM code | optional |
linearr[].unitprice |
No | decimal string >= 0 | |
linearr[].amount_netttotal |
No | decimal string >= 0 | line nett total |
| Field | Type | Notes |
|---|---|---|
data.document_id |
string | saved/target document id |
data.document_no |
string | saved/target document no |
data.msg |
string | process result message |
data.updated |
datetime string |
YYYY-MM-DD HH:MM:SS or empty |
meta.execute_time_ms |
int | execution time in ms |
meta.request_time |
datetime string | request timestamp |
meta.response_time |
datetime string | response timestamp |
GET /api/v3/purchase-orders
Use Common List Query Parameters.
| Field | Type | Notes |
|---|---|---|
data |
array | Refer to Common Document Response Fields (List) |
meta |
object | Standard metadata including timing fields |
curl -G "https://<host>/api/v3/purchase-orders" \
-H "Authorization: Bearer <token>" \
--data-urlencode "organization_code=BHH" \
--data-urlencode "document_status=CO" \
--data-urlencode "updated_from=2026-01-01 00:00:00" \
--data-urlencode "updated_to=2026-12-31 23:59:59" \
--data-urlencode "all=1"{
"status": "OK",
"data": [
{
"document_id": "1-1-9101",
"document_no": "PO000101",
"document_date": "2026-04-10",
"document_status": "CO",
"document_status_label": "Completed",
"workflow_status_label": "Completed",
"organization_id": "1",
"organization_code": "BHH",
"organization_name": "BHH",
"branch_id": "1-1",
"branch_code": "HQ",
"branch_name": "Headquarters",
"bpartner_id": "1-1-1",
"bpartner_no": "SUP0001",
"bpartner_name": "Supplier One",
"document_type": "PO",
"document_type_name": "Purchase Order",
"currency_code": "MYR",
"currency_name": "Malaysian Ringgit",
"currency_rate": "1.000000",
"document_refno": "RFQ-2026-001",
"total_amount": "100.00",
"total_tax_amount": "0.00",
"total_nett_amount": "100.00",
"line_count": 1,
"lines": [
{
"document_line_id": "1-1-9101-1",
"line_seq_no": "10",
"item_id": "1-1-10",
"item_code": "ITEM001",
"item_name": "Sample Item",
"quantity": "1.0000",
"uom_id": "1-1-400",
"uom_code": "PCS",
"unit_price": "100.0000",
"discount": "0.00",
"subtotal": "100.00",
"tax_amount": "0.00",
"nett_total": "100.00",
"location_id": "1-1-500",
"location_code": "MAIN",
"location_name": "Main Store",
"tax_id": "1-1-700",
"tax_code": "SR",
"tax_rate": "0.00"
}
],
"updated": "2026-04-10 10:15:00"
}
],
"meta": {
"filters": {
"organization_code": "BHH",
"document_status": "CO"
},
"pagination": null,
"execute_time_ms": 18,
"request_time": "2026-04-11 10:00:00",
"response_time": "2026-04-11 10:00:00"
}
}GET /api/v3/purchase-orders/{id}
None.
| Field | Type | Notes |
|---|---|---|
data |
object | Refer to Common Document Response Fields (By ID) |
meta |
object | Standard metadata including timing fields |
curl -X GET "https://<host>/api/v3/purchase-orders/1-1-9101" \
-H "Authorization: Bearer <token>"{
"status": "OK",
"data": {
"document_id": "1-1-9101",
"document_no": "PO000101",
"updated": "2026-04-10 10:20:00",
"lines": []
},
"meta": {
"execute_time_ms": 11,
"request_time": "2026-04-11 10:00:00",
"response_time": "2026-04-11 10:00:00"
}
}POST /api/v3/purchase-orders
None.
| Field | Type | Notes |
|---|---|---|
data |
object | Refer to Common Create/Void Response Fields |
meta |
object | Standard metadata including timing fields |
curl -X POST "https://<host>/api/v3/purchase-orders" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"headerarr": {
"organization_code": "BHH",
"document_date": "2026-04-10",
"document_status": "D",
"bpartner_no": "SUP0001",
"currency_code": "MYR"
},
"linearr": [
{
"item_code": "ITEM001",
"quantity": "1",
"uom_code": "PCS",
"unitprice": "100.00",
"amount_netttotal": "100.00"
}
]
}'{
"status": "OK",
"data": {
"document_id": "1-1-9101",
"document_no": "PO000101",
"msg": "Document saved successfully",
"updated": "2026-04-10 10:25:00"
},
"meta": {
"execute_time_ms": 24,
"request_time": "2026-04-11 10:00:00",
"response_time": "2026-04-11 10:00:00"
}
}GET /api/v3/purchase-invoices
Use Common List Query Parameters.
| Field | Type | Notes |
|---|---|---|
data |
array | Refer to Common Document Response Fields (List) |
meta |
object | Standard metadata including timing fields |
curl -G "https://<host>/api/v3/purchase-invoices" \
-H "Authorization: Bearer <token>" \
--data-urlencode "organization_code=BHH" \
--data-urlencode "all=1"{
"status": "OK",
"data": [
{
"document_id": "1-1-9201",
"document_no": "PI000201",
"updated": "2026-04-10 11:00:00"
}
],
"meta": {
"pagination": null,
"execute_time_ms": 16,
"request_time": "2026-04-11 10:00:00",
"response_time": "2026-04-11 10:00:00"
}
}GET /api/v3/purchase-invoices/{id}
None.
| Field | Type | Notes |
|---|---|---|
data |
object | Refer to Common Document Response Fields (By ID) |
meta |
object | Standard metadata including timing fields |
curl -X GET "https://<host>/api/v3/purchase-invoices/1-1-9201" \
-H "Authorization: Bearer <token>"{
"status": "OK",
"data": {
"document_id": "1-1-9201",
"document_no": "PI000201",
"updated": "2026-04-10 11:05:00",
"lines": []
},
"meta": {
"execute_time_ms": 10,
"request_time": "2026-04-11 10:00:00",
"response_time": "2026-04-11 10:00:00"
}
}POST /api/v3/purchase-invoices
None.
| Field | Type | Notes |
|---|---|---|
data |
object | Refer to Common Create/Void Response Fields |
meta |
object | Standard metadata including timing fields |
curl -X POST "https://<host>/api/v3/purchase-invoices" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"headerarr": {
"organization_code": "BHH",
"document_date": "2026-04-10",
"bpartner_no": "SUP0001"
},
"linearr": [
{
"item_code": "ITEM001",
"quantity": "1"
}
]
}'{
"status": "OK",
"data": {
"document_id": "1-1-9201",
"document_no": "PI000201",
"msg": "Document saved successfully",
"updated": "2026-04-10 11:10:00"
},
"meta": {
"execute_time_ms": 23,
"request_time": "2026-04-11 10:00:00",
"response_time": "2026-04-11 10:00:00"
}
}POST /api/v3/purchase-invoices/{documentNo}/void
None.
| Field | Type | Notes |
|---|---|---|
data |
object | Refer to Common Create/Void Response Fields |
meta |
object | Standard metadata including timing fields |
curl -X POST "https://<host>/api/v3/purchase-invoices/PI000201/void" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"organization_code": "BHH",
"document_reason": "Supplier reversed bill"
}'{
"status": "OK",
"data": {
"document_id": "1-1-9201",
"document_no": "PI000201",
"msg": "Document voided successfully",
"updated": "2026-04-10 11:15:00"
},
"meta": {
"execute_time_ms": 18,
"request_time": "2026-04-11 10:00:00",
"response_time": "2026-04-11 10:00:00"
}
}GET /api/v3/creditor-debit-notes
Use Common List Query Parameters.
| Field | Type | Notes |
|---|---|---|
data |
array | Refer to Common Document Response Fields (List) |
meta |
object | Standard metadata including timing fields |
curl -G "https://<host>/api/v3/creditor-debit-notes" \
-H "Authorization: Bearer <token>" \
--data-urlencode "organization_code=BHH"{
"status": "OK",
"data": [
{
"document_id": "1-1-9301",
"document_no": "CDN000101",
"updated": "2026-04-10 11:20:00"
}
],
"meta": {
"pagination": null,
"execute_time_ms": 15,
"request_time": "2026-04-11 10:00:00",
"response_time": "2026-04-11 10:00:00"
}
}GET /api/v3/creditor-debit-notes/{id}
None.
| Field | Type | Notes |
|---|---|---|
data |
object | Refer to Common Document Response Fields (By ID) |
meta |
object | Standard metadata including timing fields |
curl -X GET "https://<host>/api/v3/creditor-debit-notes/1-1-9301" \
-H "Authorization: Bearer <token>"{
"status": "OK",
"data": {
"document_id": "1-1-9301",
"document_no": "CDN000101",
"updated": "2026-04-10 11:22:00",
"lines": []
},
"meta": {
"execute_time_ms": 10,
"request_time": "2026-04-11 10:00:00",
"response_time": "2026-04-11 10:00:00"
}
}POST /api/v3/creditor-debit-notes
None.
| Field | Type | Notes |
|---|---|---|
data |
object | Refer to Common Create/Void Response Fields |
meta |
object | Standard metadata including timing fields |
curl -X POST "https://<host>/api/v3/creditor-debit-notes" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"headerarr": {
"organization_code": "BHH",
"bpartner_no": "SUP0001"
},
"linearr": [
{
"item_code": "ITEM001",
"quantity": "1"
}
]
}'{
"status": "OK",
"data": {
"document_id": "1-1-9301",
"document_no": "CDN000101",
"msg": "Document saved successfully",
"updated": "2026-04-10 11:25:00"
},
"meta": {
"execute_time_ms": 22,
"request_time": "2026-04-11 10:00:00",
"response_time": "2026-04-11 10:00:00"
}
}GET /api/v3/creditor-credit-notes
Use Common List Query Parameters.
| Field | Type | Notes |
|---|---|---|
data |
array | Refer to Common Document Response Fields (List) |
meta |
object | Standard metadata including timing fields |
curl -G "https://<host>/api/v3/creditor-credit-notes" \
-H "Authorization: Bearer <token>" \
--data-urlencode "organization_code=BHH"{
"status": "OK",
"data": [
{
"document_id": "1-1-9401",
"document_no": "CCN000101",
"updated": "2026-04-10 11:30:00"
}
],
"meta": {
"pagination": null,
"execute_time_ms": 15,
"request_time": "2026-04-11 10:00:00",
"response_time": "2026-04-11 10:00:00"
}
}GET /api/v3/creditor-credit-notes/{id}
None.
| Field | Type | Notes |
|---|---|---|
data |
object | Refer to Common Document Response Fields (By ID) |
meta |
object | Standard metadata including timing fields |
curl -X GET "https://<host>/api/v3/creditor-credit-notes/1-1-9401" \
-H "Authorization: Bearer <token>"{
"status": "OK",
"data": {
"document_id": "1-1-9401",
"document_no": "CCN000101",
"updated": "2026-04-10 11:35:00",
"lines": []
},
"meta": {
"execute_time_ms": 10,
"request_time": "2026-04-11 10:00:00",
"response_time": "2026-04-11 10:00:00"
}
}POST /api/v3/creditor-credit-notes
None.
| Field | Type | Notes |
|---|---|---|
data |
object | Refer to Common Create/Void Response Fields |
meta |
object | Standard metadata including timing fields |
curl -X POST "https://<host>/api/v3/creditor-credit-notes" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"headerarr": {
"organization_code": "BHH",
"bpartner_no": "SUP0001"
},
"linearr": [
{
"item_code": "ITEM001",
"quantity": "1"
}
]
}'{
"status": "OK",
"data": {
"document_id": "1-1-9401",
"document_no": "CCN000101",
"msg": "Document saved successfully",
"updated": "2026-04-10 11:40:00"
},
"meta": {
"execute_time_ms": 22,
"request_time": "2026-04-11 10:00:00",
"response_time": "2026-04-11 10:00:00"
}
}GET /api/v3/payment-vouchers
Use Common List Query Parameters.
| Field | Type | Notes |
|---|---|---|
data |
array | Refer to Common Document Response Fields (List) |
meta |
object | Standard metadata including timing fields |
curl -G "https://<host>/api/v3/payment-vouchers" \
-H "Authorization: Bearer <token>" \
--data-urlencode "organization_code=BHH"{
"status": "OK",
"data": [
{
"document_id": "1-1-9501",
"document_no": "PV000101",
"updated": "2026-04-10 11:45:00"
}
],
"meta": {
"pagination": null,
"execute_time_ms": 16,
"request_time": "2026-04-11 10:00:00",
"response_time": "2026-04-11 10:00:00"
}
}GET /api/v3/payment-vouchers/{id}
None.
| Field | Type | Notes |
|---|---|---|
data |
object | Refer to Common Document Response Fields (By ID) |
meta |
object | Standard metadata including timing fields |
curl -X GET "https://<host>/api/v3/payment-vouchers/1-1-9501" \
-H "Authorization: Bearer <token>"{
"status": "OK",
"data": {
"document_id": "1-1-9501",
"document_no": "PV000101",
"updated": "2026-04-10 11:50:00",
"lines": []
},
"meta": {
"execute_time_ms": 10,
"request_time": "2026-04-11 10:00:00",
"response_time": "2026-04-11 10:00:00"
}
}POST /api/v3/payment-vouchers
None.
| Field | Type | Notes |
|---|---|---|
data |
object | Refer to Common Create/Void Response Fields |
meta |
object | Standard metadata including timing fields |
curl -X POST "https://<host>/api/v3/payment-vouchers" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"headerarr": {
"organization_code": "BHH",
"bpartner_no": "SUP0001"
},
"linearr": [
{
"item_code": "ITEM001",
"quantity": "1"
}
]
}'{
"status": "OK",
"data": {
"document_id": "1-1-9501",
"document_no": "PV000101",
"msg": "Document saved successfully",
"updated": "2026-04-10 11:55:00"
},
"meta": {
"execute_time_ms": 22,
"request_time": "2026-04-11 10:00:00",
"response_time": "2026-04-11 10:00:00"
}
}POST /api/v3/payment-vouchers/{documentNo}/void
None.
| Field | Type | Notes |
|---|---|---|
data |
object | Refer to Common Create/Void Response Fields |
meta |
object | Standard metadata including timing fields |
curl -X POST "https://<host>/api/v3/payment-vouchers/PV000101/void" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"organization_code": "BHH",
"document_reason": "Void by finance"
}'{
"status": "OK",
"data": {
"document_id": "1-1-9501",
"document_no": "PV000101",
"msg": "Document voided successfully",
"updated": "2026-04-10 12:00:00"
},
"meta": {
"execute_time_ms": 17,
"request_time": "2026-04-11 10:00:00",
"response_time": "2026-04-11 10:00:00"
}
}