GraphQL API > Errors
OverviewGraphQL APIErrors
Errors

Our API reports errors adhering to the standard GraphQL endpoint protocol, as per the specification. However, in certain instances, we furnish additional fields on an error.

{
  apiError?: APIError;
}

The APIError is defined as follows:

export enum ErrorCode {
  Unauthorized = 401,
  NotFound = 404,
  TooManyRequests = 429,
  InternalServerError = 500,
  JWTInvalidForWrite = 996,
  NoPermissions = 997,
  ForceRedirect = 998,
  JWTValidationFailed = 999,
  InvalidInput = 1000,
  OrderError = 1001,
  ParsingFailure = 1030,
  VersionMismatch = 1031,
  CSVReadError = 1066,
  UserDisabled = 1068,
  UserLocked = 1069,
  ReviewOutOfDate = 1107,
  RealtimeShippingRatesFailure = 1109,
  URLFetchFailure = 1110,
  TaxSystemFailure = 1111,
  XeroFailure = 1112,
  QuickbooksFailure = 1113,
  CannotSwitchToPlan = 1116,
  GatewayCreationError = 1117,
  StripeAPICallFailure = 1122,
  GatewayTransactionError = 1123,
  TaskTypeInProgress = 1127,
  InvalidFields = 1131,
  InvalidInputCount = 1132,
  FailedCooking = 1137,
  CurrencyConversion = 1143,
  LimitExceeded = 1146,
  InvalidOperation = 1150,
  DownloadLimitExceeded = 1151,
  TryAgainLater = 1153,
  ConditionEvalFailure = 1154,
  RefundFailure = 1155,
  AdminError = 1156,
  AnalyticsAPICallFailure = 1157,
  OAuth2EmailMismatch = 1158,
}
export type InvalidInputProblem =
  | "bad_password"
  | "invalid_date_range"
  | "invalid_domain"
  | "invalid_email"
  | "invalid_enum"
  | "invalid_boolean"
  | "invalid_factor"
  | "invalid_identifier"
  | "invalid_integer"
  | "invalid_non_empty"
  | "invalid_non_negative_float"
  | "invalid_non_negative_int64"
  | "invalid_non_zero_int64"
  | "invalid_percentage"
  | "invalid_positive_int64"
  | "invalid_rfc3339_date"
  | "invalid_timezone"
  | "invalid_discount_code"
  | "invalid_url"
  | "invalid_web_url"
  | "mandatory"
  | "max_length_exceeded"
  | "min_length_not_met"
  | "invalid_two_factor_code"
  | "invalid_value"
  | "max_count_exceeded"
  | "invalid_credit_card_number"
  | "invalid_option_id"
  | "invalid_base64"
  | "invalid_start_number"
  | "already_exists"
  | "duplicate"
  | "overlapping_ranges"
  | "multiple_default_tax_rates"
  | "multiple_default_addresses"
  | "invalid_csv_number_of_columns"
  | "invalid_csv_header"
  | "invalid_integer_range"
  | "invalid_phone"
  | "invalid_app_domain"
  | "invalid_url_id";
export type OrderLineItemErrorCode =
  | "invalid_product_quantity"
  | "invalid_product_quantity_multi"
  | "out_of_stock"
  | "no_inventory"
  | "product_banned"
  | "promotion_disabled"
  | "promotion_no_longer_valid"
  | "missing_dependency"
  | "mandatory_dependency"
  | "invalid_shop_destination"
  | "invalid_subscription_index"
  | "subscription_already_exists"
  | "invalid_subscription_quantity"
  | "mandatory_subscription"
  | "too_many_subscriptions";
