Get profit and loss report

Requires authentication

HTTP Request

GET connector/api/profit-loss-report

Query Parameters

Parameter Status Description
location_id optional optional id of the location
start_date optional optional format:Y-m-d
end_date optional optional format:Y-m-d
user_id optional optional id of the user

Example request:

curl -X GET \
-G "http://erp.dstadvertising.com/connector/api/profit-loss-report?location_id=nostrum&start_date=2018-06-25&end_date=2018-06-25&user_id=cupiditate" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"

Example response (200):

{
"data": {
"total_purchase_shipping_charge": 0,
"total_sell_shipping_charge": 0,
"total_transfer_shipping_charges": "0.0000",
"opening_stock": 0,
"closing_stock": "386859.00000000",
"total_purchase": 386936,
"total_purchase_discount": "0.000000000000",
"total_purchase_return": "0.0000",
"total_sell": 9764.5,
"total_sell_discount": "11.550000000000",
"total_sell_return": "0.0000",
"total_sell_round_off": "0.0000",
"total_expense": "0.0000",
"total_adjustment": "0.0000",
"total_recovered": "0.0000",
"total_reward_amount": "0.0000",
"left_side_module_data": [
{
"value": "0.0000",
"label": "Total Payroll",
"add_to_net_profit": true
},
{
"value": 0,
"label": "Total Production Cost",
"add_to_net_profit": true
}
],
"right_side_module_data": [],
"net_profit": 9675.95,
"gross_profit": -11.55,
"total_sell_by_subtype": []
}
}

javascript

const url = new URL(
"http://erp.dstadvertising.com/connector/api/profit-loss-report"
);
let params = {
"location_id": "nostrum",
"start_date": "2018-06-25",
"end_date": "2018-06-25",
"user_id": "cupiditate",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));