Skip to main content

Error Codes Reference

This page provides a comprehensive reference of all error codes returned by the VesuvioPay SDK API.

Quick Reference​

For detailed error handling strategies, see the Error Handling guide.

Error Code Categories​

Customer Errors​

Error CodeHTTP StatusDescriptionResolution
CUSTOMER_NOT_FOUND404Customer with the specified identifier was not foundVerify the customer ID is correct and belongs to your store
CUSTOMER_ALREADY_DELETED409The customer has already been deletedThis is an idempotent operation; the customer is already removed
CUSTOMER_PROFILE_UPDATE_FAILED500Customer profile update operation failedRetry the operation; contact support if the issue persists

Address Errors​

Error CodeHTTP StatusDescriptionResolution
ADDRESS_NOT_FOUND404Address with the specified ID was not foundVerify the address ID is correct and belongs to the customer
ADDRESS_CREATION_FAILED500Failed to create new addressCheck address data validation; retry the operation
ADDRESS_UPDATE_FAILED500Failed to update the addressVerify address data; retry the operation
ADDRESS_DELETION_FAILED500Failed to delete the addressRetry the operation; check if address is in use
INVALID_ADDRESS_DATA400Address data is invalid or incompleteReview validation errors in the response

Authentication & Authorization Errors​

Error CodeHTTP StatusDescriptionResolution
INVALID_TOKEN401JWT token is invalid or malformedRefresh the authentication token
TOKEN_EXPIRED401JWT token has expiredObtain a new token through authentication
ACCESS_DENIED403Insufficient permissions for this operationVerify you have the required permissions
INVALID_CREDENTIALS401Login credentials are incorrectVerify username and password
USER_NOT_FOUND404User account not foundVerify the user exists; may need to register
USER_ALREADY_EXISTS409User with this email/phone already existsUse a different email/phone or login instead
REGISTRATION_INCOMPLETE400User registration is not completeComplete all registration steps
AUTHENTICATION_FAILED401Authentication process failedRetry authentication; verify credentials
SOCIAL_AUTH_FAILED401Social authentication (OAuth) failedRetry social login; check provider status
COMPANY_SETUP_FAILED500Failed to set up company during registrationContact support for assistance

API Key Errors​

Error CodeHTTP StatusDescriptionResolution
API_KEY_NOT_FOUND404API key not found in the systemVerify the API key ID is correct
INVALID_API_KEY401API key is invalid or malformedCheck the X-API-Key header value
API_KEY_INACTIVE401API key has been revoked or deactivatedGenerate a new API key
API_KEY_EXPIRED401API key has expiredGenerate a new API key
API_KEY_CREATION_FAILED500Failed to create new API keyRetry the operation; contact support if needed
API_KEY_UPDATE_FAILED500Failed to update API key settingsRetry the operation
API_KEY_ROTATION_FAILED500Failed to rotate API keyRetry rotation; use manual key generation if needed
API_KEY_REVOCATION_FAILED500Failed to revoke API keyRetry revocation; contact support if urgent
NO_STORE_ACCESS403API key does not have access to the specified storeUse the correct API key for this store

Email & Phone Errors​

Error CodeHTTP StatusDescriptionResolution
EMAIL_ALREADY_IN_USE409Email address is already registeredUse a different email or login instead
EMAIL_VERIFICATION_FAILED400Email verification failedRequest a new verification code
EMAIL_CHANGE_NOT_AVAILABLE400Email change is not available at this timeContact support for assistance
EMAIL_CHANGE_FAILED500Failed to change email addressRetry the operation
PHONE_ALREADY_IN_USE409Phone number is already registeredUse a different phone or login instead
PHONE_VERIFICATION_FAILED400Phone verification failedRequest a new verification code
PHONE_CHANGE_NOT_AVAILABLE400Phone change is not available at this timeContact support for assistance
INVALID_PHONE_FORMAT400Phone number format is invalidUse E.164 format (e.g., +1234567890)
PHONE_CHANGE_FAILED500Failed to change phone numberRetry the operation

Payment Errors​

