online-help.platform.features.premier_subscription.connectors.inbound-rest-api.endpoints.expense.title
Add Expense
Overview
Creates a expense in MobiWork
URL Format
https://{domain}.mobiwork.com/api/rest/{clientId}/{versionNumber}/expense/add.html?token=XXXXXXXX&userId={userId}
Arguments
clientId
required
MobiWork assigned unique ID of the company
versionNumber
required
Version number of MobiWork API SDK release. Current version is: 10.0.78
token
required
Part of URL as a request parameter and is required in every call to verify access to API calls
userId
optional
If provided, this User ID will be taken as a logged in user. If not provided we use an active global administrator ID
Return
Returns a expense Object if expense creation is successful or errors will be returned
Request Body XSD
Response Body XSD
Curl Example
HTTP Method: POST
Request: curl -k -X POST "https://www.mobiwork.com/api/rest/12026/5.0.141/expense/add.html?token=COJL8X2FKSLMMRTYCH2B" -data '<request>
<expense>
<amount></amount>
<categoryName></categoryName>
<customStatusName>1</customStatusName>
<entityId>123</entityId>
<entityReferenceId></entityReferenceId>
<entityType></entityType>
<expenseId></expenseId>
<externalId></externalId>
</expense>
</request>'
Response: <?xml version="1.0" encoding="UTF-8" ?>
<response>
<expense>
<customStatusName></customStatusName>
<amount></amount>
<categoryName>1</categoryName>
<createdById>123</createdById>
<createdByName></createdByName>
<createdDate>Mon Sep 26 06:35:29 EDT 2018</createdDate>
<entityId></entityId>
<entityName>Name</entityName>
<entityReferenceId>160</entityReferenceId>
<entityReferenceName></entityReferenceName>
<entityType>Type</entityType>
<expenseId>10</expenseId>
<externalId>33445</externalId>
</expense>
</response>'