Flavours API
Drawer

Update Drawer

POST
/api/v2/drawers/{drawerId}

Update an existing drawer transaction.

AuthorizationBearer <token>

You can retrieve your token by logging in.

In: header

Path Parameters

drawerId*integer

Header Parameters

X-API-Version*string

API contract version to target. See the Changelog for what changed in each version.

Default"2.0.0"
Value in"2.3.0" | "2.2.0" | "2.1.0" | "2.0.0"

Request Body

application/json

type?|

Transaction type.

Value in"INCREASE" | "DECREASE" | "OTHER"
amount?|

Amount (required for INCREASE/DECREASE, optional for OTHER). This field is required unless type is in OTHER.

notes?|

Notes (required for OTHER type). This field is required when type is OTHER.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.flavours.sa/dev/api/v2/drawers/717712153172636" \  -H "X-API-Version: 2.3.0" \  -H "Content-Type: application/json" \  -d '{}'
{
  "meta": {
    "code": 200,
    "status": "success",
    "message": "Drawer updated successfully."
  },
  "data": {
    "id": 717712154479224,
    "market_id": "848aa3f5-fc3d-42d3-8cc9-4c6edd0140d0",
    "branch_id": "7c538fd7-9547-4b16-959d-f01052e04c6f",
    "attendance_id": "1",
    "type": "INCREASE",
    "amount": 770.26,
    "notes": "Exercitationem similique omnis id maxime excepturi eligendi.",
    "created_at": 1787446693955,
    "updated_at": 1787446693955
  }
}
{
  "meta": {
    "code": 401,
    "status": "error",
    "message": "Unauthenticated."
  },
  "data": null
}
{
  "meta": {
    "code": 403,
    "status": "error",
    "message": "Unauthorized."
  },
  "data": null
}
{
  "meta": {
    "code": 404,
    "status": "error",
    "message": "Resource not found."
  },
  "data": null
}
{
  "meta": {
    "code": 422,
    "status": "error",
    "message": "The selected type is invalid. (and 2 more errors)"
  },
  "data": [
    {
      "code": 0,
      "message": "The selected type is invalid.",
      "field": "type"
    },
    {
      "code": 0,
      "message": "The amount must be a number.",
      "field": "amount"
    },
    {
      "code": 0,
      "message": "The amount must be greater than 0.",
      "field": "amount"
    }
  ]
}
{
  "meta": {
    "code": 500,
    "status": "error",
    "message": "Internal server error."
  },
  "data": null
}