Error CodeHTTP StatusDescriptionResolution
PAYMENT_GATEWAY_ERROR502Payment gateway returned an errorRetry the payment; check gateway status
PAYMENT_METHOD_NOT_FOUND404Payment method not foundVerify payment method ID
PAYMENT_METHOD_CREATION_FAILED500Failed to create payment methodRetry with valid card details
PAYMENT_PROCESSING_FAILED402Payment processing failedCheck card details; ensure sufficient funds
PAYMENT_INTENT_CREATION_FAILED500Failed to create payment intentRetry the operation
PAYMENT_INTENT_CONFIRMATION_FAILED402Failed to confirm payment intentVerify payment details; retry
TRANSFER_CREATION_FAILED500Failed to create transfer to merchantContact support for assistance
WEBHOOK_VALIDATION_FAILED400Webhook signature validation failedVerify webhook secret is correct

Payment Account Errors​

Error CodeHTTP StatusDescriptionResolution
PAYMENT_ACCOUNT_NOT_FOUND404Payment account not foundVerify account ID; complete onboarding
PAYMENT_ACCOUNT_CREATION_FAILED500Failed to create payment accountRetry; verify business details
PAYMENT_ACCOUNT_UPDATE_FAILED500Failed to update payment accountRetry; verify update data
EXTERNAL_ACCOUNT_ID_MISSING400External payment account ID is missingComplete payment account setup

Card & Bank Account Errors​

Error CodeHTTP StatusDescriptionResolution
BANK_ACCOUNT_NOT_FOUND404Bank account not foundVerify bank account ID
BANK_ACCOUNT_CREATION_FAILED500Failed to create bank accountVerify bank account details; retry
BANK_ACCOUNT_DELETION_FAILED500Failed to delete bank accountRetry; check if account is in use
CANNOT_DELETE_DEFAULT_BANK_ACCOUNT409Cannot delete the default bank accountSet another account as default first
BANK_ACCOUNT_SYNC_FAILED500Failed to sync bank accounts from payment providerRetry sync; check provider connection
CARD_NOT_FOUND404Card not foundVerify card ID
CARD_CREATION_FAILED500Failed to create cardVerify card details; retry
CARD_DELETION_FAILED500Failed to delete cardRetry; check if card is in use
CANNOT_DELETE_DEFAULT_CARD409Cannot delete the default cardSet another card as default first
CARD_SYNC_FAILED500Failed to sync cards from payment providerRetry sync; check provider connection
SET_DEFAULT_CARD_FAILED500Failed to set card as defaultRetry the operation
STRIPE_CUSTOMER_CREATION_FAILED500Failed to create Stripe customerRetry; contact support if issue persists

Cart & Checkout Errors​

Error CodeHTTP StatusDescriptionResolution
CHECKOUT_NOT_FOUND404Checkout session not foundVerify checkout ID; session may have expired
CHECKOUT_CREATION_FAILED500Failed to create checkout sessionRetry; verify cart has items
CHECKOUT_INVALID_STATE400Checkout is in an invalid state for this operationVerify checkout status; may need to restart
CART_NOT_FOUND404Cart not found for the customerCart may be empty or expired
EMPTY_CART400Cart is empty; cannot proceed to checkoutAdd items to cart before checkout
INSUFFICIENT_PAYMENT_METHODS400No valid payment methods availableAdd a payment method before checkout

Product & Inventory Errors​

Error CodeHTTP StatusDescriptionResolution
INSUFFICIENT_INVENTORY409Not enough inventory for the requested quantityReduce quantity or check availability
PRODUCT_OUT_OF_STOCK409Product is out of stockSubscribe to back-in-stock notifications
INVENTORY_LIMIT_EXCEEDED400Requested quantity exceeds inventory limitsReduce quantity to available stock
PRODUCT_NOT_FOUND404Product not foundVerify product ID or external ID
PRODUCT_VARIANT_NOT_FOUND404Product variant not foundVerify variant ID or external variant ID

Order Errors​

Error CodeHTTP StatusDescriptionResolution
ORDER_NOT_FOUND404Order not foundVerify order ID or external order ID

Subscription & Invoice Errors​

