Status codes and error 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 error code

  • The error codes are basically provided as an extension of the HTTP Response Code conventions.
  • Basic error code structure
Basic error code details
Code Error message Header Cases that occur
200 Success OK GET successful, PUT successful, DELETE successful
201 Creation successful Created POST successful
207 Multiple statuses exist. Multi Status When the statuses of multiple requests are different by object
400 Request cannot be understood. 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 Access permission invalid. 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 not available. Enter client_id. Unauthorized If client_id is not input when using the Front API
403 No access permission. Forbidden 1) Access Token exists but the Scope is not authorized
2) Configured at the Front API to restrict query
403 Not the https protocol. Forbidden If not the https protocol
403 This is not a new product shopping mall. Forbidden If not a new product shopping mall
403 This app has been deleted. Please accept the operator's consent again. Forbidden (When calling Admin API) If the app has been deleted from the shopping mall
403 This is an uninstalled app. Please accept the operator's consent again. Forbidden (When calling Front API) If the app has been deleted from the shopping mall
404 Cannot locate API. 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 corresponding Entity is invalid. Not Found {#id} nonexistent
422 Invalid request. 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 many requests. Too many request Enter the undefined parameters for the query (GET) request.
500 Temporary server error. Internal Server Error Internal server error, unknown error
503 Service not available. Service Unavailable When the current server is down
503 Current API cannot be used. Service Unavailable When the current server is down, the API cannot be used.
504 Request timed out. Gateway Timeout Request timeout

troubleshooting methods

  • A solution guide for major error cases is provided.
  • troubleshooting methods
troubleshooting methods
Status Code Error message How to fix errors
207 Multiple statuses exist. The error status of each object is checked for proper countermeasures.
400 Request cannot be understood. 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 Access permission invalid. Make sure that the Access Token issued according to a valid issuance process has been used.
401 API not available. Enter client_id. Verify that you have used a valid client ID.
403 No access permission. Check the API‘s scope or mall settings to see if you have permission to call the API.
403 Not the https protocol. Make sure you've requested in HTTPS for API requests.
403 This is not a new product shopping mall. The shopping mall must be upgraded to (new) product management for proper use.
403 This app has been deleted. Please accept the operator's consent again. Make sure the app is installed in the shopping mall and reinstall the app.
403 This is an uninstalled app. Please accept the operator's consent again. Make sure the app is installed in the shopping mall and reinstall the app.
404 Cannot locate API. Refer to the API documentation for errors in the endpoint URL.
404 The ID of the corresponding Entity is invalid. Verify that the Entity ID of the requested endpoint actually exists.
422 Invalid request. Refer to the API documentation to check if the required parameters are missing or invalid values ​​are entered.
429 Too many requests. Wait a few seconds for your next request to avoid exceeding the maximum number of API requests.
500 Temporary server error. A temporary error occurred. Try again later.
503 Service not available. Please contact the Developer Center.
503 Current API cannot be used. Please contact the Developer Center.
504 Request timed 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.