export type InvalidOperationReason =
  | "cannot_add_shop_owner_to_shop"
  | "cannot_change_shop_owner_permissions"
  | "cannot_delete_shop_owner"
  | "cannot_refund_more_than_paid"
  | "cannot_restock_more_than_available"
  | "cannot_restock_unmanaged_items"
  | "cycle"
  | "fulfillment_must_be_canceled"
  | "fulfillment_must_be_completed"
  | "fulfillment_must_be_disabled"
  | "fulfillment_must_be_enabled"
  | "fulfillment_type"
  | "gateway_type"
  | "in_progress"
  | "no_fulfillable_items"
  | "not_an_image"
  | "nothing_to_do"
  | "only_full_refund"
  | "order_capture_forced"
  | "order_not_calculable"
  | "order_not_capturable"
  | "order_not_editable"
  | "order_not_payable"
  | "order_not_refundable"
  | "order_not_reservable"
  | "order_not_restockable"
  | "order_not_restorable"
  | "order_not_cancelable"
  | "plan"
  | "settings"
  | "shipping_rates_invalid"
  | "storage"
  | "tree_move"
  | "trial"
  | "in_use"
  | "currency_disabled"
  | "currency_not_allowed"
  | "no_tax_system"
  | "two_factor_invalid_state"
  | "already_purchased"
  | "not_purchased"
  | "impossible"
  | "invalid_item"
  | "gateway_not_selected"
  | "test"
  | "feature";
export type APIError = { message?: string; field?: string } & (
  | { code: undefined }
  | { code: ErrorCode.Unauthorized }
  | { code: ErrorCode.NotFound }
  | { code: ErrorCode.TooManyRequests; meta?: { rate_info?: { cap: number; count: number; rate: number } } }
  | {
      code: ErrorCode.InternalServerError;
      meta?: { db_retry?: boolean; enum_id?: number; error?: string; table?: string };
    }
  | { code: ErrorCode.JWTInvalidForWrite }
  | { code: ErrorCode.NoPermissions; meta?: { bits?: string[] } }
  | { code: ErrorCode.ForceRedirect }
  | { code: ErrorCode.JWTValidationFailed }
  | {
      code: ErrorCode.InvalidInput;
      meta?: { fields?: { field: string; max: number; min: number; problem: InvalidInputProblem }[] };
    }
  | {
      code: ErrorCode.OrderError;
      meta?: {
        errors?: { code: OrderLineItemErrorCode; line_item_index: number; max: number; min: number; subject: string }[];
      };
    }
  | { code: ErrorCode.ParsingFailure; meta?: { error?: string } }
  | { code: ErrorCode.VersionMismatch }
  | { code: ErrorCode.CSVReadError; meta?: { error?: string } }
  | { code: ErrorCode.UserDisabled }
  | { code: ErrorCode.UserLocked }
  | { code: ErrorCode.ReviewOutOfDate; meta?: { reason?: string } }
  | { code: ErrorCode.RealtimeShippingRatesFailure; meta?: { error?: string } }
  | { code: ErrorCode.URLFetchFailure; meta?: { url?: string } }
  | { code: ErrorCode.TaxSystemFailure; meta?: { error?: string } }
  | { code: ErrorCode.XeroFailure; meta?: { error?: string } }
  | { code: ErrorCode.QuickbooksFailure; meta?: { error?: string } }
  | { code: ErrorCode.CannotSwitchToPlan; meta?: { reason?: string } }
  | { code: ErrorCode.GatewayCreationError; meta?: { error?: string } }
  | {
      code: ErrorCode.StripeAPICallFailure;
      meta?: { code?: string; decline_code?: string; message?: string; param?: string; type?: string };
    }
  | { code: ErrorCode.GatewayTransactionError; meta?: { error?: string } }
  | { code: ErrorCode.TaskTypeInProgress }
  | { code: ErrorCode.InvalidFields; meta?: { error?: string } }
  | { code: ErrorCode.InvalidInputCount }
  | { code: ErrorCode.FailedCooking; meta?: { error?: string } }
  | { code: ErrorCode.CurrencyConversion }
  | { code: ErrorCode.LimitExceeded; meta?: { what?: string } }
  | { code: ErrorCode.InvalidOperation; meta?: { reason?: InvalidOperationReason } }
  | { code: ErrorCode.DownloadLimitExceeded }
  | { code: ErrorCode.TryAgainLater }
  | { code: ErrorCode.ConditionEvalFailure; meta?: { what?: string } }
  | { code: ErrorCode.RefundFailure; meta?: { error?: string } }
  | { code: ErrorCode.AdminError; meta?: { error?: string } }
  | { code: ErrorCode.AnalyticsAPICallFailure; meta?: { message?: string } }
  | { code: ErrorCode.OAuth2EmailMismatch }
);
PREVIOUS
Tutorial
NEXT
Pagination