Accounting Questions

Accounting questions allow users to ask and answer questions about specific documents or bank transactions. Questions can have multiple answer options and are used for clarifying accounting treatment during document processing.

Endpoints

List Questions

GET /api/v2/questions

Retrieves a paginated list of accounting questions.

Query Parameters

Parameter Type Required Description
client_account_id integer Yes ID of the client account
document_id integer No Filter by document/voucher ID
bank_transaction_id integer No Filter by bank transaction ID
status string No Filter by question status
order_by string No Sort field
page integer No Page number (default: 1)
per_page integer No Items per page (default: 25)

Response

{
  "data": [
    {
      "id": 1,
      "created_by_id": 7,
      "created_at": "2024-03-15T10:00:00Z",
      "client_account_id": 7,
      "document_id": 123,
      "bank_transaction_id": null,
      "question": "Which account should this expense be posted to?",
      "answer_action": null,
      "question_status": "OPEN",
      "answer_options": [
        {
          "id": 1,
          "created_by_id": 7,
          "created_at": "2024-03-15T10:00:00Z",
          "question_id": 1,
          "option": "6300 - Office Supplies",
          "selected_answer": false
        },
        {
          "id": 2,
          "created_by_id": 7,
          "created_at": "2024-03-15T10:00:00Z",
          "question_id": 1,
          "option": "6800 - Other Operating Expenses",
          "selected_answer": false
        }
      ]
    }
  ],
  "meta": {
    "page": 1,
    "pages": 1,
    "per_page": 25,
    "records": 1
  }
}

Get Question

GET /api/v2/questions/{id}

Retrieves a specific accounting question by ID.

Create Question

POST /api/v2/questions

Creates a new accounting question.

Request Body

Field Type Required Description
client_account_id integer Yes The client account ID
document_id integer No ID of the related document/voucher
bank_transaction_id integer No ID of the related bank transaction
question string Yes The question text
answer_action string No Action to take when answered
answer_options array No Array of answer option objects

Answer Option Object

Field Type Required Description
option string Yes The answer option text
selected_answer boolean No Whether this option is selected (default: false)

Example Request

{
  "client_account_id": 7,
  "document_id": 123,
  "question": "Which account should this expense be posted to?",
  "answer_options": [
    {"option": "6300 - Office Supplies"},
    {"option": "6800 - Other Operating Expenses"}
  ]
}

Response

Returns the created question with status 201 Created.

Answer Question

POST /api/v2/questions/{id}/answer

Submits an answer to an accounting question.

Request Body

Field Type Required Description
option string No Answer option text
selected_answer boolean No Whether this is the selected answer

Response

Returns the updated question.

Attributes

Accounting Question

Attribute Type Description
id integer Unique identifier (read-only)
created_by_id integer ID of the creating user (read-only)
created_at datetime Creation timestamp (read-only)
client_account_id integer ID of the client account
document_id integer ID of the related document/voucher
bank_transaction_id integer ID of the related bank transaction
question string The question text
answer_action string Action to take when answered
question_status string Current status of the question

Answer Option

Attribute Type Description
id integer Unique identifier (read-only)
created_by_id integer ID of the creating user (read-only)
created_at datetime Creation timestamp (read-only)
question_id integer ID of the parent question (read-only)
option string The answer option text
selected_answer boolean Whether this option is selected

Relationships

Relationship Type Description
created_by User The user who created the question
answer_options AnswerOption[] Available answer options

Error Responses

Status Code Description
400 Invalid request (missing required fields, duplicate question)
403 Forbidden (no access to client account)
404 Question not found