The Dsco APIs adhere to best practices with respect to errors in Restian APIs.

Error Retries

The partner should implement an exponential backoff-retry algorithm to retry API calls sent to Dsco that fail when the HTTP Response Type indicates the error is a transient error, or one that will go away with time.  All 500-level errors should be considered transient errors.  It's also conceivable that an HTTP 404 response code is transient for all APIs except those that perform an update to an existing object.

Dsco recommends the backoff-retry algorithm retry for up to two hours after which the partner should send a request to Dsco support to ask whether there is an issue with the Dsco APIs.  In the event that this occurs, please send the complete API request made and the HTTP error code that is being seen by the partner in the support request.

Here are some resources describing the algorithms we recommend a partner implement...

HTTP Response Types

  • Non-200 Response
    All errors will return a non-200 http response code
  • 400 Client-caused Errors
    Any error caused by a bad request by the client (perhaps a missing or bad property value) will return a 400 http response code.
    The body of the response will still be a JSON document with this structure...
Object {
    string type;     # One of the 400-level error types defined below
    boolean success; # This will be false
    string message;  # A message describing the error (will often specify exactly what you did wrong).
}
  • 500 Unexpected Errors
    These are errors that the client did not cause that were not expected to happen.

400-Level Errors

Type Description

PropertyRequired

A required property is missing from the JSON object passed in.

PropertyMayNotBeSet

A property was found in the JSON that isn't allowed.

UnrecognizedProperty

A property was found in the JSON that isn't recognized.

OrderNotFound

An order you specified could not be found.

AttributeValueInvalid

The value of a property you provided is invalid.

InvalidPageParams

You provided a PageParams object with invalid data.

InvalidInputParams

Some aspect of the set of properties provided in the JSON was invalid.

PageNotFound

The page of data requested in a paginated response was not found.

InvalidSku

The SKU provided in the JSON was not found.

InvalidPoNumber

The PO number provided in the JSON was not found.

500-Level Errors

Type Description

JsonParseException

An exception ocurred trying to parse the JSON you passed in.
GeneralException An unexpected error occurred.
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.