Catálogo de Códigos de Erro Este catálogo lista os valores de error.code que a API pode retornar, agrupados por status HTTP e
Este catálogo lista os valores de error.code que a API pode retornar, agrupados por status HTTP e
por recurso. Para a estrutura do objeto de erro (envelope), veja Tratamento de Erros .
Trate erros pelo error.code, não pela message. O code é o identificador estável e legível por
máquina (faz parte do contrato); a message é texto e pode mudar. Sempre presente na resposta.
A API usa códigos de status HTTP padrão. O error.statusCode/error.category derivam de um template
interno (não são definidos campo a campo). Cada error.code mapeia para um template, e o template define o
trio statusCode / status / category:
categoryStatus Template interno Significado validation400badRequestRequisição malformada ou parâmetro inválido (veja error.params) authentication401unauthorizedCredencial (SelectKey / login) ausente, inválida ou revogada payment402paymentRequiredPagamento recusado pelo emissor authorization403forbiddenAutenticado, mas sem permissão / conta não ativa client404notFoundRecurso não encontrado client409conflictConflito (estado incompatível, duplicidade, idempotência) client413payloadTooLargeCorpo da requisição grande demais validation422unprocessableEntidade não processável (regra de negócio) rate_limit429tooManyRequestsLimite de requisições excedido (veja API Limits ) server500internalServerErrorErro interno — tente novamente; se persistir, contate o suporte server503serviceUnavailableIndisponibilidade temporária de um serviço — repita com backoff
Observação: erros de validação de contrato são sempre 400 / validation (com error.params), nunca
422. O 422 é reservado para regras de negócio (entidade processável sintaticamente, mas rejeitada).
Em erros que admitem nova tentativa (ex.: 429), respeite o cabeçalho Retry-After da resposta no
seu backoff .
Estes códigos vêm do kernel e podem aparecer em qualquer rota (recurso server, exceto onde indicado):
error.codeHTTP Quando ocorre invalidParameters400 Falha de validação de contrato (veja error.params para os campos) unauthorized401 SelectKey/token ausente, inválido ou revogadoforbidden403 Autenticado, mas sem permissão para a operação payloadTooLarge413 Corpo da requisição excede o limite (envie arquivos via /v1/assets) tooManyRequests429 Rate limit atingido (veja API Limits ) idempotencyInProgress409 Já há uma requisição em andamento com esta X-Idempotency-Key idempotencyMismatch409 Esta X-Idempotency-Key já foi usada com um payload diferente serverError500 Erro interno inesperado
Erros de validação de campos trazem detalhes por campo em error.params:
{
"error" : {
"status" : "Bad Request" ,
"statusCode" : 400 ,
"category" : "validation" ,
"code" : "invalidParameters" ,
"message" : "Validation errors occurred." ,
"resource" : "server" ,
"params" : [{ "amount" : "amount must be a positive integer" }]
}
}
error.codeHTTP Mensagem transactionNotFound404 Transaction not found customerNotFound404 The customer for this transaction was not found cardNotFound404 The card for this transaction was not found addressNotFound404 The billing address was not found recipientNotFound404 A split recipient was not found disputeNotFound404 No dispute was found for this transaction cardCustomerMismatch422 The card does not belong to the customer transactionNotRefundable422 This transaction cannot be refunded in its current status refundAmountInvalid422 Refund amount inválido (≤ 0 ou acima do total já cobrado) refundInProgress409 A refund for this transaction is already in progress transactionNotCapturable422 This transaction is not awaiting capture captureAmountInvalid422 Capture amount inválido (≤ 0 ou acima do autorizado) transactionNotInDispute422 Defense evidence só pode ser enviada com a transação em disputa discountExceedsAmount422 O desconto deixa a cobrança abaixo do mínimo splitsExceedAmount422 A soma dos splits excede o valor cobrado splitsInvalid422 Um split resolve para valor inválido (zero ou negativo) installmentsExceedMax422 Parcelas acima do máximo oferecido no momento onBehalfOfInvalid422 onBehalfOf deve referenciar uma sub-conta sua (marketplace habilitado) sellerRatesMissing422 Conta sem taxa configurada — não pode transacionar
Erros de processamento do pagamento (motor de pagamentos, recurso payorch):
error.codeHTTP Mensagem paymentDeclined402 The payment was declined by the issuer providerNotConfigured422 Nenhum provedor de pagamento configurado para o modo solicitado transactionNotFound404 Transaction not found at the provider providerUnavailable500 The payment provider is temporarily unavailable
/v1/subscriptions é Selectwin-strict : a precificação vem das variantes recorrentes; não há campo amount nem preço manual.
error.codeHTTP Mensagem subscriptionNotFound404 Subscription not found customerNotFound404 The customer for this subscription was not found cardNotFound404 The card for this subscription was not found variantNotFound404 One or more product variants were not found cycleNotFound404 The billing cycle was not found for this subscription itemNotFound404 The line item was not found for this subscription splitNotFound404 The split was not found for this subscription splitRecipientNotFound404 The split recipient company was not found meteredItemNotFound404 Metered subscription item not found thresholdNotFound404 Billing threshold not found cardCustomerMismatch422 The card does not belong to the customer variantNotRecurring422 A variant is not priced for recurring billing subscriptionAlreadyCanceled422 This subscription is already canceled subscriptionNotModifiable422 A canceled subscription cannot be modified subscriptionNotPausable422 This subscription cannot be paused in its current status subscriptionNotResumable422 Only a paused subscription can be resumed noScheduledCycle422 There is no scheduled cycle to renew for this subscription subscriptionRequiresItem422 A subscription must keep at least one line item itemCurrencyMismatch422 The item currency must match the subscription currency duplicateSplitRecipient422 A split already exists for this recipient splitValueInvalid422 A percentage split value must be between 0 and 100 usageOnNonMeteredItem422 Usage can only be reported on metered items usageActionUnsupported422 Usage action not supported (only 'increment') thresholdMisconfigured422 Billing threshold misconfigured thresholdAlreadyExists409 A billing threshold already exists for this item onBehalfOfInvalid422 onBehalfOf deve referenciar uma sub-conta sua (marketplace habilitado)
error.codeHTTP Mensagem customerNotFound404 Customer not found invalidCustomerId404 The provided customer id is invalid customerEmailTaken409 A customer with this email already exists customerDocumentTaken409 A customer with this document already exists customerHasActiveSubscription409 Cliente com assinatura ativa não pode ser excluído (cancele a assinatura antes)
error.codeHTTP Mensagem cardIdNotFound404 Card ID not found cardIdIsInvalid400 Card ID is invalid cardExpired400 Card expired invalidCardData422 Invalid card data cardBrandNotSupported422 Card brand not supported
error.codeHTTP Mensagem addressIdNotFound404 Address not found
error.codeHTTP Mensagem walletNotFound404 Wallet not found walletAlreadyExists409 A wallet with these account details already exists walletHasPendingWithdrawal409 Wallet com saque em andamento não pode ser excluída bankCodeNotSupported400 This bank code is not supported
error.codeHTTP Mensagem withdrawalNotFound404 Withdrawal not found withdrawalCreateNotEnabled400 Withdrawals are not enabled for this company withdrawalAmountLessThanMinimum400 The withdrawal amount is below the minimum
error.codeHTTP Mensagem autoCashoutNotFound404 Auto-cashout config not found duplicateAutoCashoutForWallet400 An auto-cashout config already exists for this wallet percentageOverlapDetected400 A soma das porcentagens habilitadas não pode exceder 100%
error.codeHTTP Mensagem balanceNotFound404 No balance found for this company yet balanceIsInsufficient422 Insufficient available balance for this withdrawal receivableNotFound404 Receivable not found
error.codeHTTP Mensagem productNotFound404 Product not found variantNotFound404 Variant not found invalidPricing422 Invalid advanced pricing configuration pricingTypeImmutable422 pricing.type is immutable pricingSchemaImmutable422 pricing.schema is immutable
error.codeHTTP Mensagem couponNotFound404 The coupon code was not found couponCodeConflict409 A coupon with this code already exists couponDisabled422 This coupon is no longer active couponNotYetActive422 This coupon is not active yet couponExpired422 This coupon has expired couponMinCartAmount422 Cart total abaixo do mínimo do cupom couponMaxCartAmount422 Cart total acima do máximo do cupom couponMinCartItems422 Menos itens do que o cupom exige couponMaxCartItems422 Mais itens do que o cupom permite couponNotApplicable422 This coupon does not apply to this cart couponUsageLimitReached422 This coupon has reached its usage limit couponCustomerLimitReached422 This coupon has already been used by this customer couponExceedsTotal422 The coupon discount exceeds the chargeable total
error.codeHTTP Mensagem checkoutSessionNotFound404 Checkout session not found checkoutSessionNotUpdatable409 A completed checkout session can no longer be updated checkoutSessionNotPayable409 This checkout session is not in a payable state variantIdIsInvalid422 One of the items references a product variant that does not exist onBehalfOfInvalid422 onBehalfOf deve referenciar uma sub-conta sua (marketplace habilitado) checkoutPaymentLinkNotFound404 Payment link not found checkoutPaymentLinkCreateFailed500 The payment link could not be created checkoutTemplateNotFound404 Checkout template not found checkoutTemplateIdIsInvalid422 The checkout template does not exist orderbumpNotFound404 Order bump not found reviewNotFound404 Checkout review not found shippingOptionNotFound404 Shipping option not found shippingOptionRequiresTemplateOrGlobal422 A shipping option must be global or bound to a checkout template checkoutMonitorNotFound404 Checkout monitor not found checkoutPixelNotFound404 Checkout tracking pixel not found upsellNotFound / upsellOfferNotFound404 Upsell offer not found upsellParentNotFound404 Parent transaction not found upsellParentNotApproved422 A transação pai precisa estar aprovada para cobrar um upsell upsellOfferExpired422 This upsell offer has expired upsellOfferNotEligible422 This upsell offer is not eligible for the parent purchase upsellAmountTooLow422 The upsell amount is below the minimum chargeable value
error.codeHTTP Mensagem webhookEndpointNotFound404 Webhook endpoint not found webhookEventNotFound404 Webhook event not found webhookDispatchNotFound404 Webhook dispatch not found webhookUnknownResource422 Unknown event resource — cannot build payload webhookSigningDisabled422 This endpoint has signing disabled (no secret)
error.codeHTTP Mensagem domainIdIsInvalid404 Domain ID is invalid (not found for this company) domainAlreadyExists409 Domain already exists domainLimitExceeded409 Domain limit exceeded domainUpdateFailed400 Domain update failed domainEdgeProvisionFailed422 Domain edge provisioning failed
error.codeHTTP Mensagem invalidPassword401 Invalid email or password userDisabled403 This account is not active. Verify your email to continue mfaCodeRequired401 This account has MFA enabled — a verification code is required mfaChallengeInvalid401 The MFA challenge is invalid, expired, or already used mfaTokenInvalid401 The verification code is incorrect stepUpRequired401 This operation requires recent authentication. Please re-authenticate recoveryTokenInvalid401 The password reset token is invalid or has expired resourceNotAllowed403 This resource is not allowed for this client operationMethodNotAllowed403 This operation is not allowed for this client companyNotMember403 You are not a member of this company sessionNotFound404 Session not found passwordMismatch422 The passwords do not match invalidApiKeyId400 API key not found m2mTokenUnauthorized401 Invalid client credentials
error.codeHTTP Mensagem userEmailExists400 An account with this email already exists userEmailConfirmationTokenInvalid400 The email confirmation token is invalid companyLimitReached422 Você atingiu o máximo de empresas para esta conta companiesNotActive422 Finalize suas empresas existentes (todas ativas) antes de criar outra companyCreateForbidden403 You do not have permission to create a company from this account signupNotProcessable500 Could not create the account
error.codeHTTP Mensagem exportNotFound404 The export was not found exportNotCancelable422 This export can no longer be canceled exportTooLarge422 The export exceeds the maximum allowed row count
error.codeHTTP Mensagem assetNotFound404 The asset was not found assetUploadIncomplete422 No uploaded object was found for this asset yet assetCompanyUnresolved422 Could not resolve the company for this upload storageNotConfigured503 Object storage is not configured (indisponibilidade temporária)
const res = await fetch (url, { headers: { SelectKey: process.env. SELECTWIN_API_KEY } });
if ( ! res.ok) {
const { error } = await res. json ();
switch (error.code) { // ← key no code, nunca na message
case 'customerNotFound' :
return handleMissingCustomer ();
case 'balanceIsInsufficient' :
return promptTopUp ();
case 'paymentDeclined' :
return promptAnotherCard ();
default :
if (error.statusCode === 429 ) return retryWithBackoff (); // rate limit
if (error.statusCode >= 500 ) return retryWithBackoff (); // transitório
throw new Error ( `${ error . code }: ${ error . message }` );
}
}
Esta lista cobre os erros mais comuns voltados ao desenvolvedor para cada recurso público. Outros
códigos específicos podem aparecer; trate sempre o default pelo error.statusCode/category.