Create expense

Requires authentication

HTTP Request

POST connector/api/expense

Body Parameters

Parameter Type Status Description
location_id integer required id of the business location
final_total float required Expense amount
transaction_date string optional transaction date format:Y-m-d H:i:s,
tax_rate_id integer optional id of the tax rate applicable to the expense
expense_for integer optional id of the user for which expense is created
contact_id integer optional id of the contact(customer or supplier) for which expense is created
additional_notes string optional
is_recurring integer optional whether expense is recurring (0, 1)
recur_interval integer optional value of the interval expense will be regenerated
recur_interval_type string optional type of the recur interval ('days', 'months', 'years')
subscription_repeat_on integer optional day of the month on which expense will be generated if recur interval type is months (1-30)
subscription_no string optional subscription number
recur_repetitions integer optional total number of expense to be generated
payment array optional payment lines for the expense
payment.*.amount float optional amount of the payment
payment.*.method string optional payment methods ('cash', 'card', 'cheque', 'bank_transfer', 'other', 'custom_pay_1', 'custom_pay_2', 'custom_pay_3')
payment.*.account_id integer optional account id
payment.*.card_number string optional
payment.*.card_holder_name string optional
payment.*.card_transaction_number string optional
payment.*.card_type string optional
payment.*.card_month string optional
payment.*.card_year string optional
payment.*.card_security string optional
payment.*.transaction_no_1 string optional
payment.*.transaction_no_2 string optional
payment.*.transaction_no_3 string optional
payment.*.note string optional payment note
payment.*.cheque_number string optional

Example request:

curl -X POST \
"" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"location_id":15,"final_total":16.37542348,"transaction_date":"2020-5-7 15:20:22","tax_rate_id":15,"expense_for":13,"contact_id":7,"additional_notes":"ipsam","is_recurring":0,"recur_interval":4,"recur_interval_type":"months","subscription_repeat_on":15,"subscription_no":"enim","recur_repetitions":9,"payment":[{"amount":453.13,"method":"cash","account_id":20,"card_number":"provident","card_holder_name":"voluptas","card_transaction_number":"excepturi","card_type":"repellat","card_month":"quis","card_year":"mollitia","card_security":"placeat","transaction_no_1":"voluptas","transaction_no_2":"fugiat","transaction_no_3":"velit","note":"maxime","cheque_number":"vitae"}]}'

Example response (200):

"data": {
"id": 75,
"business_id": 1,
"location_id": "1",
"payment_status": "due",
"ref_no": "EP2020\/0013",
"transaction_date": "2020-07-06T05:31:29.480975Z",
"total_before_tax": "43",
"tax_id": null,
"tax_amount": 0,
"final_total": "43",
"expense_category_id": null,
"document": null,
"created_by": 1,
"is_recurring": 0,
"recur_interval": null,
"recur_interval_type": null,
"recur_repetitions": null,
"recur_stopped_on": null,
"recur_parent_id": null,
"created_at": "2020-07-06 11:01:29",
"updated_at": "2020-07-06 11:01:29",
"expense_for": []


const url = new URL(
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
let body = {
"location_id": 15,
"final_total": 16.37542348,
"transaction_date": "2020-5-7 15:20:22",
"tax_rate_id": 15,
"expense_for": 13,
"contact_id": 7,
"additional_notes": "ipsam",
"is_recurring": 0,
"recur_interval": 4,
"recur_interval_type": "months",
"subscription_repeat_on": 15,
"subscription_no": "enim",
"recur_repetitions": 9,
"payment": [
"amount": 453.13,
"method": "cash",
"account_id": 20,
"card_number": "provident",
"card_holder_name": "voluptas",
"card_transaction_number": "excepturi",
"card_type": "repellat",
"card_month": "quis",
"card_year": "mollitia",
"card_security": "placeat",
"transaction_no_1": "voluptas",
"transaction_no_2": "fugiat",
"transaction_no_3": "velit",
"note": "maxime",
"cheque_number": "vitae"
fetch(url, {
method: "POST",
headers: headers,
body: body
.then(response => response.json())
.then(json => console.log(json));