Skip to main content

Error Structure

When an error occurs, the API returns a standardized response:
{
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "method": "POST",
  "url": "/v4/i/pix/in/dynamic-qrcode",
  "status": 400,
  "success": false,
  "message": "Error description",
  "hint": "Suggestion for correction",
  "code": "VALIDATION_ERROR",
  "codeMessage": "Additional details"
}
FieldTypeDescription
requestIdstringUnique UUID for tracking
statusnumberHTTP code
successbooleanAlways false on errors
messagestringHuman-readable error description
hintstringSuggestion on how to resolve
codestringProgrammatic error code

HTTP Codes

Success (2xx)

CodeNameDescription
200OKRequest successful
201CreatedResource created successfully

Client Errors (4xx)

CodeNameDescription
400Bad RequestMalformed request or invalid parameters
401UnauthorizedMissing or invalid credentials
403ForbiddenIP not allowed or access denied
404Not FoundResource not found
409ConflictIdempotency or state conflict
422Unprocessable EntityValid data but not processable
429Too Many RequestsRate limit exceeded

Server Errors (5xx)

CodeNameDescription
500Internal Server ErrorInternal error (contact support)
502Bad GatewayService temporarily unavailable
503Service UnavailableMaintenance or overload
504Gateway TimeoutExternal service timeout

Specific Error Codes

Authentication

CodeHTTPDescriptionSolution
UNAUTHORIZED401Invalid credentialsCheck API Key and Secret
TOKEN_INVALID401Invalid or expired tokenGenerate a new token
TOKEN_MISSING401Token not providedInclude token in header
TOKEN_EXPIRED401Token expiredGenerate a new token
UNAUTHORIZED_ACCESS403Unauthorized accessCheck user permissions
API_KEY_NOT_FOUND404API Key doesn’t existGenerate a new credential
IP_NOT_ALLOWED403IP not in allowlistAdd your IP in the dashboard
ACCESS_DENIED403Access deniedCheck permissions

Validation

CodeHTTPDescriptionSolution
VALIDATION_ERROR400Required field missingCheck required fields
FIELD_REQUIRED400Required fieldProvide missing field
INVALID_FIELD400Invalid field formatCheck field format
INVALID_AMOUNT400Invalid valueUse positive number
INVALID_PIX_KEY400Invalid PIX keyCheck key format
INVALID_CPF_CNPJ400Invalid CPF/CNPJUse numbers only
INVALID_DATE_RANGE400Invalid date rangeCheck start and end
INVALID_REQUEST400Invalid requestCheck parameters

Resources

CodeHTTPDescriptionSolution
RESOURCE_NOT_FOUND404Resource not foundCheck the provided ID
USER_NOT_FOUND404User not foundCheck the userId
USER_ALREADY_EXISTS409User already existsUse another email/document
USER_ALREADY_BLOCKED400User already blockedUser is already blocked
USER_NOT_BLOCKED400User is not blockedUser is not blocked
BANK_ACCOUNT_NOT_FOUND404Bank account not foundCheck the accountId
ACCOUNT_BLOCKED403Account blockedContact support
WEBHOOK_CONFIG_NOT_FOUND404Webhook config not foundCheck the configId
FEE_TIER_NOT_FOUND404Fee tier not foundConfigure fee tiers
LIMIT_RULE_NOT_FOUND404Limit rule not foundConfigure limit rules

PIX IN

CodeHTTPDescriptionSolution
QRCODE_EXPIRED400QR Code expiredGenerate a new QR Code
QRCODE_NOT_FOUND404QR Code doesn’t existCheck the txId
INVALID_QR_CODE400Invalid QR CodeCheck QR Code format
REFUND_NOT_ALLOWED400Refund not allowedCheck refund deadline
ALREADY_REFUNDED400Already refundedTransaction was refunded
REFUND_FAILED400Refund failedTry again or contact support
INSUFFICIENT_BALANCE400Insufficient balanceDeposit more funds
PIX_IN_PROCESSING400PIX in processingWait and try again
TRANSACTION_NOT_FOUND404Transaction not foundCheck the endToEndId
ENTRY_NOT_FOUND404Ledger entry not foundCheck the entry ID
NOT_A_REFUND400Transaction is not refundUse a refund transaction

DICT Query (PIX Keys)

Errors returned when querying PIX keys in the DICT (Directory of Transactional Account Identifiers):
CodeHTTPDescriptionSolution
DICT_KEY_NOT_FOUND404PIX key not found in DICTKey doesn’t exist or is inactive. Verify and try again
DICT_ENTRY_FRAUD_RESTRICTED400Key linked to account with fraud suspicionAccount or user restricted due to substantiated fraud suspicion
DICT_ENTRY_USER_RESTRICTED400Key linked to restricted userUser associated with key has restrictions. Transaction not allowed
DICT_ENTRY_ACCOUNT_RESTRICTED400Key linked to restricted accountAccount associated with key has restrictions. Transaction not allowed
DICT_ENTRY_OWNERSHIP_CONFLICT400Key ownership conflictKey has an ownership conflict. Verify with the recipient
DICT_QUERY_FORBIDDEN403DICT query deniedOperation denied by the Central Bank
DICT_QUERY_RATE_LIMITED429DICT query rate limit exceededToo many queries in a short time. Wait a few minutes
DICT_QUERY_ERROR502Error querying key in DICTError communicating with DICT. Try again
DICT_SERVICE_TIMEOUT504DICT query timeoutDICT service is slow. Wait and try again
Fraud restriction errors (DICT_ENTRY_FRAUD_RESTRICTED) indicate that the queried PIX key is associated with an account or user with substantiated fraud suspicion at the Central Bank. Transactions with this key are not allowed. This is a protection mechanism of the SPI (Instant Payment System).

