For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Logo
Resources
Log inGet a demo
Get startedAPI referenceImplementation
Get startedAPI referenceImplementation
    • Overview
          • The Expense object
          • GET/expenses
          • POST/expenses
          • GET/expenses/{id}
          • GET/expenses/lines/remote-field-classes
          • GET/expenses/meta/post
          • GET/expenses/remote-field-classes
          • POST/expenses/bulk
          • GET/expenses/bulk/{batch_id}
UnifiedAgent HandlerGateway
UnifiedAgent HandlerGateway
Resources
Log inGet a demo
Common ModelsExpenses

/expenses

POST
/accounting/v1/expenses
POST
/api/accounting/v1/expenses
$curl -X POST https://api.merge.dev/api/accounting/v1/expenses \
> -H "X-Account-Token: X-Account-Token" \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "model": {}
>}'
201Created
1{
2 "model": {
3 "id": "ecbe05ac-62a3-46c5-ab31-4b478b37d1b4",
4 "remote_id": "088899",
5 "created_at": "2021-09-15T00:00:00Z",
6 "modified_at": "2021-10-16T00:00:00Z",
7 "transaction_date": "2024-01-15T09:30:00Z",
8 "remote_created_at": "2020-03-31T00:00:00Z",
9 "account": "9d892439-5fab-4dbb-8bd8-34f7f96c7912",
10 "contact": "3d263469-51a1-4766-9205-f6c997826be1",
11 "total_amount": 10000,
12 "sub_total": 1.1,
13 "total_tax_amount": 1.1,
14 "currency": "USD",
15 "exchange_rate": "2.9",
16 "inclusive_of_tax": true,
17 "company": "595c8f97-2ac4-45b7-b000-41bdf43240b5",
18 "employee": "7442f0d5-722d-45bd-b807-6e38489d37fe",
19 "memo": "New employee supplies",
20 "lines": [
21 {
22 "remote_id": "121222",
23 "item": "b38c59b0-a9d7-4740-b1ee-5436c6751e3d",
24 "net_amount": 25.54,
25 "tracking_categories": [
26 "b38c59b0-a9d7-4740-b1ee-5436c6751e3d",
27 "9b840d2-686a-465a-8a8e-7b028498f8e4",
28 "a47e11b6-c73b-4a0c-be31-130fc48177fa"
29 ],
30 "company": "595c8f97-2ac4-45b7-b000-41bdf43240b5",
31 "employee": "7442f0d5-722d-45bd-b807-6e38489d37fe",
32 "account": "2a56344a-a491-11ec-b909-0242ac120002",
33 "contact": "c640b80b-fac9-409f-aa19-1f9221aec445",
34 "project": "22e65a5d-2df5-4e6e-884a-e538d0339000",
35 "description": "MacBook Pro",
36 "exchange_rate": "2.9",
37 "tax_rate": "a12e7c20-1922-9df7-s75n-edfeewnn7384",
38 "quantity": "1",
39 "unit_price": "25.54",
40 "remote_was_deleted": false
41 },
42 {
43 "remote_id": "121223",
44 "item": "b38c59b0-a9d7-4740-b1ee-5436c6751e3d",
45 "net_amount": 10,
46 "tracking_categories": [
47 "b38c59b0-a9d7-4740-b1ee-5436c6751e3d",
48 "9b840d2-686a-465a-8a8e-7b028498f8e4",
49 "a47e11b6-c73b-4a0c-be31-130fc48177fa"
50 ],
51 "account": "2a56344a-a491-11ec-b909-0242ac120002",
52 "description": "Desk Lamp"
53 }
54 ],
55 "tracking_categories": [
56 "b38c59b0-a9d7-4740-b1ee-5436c6751e3d",
57 "9b840d2-686a-465a-8a8e-7b028498f8e4",
58 "a47e11b6-c73b-4a0c-be31-130fc48177fa"
59 ],
60 "remote_was_deleted": true,
61 "accounting_period": "595c8f97-2ac4-45b7-b000-41bdf43240b5",
62 "field_mappings": {
63 "organization_defined_targets": {
64 "custom_key": "custom_value"
65 },
66 "linked_account_defined_targets": {
67 "custom_key": "custom_value"
68 }
69 },
70 "remote_data": [
71 {
72 "path": "/actions",
73 "data": null
74 }
75 ],
76 "remote_fields": [
77 {
78 "remote_field_class": {
79 "id": "string",
80 "display_name": "string",
81 "remote_key_name": "string",
82 "description": "string",
83 "is_custom": true,
84 "is_common_model_field": true,
85 "is_required": true,
86 "field_type": "string",
87 "field_format": "string",
88 "field_choices": [
89 "string"
90 ],
91 "item_schema": {
92 "item_type": "string",
93 "item_format": "string",
94 "item_choices": [
95 "string"
96 ]
97 }
98 },
99 "value": "string"
100 }
101 ]
102 },
103 "warnings": [
104 {
105 "title": "Unrecognized Field",
106 "detail": "An unrecognized field, age, was passed in with request data.",
107 "problem_type": "UNRECOGNIZED_FIELD",
108 "source": {
109 "pointer": "/age"
110 },
111 "block_merge_link": true,
112 "raw_error": "string",
113 "error_code": 1
114 }
115 ],
116 "errors": [
117 {
118 "title": "Missing Required Field",
119 "detail": "custom_fields is a required field on model.",
120 "problem_type": "MISSING_REQUIRED_FIELD",
121 "source": {
122 "pointer": "/model/custom_fields"
123 },
124 "block_merge_link": true,
125 "raw_error": "string",
126 "error_code": 1
127 }
128 ],
129 "logs": [
130 {
131 "log_id": "99433219-8017-4acd-bb3c-ceb23d663832",
132 "dashboard_view": "https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832",
133 "log_summary": {
134 "url": "www.exampleintegration.com/api/v1/exampleapi",
135 "method": "POST",
136 "status_code": 200
137 }
138 }
139 ]
140}

Creates an Expense object with the given values.

Field support by integration

See all supported fields

Use the /linked-accounts endpoint to pull platform support information

Was this page helpful?
Previous

/expenses

Next

/expenses/{id}

Built with

Authentication

AuthorizationBearer

Token-based authentication with required prefix “Bearer”

Headers

X-Account-TokenstringRequired
Token identifying the end user.

Query parameters

is_debug_modebooleanOptional

Whether to include debug fields (such as log file links) in the response.

run_asyncbooleanOptional

Whether or not third-party updates should be run asynchronously.

Request

This endpoint expects an object.
modelobjectRequired

Description

The Expense object is used to represent a direct purchase by a business, typically made with a check, credit card, or cash. Each Expense object is dedicated to a grouping of expenses, with each expense recorded in the lines object.

The Expense object is also used to represent refunds to direct purchases. Refunds can be distinguished from purchases by the amount sign of the records. Expense objects with a negative amount are purchases and Expense objects with a positive amount are refunds to those purchases.

Usage Example

Fetch from the GET Expense endpoint and view a company’s expense.

Response

modelobject

Description

The Expense object is used to represent a direct purchase by a business, typically made with a check, credit card, or cash. Each Expense object is dedicated to a grouping of expenses, with each expense recorded in the lines object.

The Expense object is also used to represent refunds to direct purchases. Refunds can be distinguished from purchases by the amount sign of the records. Expense objects with a negative amount are purchases and Expense objects with a positive amount are refunds to those purchases.

Usage Example

Fetch from the GET Expense endpoint and view a company’s expense.

warningslist of objects
errorslist of objects
logslist of objects