Daftra API
DocsAll EndpointsDaftra Partners
DocsAll EndpointsDaftra Partners
  1. Expenses
  • Welcome
  • Getting Started
  • Authorization
  • All Endpoints
    • Auth
      • Generate Access Token
    • Invoices
      • GET All Invoices
      • GET Single Invoice
      • Edit Invoices
      • Delete Invoices
      • Add New Invoice
    • Estimates
      • GET All Estimates
      • GET Single Estimate
      • Edit Estimates
      • Delete Estimates
      • Add New Estimate
    • Credit Notes
      • GET All Credit Notes
      • GET Single Credit Note
      • Edit Credit Notes
      • Delete Credit Notes
      • Add New Credit Note
    • Refund Receipts
      • GET All Refund Receipts
      • GET Single Refund Receipt
      • Edit Refund Receipts
      • Delete Refund Receipts
      • Add New Refund Receipt
    • Clients
      • GET All Clients
      • GET Single Client
      • Edit Clients
      • Delete Clients
      • Add New Client
    • Suppliers
      • GET All Suppliers
      • GET Single Supplier
      • Edit Suppliers
      • Delete Suppliers
      • Add New Supplier
    • Work Orders
      • GET Single Work Order
      • Edit Work Orders
      • Delete Work Orders
      • GET All Work Orders
      • Add New Work Order
    • Client Appointments
      • GET All Client Appointments
      • GET Single Client Appointment
      • Edit Client Appointments
      • Delete Client Appointments
      • Add New Client Appointment
    • Invoice Appointments
      • GET All Invoice Appointments
      • GET Single Invoice Appointment
      • Edit Invoice Appointments
      • Delete Invoice Appointments
      • Add New Invoice Appointment
    • Estimate Appointments
      • GET All Estimate Appointments
      • GET Single Estimate Appointment
      • Edit Estimate Appointments
      • Delete Estimate Appointments
      • Add New Estimate Appointment
    • Work Order Appointments
      • GET All Work Order Appointments
      • GET Single Work Order Appointment
      • Edit Work Order Appointments
      • Delete Work Order Appointments
      • Add New Work Order Appointment
    • Notes
      • GET All Notes
      • GET Single Note
      • Edit Notes
      • Delete Notes
      • Add New Note
    • Time Tracking
      • GET All Time Tracking
      • GET Single Time Tracking
      • Edit Time Tracking
      • Delete Time Tracking
      • Add New Time Tracking
    • Invoice Payments
      • GET All Invoice Payments
      • GET Single Invoice Payment
      • Edit Invoice Payments
      • Delete Invoice Payments
      • Add New Invoice Payment
    • Client Payments
      • GET All Client Payments
      • GET Single Client Payment
      • Edit Client Payments
      • Delete Client Payments
      • Add New Client Payment
    • Products
      • GET All Products
      • GET Single Product
      • Edit Products
      • Delete Products
      • Add New Product
    • Journals
      • GET All Journals
      • GET Single Journal
      • Edit Journals
      • Delete Journals
      • Add New Journal
    • Journal Accounts
      • GET All Journal Accounts
      • GET Single Journal Account
      • Edit Journal Accounts
      • Delete Journal Accounts
      • Add New Journal Account
    • Journal Cats
      • GET All Journal Cats
      • GET Single Journal Cat
      • Edit Journal Cats
      • Delete Journal Cats
      • Add New Journal Cat
    • Expenses
      • GET All Expenses
        GET
      • GET Single Expens
        GET
      • Edit Expenses
        PUT
      • Delete Expenses
        DELETE
      • Add New Expens
        POST
    • Incomes
      • GET All Incomes
      • GET Single Income
      • Edit Incomes
      • Delete Incomes
      • Add New Income
    • Taxes
      • GET All Taxes
      • GET Single Taxe
      • Edit Taxes
      • Delete Taxes
      • Add New Taxe
    • Purchase Invoices
      • GET All Purchase Invoices
      • GET Single Purchase Invoice
      • Edit Purchase Invoices
      • Delete Purchase Invoices
      • Add New Purchase Invoice
    • Purchase Refunds
      • GET All Purchase Refunds
      • GET Single Purchase Refund
      • Edit Purchase Refunds
      • Delete Purchase Refunds
      • Add New Purchase Refund
    • Stock Transactions
      • GET All Stock Transactions
      • GET Single Stock Transaction
      • Edit Stock Transactions
      • Delete Stock Transactions
      • Add New Stock Transaction
    • Stores
      • GET All Stores
      • GET Single Store
      • Edit Stores
      • Delete Stores
      • Add New Store
    • Treasuries
      • GET All Treasuries
      • GET Single Treasury
      • Edit Treasuries
      • Delete Treasuries
      • Add New Treasury
    • Product Categories
      • GET All Product Categories
      • GET Single Product Category
    • Staff
      • GET All Staff
      • GET Single Staff
    • Client-attendance-log
      • Add New Client-attendance-log
    • Follow Up Actions
      • GET All Follow Up Actions
      • GET Single Follow Up Action
      • Delete Follow Up Action
    • Follow Up Statuses
      • GET All Follow Up Statuses
      • GET Single Follow Up Status
      • Delete Follow Up Status
    • General Listing
      • GET General Listing
    • Site
      • GET Site Info
  1. Expenses

