Jobs
This domain serves for Jobs related requests.
New Job No
POSTThis api call generates a new job number based on the latest job number in the database.
Request Paramters
string domain |
Value should be job |
Required |
string action |
Value should be newjob |
Required |
object data |
Empty object | Optional |
Sample Request Body
{
domain: "job",
action: "newjob"
}
Response Paramters
string status |
This indicate the status of the response. success is the expected value. |
string message |
This explains the reson for status. |
string data |
Generated Job Number |
Sample Response
{
status: "success",
data: {
status: "success",
message: "new Job Created",
data: "J240013"
}
}
Get Job
POSTThis api call retrieves a job from the database based on the provided quote number.
Request Paramters
string domain |
Value should be job |
Required |
string action |
Value should be get |
Required |
object data |
Contains input parameters. | Required |
string quote_no |
The quote number associated with the job. | Required |
Sample Request Body
{
domain: "job",
action: "get",
data: {
quote_no: "Q05240053"
}
}
Response Paramters
string status |
This indicate the status of the response. success is the expected value. |
string message |
This explains the reson for status. |
object data |
This contain result data object of the API call. |
int id |
The ID of the job. |
string quote_no |
The quote number associated with the job. |
string job_no |
The job number. |
string submitted_date |
The date the job was submitted. |
string submitted_by |
The ID of the user who submitted the job. |
string job_status |
The status of the job. |
string date_x |
A date field associated with the job. |
int status |
The status code of the job. |
Sample Response
{
status: "success",
data: {
status: "success",
message: "Job Read",
data: {
id: "11",
quote_no: "Q05240053",
job_no: "J0011",
submitted_date: "2024-05-27",
submitted_by: "8705",
job_status: "Approved",
date_x: "0000-00-00",
status: "1"
}
}
}
Update Job Product
POSTThis api call updates the status of a job product.It either inserts or updates the status of a product based on the job number and quote number.
Request Paramters
string domain |
Value should be job |
Required |
string action |
Value should be update_job_product |
Required |
object data |
Contains input parameters. | Required |
string job_no |
The job number. | Required |
string quote_no |
The quote number. | Required |
string calc_code |
The calculation code of the product. | Required |
string id |
The ID of the attachment. | Required |
string type |
The type of item to update (either 'product' or 'attachment'). | Required |
string status |
The new status of the item. | Required |
string status_text |
The textual representation of the status. | Required |
string product |
The name of the product being updated. | Required |
Sample Request Body
{
domain: "job",
action: "update_job_product",
data: {
job_no: "J0011",
quote_no: "Q05240053",
calc_code: "584f4f914be7e",
id: "37",
type: "product",
status: "8",
status_text: "Ordered",
product: "Rollers (2)"
}
}
Response Paramters
string status |
This indicate the status of the response. success is the expected value. |
string message |
This explains the reson for status. |
int data |
The number of rows affected by the update. |
Sample Response
{
status: "success",
data: {
status: "success",
message: "Job Product Updated",
data: 2
}
}
Update Job Product ETA Date
POSTThis api call updates the estimated time of completion (ETA) date for a job. It inserts or updates the ETA date based on the job number, quote number, and item type.
Request Paramters
string domain |
Value should be job |
Required |
string action |
Value should be update_job_product_eta_date |
Required |
object data |
Contains input parameters. | Required |
string job_no |
The job number. | Required |
string quote_no |
The quote number. | Required |
string calc_code |
The calculation code of the product. | Required |
string id |
The ID of the attachment (if applicable)/td> | Optional |
string type |
The type of item to update (either product or attachment ). |
Required |
string date |
The new ETA date in YYYY-MM-DD format. | Required |
string product |
The name of the product being updated. | Required |
Sample Request Body
{
domain: "job",
action: "update_job_product",
data: {
job_no: "J0011",
quote_no: "Q05240053",
calc_code: "584f4f914be7e",
id: "37",
type: "product",
status: "8",
status_text: "Ordered",
product: "Rollers (2)"
}
}
Response Paramters
string status |
This indicate the status of the response. success is the expected value. |
string message |
This explains the reson for status. |
object data |
This contain result data object of the API call. |
int updated_row |
The number of rows affected by the update. |
Sample Response
{
status: "success",
data: {
status: "success",
message: "Job Product Updated",
data: {
updated_row: 2
}
}
}
Update Job Status
POSTThis api call updates the status of a job in the database.It updates the status of a job based on the job ID provided.
Request Paramters
string domain |
Value should be job |
Required |
string action |
Value should be update_job_status |
Required |
object data |
Contains input parameters. | Required |
string id |
The ID of the job to update. | Required |
string job_status |
The new status of the job. | Required |
Sample Request Body
{
domain: "job",
action: "update_job_status",
data: {
id: "37",
job_status: "8"
}
}
Response Paramters
string status |
This indicate the status of the response. success is the expected value. |
string message |
This explains the reson for status. |
object data |
This contain result data object of the API call. |
int updated_row |
The number of rows affected by the update. |
Sample Response
{
status: "success",
data: {
status: "success",
message: "Job Product Updated",
data: {
updated_row: 1
}
}
}
Update ECD
POSTThis api call updates the estimated completion date (ECD) of a job in the database.It updates the ECD of a job based on the job ID provided.
Request Paramters
string domain |
Value should be job |
Required |
string action |
Value should be update_ecd |
Required |
object data |
Contains input parameters. | Required |
string id |
The ID of the job to update. | Required |
string ecd |
The new estimated completion date (ECD) in any valid date format (YYYY-MM-DD). | Required |
Sample Request Body
{
domain: "job",
action: "update_job_status",
data: {
id: "37",
ecd: "2024-05-30"
}
}
Response Paramters
string status |
This indicate the status of the response. success is the expected value. |
string message |
This explains the reson for status. |
int data |
The number of rows affected by the update. |
Sample Response
{
"status": "success",
"data": {
"status": "success",
"message": "Job Status Updated",
"data": 1
}
}
Approve Job
POSTThis api call approves a job in the database.If the job associated with the provided quote number doesn't exist, a new job is created and approved.If the job is already approved, it will be unapproved.
Request Paramters
string domain |
Value should be job |
Required |
string action |
Value should be approve_job |
Required |
object data |
Contains input parameters. | Required |
string user_id |
The ID of the user approving the job. | Required |
string quote_no |
The quote number associated with the job. | Required |
Sample Request Body
{
domain: "job",
action: "approve_job",
data: {
user_id: "69",
quote_no: "Q05240053"
}
}
Response Paramters
string status |
This indicate the status of the response. success is the expected value. |
string message |
This explains the reson for status. |
object data |
This contain result data object of the API call. |
int job_id |
The ID of the approved job. |
string job_no |
The job number of the approved job. |
int status |
The status of the approved job (1 for approved, 0 for unapproved). |
Sample Response
{
status: "success",
data: {
status: "success",
message: "Job Status Updated",
data: {
job_id: 11,
job_no: "J0011",
status: 1
}
}
}
Read All Jobs
POSTThis api call retrieves all jobs based on the specified filters.It supports filtering by date range, customer ID, and job status. The call also include a query type parameter to fetch all jobs or specific jobs for a trader.
Request Paramters
string domain |
Value should be job |
Required |
string action |
Value should be read_all |
Required |
object data |
Contains input parameters. | Required |
string date_from |
The start date for filtering jobs in format of YYYY-MM-DD. | Optional |
string|null date_to |
The end date for filtering jobs in format of YYYY-MM-DD. | Optional |
int customer_id |
The ID of the customer to filter jobs. | Required |
string status |
The status of the jobs to filter. | Optional |
string query |
The query type, which can be all , trader , or any other specific query. |
Required |
Sample Request Body
{
domain: "job",
action: "read_all",
data: {
date_from: "2024-03-01",
date_to: "2024-03-31",
customer_id: 75,
status: null,
query: "all"
}
}
Response Paramters
string status |
This indicate the status of the response. success is the expected value. |
string message |
This explains the reson for status. |
object data |
This contain result data object of the API call. |
string DT_RowId |
The unique identifier for the row in the data table, formatted as "row_{id}". |
string id |
The ID of the job. |
string submitted_date |
The date the job was submitted. |
string job_no |
The job number. |
string quote_id |
The ID of the associated quote (if available). |
string quote_no |
The quote number associated with the job. |
string customer_id |
The ID of the customer associated with the job (if available). |
string customer_no |
The customer number associated with the job. |
string q_name |
The full name of the customer associated with the quote. |
string q_name_1 |
The first name of the customer associated with the quote. |
string q_name_2 |
The last name of the customer associated with the quote. |
string q_address |
The full address of the customer associated with the quote. |
string q_address_1 |
The first line of the customer's address associated with the quote. |
string q_address_2 |
The second line of the customer's address associated with the quote. |
string q_suburb |
The suburb of the customer's address associated with the quote. |
string q_postcode |
The postcode of the customer's address associated with the quote. |
string q_email |
The email address of the customer associated with the quote. |
string q_phone |
The phone number of the customer associated with the quote. |
string q_mobile |
The mobile number of the customer associated with the quote. |
string c_ref |
The customer reference number (if available). |
string order_number |
The order number associated with the job. |
string sidemark |
A sidemark associated with the job for internal reference. |
string job_status |
The current status of the job (e.g., Approved). |
string j_status |
The status code of the job (1 for approved). |
string ecd |
The estimated completion date of the job. |
object calculation |
Calculations of the job. |
float grand_total |
The grand total amount associated with the job. |
float balance |
The remaining balance amount, which may be negative if overpaid. |
list products |
Lsit of product realted to the job calculation. Contains Product objects as list elements |
string id |
The unique identifier for the product. |
string name |
The name of the product, e.g., "Retrofit Double Glazing". |
string pro_count |
The count of product units available. |
string eta_date |
The estimated arrival date of the product. |
string status |
The status code representing the product's current status. |
string calc_code |
A unique calculation code associated with the product. |
string type |
The type of item, in this case, "product". |
Sample Response
{
status: "success",
data: {
status: "success",
message: "Job Read",
data:
[
{
DT_RowId: "row_4",
id: "4",
submitted_date: "14 Mar 2024",
job_no: "J0004",
quote_id: null,
quote_no: "Q02240005",
customer_id: null,
customer_no: null,
q_name: "",
q_name_1: null,
q_name_2: null,
q_address: "",
q_address_1: null,
q_address_2: null,
q_suburb: null,
q_postcode: null,
q_email: null,
q_phone: null,
q_mobile: null,
c_ref: null,
order_number: null,
sidemark: "",
job_status: "Approved",
j_status: "1",
ecd: "0000-00-00",
calculation: {
grand_total: 1900.8,
balance: -99.20000000000005,
products: [
{
id: "36",
name: "Retrofit Double Glazing",
pro_count: "2",
eta_date: "2024-03-20",
status: "8",
calc_code: "6509024c16bef",
type: "product"
}
]
}
},
]
}
}
Update Job Status
POSTThis api call updates the status of a job in the database.It updates the status of a job based on the job ID provided.
Request Paramters
string domain |
Value should be job |
Required |
string action |
Value should be update_job_status |
Required |
object data |
Contains input parameters. | Required |
int user_id |
The ID of the user updating the job date. | Required |
int customer_id |
The ID of the customer. | Required |
string customer_no |
The customer number. | Required |
int quote_id |
The ID of the quote. | Required |
string quote_no |
The quote number. | Required |
string customer_name |
The name of the customer. | Required |
string job_no |
The job number. | Required |
string job_date_x |
The new date for the job in 'd/m/Y' format. | Required |
Sample Request Body
{
domain: "job",
action: "update_job_date_x",
data: {
user_id: 69,
customer_id: 1,
customer_no: "C240001",
quote_id: 31,
quote_no: "Q03240017",
job_no: "J0005",
job_date_x: "6/5/2024",
customer_name: "Test"
}
}
Response Paramters
string status |
This indicate the status of the response. success is the expected value. |
string message |
This explains the reson for status. |
int data |
Always return 1 upon successful execution. |
Sample Response
{
status: "success",
data: {
status: "success",
message: "Job Date X Updated",
data: 1
}
}