Add new expense

This interface is used to add a new expense record to a worker.

Add new expense

POST /add-ee-expense

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Required
Description

customer_id

number

The unique Marco identifier for your company

email

string

Account email of the user

expense_date

date

Expense date

expense_name

string

Expense name or type

expense_status

string

Expense status Valid value: Submitted/Approved/Rejected/Processing/Processed

expense_currency

string

Expense currency

expense_amount

number

Expense amount

expense_notes

string

Expense notes or details

origin

string

Origin - For travel-related expenses

destination

string

Destination - For travel-related expenses

travel_start_date

date

Travel start date - For travel-related expenses

travel_end_date

date

Travel end date - For travel-related expenses

tax_free_payment_amount

number

The tax-free portion of th expense amount

tax_free_payment_currency

string

The tax-free portion's currency

taxable_payment_amount

number

The taxable portion of th expense amount

taxable_payment_currency

string

The taxable portion's currency

files

List of file resource

Related files

files_path

string

If the file cannot be uploaded, the file link will also work. Please use "," to separate multiple file links.

Parameter Example

{
  "customer_id": 1,
  "email": "[email protected]",
  "expense_date": "2024-10-09",
  "expense_name": "Airplane",
  "expense_status": "Submitted",
  "expense_currency": "CNY",
  "expense_amount": "4585",
  "expense_notes": "Testing API",
  "origin": "China",
  "destination": "Singapore",
  "travel_start_date": "2024-10-07",
  "travel_end_date": "2024-10-06",
  "tax_free_payment_amount":"4000",
  "tax_free_payment_currency":"CNY",
  "taxable_payment_amount":"585",
  "taxable_payment_currency":"CNY",
  "files":[]
}

Request Example

var form = new FormData();
form.append("customer_id", "1");
form.append("email", "[email protected]");
form.append("expense_date", "2024-10-11");
form.append("expense_name", "Hotel3");
form.append("expense_status", "Submitted");
form.append("expense_currency", "CNY");
form.append("expense_amount", "600");
form.append("expense_notes", "");
form.append("files[0]", fileInput.files[0], "/C:/Users/ZhounanZhang/OneDrive - Marco Global Payroll Pte Ltd/Desktop/New Microsoft Word Document.docx");
form.append("files[1]", fileInput.files[0], "/C:/Users/ZhounanZhang/OneDrive - Marco Global Payroll Pte Ltd/Desktop/PH-2.csv");

var token = YOUR_TOKEN
var settings = {
  "url": "https://api.marcopayroll.com/api:eZ5RDmx2/api/add-ee-expense",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": token
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});

Response

{
        "id": 5250,
        "customer_id": 1,
        "user": 2232,
        "expense_date": "2024-10-09",
        "expense_currency": "CNY",
        "expense_amount": 4585,
        "title": "Airplane",
        "doc_list": [],
        "notes": "Testing API",
        "travel_start_date": "2024-10-07",
        "travel_end_date": "2024-10-06",
        "origin": "China",
        "destination": null,
        "status": "Submitted",
        "approver": 0,
        "decision_time": null,
        "decision": "",
        "reject_notes": "",
        "tax_free_payment_amount": 4000,
        "tax_free_payment_currency": "CNY",
        "tax_free_payment_entity": 0,
        "taxable_payment_amount": 585,
        "taxable_payment_currency": "CNY",
        "taxable_payment_entity": 0,
        "processing_notes": null,
        "tax_record_list": [],
        "user": 2232,
        "platform_email": "[email protected]"
}

Last updated