iotoms Docs

Reject an expense

PATCH
/api/v1/ops/day-cycles/{dayCycleId}/expenses/{expenseId}/reject

Marks a pending expense as rejected with a mandatory reason. Fails with 400 if the expense is not pending.

How to use it

  1. Find a PENDING expense with List expenses for a day cycle.
  2. Send a reason; it is stored on the expense as rejectionReason.
  3. The expense becomes REJECTED with your username and the time, and can no longer be approved or rejected.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Path Parameters

dayCycleId*string

Day cycle UUID

Formatuuid
expenseId*string

Expense UUID

Formatuuid

Header Parameters

Request Body

application/json
  1. body
reason*string

Required. Why the expense is rejected; shown back on the expense as rejectionReason.

Response Body

OK

*/*
  1. response
status*string

Outcome of the call: SUCCESS when it worked, ERROR when it failed.

message*string

Short human-readable message describing the outcome, for example "Vendor created". Do not parse it.

data?

The expense as stored after the change.

Example Request
curl -X PATCH 'https://beta.iotoms.com/api/v1/ops/day-cycles/497f6eca-6276-4993-bfeb-53cbbbba6f08/expenses/497f6eca-6276-4993-bfeb-53cbbbba6f08/reject' \  -H 'Content-Type: application/json' \  -d '{  "reason": "string"}'
Example Response
{  "status": "string",  "message": "string",  "data": {    "expenseId": "a2142719-090a-410b-ad70-ea5efeb1c9dc",    "dayCycleId": "bbed7a30-80be-4ccf-810d-a33c370a67d1",    "salesExecutiveId": "string",    "category": "FUEL",    "amount": 0,    "title": "string",    "vendorName": "string",    "receiptNumber": "string",    "paymentMode": "CASH",    "expenseDate": "2019-08-24",    "gpsLat": 0,    "gpsLon": 0,    "notes": "string",    "approvalStatus": "PENDING",    "approvedBy": "string",    "approvedAt": "2019-08-24T14:15:22Z",    "rejectionReason": "string",    "createdAt": "2019-08-24T14:15:22Z"  }}