Error CodeHTTP StatusDescriptionResolution
SUBSCRIPTION_NOT_FOUND404Subscription not foundVerify subscription ID
PLAN_NOT_FOUND404Subscription plan not foundVerify plan ID
INVOICE_NOT_FOUND404Invoice not foundVerify invoice ID
INVOICE_NOT_PAID402Invoice has not been paidPay the invoice to proceed
INVOICE_DOWNLOAD_FAILED500Failed to download invoiceRetry; contact support if issue persists

File Upload Errors​

Error CodeHTTP StatusDescriptionResolution
FILE_NOT_PROVIDED400No file was provided in the requestInclude a file in the upload request
FILE_SIZE_EXCEEDED400File size exceeds maximum allowedReduce file size (max 10MB)
INVALID_FILE_FORMAT400File format is not supportedUse supported formats (JPEG, PNG, PDF)
INVALID_CONTENT_TYPE400File content type is invalidEnsure content type matches file format
FILE_UPLOAD_FAILED500File upload failedRetry the upload

SMS & Template Errors​

Error CodeHTTP StatusDescriptionResolution
SMS_NOT_FOUND404SMS message not foundVerify SMS ID
TWILIO_SETTINGS_NOT_FOUND404Twilio settings not configuredConfigure Twilio in admin panel
TEMPLATE_TYPE_NOT_FOUND404SMS template type not foundVerify template type
TEMPLATE_WORD_NOT_FOUND404Template word/variable not foundVerify template variable names
TEMPLATE_NOT_FOUND404SMS template not foundVerify template ID
TEMPLATE_CREATION_FAILED500Failed to create SMS templateRetry; verify template data
TEMPLATE_UPDATE_FAILED500Failed to update SMS templateRetry the operation
TEMPLATE_DELETION_FAILED500Failed to delete SMS templateRetry; check if template is in use
TEMPLATE_IN_USE409Template is in use and cannot be deletedDeactivate template or replace references

Platform & Store Errors​

Error CodeHTTP StatusDescriptionResolution
PLATFORM_NOT_FOUND404External platform not foundVerify platform ID
STORE_NOT_FOUND404Store not foundVerify store ID
COMPANY_NOT_FOUND404Company not foundVerify company ID

General Errors​

Error CodeHTTP StatusDescriptionResolution
VALIDATION_FAILED400Request validation failedReview validation errors in response
INVALID_INPUT400Input data is invalidCheck request format and required fields
INVALID_OPERATION400Operation is not valid in current contextVerify operation prerequisites
INVALID_ENTITY_TYPE400Entity type is invalidUse a supported entity type
INVALID_PREFIX400ID prefix is invalidUse correct ID format for entity type
STORE_ID_REQUIRED400Store ID is required for this operationInclude store ID in request
RESOURCE_NOT_FOUND404Requested resource was not foundVerify resource ID and permissions
DUPLICATE_RESOURCE409Resource with this identifier already existsUse update instead or change identifier
INTERNAL_ERROR500An internal error occurredRetry; contact support if issue persists
INTERNAL_SERVER_ERROR500Internal server errorRetry; contact support if issue persists
SERVICE_UNAVAILABLE503Service is temporarily unavailableRetry with exponential backoff
TIMEOUT408Request timeoutRetry the operation
HTTP_REQUEST_FAILED502External HTTP request failedRetry; check external service status

Using Error Codes​

Example Error Response​

{
"success": false,
"message": "Product with this ID was not found in your store",
"errorCode": "PRODUCT_NOT_FOUND"
}

Example with Validation Errors​

{
"success": false,
"message": "Request validation failed",
"errorCode": "VALIDATION_FAILED",
"errors": [
{
"field": "email",
"message": "Email address is required"
},
{
"field": "phoneNumber",
"message": "Phone number must be in E.164 format"
}
]
}

Error Handling Best Practices​

  1. Always check the errorCode field for programmatic error handling
  2. Use the message field for logging and debugging
  3. Show the message field to users only after sanitizing for security
  4. Implement retry logic for 5xx errors with exponential backoff
  5. Don't retry 4xx errors (except 429) - they require client-side fixes

For comprehensive error handling strategies, see the Error Handling Guide.