Skip to main content

Error Codes

This page documents all error codes returned by the LuxCore API, along with their meanings and recommended solutions.

Error Response Format

All errors follow a consistent JSON format:
{
  "statusCode": 400,
  "message": "Human-readable error message",
  "error": "ERROR_CODE"
}

HTTP Status Codes

Status CodeMeaning
200Success
201Created
204No Content (successful deletion)
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Insufficient permissions
404Not Found - Resource doesn’t exist
422Unprocessable Entity - Validation error
429Too Many Requests - Rate limit exceeded
500Internal Server Error
503Service Unavailable

Payment Error Codes Quick Reference

The following error codes can be returned in the error_code field when a payment fails:
Error CodeHTTP StatusDescriptionRecoverable
INSUFFICIENT_BALANCE400Merchant balance too low for withdrawal✅ Wait for deposits
MISSING_REQUISITES400No available requisites for this amount✅ Wait/retry
NO_AVAILABLE_REQUISITES400All requisites are locked by pending transactions✅ Wait/retry
INVALID_METHOD400Payment method not configured or inactive❌ Contact support
INVALID_WITHDRAWAL_DATA400Invalid payout details (bank account, etc.)✅ Fix data
UNSUPPORTED_CURRENCY400Currency not supported❌ Use different currency
WITHDRAWAL_NOT_SUPPORTED400Method doesn’t support withdrawals❌ Use different method
MERCHANT_REFERENCE_DUPLICATE200Payment with this reference exists⚠️ Returns existing
VALIDATION_ERROR400Request validation failed✅ Fix request
Recoverable errors (✅) can typically be resolved by waiting and retrying, or by fixing the request data. Non-recoverable errors (❌) require configuration changes or using different parameters.

Authentication Errors

INVALID_API_KEY

HTTP Status401
MessageAPI key not found or invalid
CauseThe provided API key is incorrect, expired, or doesn’t exist
SolutionVerify you’re using the correct API key provided by your LuxCore account manager. Ensure you’re using the correct key for the environment (qp_test_* or qp_prod_*).
{
  "statusCode": 401,
  "message": "API key not found or invalid",
  "error": "INVALID_API_KEY"
}

MISSING_API_KEY

HTTP Status401
MessageAPI key is required
CauseNo X-API-Key header was provided
SolutionInclude the X-API-Key header in your request

INSUFFICIENT_SCOPES

HTTP Status403
MessageAPI key lacks required scope:
CauseYour API key doesn’t have permission for this operation
SolutionContact your LuxCore account manager to request additional scopes for your API key

Payment Errors

INSUFFICIENT_BALANCE

HTTP Status400
MessageInsufficient balance for withdrawal
CauseYour merchant balance is too low for the requested withdrawal
SolutionCheck your balance via the Balance API. To add funds, you can request the LuxCore team to finalize a pending deposit for the required amount, which will credit your merchant balance.
{
  "statusCode": 400,
  "message": "Insufficient balance for withdrawal",
  "error": "INSUFFICIENT_BALANCE"
}

MISSING_REQUISITES

HTTP Status400
MessageNo available requisites for this operation
CauseNo requisites (bank accounts/payment instruments) are currently available for processing. This typically happens when: (1) Multiple transactions with the same amount are created simultaneously, exceeding the number of available requisites, (2) All requisites are already locked by pending transactions, (3) No requisites are configured for this payment method/currency combination
SolutionWait for existing pending transactions to complete or fail (freeing up requisites). If this persists, contact LuxCore support to check requisite configuration or increase capacity. Consider implementing request queuing on your side.
{
  "transaction_id": "pay_1761290149387_6149e9c2",
  "status": "failed",
  "amount": 200000,
  "currency": "ARS",
  "method": "bank_transfer",
  "type": "deposit",
  "merchant_reference": "fb384323-a356-4877-b9ff-9de8d0a3c126",
  "created_at": "2025-10-24T07:15:49.387Z",
  "error_code": "MISSING_REQUISITES",
  "error_message": "No available requisites for this operation"
}

NO_AVAILABLE_REQUISITES

HTTP Status400
MessageNo available requisites for this operation
CauseSimilar to MISSING_REQUISITES - no free requisites are available. This is a more specific error code used when the system attempted to find a requisite but all were locked or unavailable.
SolutionSame as MISSING_REQUISITES. Wait for pending transactions to reach terminal status (completed/failed), or contact support for requisite capacity increase.

INVALID_METHOD

HTTP Status400
MessagePayment method is not configured or inactive
CauseThe requested payment method is not enabled for your merchant account, not supported for this currency, or has been deactivated
SolutionContact support to enable the payment method. Verify the method is supported for your target currency and region.
{
  "statusCode": 400,
  "message": "Payment method 'bank_transfer' is not configured for currency USD",
  "error": "INVALID_METHOD"
}

INVALID_WITHDRAWAL_DATA

HTTP Status400
MessageInvalid withdrawal data provided
CauseThe payout object contains invalid or incomplete data (e.g., invalid bank account format, missing recipient name, unsupported bank code)
SolutionVerify all payout fields: recipient_name (required), bank_account (valid format for country), bank_code (valid bank identifier). Check country-specific validation rules.
{
  "statusCode": 400,
  "message": "Invalid bank account format for ARS withdrawals",
  "error": "INVALID_WITHDRAWAL_DATA"
}

UNSUPPORTED_CURRENCY

HTTP Status400
MessageCurrency is not supported
CauseThe specified currency code is not supported by LuxCore or not enabled for your merchant account
SolutionUse a supported currency code. Contact support to enable additional currencies. Supported currencies include: ARS, BRL, CLP, COP, MXN, PEN, USD.
{
  "statusCode": 400,
  "message": "Currency 'EUR' is not supported for this merchant",
  "error": "UNSUPPORTED_CURRENCY"
}