PIX OUT

CodeHTTPDescriptionSolution
TRANSFER_FAILED400Transfer failedCheck recipient data
PIX_KEY_NOT_FOUND404PIX key doesn’t existConfirm key with recipient
PIX_KEY_ALREADY_EXISTS409PIX key already existsUse another key
PIX_KEY_CREATION_BLOCKED400Key creation blockedAccount blocked for keys
DAILY_LIMIT_EXCEEDED400Daily limit exceededWait for next day
BLOCKED_RECIPIENT403Blocked recipientContact support
TRANSFER_WRONG_STATUS400Invalid transfer statusCheck current status
ENDTOEND_ALREADY_EXISTS409EndToEndId already existsUse another endToEndId
WITHDRAWAL_RESTRICTION_BLOCKED422Account restricted for withdrawals by documentCheck account restriction settings

Limits and Time Restrictions

CodeHTTPDescriptionSolution
LIMIT_EXCEEDED_PER_TX422Per-transaction limit exceededReduce the amount
LIMIT_EXCEEDED_DAILY422Daily limit exceededWait for next day
LIMIT_EXCEEDED_MONTHLY422Monthly limit exceededWait for next month
LIMIT_EXCEEDED_PER_TX_NIGHT422Night limit exceededReduce amount or wait until 8 AM (night window: 8 PM–8 AM)
REQUEST_FORBIDDEN_TIME422Forbidden timeWait for allowed hours (night window: 8 PM–8 AM)

MED (Special Return Mechanism)

CodeHTTPDescriptionSolution
MED_NOT_FOUND404MED not foundCheck the MED ID
MED_NOT_AWAITING_DEFENSE400MED not awaiting defenseMED already responded/expired
MED_DEFENSE_FILE_REQUIRED400Defense file requiredUpload defense file

BACEN/SPI Codes

Errors returned by the Brazilian Central Bank’s Instant Payment System (SPI):
CodeCategoryMeaningDescription
AB03SettlementSPI TimeoutSettlement interrupted by timeout in the Instant Payment System
AB09SettlementReceiver participant errorError at the receiver’s PSP (bank) when processing the request
AC03AccountInvalid account numberReceiver’s branch and/or account does not exist or is invalid
AC06AccountBlocked accountSpecified account is blocked for transactions
AC07AccountClosed accountTransactional account closed at the Receiver’s PSP
AC14AccountInvalid account typeIncorrect type for the specified transactional account
AG03OperationUnsupported transactionTransaction type not supported/authorized for the account
AM02AmountValue exceeds limitValue exceeds the limit allowed for the account type
AM09AmountValue mismatchRefund amount exceeds the original payment order
BE01IdentificationInconsistent CPF/CNPJCPF/CNPJ not consistent with account holder
BE17IdentificationQR Code rejectedQR Code rejected by the receiver’s participant
CH11CPF/CNPJIncorrect CPF/CNPJReceiver’s CPF/CNPJ is incorrect or invalid
DS04ProcessingOrder rejected by receiverRejected by the Receiver’s PSP for operational reasons
DS24ProcessingAuthorization timeoutTimeout between PAIN.013 and PACS.008 (recurring authorization)
DT05DateInvalid or expired dateInvalid or expired cut-off date
RR04RegulationRegulatory reasonRejection due to regulatory compliance or legal requirements
SL02SettlementInvalid account numberInvalid account for settlement
These codes are defined by the Central Bank of Brazil and may be returned in PIX operations involving communication with other banks.

Webhooks

CodeHTTPDescriptionSolution
WEBHOOK_NOT_FOUND404Webhook doesn’t existCheck configId
INVALID_URL400Invalid URLUse valid HTTPS
DUPLICATE_WEBHOOK409Duplicate webhookUse different URL

Rate Limiting

CodeHTTPDescriptionSolution
RATE_LIMIT_EXCEEDED429Too many requestsWait and implement backoff

System Errors

CodeHTTPDescriptionSolution
INTERNAL_ERROR500Internal server errorTry again or contact support
SERVICE_UNAVAILABLE503Service unavailableWait and try again
TIMEOUT504Request timeoutTry again
EXTERNAL_SERVICE_ERROR502External service errorTry again

Error Handling

JavaScript Example

async function callOwemAPI(endpoint, options) {
  try {
    const response = await fetch(`https://api.owem.com.br${endpoint}`, options)
    const data = await response.json()

    if (!data.success) {
      switch (data.status) {
        case 401:
          throw new Error("Invalid credentials")
        case 403:
          throw new Error("IP not allowed")
        case 429:
          // Implement exponential backoff
          await sleep(getBackoffDelay(data))
          return callOwemAPI(endpoint, options)
        default:
          throw new Error(data.message)
      }
    }

    return data
  } catch (error) {
    console.error(`[Owem API] ${error.message}`)
    throw error
  }
}

Python Example

import requests
import time

def call_owem_api(endpoint, **kwargs):
    try:
        response = requests.request(
            url=f"https://api.owem.com.br{endpoint}",
            **kwargs
        )
        data = response.json()

        if not data.get("success"):
            status = data.get("status")

            if status == 429:
                # Exponential backoff
                time.sleep(get_backoff_delay(data))
                return call_owem_api(endpoint, **kwargs)

            raise Exception(data.get("message"))

        return data

    except requests.RequestException as e:
        print(f"[Owem API] {e}")
        raise

Best Practices

Log Request IDs

Always log the requestId to facilitate debugging with support.

Exponential Backoff

Implement retry with exponential backoff for 429 and 5xx errors.

Circuit Breaker

Use circuit breaker to avoid cascading failures.

Monitoring

Monitor error rate and latency per endpoint.