Skip to main content

Agentic Commerce Errors
DEPRECATED

This reference applies to the deprecated Agents, Enrollments, and Instructions API, which remains available for existing integrations. New Agentic Payments integrations should use Errors and Recovery. No removal date has been announced.

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 supportedThe card brand is not supported. Visa and Mastercard are the supported brands.
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 approvalThe provider has not approved the instruction yet.
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 cancelledThe card network suspended or removed the underlying token, so the instruction was cancelled. Deleting an instruction removes it outright — a later request returns 404, not this code.
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.
AUTOFILL_NOT_VERIFIABLE400Verification is not applicable to autofill enrollmentsCalled a verification endpoint on an autofill enrollment.
AUTOFILL_NOT_CONFIRMABLE400Transaction confirmation is not applicable to autofill instructionsCalled confirm on an autofill instruction.
INVALID_OTP400The OTP code is invalid or expiredWrong OTP code submitted.
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.
CARD_NOT_ELIGIBLE400Card is not eligible for enrollmentRejected by eligibility rules before any network call — a non-US issuer country, a prepaid or commercial card, or an unsupported issuer.
VERIFICATION_NOT_SUPPORTED422Verification is not supported for this cardThe card cannot complete the requested ceremony.
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.
AUTOFILL_NOT_AVAILABLE403Autofill is not available for this tenantTenant is not enabled for autofill enrollments.
AGENT_NOT_FOUND404Agent not foundAgent ID doesn't exist or belongs to a different tenant.
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_VERIFICATION_FAILED422Verification failed at providerUnexpected error from card network during OTP/passkey verification.

Server Errors (5XX)

TypeHTTPTitleWhen
INTERNAL_ERROR500Internal server errorUnexpected server error.
PROVIDER_INSTRUCTION_CANCEL_FAILED500Internal server errorVisa instruction cancellation failed or could not be confirmed. The instruction or allowance remains active locally; repeat the same DELETE, then contact support if it persists.
PROVIDER_CONFIRMATION_FAILED500Internal server errorVisa transaction confirmation failed or could not be confirmed. Preserve the confirmation data and contact support before submitting a new confirmation.