Execution Statuses

The operational track a document moves along — waiting, in preparation, shipped, done. You define the list; it is a separate axis from the financial status, so a document can be paid and unshipped, or shipped and unpaid, and neither hides the other.

Use cases: Use execution statuses to run fulfilment from the document list: tag orders as they progress, and filter GET /documents by where they are.
GET/document-execution-statuses

List the execution statuses your company has defined, in display order.

Deleted statuses are omitted.

Request

curl -X GET "https://api.glance.co.il/document-execution-statuses" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response

Response
{
  "success": true,
  "statuses": [
    {
      "id": 1,
      "name": "ממתין",
      "color": "#9CA3AF",
      "sortOrder": 0,
      "isDefault": true,
      "isTerminal": false
    },
    {
      "id": 3,
      "name": "נשלח",
      "color": "#2563EB",
      "sortOrder": 20,
      "isDefault": false,
      "isTerminal": true
    }
  ]
}
POST/document-execution-statuses

Create an execution status.

Requires an owner-level key.

Body Parameters

NameTypeDescription
name
stringrequiredStatus name, 1-60 characters.
color
stringChip colour as `#RRGGBB`, or null for none. Any other format is rejected.
sortOrder
numberDisplay order. Defaults to 0.
isDefault
booleanGive new documents this status at issue. Only one status can be the default — setting it here clears it from the others.
isTerminal
booleanMarks the end of the operational track (e.g. delivered). Does not close the document financially.

Request

curl -X POST "https://api.glance.co.il/document-execution-statuses" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "example_name",
  "color": "example_color",
  "sortOrder": 0,
  "isDefault": true,
  "isTerminal": true
}'

Response

Response
{
  "success": true,
  "id": 3
}
PUT/document-execution-statuses/:id

Update an execution status. All fields are optional.

Requires an owner-level key.

Path Parameters

NameTypeDescription
id
numberrequiredThe status ID.

Body Parameters

NameTypeDescription
name
stringStatus name.
color
string`#RRGGBB` or null.
sortOrder
numberDisplay order.
isDefault
booleanMake this the default, clearing it from the others.
isTerminal
booleanWhether this status ends the operational track.

Request

curl -X PUT "https://api.glance.co.il/document-execution-statuses/:id" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "example_name",
  "color": "example_color",
  "sortOrder": 0,
  "isDefault": true,
  "isTerminal": true
}'

Response

Response
{
  "success": true
}
DELETE/document-execution-statuses/:id

Delete an execution status.

A soft delete: documents already tagged with this status keep it — it describes what actually happened, and a hard delete would erase the operational history of closed documents. Requires an owner-level key. Assign a status to a document with PATCH /documents/:visibleId/execution-status.

Path Parameters

NameTypeDescription
id
numberrequiredThe status ID.

Request

curl -X DELETE "https://api.glance.co.il/document-execution-statuses/:id" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response

Response
{
  "success": true
}

Last updated