Error Reference

Known Cobru error patterns, misleading status codes, and troubleshooting guidance.

Cobru's current error model is functional but not yet ergonomic. Some validation failures show up as 403 Forbidden, and the response shape is not consistently descriptive.

Current response formats

You will most often see one of these:

{ "error": "Error en la creacion del cobru." }
{ "payment_method_enabled": ["Not a valid string."] }

Error-handling strategy

Capture the exact HTTP status, headers, and raw response body from Cobru.

Normalize Cobru's response into your own internal error type.

Decide whether the error is retryable, fixable by the caller, or operational.

Surface a safe customer-facing message while keeping the raw Cobru payload in logs.

Known quirks

SymptomHTTP codeActual causeFix
payment_method_enabled sent as object400Cobru expects a JSON stringJSON.stringify() before sending
Missing payer_redirect_url or callback403request validation failuresend both fields on payment creation
Credentials are present but create payment still fails403body shape may be invalid, not authverify payment_method_enabled, redirect URLs, and content type
refresh_token body field fails400 or auth failurewrong field nameuse refresh
Payment URL does not openclient bugusing pk path instead of url slugbuild {baseUrl}/{url}

Suggested internal error categories

CategoryUse for
configuration_errormissing credentials, wrong environment, missing callback URL
request_validation_errormalformed payloads, wrong field types, missing required fields
authentication_errorinvalid or expired auth material
provider_processing_errorCobru or downstream payment provider failed after request validation
reconciliation_errorcallback and payment status do not match your internal order state

Troubleshooting checklist

  1. Confirm you are hitting the right base URL.
  2. Confirm all three credentials are present.
  3. Log the exact JSON body before sending.
  4. Verify payment_method_enabled is serialized as a string.
  5. Confirm callback and payer_redirect_url are valid HTTPS URLs.
  6. Keep raw responses from Cobru in logs during integration.

What to log for every failed request

  • internal request ID
  • Cobru endpoint and method
  • sanitized request body
  • HTTP status
  • raw Cobru response
  • internal error category
  • retry decision

Retry guidance

Desired future model

A future Cobru error model should move to application/problem+json with stable machine-readable error types. Until then, your integration should normalize Cobru responses into your own internal error format.

On this page