Status codes and messages

  • Error message types and codes created in the process of calling the cafe24 API are defined.
  • The basic error codes are provided as an extension of the HTTP Response Code.

API code

  • The codes are basically provided as an extension of the HTTP Response Code conventions.
  • Basic code structure
Basic code structure
Response Class Description
2XX Success
4XX Client Error
5XX Server Error
  • If a 4xx occurs, check the request form again. If a 5xx error persists, please contact the developer center.

  • Basic code details
Basic code details
Code Message Header Cases that occur
200 Success OK GET successful, PUT successful, DELETE successful
201 Successfully created Created POST successful
207 Multi-status exists. Multi Status When the statuses of multiple requests are different by object
400 Content-type is not an application/json in the header. Bad Request Server does not comprehend request.
1) Content-Type is incorrectly specified
2) Application / type is not json
400 Bad Request Bad Request If Korean or special characters are used without encoding in the request API URL
401 Authority to access is not valid. Unauthorized 1) When called without an Access Token
2) When the Access Token is not valid
3) When the Access Token has expired
4) When the client is unknown
401 API cannot be used. Please enter the App key. Unauthorized If client_id is not input when using the Front API
403 No authority to access Forbidden 1) Access Token exists but the Scope is not authorized
2) Configured at the Front API to restrict query
403 It is not the https protocol. Forbidden If not the https protocol
403 It is not a new product shopping mall. Forbidden If not a new product shopping mall
403 This app is deleted. Receive the consent of the operator again. Forbidden (When calling Admin API) If the app has been deleted from the shopping mall
403 This app is not installed. Receive the consent of the operator again. Forbidden (When calling Front API) If the app has been deleted from the shopping mall
403 Requested client_id is blocked. Forbidden client_id has blocked for following reasons.
1) client_id makes resource server overload.
2) App violates App Store guideline.
404 No API found. Not Found 1) Applied to all cases where the API URL is incorrectly called
2) If the resource can not be found
404 The ID of the entity is not valid. Not Found {#id} nonexistent
422 An invalid request is entered. Unprocessable Entity In case the value differs from the specifications set for the inquireprocess request
1) Missing required parameters
2) If different from the specifications
429 Too much requests occur. Too many request Enter the undefined parameters for the query (GET) request.
500 A temporary server error occurs. Internal Server Error Internal server error, unknown error
503 You cannot use the service. Service Unavailable When the current server is down
503 The current API cannot be used. Service Unavailable When the current server is down, the API cannot be used.
504 Gateway time-out Gateway Timeout Request timeout

Trouble-shooting methods

  • A solution guide for major error cases is provided.
  • Trouble-shooting methods
Trouble-shooting methods
Code Message How to fix
207 Multi-status exists. The error status of each object is checked for proper countermeasures.
400 Content-type is not an application/json in the header. Make sure the "Content-Type" is set to application / json on request.
400 Bad Request Make sure Korean or special characters are URL-encoded in the request API URL.
401 Authority to access is not valid. Make sure that the Access Token issued according to a valid issuance process has been used.
401 API cannot be used. Please enter the App key. Verify that you have used a valid client ID.
403 No authority to access Check the API‘s scope or mall settings to see if you have permission to call the API.
403 It is not the https protocol. Make sure you've requested in HTTPS for API requests.
403 It is not a new product shopping mall. The shopping mall must be upgraded to (new) product management for proper use.
403 This app is deleted. Receive the consent of the operator again. Make sure the app is installed in the shopping mall and reinstall the app.
403 This app is not installed. Receive the consent of the operator again. Make sure the app is installed in the shopping mall and reinstall the app.
403 Requested client_id is blocked. Please contact to developer center.
404 No API found. Refer to the API documentation for errors in the endpoint URL.
404 The ID of the entity is not valid. Verify that the Entity ID of the requested endpoint actually exists.
422 An invalid request is entered. Refer to the API documentation to check if the required parameters are missing or invalid values ​​are entered.
429 Too much requests occur. Wait a few seconds for your next request to avoid exceeding the maximum number of API requests.
500 A temporary server error occurs. A temporary error occurred. Try again later.
503 You cannot use the service. Please contact the Developer Center.
503 The current API cannot be used. Please contact the Developer Center.
504 Gateway time-out Response is delayed due to a temporary error. Please try again later.

Error message structure

  • The error message structure is provided in 3 types (Request, Response and Biz logic).
  • Basic structure of the response message

HTTP/1.1 status
{
"Resource": [
{
"key": value,
"key": "value"

}
]
}

  • Error message structure: request specification error sample
Description: This is a case where an error occurs when checking the specification of the request parameter before executing Biz Logic.

HTTP/1.1 422 Unprocessable Entity
{
"error": {
"code": 4220,
"message": "The image type is incorrect (parameter.image_upload_type)."

}
}

  • Error message structure: response specification error sample
Description: This is a case where an error occurs when checking the specification of the response property value after the execution of Biz Logic.

HTTP/1.1 200 OK
{
"error": {
"code": 4003,
"message": "The icon list item exceeds the maximum array size of 5 (properties.icon)."

}
}

  • Error message structure: Biz logic run error sample
Description: This is the case where an error occurs when executing Biz Logic.

HTTP/1.1 500 Internal Server Error
{
"error": {
"code": "5002",
"message": "DB input failed.",
"more_info": {
"event_no": "1"
}

}
}

  • Error message structure: fail collection
Explanation: This is the case where an error occurs for multiple requests.

HTTP/1.1 500 Internal Server Error
{
"errors": [
{
"code": "5002",
"message": "DB input failed.",
"more_info": {
"event_no": "1"
}

},
{
"code": "5002",
"message": "DB input failed.",
"more_info": {
"event_no": "2"
}

}
]
}

  • Error message structure: success & fail collection
Description: This is the case where completion and error simultaneously occur for multiple requests.

HTTP/1.1 200 OK
{
"products": [
{
"event_no": "1",
"item_code": "TEST_123",
"item_value": "test"

}
],
"errors": [
{
"code": "5002",
"message": "Failed to insert database",
"more_info": {
"event_no": "2"
}

}
]
}

Other notes

  • In addition to the defined error codes, this is a reference for situations where errors can occur.
  1. When privacy-related fields are accessed without an SSL certificate, the protocol is supported depending on whether or not the called API includes personal information because only SSL can be allowed when calling an API containing private information,
    - PUBLIC: The API is called by the site-connected protocol
    - PRIVATE: API called only with HTTPS

    It is recommended that the API be called with the same protocol that the user accesses and that a relative path be used to prevent problems in advance.
    - Example) https://{{domain}}/api/v2/products → /api/v2/products
  2. Provision of Javascript SDK for Front API
    We provide Front API Javascript SDK for solving problems associated with SSL access and relative path for apps developed only with the Front API.