Edit Expenses

Production
https://{{subdomain}}.daftra.com/api2
Production
https://{{subdomain}}.daftra.com/api2
PUT
https://{{subdomain}}.daftra.com/api2
/expenses/{id}{format}
Expenses
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request PUT 'https://.daftra.com/api2/expenses/' \
--header 'Accept: application/json' \
--header 'apikey: ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "Expense": {
        "id": 0,
        "amount": 0,
        "currency_code": "string",
        "vendor": "string",
        "category": "string",
        "date": "2019-08-24",
        "file": "string",
        "note": "string",
        "client_id": 0,
        "tax1_id": 0,
        "tax1_name": "string",
        "tax1_value": 0,
        "tax1_amount": 0,
        "tax1_included": true,
        "tax2_id": 0,
        "tax2_name": "string",
        "tax2_value": 0,
        "tax2_amount": 0,
        "tax2_included": true,
        "is_income": true,
        "attachments": "[\r\n '\''https://s3.eu-west-1.amazonaws.com/daftra.local/files/9c3832a8/expense/d5912439-52dc-4385-a2e5-06bc9176e8bb.png?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAXJXESINN22IBY4MO%2F20230515%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20230515T101647Z&X-Amz-SignedHeaders=host&X-Amz-Expires=6000&X-Amz-Signature=a804d6a4070f36cc4f2c7a06e76b6b5d6050dd918ffa14ac5458be6efebc0e07'\'',\r\n '\''https://s3.eu-west-1.amazonaws.com/daftra.local/files/9c3832a8/expense/f75922d3-b5a1-4a7c-a174-3b9a4a960c08.png?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAXJXESINN22IBY4MO%2F20230515%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20230515T101647Z&X-Amz-SignedHeaders=host&X-Amz-Expires=6000&X-Amz-Signature=ea4189619af49a92d9b98c3e98695225e55912376e0586977a99f413a286b972'\''\r\n ]"
    }
}'
Response Response Example
200 - Example 1
{
    "code": 200,
    "result": "successful"
}

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Path Params
id
string 
required
format
string 
required
Header Params
Accept
string 
optional
Default:
application/json
Content-Type
string 
optional
Default:
application/json
apikey
string 
deprecated
You can find/generate your apikey(s) from inside your Daftra Account
Default:
{{apikey}}
Body Params application/json
Expense
object 
ExpenseBase
optional
id
integer <int32>
optional
Unique identifier
amount
number <double>
optional
Expense amount
currency_code
string 
optional
3 Digit currency code following ISO 4217 standard
<= 100 characters
vendor
string 
optional
(optional)Vendor name
<= 200 characters
category
string 
optional
Category name
<= 200 characters
date
string <date>
optional
date of the expense
file
string 
optional
Link to the uploaded file
<= 200 characters
note
string 
optional
Notes to the expense.
client_id
integer <int32>
optional
Client REF#, you can get it through the Clients API
tax1_id
integer <int32>
optional
First tax Ref #
tax1_name
string 
optional
First tax name
<= 255 characters
tax1_value
number <float>
optional
First tax value
tax1_amount
number <double>
optional
First tax amount
tax1_included
boolean 
optional
0/1 if the first tax is included in the expense amount or not .
tax2_id
integer <int32>
optional
Second tax Ref #
tax2_name
string 
optional
Second tax name
<= 255 characters
tax2_value
number <float>
optional
Second tax value
tax2_amount
number <double>
optional
Second tax amount
tax2_included
boolean 
optional
0/1 if the second tax is included in the expense amount or not .
is_income
boolean 
optional
0/1 indicating if it is an income or not
attachments
array[string]
optional
contains urls of s3 attachments
Example:
[ 'https://s3.eu-west-1.amazonaws.com/daftra.local/files/9c3832a8/expense/d5912439-52dc-4385-a2e5-06bc9176e8bb.png?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAXJXESINN22IBY4MO%2F20230515%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20230515T101647Z&X-Amz-SignedHeaders=host&X-Amz-Expires=6000&X-Amz-Signature=a804d6a4070f36cc4f2c7a06e76b6b5d6050dd918ffa14ac5458be6efebc0e07', 'https://s3.eu-west-1.amazonaws.com/daftra.local/files/9c3832a8/expense/f75922d3-b5a1-4a7c-a174-3b9a4a960c08.png?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAXJXESINN22IBY4MO%2F20230515%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20230515T101647Z&X-Amz-SignedHeaders=host&X-Amz-Expires=6000&X-Amz-Signature=ea4189619af49a92d9b98c3e98695225e55912376e0586977a99f413a286b972' ]
Examples

Responses

🟢200OK
application/json
OK
Body
code
integer 
optional
Example:
200
result
string 
optional
Example:
successful
🟠400Bad Request
🟠401Unauthorized
🟠403Forbidden
🟠404Record Not Found
Previous
GET Single Expens
Next
Delete Expenses