Purchases API
Purchase bills
Create or update a supplier bill, create a share link, list bills, or load one bill by id. Line items match invoices. The contact field is supplier_id.
Create or update a purchase bill
POST https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bill
- cURL
- JavaScript
curl -X POST 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bill' \
-H 'Authorization: Bearer <personal_access_token>' \
-H 'SelectedBranchId: <numeric_branch_id>' \
-H 'Content-Type: application/json' \
-d '{
"record_id": 5678,
"supplier_id": 15,
"purchase_bill_date": "09/09/2026",
"bill_no": "SUP-1044",
"status": "Published",
"purchasebill_294": "PO-44",
"purchasebill_297": 101,
"purchasebill_298": ["201", "202"],
"adjustment": 0,
"currency_rate": 1,
"payment_terms": 3,
"discount_method": { "type": "Bill Wise", "before_tax": true },
"is_tax_inclusive": 0,
"title": "September purchase",
"bill_discount": 10,
"bill_discount_type": "p",
"serial_code_id": 3,
"additional_expenses": [{ "category_id": 123, "amount": 50.0 }],
"billing_street": "12 Market Road",
"billing_city": "Dubai",
"billing_state": "Dubai",
"billing_zip": "00000",
"billing_country": "United Arab Emirates",
"billing_address": "12 Market Road, Dubai",
"shipping_street": "Warehouse 4",
"shipping_city": "Dubai",
"shipping_state": "Dubai",
"shipping_zip": "00000",
"shipping_country": "United Arab Emirates",
"shipping_address": "Warehouse 4, Dubai",
"shipping_contact_person": "Amina Khan",
"shipping_phone": "+971500000000",
"items": [
{
"item_id": 10,
"item_quantity": 2,
"item_rate": 100,
"item_line_discount": 0,
"item_discount_type": "p",
"item_unit": 5,
"item_foc": 0,
"items_tax_id": 1,
"items_taxrate": 5,
"items_taxname": "VAT 5%",
"items_is_taxgroup": 0,
"items_taxrate1": "0.00",
"items_taxrate2": "0.00",
"items_tax1_name": "VAT",
"items_tax2_name": "",
"items_tax_type": "tax",
"items_tax_type1": "tax",
"items_tax_type2": "tax",
"warehouse_id": 1
}
]
}'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bill", {
method: "POST",
headers: {
Authorization: "Bearer <personal_access_token>",
SelectedBranchId: "<numeric_branch_id>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"record_id": 5678,
"supplier_id": 15,
"purchase_bill_date": "09/09/2026",
"bill_no": "SUP-1044",
"status": "Published",
"purchasebill_294": "PO-44",
"purchasebill_297": 101,
"purchasebill_298": ["201", "202"],
"adjustment": 0,
"currency_rate": 1,
"payment_terms": 3,
"discount_method": { "type": "Bill Wise", "before_tax": true },
"is_tax_inclusive": 0,
"title": "September purchase",
"bill_discount": 10,
"bill_discount_type": "p",
"serial_code_id": 3,
"additional_expenses": [{ "category_id": 123, "amount": 50.0 }],
"billing_street": "12 Market Road",
"billing_city": "Dubai",
"billing_state": "Dubai",
"billing_zip": "00000",
"billing_country": "United Arab Emirates",
"billing_address": "12 Market Road, Dubai",
"shipping_street": "Warehouse 4",
"shipping_city": "Dubai",
"shipping_state": "Dubai",
"shipping_zip": "00000",
"shipping_country": "United Arab Emirates",
"shipping_address": "Warehouse 4, Dubai",
"shipping_contact_person": "Amina Khan",
"shipping_phone": "+971500000000",
"items": [
{
"item_id": 10,
"item_quantity": 2,
"item_rate": 100,
"item_line_discount": 0,
"item_discount_type": "p",
"item_unit": 5,
"item_foc": 0,
"items_tax_id": 1,
"items_taxrate": 5,
"items_taxname": "VAT 5%",
"items_is_taxgroup": 0,
"items_taxrate1": "0.00",
"items_taxrate2": "0.00",
"items_tax1_name": "VAT",
"items_tax2_name": "",
"items_tax_type": "tax",
"items_tax_type1": "tax",
"items_tax_type2": "tax",
"warehouse_id": 1
}
]
}),
});
const data = await response.json();
console.log(data);
Creating a purchase bill requires permission to create purchase bills. Updating requires permission to edit them. Transaction lock and other bill rules still apply.
A lookup or multiselect-lookup value must be an id returned by Custom field options for that field. Soft-deleted items and leads are not valid. Omitting the key on update keeps the stored value, and that stored value is checked again.
Body
Required: supplier_id, and items with the invoice line shape.
| Field | Difference from an invoice |
|---|---|
purchase_bill_date | Use this instead of invoice_date. Branch date format. idate is rejected |
bill_no | Optional supplier bill number. Maximum 200 characters |
status | Published only |
sales_person | Not supported |
purchasebill_{id} | One purchase bill custom field. {id} is customfields_id. The key, type, and allowed values come from Get form details with module=purchase_bill. Omit a key on update to keep the stored value. Dropdown and multiselect values must be an allowed option unless the field allows a new option. Lookup is one id from Custom field options. Multiselect lookup is an array of those ids and replaces the whole set. A repeated multiselect or multiselect-lookup value is stored once. A number field is stored as an integer, so 7.7 is stored as 8, and a value that is not a number is rejected. A number field max is 2147483647 and min is -2147483648. A decimal field max is 9999999999.99999999 and min is -9999999999.99999999. Each custom-field value is checked for its type, and a value of the wrong type is rejected. A 12H time or datetime value must include AM or PM (for example 02:30 PM); a value without meridem is rejected. On create, an omitted date, time, or datetime key uses the field default (current stores now; empty stores null). Sending "" stores null. An uploader value is an existing document id. Autogenerate and formula keys are rejected |
additional_expenses | Categories must be Direct Expense or Indirect Expense (module=purchase_bill). Each amount must be greater than 0 |
Other optional fields match the shared invoice fields, including address overrides.
Example request
{
"record_id": 5678,
"supplier_id": 15,
"purchase_bill_date": "09/09/2026",
"bill_no": "SUP-1044",
"status": "Published",
"purchasebill_294": "PO-44",
"purchasebill_297": 101,
"purchasebill_298": ["201", "202"],
"adjustment": 0,
"currency_rate": 1,
"payment_terms": 3,
"discount_method": { "type": "Bill Wise", "before_tax": true },
"is_tax_inclusive": 0,
"title": "September purchase",
"bill_discount": 10,
"bill_discount_type": "p",
"serial_code_id": 3,
"additional_expenses": [{ "category_id": 123, "amount": 50.0 }],
"billing_street": "12 Market Road",
"billing_city": "Dubai",
"billing_state": "Dubai",
"billing_zip": "00000",
"billing_country": "United Arab Emirates",
"billing_address": "12 Market Road, Dubai",
"shipping_street": "Warehouse 4",
"shipping_city": "Dubai",
"shipping_state": "Dubai",
"shipping_zip": "00000",
"shipping_country": "United Arab Emirates",
"shipping_address": "Warehouse 4, Dubai",
"shipping_contact_person": "Amina Khan",
"shipping_phone": "+971500000000",
"items": [
{
"item_id": 10,
"item_quantity": 2,
"item_rate": 100,
"item_line_discount": 0,
"item_discount_type": "p",
"item_unit": 5,
"item_foc": 0,
"items_tax_id": 1,
"items_taxrate": 5,
"items_taxname": "VAT 5%",
"items_is_taxgroup": 0,
"items_taxrate1": "0.00",
"items_taxrate2": "0.00",
"items_tax1_name": "VAT",
"items_tax2_name": "",
"items_tax_type": "tax",
"items_tax_type1": "tax",
"items_tax_type2": "tax",
"warehouse_id": 1
}
]
}
Example response
{
"success": true,
"message": "Purchase bill saved successfully",
"result": 5678
}
result is the purchase bill id. Use it as record_id to edit and for a share link, and as payment id with type supplier.
Errors
Permission Denied
Create a purchase bill share link
POST https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bill/share-link
- cURL
- JavaScript
curl -X POST 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bill/share-link' \
-H 'Authorization: Bearer <personal_access_token>' \
-H 'SelectedBranchId: <numeric_branch_id>'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bill/share-link", {
method: "POST",
headers: {
Authorization: "Bearer <personal_access_token>",
SelectedBranchId: "<numeric_branch_id>",
},
});
const data = await response.json();
console.log(data);
Requires purchase bill view access.
Body: record_id (purchase bill id).
Response: same shape as an invoice share link. result.link is the URL. The link expires one month after it is created.
Errors
Permission Denied
Delete a purchase bill
DELETE https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills/5678
- cURL
- JavaScript
curl -X DELETE 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills/5678' \
-H 'Authorization: Bearer <personal_access_token>' \
-H 'SelectedBranchId: <numeric_branch_id>'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills/5678", {
method: "DELETE",
headers: {
Authorization: "Bearer <personal_access_token>",
SelectedBranchId: "<numeric_branch_id>",
},
});
const data = await response.json();
console.log(data);
Deleting a purchase bill requires permission to delete purchase bills. There is no request body.
Example response
{
"success": true,
"message": "PB-001 deleted successfully",
"result": 5678
}
result is the deleted purchase bill id.
Errors
Permission DeniedPurchase bill not foundUnable to process the request since <b>Transaction Lock is enabled for this module for the date you've selected.</b>Delete the payments to delete PB-001Remove Associated Debit Notes to delete PB-001Remove Associated Reminders to delete PB-001PB-001 cannot be deleted.<br>followed by the stock message when negative stock is not allowed
List purchase bills
GET https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&page_size=50
- cURL
- JavaScript
curl -X GET 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&page_size=50' \
-H 'Authorization: Bearer <personal_access_token>' \
-H 'SelectedBranchId: <numeric_branch_id>'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills&page_size=50", {
method: "GET",
headers: {
Authorization: "Bearer <personal_access_token>",
SelectedBranchId: "<numeric_branch_id>",
},
});
const data = await response.json();
console.log(data);
Requires access to purchase bills. See Pagination.
| Parameter | Value |
|---|---|
include_attachments | Set to 1 to include attachments. Omit it and the response has no attachments key. The array matches List invoices |
Default sort_by | purchasebill_id |
| Sort fields | purchasebill_id, purchasebill_code, purchasebill_date, purchasebill_total, purchasebill_status, purchasebill_created_at, purchasebill_updated_at |
| Filter fields | purchasebill_status, purchasebill_code, purchasebill_date, purchasebill_userid, purchasebill_created_by, purchasebill_project_id, purchasebill_total |
Example response
{
"success": true,
"message": "Purchase bills fetched successfully",
"result": {
"records": [
{
"purchasebill_id": 5678,
"purchasebill_uuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"purchasebill_code": "PB-001",
"purchasebill_date": "2026-01-15",
"purchasebill_status": "Unpaid",
"purchasebill_userid": 42,
"purchasebill_created_by": 11,
"purchasebill_currency": 1,
"purchasebill_created_at": "2026-01-15 10:30:00",
"purchasebill_total": "$1,250.00",
"purchasebill_due_amount": "$250.00"
}
],
"page_info": {
"next_page_token": "...",
"has_next_page": true,
"has_prev_page": false,
"page_size": 50
}
}
}
Get purchase bill details
GET {workspace_url}/?app=ealsuite_api/v1/purchase-bills/{id}
- cURL
- JavaScript
curl -X GET 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills/{id}' \
-H 'Authorization: Bearer <personal_access_token>' \
-H 'SelectedBranchId: <numeric_branch_id>'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-bills/{id}", {
method: "GET",
headers: {
Authorization: "Bearer <personal_access_token>",
SelectedBranchId: "<numeric_branch_id>",
},
});
const data = await response.json();
console.log(data);
Requires purchase bill view access. Users limited to their own or linked records get Purchase bill not found when this bill is outside that scope.
Query
| Parameter | Value |
|---|---|
include_attachments | Set to 1 to include attachments. Omit it and the response has no attachments key |
attachments matches List invoices. Do not store url permanently.
Header money fields purchasebill_total and purchasebill_due_amount match the list. Dates are Y-m-d. purchasebill_status is the stored status (Unpaid, Paid, Draft, and similar), not the create-time Published flag. summary amounts are unformatted decimal strings. Line items use the create line shape. Each priced line is returned separately in items. Free-of-charge quantity is merged onto the immediately preceding paid line for the same item and unit as item_foc. Landing-cost lines are omitted.
Example response
{
"success": true,
"message": "Purchase bill details fetched successfully",
"result": {
"purchasebill_id": 5678,
"purchasebill_uuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"purchasebill_code": "PB-001",
"purchasebill_date": "2026-01-15",
"purchasebill_status": "Unpaid",
"purchasebill_userid": 42,
"purchasebill_created_by": 11,
"purchasebill_currency": 1,
"purchasebill_created_at": "2026-01-15 10:30:00",
"purchasebill_total": "$1,250.00",
"purchasebill_due_amount": "$250.00",
"supplier_id": 42,
"title": "September purchase",
"purchase_bill_date": "2026-01-15",
"bill_no": "SUP-1044",
"payment_terms": 3,
"adjustment": 0,
"currency_rate": 1,
"is_tax_inclusive": 0,
"discount_method": { "type": "Bill Wise", "before_tax": true },
"bill_discount": 10,
"bill_discount_type": "p",
"billing_street": "12 Market Road",
"billing_city": "Dubai",
"billing_state": "Dubai",
"billing_zip": "00000",
"billing_country": "United Arab Emirates",
"billing_address": "12 Market Road, Dubai",
"shipping_street": "Warehouse 4",
"shipping_city": "Dubai",
"shipping_state": "Dubai",
"shipping_zip": "00000",
"shipping_country": "United Arab Emirates",
"shipping_address": "Warehouse 4, Dubai",
"shipping_contact_person": "Amina Khan",
"shipping_phone": "+971500000000",
"additional_expenses": [{ "category_id": 123, "amount": 50.0 }],
"summary": {
"subtotal": "1200.00",
"discount": "120.00",
"adjustment": "0.00",
"total": "1250.00",
"tax": "57.00",
"paid": "1000.00",
"due": "250.00"
},
"items": [
{
"item_id": 10,
"item_quantity": 2,
"item_rate": 100,
"item_line_discount": 0,
"item_discount_type": "p",
"item_unit": 5,
"item_foc": 0,
"items_tax_id": 1,
"items_taxrate": 5,
"items_taxname": "VAT 5%",
"items_is_taxgroup": 0,
"items_taxrate1": "0.00",
"items_taxrate2": "0.00",
"items_tax1_name": "VAT",
"items_tax2_name": "",
"items_tax_type": "tax",
"items_tax_type1": "tax",
"items_tax_type2": "tax",
"warehouse_id": 1
}
]
}
}
Errors
Purchase bill not foundPermission Denied
Purchase orders
Create or update a supplier purchase order, create a share link, list orders, or get one order by id. Line items match invoices. The contact field is supplier_id.
Create or update a purchase order
POST https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-order
- cURL
- JavaScript
curl -X POST 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-order' \
-H 'Authorization: Bearer <personal_access_token>' \
-H 'SelectedBranchId: <numeric_branch_id>' \
-H 'Content-Type: application/json' \
-d '{
"record_id": 3456,
"supplier_id": 15,
"purchase_order_date": "09/09/2026",
"status": "Published",
"purchases_294": "PO-44",
"purchases_297": 101,
"purchases_298": ["201", "202"],
"adjustment": 0,
"currency_rate": 1,
"payment_terms": 3,
"discount_method": { "type": "Bill Wise", "before_tax": true },
"is_tax_inclusive": 0,
"title": "September purchase order",
"bill_discount": 10,
"bill_discount_type": "p",
"serial_code_id": 3,
"additional_expenses": [{ "category_id": 123, "amount": 50.0 }],
"billing_street": "12 Market Road",
"billing_city": "Dubai",
"billing_state": "Dubai",
"billing_zip": "00000",
"billing_country": "United Arab Emirates",
"billing_address": "12 Market Road, Dubai",
"shipping_street": "Warehouse 4",
"shipping_city": "Dubai",
"shipping_state": "Dubai",
"shipping_zip": "00000",
"shipping_country": "United Arab Emirates",
"shipping_address": "Warehouse 4, Dubai",
"shipping_contact_person": "Amina Khan",
"shipping_phone": "+971500000000",
"items": [
{
"item_id": 10,
"item_quantity": 2,
"item_rate": 100,
"item_line_discount": 0,
"item_discount_type": "p",
"item_unit": 5,
"item_foc": 0,
"items_tax_id": 1,
"items_taxrate": 5,
"items_taxname": "VAT 5%",
"items_is_taxgroup": 0,
"items_taxrate1": "0.00",
"items_taxrate2": "0.00",
"items_tax1_name": "VAT",
"items_tax2_name": "",
"items_tax_type": "tax",
"items_tax_type1": "tax",
"items_tax_type2": "tax",
"warehouse_id": 1
}
]
}'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-order", {
method: "POST",
headers: {
Authorization: "Bearer <personal_access_token>",
SelectedBranchId: "<numeric_branch_id>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"record_id": 3456,
"supplier_id": 15,
"purchase_order_date": "09/09/2026",
"status": "Published",
"purchases_294": "PO-44",
"purchases_297": 101,
"purchases_298": ["201", "202"],
"adjustment": 0,
"currency_rate": 1,
"payment_terms": 3,
"discount_method": { "type": "Bill Wise", "before_tax": true },
"is_tax_inclusive": 0,
"title": "September purchase order",
"bill_discount": 10,
"bill_discount_type": "p",
"serial_code_id": 3,
"additional_expenses": [{ "category_id": 123, "amount": 50.0 }],
"billing_street": "12 Market Road",
"billing_city": "Dubai",
"billing_state": "Dubai",
"billing_zip": "00000",
"billing_country": "United Arab Emirates",
"billing_address": "12 Market Road, Dubai",
"shipping_street": "Warehouse 4",
"shipping_city": "Dubai",
"shipping_state": "Dubai",
"shipping_zip": "00000",
"shipping_country": "United Arab Emirates",
"shipping_address": "Warehouse 4, Dubai",
"shipping_contact_person": "Amina Khan",
"shipping_phone": "+971500000000",
"items": [
{
"item_id": 10,
"item_quantity": 2,
"item_rate": 100,
"item_line_discount": 0,
"item_discount_type": "p",
"item_unit": 5,
"item_foc": 0,
"items_tax_id": 1,
"items_taxrate": 5,
"items_taxname": "VAT 5%",
"items_is_taxgroup": 0,
"items_taxrate1": "0.00",
"items_taxrate2": "0.00",
"items_tax1_name": "VAT",
"items_tax2_name": "",
"items_tax_type": "tax",
"items_tax_type1": "tax",
"items_tax_type2": "tax",
"warehouse_id": 1
}
]
}),
});
const data = await response.json();
console.log(data);
Creating a purchase order requires permission to create purchase orders. Updating requires permission to edit them. Transaction lock and other bill rules still apply.
A lookup or multiselect-lookup value must be an id returned by Custom field options for that field. Soft-deleted items and leads are not valid. Omitting the key on update keeps the stored value, and that stored value is checked again.
Body
Required: supplier_id, and items with the invoice line shape.
| Field | Difference from an invoice |
|---|---|
purchase_order_date | Use this instead of invoice_date. Branch date format. Defaults to today. idate is rejected |
status | Published or Draft. The order is stored as Pending, or as Waiting Approval when purchase-order approval applies. Draft is accepted and is not stored as Draft |
sales_person | Not supported |
purchases_{id} | One purchase order custom field. {id} is customfields_id. The key, type, and allowed values come from Get form details with module=purchase_order. Omit a key on update to keep the stored value. Dropdown and multiselect values must be an allowed option unless the field allows a new option. Lookup is one id from Custom field options. Multiselect lookup is an array of those ids and replaces the whole set. A repeated multiselect or multiselect-lookup value is stored once. A number field is stored as an integer, so 7.7 is stored as 8, and a value that is not a number is rejected. A number field max is 2147483647 and min is -2147483648. A decimal field max is 9999999999.99999999 and min is -9999999999.99999999. Each custom-field value is checked for its type, and a value of the wrong type is rejected. A 12H time or datetime value must include AM or PM (for example 02:30 PM); a value without meridem is rejected. On create, an omitted date, time, or datetime key uses the field default (current stores now; empty stores null). Sending "" stores null. An uploader value is an existing document id. Autogenerate and formula keys are rejected |
additional_expenses | Categories must be Direct Expense or Indirect Expense (module=purchase_order). Each amount must be greater than 0 |
Other optional fields match the shared invoice fields, including address overrides.
Example request
{
"record_id": 3456,
"supplier_id": 15,
"purchase_order_date": "09/09/2026",
"status": "Published",
"purchases_294": "PO-44",
"purchases_297": 101,
"purchases_298": ["201", "202"],
"adjustment": 0,
"currency_rate": 1,
"payment_terms": 3,
"discount_method": { "type": "Bill Wise", "before_tax": true },
"is_tax_inclusive": 0,
"title": "September purchase order",
"bill_discount": 10,
"bill_discount_type": "p",
"serial_code_id": 3,
"additional_expenses": [{ "category_id": 123, "amount": 50.0 }],
"billing_street": "12 Market Road",
"billing_city": "Dubai",
"billing_state": "Dubai",
"billing_zip": "00000",
"billing_country": "United Arab Emirates",
"billing_address": "12 Market Road, Dubai",
"shipping_street": "Warehouse 4",
"shipping_city": "Dubai",
"shipping_state": "Dubai",
"shipping_zip": "00000",
"shipping_country": "United Arab Emirates",
"shipping_address": "Warehouse 4, Dubai",
"shipping_contact_person": "Amina Khan",
"shipping_phone": "+971500000000",
"items": [
{
"item_id": 10,
"item_quantity": 2,
"item_rate": 100,
"item_line_discount": 0,
"item_discount_type": "p",
"item_unit": 5,
"item_foc": 0,
"items_tax_id": 1,
"items_taxrate": 5,
"items_taxname": "VAT 5%",
"items_is_taxgroup": 0,
"items_taxrate1": "0.00",
"items_taxrate2": "0.00",
"items_tax1_name": "VAT",
"items_tax2_name": "",
"items_tax_type": "tax",
"items_tax_type1": "tax",
"items_tax_type2": "tax",
"warehouse_id": 1
}
]
}
Example response
{
"success": true,
"message": "Purchase order saved successfully",
"result": 3456
}
result is the purchase order id. Use it as record_id to edit and for a share link.
Errors
Permission DeniedInvalid SupplierInvalid purchase orderAtleast one item is required for creating a purchase orderUse purchase_order_date instead of idatestatus must be one of: Published, Draft
Create a purchase order share link
POST https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-order/share-link
- cURL
- JavaScript
curl -X POST 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-order/share-link' \
-H 'Authorization: Bearer <personal_access_token>' \
-H 'SelectedBranchId: <numeric_branch_id>' \
-H 'Content-Type: application/json' \
-d '{
"record_id": 3456,
"expiry_days": 30
}'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-order/share-link", {
method: "POST",
headers: {
Authorization: "Bearer <personal_access_token>",
SelectedBranchId: "<numeric_branch_id>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"record_id": 3456,
"expiry_days": 30
}),
});
const data = await response.json();
console.log(data);
Requires purchase order view access.
Body
| Field | Required | Type | Description |
|---|---|---|---|
record_id | Yes | number | Purchase order id |
expiry_days | No | number | Days until the link expires. Default 30. Must be greater than 0 |
Example request
{
"record_id": 3456,
"expiry_days": 30
}
Example response
{
"success": true,
"message": "Shareable link created successfully",
"result": {
"link": "https://example.com/s/abc123",
"valid_until": "18/11/2026"
}
}
result.link is the URL. result.valid_until is the expiry date in the branch date format.
Errors
Permission Deniedrecord_id is requiredPurchase order not foundExpiry days must be greater than 0. Default is 30 days
Delete a purchase order
DELETE https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-orders/3456
- cURL
- JavaScript
curl -X DELETE 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-orders/3456' \
-H 'Authorization: Bearer <personal_access_token>' \
-H 'SelectedBranchId: <numeric_branch_id>'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-orders/3456", {
method: "DELETE",
headers: {
Authorization: "Bearer <personal_access_token>",
SelectedBranchId: "<numeric_branch_id>",
},
});
const data = await response.json();
console.log(data);
Deleting a purchase order requires permission to delete purchase orders. There is no request body.
Example response
{
"success": true,
"message": "PO-001 deleted successfully",
"result": 3456
}
result is the deleted purchase order id.
Errors
Permission DeniedPurchase Order Not FoundUnable to process the request since <b>Transaction Lock is enabled for this module for the date you've selected.</b>Remove Associated Reminders to delete PO-001PO-001 cannot be deleted as purchase Order has been converted.PO-001 cannot be deleted as purchase Order has been present in grn.
List purchase orders
GET https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-orders&page_size=50
- cURL
- JavaScript
curl -X GET 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-orders&page_size=50' \
-H 'Authorization: Bearer <personal_access_token>' \
-H 'SelectedBranchId: <numeric_branch_id>'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-orders&page_size=50", {
method: "GET",
headers: {
Authorization: "Bearer <personal_access_token>",
SelectedBranchId: "<numeric_branch_id>",
},
});
const data = await response.json();
console.log(data);
Requires access to purchase orders. See Pagination.
| Parameter | Value |
|---|---|
include_attachments | Set to 1 to include attachments. Omit it and the response has no attachments key. The array matches List invoices |
Default sort_by | purchaseorder_id |
| Sort fields | purchaseorder_id, purchaseorder_code, purchaseorder_date, purchaseorder_total, purchaseorder_status, purchaseorder_created_at, purchaseorder_updated_at |
| Filter fields | purchaseorder_status, purchaseorder_code, purchaseorder_date, purchaseorder_userid, purchaseorder_created_by, purchaseorder_project_id, purchaseorder_total |
Example response
{
"success": true,
"message": "Purchase orders fetched successfully",
"result": {
"records": [
{
"purchaseorder_id": 3456,
"purchaseorder_uuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"purchaseorder_code": "PO-001",
"purchaseorder_date": "2026-01-15",
"purchaseorder_status": "Pending",
"purchaseorder_userid": 15,
"purchaseorder_created_by": 11,
"purchaseorder_currency": 1,
"purchaseorder_created_at": "2026-01-15 10:30:00",
"purchaseorder_total": "$1,250.00"
}
],
"page_info": {
"next_page_token": "...",
"has_next_page": true,
"has_prev_page": false,
"page_size": 50
}
}
}
Get purchase order details
GET {workspace_url}/?app=ealsuite_api/v1/purchase-orders/{id}
- cURL
- JavaScript
curl -X GET 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-orders/{id}' \
-H 'Authorization: Bearer <personal_access_token>' \
-H 'SelectedBranchId: <numeric_branch_id>'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/purchase-orders/{id}", {
method: "GET",
headers: {
Authorization: "Bearer <personal_access_token>",
SelectedBranchId: "<numeric_branch_id>",
},
});
const data = await response.json();
console.log(data);
Requires purchase order view access. Users limited to their own or linked records get Purchase order not found when this order is outside that scope.
Query
| Parameter | Value |
|---|---|
include_attachments | Set to 1 to include attachments. Omit it and the response has no attachments key |
attachments matches List invoices. Do not store url permanently.
Header money field purchaseorder_total matches the list. Dates are Y-m-d. purchaseorder_status is the stored status (Pending, Waiting Approval, Cancelled, and similar), not the create-time Published flag. summary amounts are unformatted decimal strings. Line items use the create line shape. Each priced line is returned separately in items. Free-of-charge quantity is merged onto the immediately preceding paid line for the same item and unit as item_foc.
Example response
{
"success": true,
"message": "Purchase order details fetched successfully",
"result": {
"purchaseorder_id": 3456,
"purchaseorder_uuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"purchaseorder_code": "PO-001",
"purchaseorder_date": "2026-01-15",
"purchaseorder_status": "Pending",
"purchaseorder_userid": 15,
"purchaseorder_created_by": 11,
"purchaseorder_currency": 1,
"purchaseorder_created_at": "2026-01-15 10:30:00",
"purchaseorder_total": "$1,250.00",
"supplier_id": 15,
"title": "September purchase order",
"purchase_order_date": "2026-01-15",
"payment_terms": 3,
"adjustment": 0,
"currency_rate": 1,
"is_tax_inclusive": 0,
"discount_method": { "type": "Bill Wise", "before_tax": true },
"bill_discount": 10,
"bill_discount_type": "p",
"billing_street": "12 Market Road",
"billing_city": "Dubai",
"billing_state": "Dubai",
"billing_zip": "00000",
"billing_country": "United Arab Emirates",
"billing_address": "12 Market Road, Dubai",
"shipping_street": "Warehouse 4",
"shipping_city": "Dubai",
"shipping_state": "Dubai",
"shipping_zip": "00000",
"shipping_country": "United Arab Emirates",
"shipping_address": "Warehouse 4, Dubai",
"shipping_contact_person": "Amina Khan",
"shipping_phone": "+971500000000",
"additional_expenses": [{ "category_id": 123, "amount": 50.0 }],
"summary": {
"subtotal": "1200.00",
"discount": "120.00",
"adjustment": "0.00",
"total": "1250.00",
"tax": "57.00"
},
"items": [
{
"item_id": 10,
"item_quantity": 2,
"item_rate": 100,
"item_line_discount": 0,
"item_discount_type": "p",
"item_unit": 5,
"item_foc": 0,
"items_tax_id": 1,
"items_taxrate": 5,
"items_taxname": "VAT 5%",
"items_is_taxgroup": 0,
"items_taxrate1": "0.00",
"items_taxrate2": "0.00",
"items_tax1_name": "VAT",
"items_tax2_name": "",
"items_tax_type": "tax",
"items_tax_type1": "tax",
"items_tax_type2": "tax",
"warehouse_id": 1
}
]
}
}
Errors
Purchase order not foundPermission Denied
Debit notes
Create or update a debit note, list debit notes, or load one debit note by id. Omit record_id to create. Pass the numeric debit note id as record_id to update. Line items match invoices. The contact field is supplier_id.
Create or update a debit note
POST https://yoursite.ealsuite.com/?app=ealsuite_api/v1/debit-note
- cURL
- JavaScript
curl -X POST 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/debit-note' \
-H 'Authorization: Bearer <personal_access_token>' \
-H 'SelectedBranchId: <numeric_branch_id>' \
-H 'Content-Type: application/json' \
-d '{
"record_id": 9012,
"supplier_id": 15,
"debit_note_date": "09/09/2026",
"purchase_bill_id": 5678,
"status": "Published",
"sales_person": 11,
"debitnote_294": "PO-44",
"debitnote_297": 101,
"debitnote_298": ["201", "202"],
"adjustment": 0,
"currency_rate": 1,
"payment_terms": 3,
"discount_method": { "type": "Bill Wise", "before_tax": true },
"is_tax_inclusive": 0,
"title": "September debit note",
"bill_discount": 10,
"bill_discount_type": "p",
"serial_code_id": 3,
"additional_expenses": [{ "category_id": 123, "amount": 50.0 }],
"billing_street": "12 Market Road",
"billing_city": "Dubai",
"billing_state": "Dubai",
"billing_zip": "00000",
"billing_country": "United Arab Emirates",
"billing_address": "12 Market Road, Dubai",
"shipping_street": "Warehouse 4",
"shipping_city": "Dubai",
"shipping_state": "Dubai",
"shipping_zip": "00000",
"shipping_country": "United Arab Emirates",
"shipping_address": "Warehouse 4, Dubai",
"shipping_contact_person": "Amina Khan",
"shipping_phone": "+971500000000",
"items": [
{
"item_id": 10,
"item_quantity": 2,
"item_rate": 100,
"item_line_discount": 0,
"item_discount_type": "p",
"item_unit": 5,
"item_foc": 0,
"items_tax_id": 1,
"items_taxrate": 5,
"items_taxname": "VAT 5%",
"items_is_taxgroup": 0,
"items_taxrate1": "0.00",
"items_taxrate2": "0.00",
"items_tax1_name": "VAT",
"items_tax2_name": "",
"items_tax_type": "tax",
"items_tax_type1": "tax",
"items_tax_type2": "tax",
"warehouse_id": 1
}
]
}'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/debit-note", {
method: "POST",
headers: {
Authorization: "Bearer <personal_access_token>",
SelectedBranchId: "<numeric_branch_id>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"record_id": 9012,
"supplier_id": 15,
"debit_note_date": "09/09/2026",
"purchase_bill_id": 5678,
"status": "Published",
"sales_person": 11,
"debitnote_294": "PO-44",
"debitnote_297": 101,
"debitnote_298": ["201", "202"],
"adjustment": 0,
"currency_rate": 1,
"payment_terms": 3,
"discount_method": { "type": "Bill Wise", "before_tax": true },
"is_tax_inclusive": 0,
"title": "September debit note",
"bill_discount": 10,
"bill_discount_type": "p",
"serial_code_id": 3,
"additional_expenses": [{ "category_id": 123, "amount": 50.0 }],
"billing_street": "12 Market Road",
"billing_city": "Dubai",
"billing_state": "Dubai",
"billing_zip": "00000",
"billing_country": "United Arab Emirates",
"billing_address": "12 Market Road, Dubai",
"shipping_street": "Warehouse 4",
"shipping_city": "Dubai",
"shipping_state": "Dubai",
"shipping_zip": "00000",
"shipping_country": "United Arab Emirates",
"shipping_address": "Warehouse 4, Dubai",
"shipping_contact_person": "Amina Khan",
"shipping_phone": "+971500000000",
"items": [
{
"item_id": 10,
"item_quantity": 2,
"item_rate": 100,
"item_line_discount": 0,
"item_discount_type": "p",
"item_unit": 5,
"item_foc": 0,
"items_tax_id": 1,
"items_taxrate": 5,
"items_taxname": "VAT 5%",
"items_is_taxgroup": 0,
"items_taxrate1": "0.00",
"items_taxrate2": "0.00",
"items_tax1_name": "VAT",
"items_tax2_name": "",
"items_tax_type": "tax",
"items_tax_type1": "tax",
"items_tax_type2": "tax",
"warehouse_id": 1
}
]
}),
});
const data = await response.json();
console.log(data);
Creating a debit note requires permission to create debit notes. Updating requires permission to edit them. Transaction lock and other bill rules still apply. purchase_bill_id is optional: omit it for a standalone debit note, or pass an eligible purchase bill to return against it. Eligible bills are not Draft, Waiting Approval, Rejected, or Cancelled, and must belong to supplier_id. When linked, remaining bill due can be applied automatically. status is accepted as Published; the saved debit note is Open, or Waiting Approval when debit-note approval is enabled and the amount exceeds the approval value.
A lookup or multiselect-lookup value must be an id returned by Custom field options for that field. Soft-deleted items and leads are not valid. Omitting the key on update keeps the stored value, and that stored value is checked again.
Body
Required: supplier_id, and items with the invoice line shape.
| Field | Required | Type | Description |
|---|---|---|---|
supplier_id | Yes | number | Supplier id from List suppliers |
items | Yes | array | At least one line item |
debit_note_date | No | string | Branch date format. Defaults to today. idate is rejected |
purchase_bill_id | No | number | Purchase bill to return against. Omit for a standalone debit note |
status | No | string | Published only |
sales_person | No | number | User id from List users. Defaults to the authenticated user |
debitnote_{id} | No | mixed | One debit note custom field. {id} is customfields_id. The key, type, and allowed values come from Get form details with module=debit_note. Omit a key on update to keep the stored value. Dropdown and multiselect values must be an allowed option unless the field allows a new option. Lookup is one id from Custom field options. Multiselect lookup is an array of those ids and replaces the whole set. A repeated multiselect or multiselect-lookup value is stored once. A number field is stored as an integer, so 7.7 is stored as 8, and a value that is not a number is rejected. A number field max is 2147483647 and min is -2147483648. A decimal field max is 9999999999.99999999 and min is -9999999999.99999999. Each custom-field value is checked for its type, and a value of the wrong type is rejected. A 12H time or datetime value must include AM or PM (for example 02:30 PM); a value without meridem is rejected. On create, an omitted date, time, or datetime key uses the field default (current stores now; empty stores null). Sending "" stores null. An uploader value is an existing document id. Autogenerate and formula keys are rejected |
additional_expenses | No | array | Categories must be Direct Expense or Indirect Expense (module=debit_note) |
| Other fields | No | — | Shared optional fields and address overrides |
Example request
{
"record_id": 9012,
"supplier_id": 15,
"debit_note_date": "09/09/2026",
"purchase_bill_id": 5678,
"status": "Published",
"sales_person": 11,
"debitnote_294": "PO-44",
"debitnote_297": 101,
"debitnote_298": ["201", "202"],
"adjustment": 0,
"currency_rate": 1,
"payment_terms": 3,
"discount_method": { "type": "Bill Wise", "before_tax": true },
"is_tax_inclusive": 0,
"title": "September debit note",
"bill_discount": 10,
"bill_discount_type": "p",
"serial_code_id": 3,
"additional_expenses": [{ "category_id": 123, "amount": 50.0 }],
"billing_street": "12 Market Road",
"billing_city": "Dubai",
"billing_state": "Dubai",
"billing_zip": "00000",
"billing_country": "United Arab Emirates",
"billing_address": "12 Market Road, Dubai",
"shipping_street": "Warehouse 4",
"shipping_city": "Dubai",
"shipping_state": "Dubai",
"shipping_zip": "00000",
"shipping_country": "United Arab Emirates",
"shipping_address": "Warehouse 4, Dubai",
"shipping_contact_person": "Amina Khan",
"shipping_phone": "+971500000000",
"items": [
{
"item_id": 10,
"item_quantity": 2,
"item_rate": 100,
"item_line_discount": 0,
"item_discount_type": "p",
"item_unit": 5,
"item_foc": 0,
"items_tax_id": 1,
"items_taxrate": 5,
"items_taxname": "VAT 5%",
"items_is_taxgroup": 0,
"items_taxrate1": "0.00",
"items_taxrate2": "0.00",
"items_tax1_name": "VAT",
"items_tax2_name": "",
"items_tax_type": "tax",
"items_tax_type1": "tax",
"items_tax_type2": "tax",
"warehouse_id": 1
}
]
}
Example response
{
"success": true,
"message": "Debit Note saved successfully",
"result": 9012
}
result is the debit note id. Use it as record_id to edit.
Errors
Use debit_note_date instead of idateInvalid purchase_bill_idInvalid purchase billPurchase bill is not eligible for a debit notePurchase bill does not belong to the selected supplierInvalid debit notePermission Denied
Delete a debit note
DELETE https://yoursite.ealsuite.com/?app=ealsuite_api/v1/debit-notes/9012
- cURL
- JavaScript
curl -X DELETE 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/debit-notes/9012' \
-H 'Authorization: Bearer <personal_access_token>' \
-H 'SelectedBranchId: <numeric_branch_id>'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/debit-notes/9012", {
method: "DELETE",
headers: {
Authorization: "Bearer <personal_access_token>",
SelectedBranchId: "<numeric_branch_id>",
},
});
const data = await response.json();
console.log(data);
Deleting a debit note requires permission to delete debit notes. There is no request body.
Example response
{
"success": true,
"message": "DN-001 deleted successfully",
"result": 9012
}
result is the deleted debit note id.
Errors
Permission DeniedInvalid RequestDebit Note Not FoundUnable to process the request since <b>Transaction Lock is enabled for this module for the date you've selected.</b>DN-001 cannot be deleted as Debit Note credit has been applied.Remove Associated Reminders to delete DN-001
List debit notes
GET https://yoursite.ealsuite.com/?app=ealsuite_api/v1/debit-notes&page_size=50
- cURL
- JavaScript
curl -X GET 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/debit-notes&page_size=50' \
-H 'Authorization: Bearer <personal_access_token>' \
-H 'SelectedBranchId: <numeric_branch_id>'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/debit-notes&page_size=50", {
method: "GET",
headers: {
Authorization: "Bearer <personal_access_token>",
SelectedBranchId: "<numeric_branch_id>",
},
});
const data = await response.json();
console.log(data);
Requires access to debit notes. A role limited to the user's own records or to linked records can restrict results by creator and the linked supplier's creator. See Pagination.
| Parameter | Value |
|---|---|
include_attachments | Set to 1 to include attachments. Omit it and the response has no attachments key. The array matches List invoices |
Default sort_by | debitnote_id |
| Sort fields | debitnote_id, debitnote_code, debitnote_date, debitnote_total, debitnote_status, debitnote_created_at, debitnote_updated_at |
| Filter fields | debitnote_status, debitnote_code, debitnote_date, debitnote_userid, debitnote_created_by, debitnote_project_id, debitnote_total, debitnote_purchase_id |
Example response
{
"success": true,
"message": "Debit notes fetched successfully",
"result": {
"records": [
{
"debitnote_id": 9012,
"debitnote_uuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"debitnote_code": "DN-001",
"debitnote_date": "2026-01-15",
"debitnote_status": "Open",
"debitnote_userid": 15,
"debitnote_created_by": 11,
"debitnote_created_at": "2026-01-15 10:30:00",
"debitnote_purchase_id": 5678,
"debitnote_total": "$1,250.00",
"debitnote_due_amount": "$250.00"
}
],
"page_info": {
"next_page_token": "...",
"has_next_page": true,
"has_prev_page": false,
"page_size": 50
}
}
}
Errors
Permission Denied
Get debit note details
GET {workspace_url}/?app=ealsuite_api/v1/debit-notes/{id}
- cURL
- JavaScript
curl -X GET 'https://yoursite.ealsuite.com/?app=ealsuite_api/v1/debit-notes/{id}' \
-H 'Authorization: Bearer <personal_access_token>' \
-H 'SelectedBranchId: <numeric_branch_id>'
const response = await fetch("https://yoursite.ealsuite.com/?app=ealsuite_api/v1/debit-notes/{id}", {
method: "GET",
headers: {
Authorization: "Bearer <personal_access_token>",
SelectedBranchId: "<numeric_branch_id>",
},
});
const data = await response.json();
console.log(data);
Requires debit note view access. Users limited to their own or linked records get Debit note not found when this debit note is outside that scope.
Query
| Parameter | Value |
|---|---|
include_attachments | Set to 1 to include attachments. Omit it and the response has no attachments key |
attachments matches List invoices. Do not store url permanently.
Keys match create or update a debit note so the same object can be posted back as an edit. record_id is the debit note id. debit_note_date uses the branch date format. status, serial_code_id, and sales_person are omitted. purchase_bill_id is the linked purchase bill, or null for a standalone debit note. summary and attachments are read-only. summary.due is remaining unused debit. summary.paid is debit already applied. summary amounts are unformatted decimal strings. Line items use the create line shape. Each priced line is returned separately in items. Free-of-charge quantity is merged onto the immediately preceding paid line for the same item and unit as item_foc.
Example response
{
"success": true,
"message": "Debit note details fetched successfully",
"result": {
"record_id": 9012,
"supplier_id": 15,
"debit_note_date": "09/09/2026",
"purchase_bill_id": 5678,
"adjustment": 0,
"currency_rate": 1,
"payment_terms": 3,
"discount_method": { "type": "Bill Wise", "before_tax": true },
"is_tax_inclusive": 0,
"title": "September debit note",
"bill_discount": 10,
"bill_discount_type": "p",
"additional_expenses": [{ "category_id": 123, "amount": 50.0 }],
"billing_street": "12 Market Road",
"billing_city": "Dubai",
"billing_state": "Dubai",
"billing_zip": "00000",
"billing_country": "United Arab Emirates",
"billing_address": "12 Market Road, Dubai",
"shipping_street": "Warehouse 4",
"shipping_city": "Dubai",
"shipping_state": "Dubai",
"shipping_zip": "00000",
"shipping_country": "United Arab Emirates",
"shipping_address": "Warehouse 4, Dubai",
"shipping_contact_person": "Amina Khan",
"shipping_phone": "+971500000000",
"items": [
{
"item_id": 10,
"item_quantity": 2,
"item_rate": 100,
"item_line_discount": 0,
"item_discount_type": "p",
"item_unit": 5,
"item_foc": 0,
"items_tax_id": 1,
"items_taxrate": 5,
"items_taxname": "VAT 5%",
"items_is_taxgroup": 0,
"items_taxrate1": "0.00",
"items_taxrate2": "0.00",
"items_tax1_name": "VAT",
"items_tax2_name": "",
"items_tax_type": "tax",
"items_tax_type1": "tax",
"items_tax_type2": "tax",
"warehouse_id": 1
}
],
"summary": {
"subtotal": "1200.00",
"discount": "120.00",
"adjustment": "0.00",
"total": "1250.00",
"tax": "57.00",
"paid": "1000.00",
"due": "250.00"
}
}
}
Errors
Debit note not foundPermission Denied