Skip to content
Get started

List Reason Codes

reason_codes.list_reason_codes(ReasonCodeListReasonCodesParams**kwargs) -> ReasonCodeListReasonCodesResponse
GET/api/v2/public/reasoncodes

Reason codes for the organisation. Reason codes say why stock moved and are required when booking losses, gains and corrections. Each code also carries the rules the app enforces, such as whether a comment or image is mandatory.

ParametersExpand Collapse
code: Optional[str]

Filter by reason code.

code_description: Optional[str]

Filter by reason code description.

function_key: Optional[str]

Filter by function key.

is_gain: Optional[bool]

Filter by gain-type reason codes.

is_loss: Optional[bool]

Filter by loss-type reason codes.

is_store: Optional[bool]

Filter by store-level reason codes.

ReturnsExpand Collapse
List[ReasonCodeListReasonCodesResponseItem]
code: int

The reason code itself. This is the value the movement endpoints expect.

formatint32
is_comment_mandatory: bool

true when a comment must be supplied with the movement.

is_gain: bool

true when the code represents stock arriving. The is_gain filter matches on this.

is_image_mandatory: bool

true when a photo must be supplied with the movement.

is_loss: bool

true when the code represents stock leaving. The is_loss filter on the movement log matches on this.

is_order_number_mandatory: bool

true when an order number must be supplied with the movement.

is_picking_list: bool

true when the code applies to picking.

is_rollback_allowed: bool

true when a movement booked under this code can be reversed.

is_sales_order_discount: bool

Correctly spelled alias of CountingCloud.Entities.Entities.Response.ReasonCodesResponsePublicV2.IsSalesOrderDiscsount. Both fields are always emitted and always carry the same value; the misspelled one is kept because live integrations read it.

Deprecatedis_sales_order_discsount: bool

Deprecated — use is_sales_order_discount instead. Both names are still accepted and behave identically; is_sales_order_discount is the supported spelling going forward.

is_store: bool

true when store staff may use this code.

reason_code_type: int

Type of reason code.

formatint32
review_status: int

Review state movements get when booked under this code.

formatint32
code_description: Optional[str]

Short label for the code.

description: Optional[str]

Fuller description of when to use the code.

function_key: Optional[str]

Shortcut key the code is bound to in the app.

store_type: Optional[str]

Store type the code applies to.

List Reason Codes

import os
from colleqtive_sdk import Colleqtive

client = Colleqtive(
    bearer_token=os.environ.get("COLLEQTIVE_BEARER_TOKEN"),  # This is the default and can be omitted
)
response = client.reason_codes.list_reason_codes()
print(response)
[
  {
    "code": 0,
    "is_comment_mandatory": true,
    "is_gain": true,
    "is_image_mandatory": true,
    "is_loss": true,
    "is_order_number_mandatory": true,
    "is_picking_list": true,
    "is_rollback_allowed": true,
    "is_sales_order_discount": true,
    "is_sales_order_discsount": true,
    "is_store": true,
    "reason_code_type": 0,
    "review_status": 0,
    "code_description": "code_description",
    "description": "description",
    "function_key": "function_key",
    "store_type": "store_type"
  }
]
{
  "code": 401,
  "status": "error",
  "message": "Authentication failed.",
  "error": "unauthorized",
  "error_description": "Authentication failed."
}
{
  "code": 500,
  "status": "fail",
  "message": "The request could not be processed.",
  "error": "internal_error",
  "error_description": "The request could not be processed."
}
Returns Examples
[
  {
    "code": 0,
    "is_comment_mandatory": true,
    "is_gain": true,
    "is_image_mandatory": true,
    "is_loss": true,
    "is_order_number_mandatory": true,
    "is_picking_list": true,
    "is_rollback_allowed": true,
    "is_sales_order_discount": true,
    "is_sales_order_discsount": true,
    "is_store": true,
    "reason_code_type": 0,
    "review_status": 0,
    "code_description": "code_description",
    "description": "description",
    "function_key": "function_key",
    "store_type": "store_type"
  }
]
{
  "code": 401,
  "status": "error",
  "message": "Authentication failed.",
  "error": "unauthorized",
  "error_description": "Authentication failed."
}
{
  "code": 500,
  "status": "fail",
  "message": "The request could not be processed.",
  "error": "internal_error",
  "error_description": "The request could not be processed."
}