API responses use the HTTP response format. This topic provides sample success and error responses.

Data format

A 2xx HTTP status code indicates a successful call. A 4xx or 5xx HTTP status code indicates a failed call. Responses can be returned in either the JSON or XML format. You can specify the response format in the request. The default response format is XML.

The response examples in this topic have been formatted with line breaks or indents to provide a clear view. The responses in your actual running environments are not properly formatted as these examples.

Sample success responses

  • XML format
    <DescribePriceResponse>
      <DiscountPrice>0.0</DiscountPrice>
      <ProductCode>cmfw019940</ProductCode>
      <OriginalPrice>300.0</OriginalPrice>
      <TradePrice>300.0</TradePrice>
      <PromotionRules/>
    </DescribePriceResponse>
    
    					
  • JSON format
    {
        "DiscountPrice":0.0,
        "OriginalPrice":300.0,
        "ProductCode":"cmfw019940",
        "PromotionRules":{
            "PromotionRule":[]
        },
        "TradePrice":300.0
    }
    					

Sample error responses

If an error occurs during an API call, the system will not return any response. You can troubleshoot the error based on the error code returned and common error codes. For more information about errors common to all operations, see Common errors.

When a request failed, an HTTP response containing a 4xx or 5xx HTTP status code is returned. The body of the returned message includes the specific error code and error message. The body of the returned message also contains the RequestId and HostId parameters. The RequestId parameter indicates the globally unique identifier (GUID) of the request, and the HostId parameter indicates the ID of the site that you accessed with the request. If you are unable to pinpoint the cause of the error, you can contact Alibaba Cloud customer service and provide the HostId and RequestId parameters to help resolve the issue as quickly as possible.

  • XML format
    <Error>
      <RequestId>DE134F78-831E-49BB-A9BE-DB216D7B5115</RequestId>
      <HostId>market.aliyuncs.com</HostId>
      <Code>UnknownError</Code>
      <Message>The request processing has failed due to some unknown error. </Message>
    </Error>                   
  • JSON format
    {
        "Code":"UnknownError",
        "HostId":"market.aliyuncs.com",
        "Message":"The request processing has failed due to some unknown error.",
        "RequestId":"B55A3554-8C06-4AFF-B930-D7636758ED14"
    }