WITHDRAWAL_NOT_SUPPORTED

HTTP Status400
MessageWithdrawals are not supported for this payment method
CauseThe specified payment method only supports deposits, not withdrawals
SolutionUse a different payment method that supports withdrawals. Check method capabilities via the Methods API.

MERCHANT_REFERENCE_DUPLICATE

HTTP Status200 (returns existing payment)
MessageN/A - existing payment is returned
CauseA payment with this merchant_reference already exists. LuxCore uses idempotency based on merchant_reference to prevent duplicate payments.
SolutionThis is not an error - the API returns the existing payment. If you need to create a new payment, use a unique merchant_reference.
{
  "transaction_id": "pay_existing_123",
  "status": "pending",
  "merchant_reference": "order-12345",
  "created_at": "2025-10-24T07:10:00.000Z",
  "_note": "Existing payment returned due to duplicate merchant_reference"
}

Payment Status Errors

PAYMENT_METHOD_UNAVAILABLE

HTTP Status400
MessagePayment method '' is not available
CauseThe requested payment method is not enabled for your account or not supported for this operation
SolutionContact support to enable the payment method, or use an alternative method

INVALID_AMOUNT

HTTP Status400
MessageAmount must be between and
CauseThe payment amount is outside allowed limits
SolutionEnsure amount is within the method’s min/max limits. Check limits via the Methods API.

INVALID_CURRENCY

HTTP Status400
MessageCurrency '' is not supported
CauseThe specified currency is not valid or not enabled
SolutionUse a supported currency code (e.g., MXN, USD)

PAYMENT_NOT_FOUND

HTTP Status404
MessagePayment not found
CauseThe payment ID doesn’t exist or doesn’t belong to your merchant
SolutionVerify the payment ID is correct

PAYMENT_CANNOT_BE_CANCELLED

HTTP Status400
MessagePayment cannot be cancelled in current status
CauseThe payment is not in a cancellable state (only pending and created can be cancelled)
SolutionCheck the payment status. Completed or failed payments cannot be cancelled.

INVALID_BANK_ACCOUNT

HTTP Status400
MessageInvalid CLABE format
CauseThe bank account number (CLABE) is invalid
SolutionVerify the CLABE is 18 digits and passes checksum validation

PAYOUT_DETAILS_REQUIRED

HTTP Status400
MessagePayout details are required for withdrawal
CauseWithdrawal request is missing required payout object
SolutionInclude payout with recipient_name, bank_account, and bank_code

Webhook Errors

WEBHOOK_NOT_FOUND

HTTP Status404
MessageWebhook not found
CauseThe webhook ID doesn’t exist
SolutionVerify the webhook ID or list all webhooks to find the correct one

INVALID_WEBHOOK_URL

HTTP Status400
MessageInvalid webhook URL
CauseThe URL is not a valid HTTPS endpoint
SolutionUse a publicly accessible HTTPS URL

WEBHOOK_DELIVERY_FAILED

HTTP StatusN/A (webhook event status)
MessageWebhook delivery failed after attempts
CauseYour server returned a non-2xx response or timed out
SolutionCheck your server logs. Ensure your endpoint returns 200 within 30 seconds.

Rate Limit Errors

RATE_LIMIT_EXCEEDED

HTTP Status429
MessageToo Many Requests
CauseYou’ve exceeded the rate limit for this endpoint
SolutionImplement exponential backoff. Check the Retry-After header for wait time.
{
  "statusCode": 429,
  "message": "Too Many Requests",
  "error": "RATE_LIMIT_EXCEEDED"
}
Rate Limits:
Endpoint TypeLimit
Payment creation5000 requests/minute (burst: 500/10sec)
Standard endpoints100 requests/minute
Bulk operations10 requests/minute

Validation Errors

VALIDATION_ERROR

HTTP Status400 or 422
MessageVaries based on field
CauseRequest body failed validation
SolutionCheck the error message for specific field issues
{
  "statusCode": 400,
  "message": [
    "amount must be a positive number",
    "customer.email must be a valid email"
  ],
  "error": "Bad Request"
}

Server Errors

INTERNAL_ERROR

HTTP Status500
MessageInternal server error
CauseAn unexpected error occurred on our servers
SolutionRetry the request. If the issue persists, contact support.

SERVICE_UNAVAILABLE

HTTP Status503
MessageService Unavailable
CauseThe service is temporarily unavailable
SolutionWait and retry. Check our status page for outages.

Error Handling Best Practices

Log All Errors

Log error responses with request IDs for debugging

Retry with Backoff

Implement exponential backoff for 429 and 5xx errors

Validate Before Sending

Validate inputs client-side before API calls

Handle Gracefully

Show user-friendly messages, not raw API errors

Example Error Handler

async function makeApiRequest(endpoint, options) {
  try {
    const response = await fetch(endpoint, options);
    
    if (!response.ok) {
      const error = await response.json();
      
      switch (response.status) {
        case 401:
          // Re-authenticate or prompt for new API key
          throw new AuthenticationError(error.message);
        case 429:
          // Wait and retry
          const retryAfter = response.headers.get('Retry-After') || 60;
          await sleep(retryAfter * 1000);
          return makeApiRequest(endpoint, options);
        case 400:
        case 422:
          // Validation error - show to user
          throw new ValidationError(error.message);
        default:
          throw new ApiError(error.message, response.status);
      }
    }
    
    return response.json();
  } catch (error) {
    // Network error - retry
    if (error.name === 'NetworkError') {
      await sleep(1000);
      return makeApiRequest(endpoint, options);
    }
    throw error;
  }
}