Skip to content

Retrieve an expense

GET
/api/v1/expenses/{id}
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.

id
required
integer

Expense ID

Expense details

Media type application/json
object
expense
required
object
id
required
integer
code
string
nullable
purchased_at
string format: date-time
nullable
estimated_arrival_at
string format: date
nullable
supplier_id

ID of the supplier contact

integer
nullable
supplier_name
string
nullable
paid
required
boolean
received
required
boolean
received_status
required

Line-item receipt rollup: all lines received, some received, or none received. “received” for a purchase with zero line items.

string
Allowed values: received partial outstanding
notes
string
nullable
amount

Grand total

object
amount

Decimal string, e.g. ‘8.75’

string
currency_code

ISO 4217 code, e.g. ‘USD’

string
item_total

Sum of line item totals

object
amount

Decimal string, e.g. ‘8.75’

string
currency_code

ISO 4217 code, e.g. ‘USD’

string
tax
object
amount

Decimal string, e.g. ‘8.75’

string
currency_code

ISO 4217 code, e.g. ‘USD’

string
shipping
object
amount

Decimal string, e.g. ‘8.75’

string
currency_code

ISO 4217 code, e.g. ‘USD’

string
discount
object
amount

Decimal string, e.g. ‘8.75’

string
currency_code

ISO 4217 code, e.g. ‘USD’

string
line_items
required
Array<object>
object
id
integer
material_id

ID of the material on this line

integer
nullable
material_name
string
nullable
material_expense

True when this line is a material purchase

boolean
received

True when this line has been received

boolean
category_id
integer
nullable
category_name
string
nullable
quantity

Decimal string

string
unit_price
object
amount

Decimal string, e.g. ‘8.75’

string
currency_code

ISO 4217 code, e.g. ‘USD’

string
total_price
object
amount

Decimal string, e.g. ‘8.75’

string
currency_code

ISO 4217 code, e.g. ‘USD’

string
created_at
required
string format: date-time
updated_at
required
string format: date-time
Example
{
"expense": {
"received_status": "received"
}
}

Missing or invalid Bearer token

Media type application/json
object
error
required

Error message

string
Example generated
{
"error": "example"
}

User lacks financial access (view_material_costs permission)

Media type application/json
object
error
required

Error message

string
Example generated
{
"error": "example"
}

Expense not found

Media type application/json
object
error
required

Error message

string
Example generated
{
"error": "example"
}