Income by Customers

Income by Customers is a financial report or analysis that breaks down a business’s revenue by individual customers or customer segments over a specific period.

Get All Income by Customers

To get all Income by Customers, make a GET request to the /api/v3/reports/customers/:from/:to endpoint. Sample request using axios:

js
const response = await axios.get("/api/v3/reports/customers/:from/:to");

Where <from> is the start date and <to> is the end date of the Income by Customers list

Sample Response object:

json
{ { "id": 1, "owner_id": 1, "business_id": 1, "first_name": null, "last_name": null, "phone_number": null, "business_name": "Amin", "business_address": null, "business_phone": null, "business_location": null, "business_email": null, "created_at": "2020-03-05 16:54:04", "updated_at": "2023-12-22 13:05:23", "account_id": 137, "category": "Uncategorised", "category_id": 1, "deposit_amount": 20000, "deposit_account_id": null, "archived": 0, "amount_due": 0, "invoice_count": 0, "balance": 8311126.41, "amount_paid": null, "online_amount_paid": null, "dateFrom": "2024-11-01", "dateTo": "2024-11-11", "average_payment_terms": 0, "owing": 0, "total_paid": 0, "invoices": 0 }, { "id": 2, "owner_id": 1, "business_id": 1, "first_name": "", "last_name": "", "phone_number": "", "business_name": "AdMob Int.", "business_address": "", "business_phone": "", "business_location": "", "business_email": "", "created_at": "2020-03-08 21:22:29", "updated_at": "2020-03-08 21:22:29", "account_id": 318, "category": "Uncategorised", "category_id": 1, "deposit_amount": 0, "deposit_account_id": null, "archived": 0, "amount_due": 0, "invoice_count": 0, "balance": 8073384, "amount_paid": null, "online_amount_paid": null, "dateFrom": "2024-11-01", "dateTo": "2024-11-11", "average_payment_terms": 0, "owing": 0, "total_paid": 0, "invoices": 0 }, { "id": 3, "owner_id": 1, "business_id": 1, "first_name": null, "last_name": null, "phone_number": null, "business_name": "Andy Aldason", "business_address": null, "business_phone": null, "business_location": null, "business_email": null, "created_at": "2020-03-09 02:11:12", "updated_at": "2020-03-09 02:11:12", "account_id": 321, "category": "Uncategorised", "category_id": 1, "deposit_amount": 0, "deposit_account_id": null, "archived": 0, "amount_due": 0, "invoice_count": 0, "balance": 8002148.76, "amount_paid": null, "online_amount_paid": null, "dateFrom": "2024-11-01", "dateTo": "2024-11-11", "average_payment_terms": 0, "owing": 0, "total_paid": 0, "invoices": 0 }, }

Sending an Income to Customer

To send an income to customer, you will need to draft message, and enter customer’s email address to send an income to a customer. Make a POST request to /client/transactions/send/id?from=<startdate>&to=<enddate> endpoint to send an income to customer. Sample request using axios:

js
const response = await axios.post( "/api/v3/reports/customers/client/transactions/send/id?from=<startdate>&to=<enddate>", { send_tome: "2024-11-07", // The send time of the income other_emails: ["[email protected]", "[email protected]"], // The other email addresses to send the income to message: "This is the message to be sent with the income notification.", // The message of the income to be sent to the email address }, { headers: { accept: "application/json", authorization: "Bearer <API-KEY>", "content-type": "application/json", }, } );

Here is an example response received after successfully sending an income to the customer:

json
{ "Transactions sent" }