跳至主要内容

Error Codes

API 錯誤回應使用 ErrorResponse

提示

整合時請優先判斷 result_code,再依 validation_failed_responses 找出需要修正的欄位。

{
"message": "Validation failed.",
"result_code": "data_validation_failed",
"validation_failed_responses": [
{
"result_code": "field_is_required",
"message": "product_id is required.",
"property_name": "product_id"
}
],
"odata": null
}

Error Response Fields

FieldTypeRequiredDescription
messagestringNo錯誤訊息。
result_codeenumYes結果代碼。
validation_failed_responsesarrayNo驗證錯誤清單,通常在 data_validation_failed 時有值。
odatastringNoOData 錯誤內容。

Common Codes

HTTP StatusCodeMeaningHow to Fix
400data_validation_failed資料驗證失敗。檢查必填、格式、數值範圍與 enum 值。
400o_data_failedOData 驗證失敗。檢查 $filter$orderby 欄位與語法。
401token_validation_failedprivate key 驗證失敗。確認 x-api-key header 或重新申請 private key。
400data_not_exist資料不存在。確認 product_id、訂單或組織資料是否正確。
400organization_disable組織停用。聯繫客服確認組織狀態。
400credit_not_enough信用點數不足。補足信用點數後重試。
400create_order_failed訂單建立失敗。檢查產品狀態與 request body;若仍失敗,聯繫客服。
400conflicting_parameters參數衝突。移除互斥欄位,例如同時帶入 linkusername
400below_minimum_quantity低於最低數量。查詢產品 min 後重新送出。
400exceeds_maximum_quantity高於最高數量。查詢產品 max 後重新送出。
400contact_customer_service需要聯繫客服。提供 request payload、時間點與錯誤訊息給客服。

Full Result Code Enum

un_handle_exception
data_validation_failed
o_data_failed
token_validation_failed
data_not_exist
robot_validation_failed
not_allowed_enum_values
value_out_of_range
failed_to_upload_file
organization_disable
organization_id_incorrect
sequence_at_least_one_element
credit_not_enough
create_order_failed
string_length_out_of_range
field_is_required
invalid_email_format
invalid_format
file_type_must_be_temp
organization_not_belong_account
mobile_phone_only
phone_number_invalid
get_invoice_failed
invoice_provider_not_allow_invoice_receive_type
invoice_provider_not_allow_invoice_tax_type
create_invoice_failed
invoice_not_found
invoice_status_incorrect
issue_invoice_failed
void_invoice_failed
get_invoice_print_url_failed
credit_charge_payment_type_incorrect
credit_charge_status_incorrect
credit_charge_not_belong_organization
credit_charge_not_belong_account
batch_operation_failed
invalid_expiry_date
conflicting_parameters
below_minimum_quantity
exceeds_maximum_quantity
contact_customer_service
incorrect_service_id
incorrect_order_id
pay_uni_order_not_found