expenses create
POST {{baseUrl}}/expenses
Creates an Expense
object with the given values.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
is_debug_mode | boolean | Whether to include debug fields (such as log file links) in the response. | |
run_async | boolean | Whether or not third-party updates should be run asynchronously. |
Request Body
{"model"=>{"transaction_date"=>"2023-10-01T00:00:00", "account"=>"9d892439-5fab-4dbb-8bd8-34f7f96c7912", "contact"=>"3d263469-51a1-4766-9205-f6c997826be1", "currency"=>"USD", "exchange_rate"=>"2.9", "company"=>"595c8f97-2ac4-45b7-b000-41bdf43240b5", "memo"=>"New employee supplies", "lines"=>[{"remote_id"=>"121222", "net_amount"=>-25.54, "tracking_categories"=>["b38c59b0-a9d7-4740-b1ee-5436c6751e3d", "9b840d2-686a-465a-8a8e-7b028498f8e4", "a47e11b6-c73b-4a0c-be31-130fc48177fa"], "company"=>"595c8f97-2ac4-45b7-b000-41bdf43240b5", "item"=>"b38c59b0-a9d7-4740-b1ee-5436c6751e3d", "account"=>"2a56344a-a491-11ec-b909-0242ac120002", "contact"=>"c640b80b-fac9-409f-aa19-1f9221aec445", "description"=>"MacBook Pro", "exchange_rate"=>"2.9"}, {"net_amount"=>-10, "tracking_categories"=>["b38c59b0-a9d7-4740-b1ee-5436c6751e3d", "9b840d2-686a-465a-8a8e-7b028498f8e4", "a47e11b6-c73b-4a0c-be31-130fc48177fa"], "item"=>"b38c59b0-a9d7-4740-b1ee-5436c6751e3d", "account"=>"2a56344a-a491-11ec-b909-0242ac120002", "description"=>"Desk Lamp"}]}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
X-Account-Token | string | (Required) Token identifying the end user. | |
Content-Type | string | ||
Accept | string |
RESPONSES
status: Created
{"errors":[{"detail":"custom_fields is a required field on model.","problem_type":"MISSING_REQUIRED_FIELD","title":"Missing Required Field","source":{"pointer":"minim anim ullamco ut"}},{"detail":"custom_fields is a required field on model.","problem_type":"MISSING_REQUIRED_FIELD","title":"Missing Required Field","source":{"pointer":"consectetur id enim amet"}}],"model":{"id":"ecbe05ac-62a3-46c5-ab31-4b478b37d1b4","remote_id":"088899","remote_data":[{"path":"anim magna","data":{"laborecc0":{}}},{"path":"in veniam aliqua","data":{"sintc":{},"laborum_c1_":{}}}],"transaction_date":"1968-10-01T06:18:12.004Z","remote_created_at":"2020-03-31T00:00:00Z","account":"9d892439-5fab-4dbb-8bd8-34f7f96c7912","contact":"3d263469-51a1-4766-9205-f6c997826be1","total_amount":10000,"currency":"JOD","exchange_rate":"2.9","company":"595c8f97-2ac4-45b7-b000-41bdf43240b5","memo":"New employee supplies","lines":[{"remote_id":"121222","net_amount":25.54,"trackingCategory":"b38c59b0-a9d7-4740-b1ee-5436c6751e3d","item":"b38c59b0-a9d7-4740-b1ee-5436c6751e3d","account":"2a56344a-a491-11ec-b909-0242ac120002","description":"MacBook Pro"},{"remote_id":"121223","net_amount":10,"trackingCategory":"b38c59b0-a9d7-4740-b1ee-5436c6751e3d","item":"b38c59b0-a9d7-4740-b1ee-5436c6751e3d","account":"2a56344a-a491-11ec-b909-0242ac120002","description":"Desk Lamp"}],"remote_was_deleted":false},"warnings":[{"detail":"An unrecognized field, age, was passed in with request data.","problem_type":"UNRECOGNIZED_FIELD","title":"Unrecognized Field","source":{"pointer":"et id eu"}},{"detail":"An unrecognized field, age, was passed in with request data.","problem_type":"UNRECOGNIZED_FIELD","title":"Unrecognized Field","source":{"pointer":"voluptate nostrud"}}],"logs":[{"dashboard_view":"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832","log_id":"99433219-8017-4acd-bb3c-ceb23d663832","log_summary":{"method":"POST","status_code":200,"url":"https://harvest.greenhouse.io/v1/candidates/"}},{"dashboard_view":"https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832","log_id":"99433219-8017-4acd-bb3c-ceb23d663832","log_summary":{"method":"POST","status_code":200,"url":"https://harvest.greenhouse.io/v1/candidates/"}}]}