Skip to main content

Agentic Commerce Errors

All error responses follow RFC 7807 problem details format and include a BT-TRACE-ID response header for correlating requests with Basis Theory support.

Request Tracing

Every API response includes a BT-TRACE-ID header. The value is determined in this order:

  1. Client-provided — if you send a BT-TRACE-ID request header, it is echoed back.
  2. Cloudflare Ray ID — if no client header is present, the CF-Ray header from Cloudflare is used.
  3. Auto-generated — if neither is available, a UUID is generated.

Include this value when contacting support to help trace issues.

Error Response Format

{
"type": "PROVIDER_ENROLLMENT_FAILED",
"title": "Card enrollment failed at provider",
"status": 422,
"detail": "An error occurred with the upstream provider. Contact support if the issue persists.",
"debug": {
"provider_correlation": "visa-corr-456"
}
}

The debug field is included on provider errors (PROVIDER_*) when a provider correlation ID is available. This can be useful when working with Basis Theory support to trace issues back to the card network.

Client Errors (4XX)

TypeHTTPTitleWhen
VALIDATION_ERROR400Request validation failedRequest body fails schema validation. The errors field contains per-field details.
INVALID_TOKEN400Invalid or inaccessible Basis Theory tokenThe token_id doesn't exist, is expired, or the API key lacks access.
UNSUPPORTED_PROVIDER400Card brand not supportedCard brand (e.g., Amex, Discover) isn't supported yet — only Visa and Mastercard currently.
VISA_RELATIONSHIP_ID_NOT_CONFIGURED400Visa relationship ID is not configured for this tenantTenant hasn't completed Visa onboarding.
AGENT_ENROLLMENT_LIMIT400Agent has reached the maximum number of enrollments (50)Agent already has 50 enrollments linked.
ENROLLMENT_PENDING400Enrollment is pending cardholder approvalEnrollment exists but hasn't completed verification yet.
INSTRUCTION_PENDING400Instruction is pending cardholder approvalInstruction requires passkey verification before use.
INSTRUCTION_PENDING_VERIFICATION400Instruction requires verification before credentials can be retrievedInstruction was approved by the provider but the consumer hasn't completed passkey verification yet.
INSTRUCTION_CANCELLED400Instruction has been cancelledInstruction was soft-deleted or cancelled.
INSTRUCTION_EXPIRED400Instruction has expiredInstruction's expires_at has passed.
VERIFICATION_NOT_REQUIRED400Enrollment does not require verificationCalled verify on an enrollment that was auto-approved.
VERIFICATION_STATE_INVALID400Verification state is invalid for this operationCalled an OTP/method/passkey endpoint out of order.
INVALID_OTP400The OTP code is invalid or expiredWrong OTP code submitted.
OTP_EXPIRED400OTP code expired, please request a new codeOTP timed out — restart by calling the select method endpoint again.
MAX_ATTEMPTS_EXCEEDED400Too many failed attempts, please restart verificationToo many wrong OTP attempts — must restart the verification flow.
PASSKEY_FAILED400Passkey authentication failedPasskey/FIDO assertion was invalid.
UNAUTHORIZED401Invalid or missing credentialsMissing or invalid BT-API-KEY header.
FORBIDDEN403Insufficient permissionsAPI key lacks the required permission for this endpoint.
ENROLLMENT_DELETED403Enrollment has been deletedAttempted to use a soft-deleted enrollment.
ENROLLMENT_ACCESS_DENIED403Agent does not have access to this enrollmentAgent doesn't have this enrollment in its enrollment_ids.
ENROLLMENT_FAILED422Enrollment failed and must be retried before useEnrollment is in failed status. Retry the enrollment before verifying or creating instructions.
ENROLLMENT_NOT_FAILED400Only failed enrollments can be retriedCalled retry on an enrollment that isn't in failed status.
ENROLLMENT_PENDING_VERIFICATION403Cannot create instruction with unverified enrollmentTried to create instruction before enrollment verification completed.
AGENT_NOT_FOUND404Agent not foundAgent ID doesn't exist or belongs to a different tenant.
KEY_NOT_FOUND404Key not foundInternal key lookup failed.
ENROLLMENT_NOT_FOUND404Enrollment not foundEnrollment ID doesn't exist or belongs to a different tenant.
INSTRUCTION_NOT_FOUND404Instruction not foundInstruction ID doesn't exist or belongs to a different agent.
ENROLLMENT_ALREADY_VERIFIED409Enrollment is already verifiedCalled verify on an enrollment that's already active.
CARD_REJECTED422Card was rejected by the card networkCard was declined, not eligible, or failed verification at the network. Try a different card.
PROVIDER_ENROLLMENT_FAILED422Card enrollment failed at providerUnexpected error from card network during enrollment.
PROVIDER_INSTRUCTION_FAILED422Instruction creation failed at providerUnexpected error from card network during instruction creation.
PROVIDER_INSTRUCTION_UPDATE_FAILED422Instruction update failed at providerUnexpected error from card network during instruction update.
PROVIDER_CREDENTIALS_FAILED422Credential retrieval failed at providerUnexpected error from card network during credential fetch.
PROVIDER_CONFIRMATION_FAILED422Confirmation publishing failed at providerUnexpected error from card network during instruction confirmation.
PROVIDER_VERIFICATION_FAILED422Verification failed at providerUnexpected error from card network during OTP/passkey verification.
PROVIDER_UNAVAILABLE422Provider service unavailableCard network is down or unreachable. Retry with backoff.

Server Errors (5XX)

TypeHTTPTitleWhen
INTERNAL_ERROR500Internal server errorUnexpected server error.