Retrieve an expense
const url = 'https://api.stocksmith.io/api/v1/expenses/1';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.stocksmith.io/api/v1/expenses/1 \ --header 'Authorization: Bearer <token>'Requires financial access (view_material_costs permission). Returns 403 if the authenticated user lacks this permission.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Expense ID
Responses
Section titled “ Responses ”Expense details
object
object
ID of the supplier contact
Line-item receipt rollup: all lines received, some received, or none received. “received” for a purchase with zero line items.
Grand total
object
Decimal string, e.g. ‘8.75’
ISO 4217 code, e.g. ‘USD’
Sum of line item totals
object
Decimal string, e.g. ‘8.75’
ISO 4217 code, e.g. ‘USD’
object
Decimal string, e.g. ‘8.75’
ISO 4217 code, e.g. ‘USD’
object
Decimal string, e.g. ‘8.75’
ISO 4217 code, e.g. ‘USD’
object
Decimal string, e.g. ‘8.75’
ISO 4217 code, e.g. ‘USD’
object
ID of the material on this line
True when this line is a material purchase
True when this line has been received
Decimal string
object
Decimal string, e.g. ‘8.75’
ISO 4217 code, e.g. ‘USD’
object
Decimal string, e.g. ‘8.75’
ISO 4217 code, e.g. ‘USD’
Example
{ "expense": { "received_status": "received" }}Missing or invalid Bearer token
object
Error message
Example generated
{ "error": "example"}User lacks financial access (view_material_costs permission)
object
Error message
Example generated
{ "error": "example"}Expense not found
object
Error message
Example generated
{ "error": "example"}