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.
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."
}