Skip to main content

Import Expenses

Overview

Use this endpoint to push one or more supplier/vendor expense records (AP/expense entries) from an external system into GuestPro Accounting. Each expense item is sent inside transaction_list and includes the basic bookkeeping fields such as reference number, supplier name, account/COA code, invoice & payment dates, amount, and payment method.

Request Endpoint

  • Method: POST
  • Path: {{base_url}}/api/integration/import_expenses

Payload Construction and Schema Definition

The request payload is submitted as form-data fields.

Request Body Fields

FieldTypeRequiredDescriptionExample
transaction_listarray of objectYesList of expense transactions to import. See transaction_list object below.[...]

Request transaction_list Fields

FieldTypeRequiredDescriptionExample
reference_nostringYesReference number for the expense.12345
supplier_namestringYesSupplier/vendor name.Supplier Ayam
account_codestringYesAccount code for expense.1.1.04.04
invoice_datestring (date)YesInvoice date in YYYY-MM-DD.2023-11-30
payment_datestring (date)YesPayment date in YYYY-MM-DD.2023-12-01
amountnumberYesExpense amount.400000
notesstringNoNotes for the transaction.invoice 1
remarkstringNoAdditional remark.Purchase
payment_methodstringYesPayment method.Cash
img_base64stringNoImage attachment as base64 data URL.data:image/png;base64,<<base64>>

Response Body Fields

FieldTypeAlways presentDescription
successbooleanYesIndicates whether the request succeeded.
messagestringYesHuman-readable message.
dataobjectYes (on success)May contain additional info or be empty.

Expected System Request

{
"company_id": "5bae2b00-9849-11eb-bebf-fd10f16383f2",
"username": "admin",
"password": "admin",
"transaction_list": [
{
"reference_no": "12345",
"supplier_name": "Supplier Ayam",
"account_code": "1.1.04.04",
"invoice_date": "2023-11-30",
"payment_date": "2023-12-01",
"amount": 400000,
"notes": "invoice 1",
"remark": "Purchase",
"payment_method": "Cash",
"img_base64": "data:image/png;base64,<<base64>>"
}
]
}