Error Handling

Amazon Yojaka raises errors as API responses for a variety of reasons. As a connector developer, you should be able to handle them and recover from them. This section documents the error responses from Amazon Yojaka and gives you guidelines on how you could handle them.

Response Format

Amazon Yojaka APIs return a standard error response in JSON format when any API invocation encounters an error or exception. This response will be returned every time the HTTP status code from the API response is 400 or greater. The fields in the error response are described below.

Field

Description

errorCode

A unique Amazon Yojaka error code assigned to each class of errors. This will help you uniquely identify the exact error.

description

A human-readable description of the error. This can be used for debugging or troubleshooting the error.

retryable

A boolean value indicating if the API can be retried again with the possibility that the API invocation might succeed upon retry.

Sample Error Responses

Below are a few sample error response in JSON format.

500 Status Code

{
    "errorCode": "SC_00000",
    "description": "Internal failure occurred, contact Amazon support",
    "retryable": false
}

400 Status Code

{
    "errorCode": "SC_00002",
    "description": "Invalid input '123' for parameter 'locationId'",
    "retryable": false
}

HTTP Status Codes

Being a RESTful API, Amazon Yojaka’s leverages the HTTP status code in the HTTP response to an API request to indicate the broad class of error that the system encountered. Below is a description of the possible HTTP status codes that Amazon Yojaka APIs return.

Status Code

Status Message

Description

200

OK

API invocation was successful.

204

No Content

API invocation was successful and there is no response.

400

Bad Request

API invocation failed. The failure could be due to a variety of reasons such as invalid input, invalid workflow state, etc.

401

Unauthorized

API invocation failed as your connector is not authorized to make that API call. This could happen if either you AWS IAM signature is invalid or the authorization token present in the request is invalid.

403

Forbidden

API invocation is forbidden for the given parameters.

404

Not Found

The entity that the API is trying to load does not exist.

409

Conflict

This status code is returned if the API fails due to an idempotency check. For example, two inventory updates for the same SKU in the same location using the same inventory sequence number.

This status code will also be returned if the requested operation was already performed by some other source. For example, if the order was already marked as shipped as part of auto ship feature and connector again tried to perform ship operation.

422

Unprocessable Entity

This is a specific status code returned when an order workflow API is invoked on an order which has been cancelled by the marketplace.

429

Too Many Requests

Too many requests have been received by server from the user in a short amount of time. Retry the API request.

500

Internal Server Error

An internal error occurred in the Amazon Yojaka system. Reach out to Amazon Support for further assistance.

503

Service Unavailable

Amazon Yojaka services are temporarily unavailable. Retry the API request.

Amazon Yojaka Error Codes

While the HTTP status code response provides a broad indication of the class of error that occurred, Amazon Yojaka’s error codes will provide a more fine-grained insight into the error. These error codes are described below.

Note

You should never rely solely on the HTTP status code of an API response to determine the type of error that occurred. It is possible that more than one class of errors share the same HTTP status code. Use the HTTP status code only to determine if the API call succeeded or not. For all non-2XX HTTP status response, you should check the Amazon Yojaka error code returned in the response payload to determine the exact cause of the error.

Error Code

HTTP Status Code

Description

SC_00000

500

An internal error occurred in the Amazon Yojaka product. This is a permanent failure and will not succeed on retry contact Amazon Support for resolution.

SC_00001

503

A temporary failure occurred in the Amazon Yojaka product. This is a temporary failure and will work on retry. Connector systems can choose to configure a retry strategy for this error code.

SC_00002

400

One or more input parameters are invalid. This is a bad request and will not succeed on retry. Refer to Amazon Yojaka API documentation for further details.

SC_00003

404

Requested resource not found in the Amazon Yojaka product. This is a bad request and will not succeed on retry. Check whether provided resource id is valid.

SC_00004

409

Duplicate request found and operation can’t be performed. Requested operation is either already performed or still in progress. This is a bad request and will not succeed on retry. Connectors can choose to ignore this error code.

SC_00005

403

Operation is forbidden for the parameters provided in the API request. This operation will not succeed on a retry.

SC_00007

429

A temporary failure occurred in the Amazon Yojaka product due to large number of requests. This is a temporary failure and will work on retry. Connector systems can choose to configure a retry strategy for this error code.

SC_10000

409

Requested operation will be ignored because the Amazon Yojaka product is already working on another process for the same order. This is a retryable failure and might work on retry. This error code implies that connector is trying to use the order workflow in an non-standard way. Refer to the Amazon Yojaka API documentation for further details.

SC_10001

400

Requested operation is invalid and can’t be performed because the Amazopn Yojaka product does not support requested operation in the current workflow state of the order. This is a bad request and will not succeed on retry. This error code implies that connector is trying to use order workflow in a non-standard way. Refer to the Amazon Yojaka API documentation for further details.

SC_20002

409

Requested inventory quantity cannot be updated because the inventory sequence number provided is out-of-sequence. This is a bad request and will not succeed on retry. Refer to the Amazon Yojaka API documentation for the correct usage of the inventory sequence number.

SC_30000

422

Requested operation cannot be processed because the order has been cancelled by the marketplace. This operation will not succeed on retry. This error code can be used to identify that order has been cancelled and no further operations need to be performed on the order.

SC_30001

400

Requested operation cannot be processed because either package dimensions are incorrect or the carrier capacity has been completely utilized. This could be fixed by using correct dimensions or trying again later.

SC_30002

400

Requested operation cannot be processed because trans capacity for the site is breached. Please try processing the order as per the expected ship date.

SC_30003

400

Requested operation cannot be processed because input package dimensions are incorrect. This can be fixed by using correct package dimensions.

On this page