Using the API
Error codes
Some error responses include a code indicating the specific reason for the error. Refer to the table of error codes below.
Error Code | Description |
---|---|
UNEXPECTED_ERROR | An unexpected error occurred. Contact Loop Support if the error persists. |
ORDER_NOT_FOUND | An order with the specified ID could not be found. |
NOT_AUTHORIZED | The request couldn’t be processed because authorization failed. Confirm that your API key is correct and try again. |
NOT_FOUND | The resource requested was not found |
UNPROCESSABLE_RETURN | The return cannot be processed because it is in a state that keeps it from being processed. Check the state of the return and make sure it is eligible for processing. |
UNPROCESSABLE_FLAGGED_RETURN | Unless enabled, flagged returns cannot be processed. If you would like to configure your flagged returns to process, please adjust the “Allow flagged returns to process” setting in your Loop Admin. |
FAILED_TO_GET_WEBHOOKS | The webhooks requested could not be returned. Contact Loop Support if the error persists. |
FAILED_TO_DELETE_WEBHOOK | The webhook could not be deleted. Contact Loop Support if the error persists. |
FAILED_TO_CREATE_WEBHOOK | The webhook could not be created. Contact Loop Support if the error persists. |
FAILED_TO_UPDATE_WEBHOOK | The webhook could not be updated. Contact Loop Support if the error persists. |
FAILED_TO_GET_SAMPLE_WEBHOOK | The sample webhook could not be returned. Contact Loop Support if the error persists. |
DESTINATION_LIMIT_EXCEEDED | You have exceeded the number of destinations included in your plan. Contact your Merchant Success Manager or Loop Support for more information. |
Draft returns-specific errors
The following error codes may be returned as part of the draft return response when using the Return Creation API.
Error Code | Description |
---|---|
draft-returns-not-enabled | Draft returns are not enabled for this shop. |
validation-failed | Validation failed. |
shop-not-found | Shop not found. |
order-lookup-failed | Failed to lookup the order. |
order-not-found | Order not found. |
error-retrieving-order | Error retrieving order. |
secondary-input-mismatch | Secondary input mismatch. |
returns-unavailable-from-order-address | Returns unavailable from order address. |
returns-unavailable-for-order | Returns unavailable for order. |
order-has-been-cancelled | Order has been cancelled. |
order-get-data-failed | Failed to get order data. |
order-line-item-get-data-failed | Failed to get order line item data. |
draft-return-not-found | Draft return not found. |
draft-return-version-mismatch | Draft return version mismatch. |
draft-return-not-actionable | Draft return is not actionable. |
unable-to-resolve-action-handler | Unable to resolve action handler. |
action-failed | Action failed. |
partial-context-generation | Partial context generation. |
partial-available-action-generation | Partial available action generation. |
no-returning-items | No returning items. |
cart-error | Cart error. |
totals-calculation-failed | Failed to calculate totals. |
return-creation-failed | Failed to create return. |
terminal-state | Draft return has been {state} and cannot be modified (where {state} is the current state). Terminal states include submitted , cancelled , and expired . |
unsupported-feature | Unsupported feature. |
internal-error | An unexpected error occurred. |