{"record":{"id":"14a0eb94093e6db1","repo":"juspay/hyperswitch","slug":"iatapay-requires-signaturekey-auth-type","errorCode":null,"errorMessage":"Iatapay requires SignatureKey auth type","messagePattern":"Iatapay requires SignatureKey auth type","errorType":"exception","errorClass":"ApiErrorResponse","httpStatus":500,"severity":"error","filePath":"crates/router/src/core/unified_connector_service/connector_config.rs","lineNumber":1383,"sourceCode":"                    api_secret,\n                } => Ok(Self::Hyperpg {\n                    username: api_key.clone(),\n                    password: key1.clone(),\n                    merchant_id: api_secret.clone(),\n                }),\n                _ => Err(err(\"Hyperpg requires SignatureKey auth type\")),\n            },\n            Connector::Iatapay => match auth {\n                ConnectorAuthType::SignatureKey {\n                    api_key,\n                    key1,\n                    api_secret,\n                } => Ok(Self::Iatapay {\n                    client_id: api_key.clone(),\n                    merchant_id: key1.clone(),\n                    client_secret: api_secret.clone(),\n                }),\n                _ => Err(err(\"Iatapay requires SignatureKey auth type\")),\n            },\n            Connector::Moneris => match auth {\n                ConnectorAuthType::SignatureKey {\n                    api_key,\n                    key1,\n                    api_secret,\n                } => Ok(Self::Moneris {\n                    client_secret: api_key.clone(),\n                    client_id: key1.clone(),\n                    merchant_id: api_secret.clone(),\n                }),\n                _ => Err(err(\"Moneris requires SignatureKey auth type\")),\n            },\n            Connector::Noon => match auth {\n                ConnectorAuthType::SignatureKey {\n                    api_key,\n                    key1,\n                    api_secret,","sourceCodeStart":1365,"sourceCodeEnd":1401,"githubUrl":"https://github.com/juspay/hyperswitch/blob/3093f22cc46b46415cca152ea0b234277b251ecd/crates/router/src/core/unified_connector_service/connector_config.rs#L1365-L1401","documentation":"Thrown in ConnectorSpecificConfig::foreign_try_from while building the X_CONNECTOR_CONFIG header for the Iatapay connector (via build_connector_config_header, connector_config.rs:1876). Iatapay only accepts the SignatureKey variant of ConnectorAuthType (api_key, key1, api_secret), which maps to client_id / merchant_id / client_secret respectively; any other variant hits the wildcard arm and returns this error. It signals that the merchant connector account's stored auth shape is wrong for Iatapay, not that credentials are invalid.","triggerScenarios":"A merchant connector account for connector_name = \"iatapay\" exists with auth_type HeaderKey/BodyKey/MultiAuthKey/CertificateAuth/CurrencyAuthKey/NoKey, and a UCS-path request (payment, payout, or header build) evaluates build_connector_config_header(Connector::Iatapay, auth, ...). Also produced at account creation when the payload's auth object lacks any of api_key/key1/api_secret and the caller stores a non-SignatureKey variant instead.","commonSituations":"Onboarding Iatapay with a two-field auth block (client_id + client_secret as BodyKey) because the provider docs mention only two credentials, forgetting Iatapay also needs merchant_id as key1; converting a connector from the legacy X-CONNECTOR-AUTH header path to unified connector service where the check is strict; form serializers that downgrade to HeaderKey when optional fields are blank.","solutions":["Set the Iatapay connector account auth to SignatureKey with the correct field mapping: api_key = client_id, key1 = merchant_id, api_secret = client_secret.","Confirm all three values are non-empty strings in the update payload; a missing field can silently change the stored variant.","If you only have two credentials, obtain the Iatapay merchant_id from the provider — it is mandatory for this variant, not optional.","Prefer fixing the stored account over catching the error downstream: this error aborts header construction and the whole UCS call fails."],"exampleFix":"// before — connector account auth for Iatapay\n\"auth_type\": { \"auth_type\": \"BodyKey\", \"api_key\": \"client_id_here\", \"key1\": \"client_secret_here\" }\n\n// after\n\"auth_type\": {\n  \"auth_type\": \"SignatureKey\",\n  \"api_key\": \"<client_id>\",\n  \"key1\": \"<merchant_id>\",\n  \"api_secret\": \"<client_secret>\"\n}","handlingStrategy":"type-guard","validationCode":"// Before creating/updating an Iatapay connector account\nlet auth_ok = matches!(\n    &payload.auth_type,\n    ConnectorAuthType::SignatureKey { .. }\n);\nassert!(auth_ok, \"Iatapay requires SignatureKey: api_key=client_id, key1=merchant_id, api_secret=client_secret\");","typeGuard":"fn is_iatapay_compatible(auth: &ConnectorAuthType) -> bool {\n    matches!(auth, ConnectorAuthType::SignatureKey { .. })\n}","tryCatchPattern":"// Rust: match on the config error and degrade to a setup-required state instead of failing payments blindly\nlet header = match build_connector_config_header(Connector::Iatapay, &auth, metadata) {\n    Ok(h) => h,\n    Err(e) if e.current_context().message.contains(\"Iatapay requires\") => {\n        disable_connector_and_alert(\"iatapay\", \"auth_type must be SignatureKey\");\n        return Err(e);\n    }\n    Err(e) => return Err(e),\n};","preventionTips":["Treat Iatapay as a three-credential connector (client_id, merchant_id, client_secret) in onboarding forms; map them to api_key, key1, api_secret.","Reject account creation when a connector known to need SignatureKey submits fewer than three non-empty secrets.","Check the stored auth variant immediately after any connector-account migration to the unified connector service path.","Unit-test the exact field mapping (key1→merchant_id) so credential swaps are caught before live traffic."],"tags":["iatapay","connector-auth","signature-key","auth-type-mismatch","hyperswitch","connector-config"],"backgroundTag":"auth-type-mismatch","analyzedSha":"3093f22cc46b46415cca152ea0b234277b251ecd","analyzedAt":"2026-08-23T00:36:32.882Z","contentChangedAt":"2026-08-23T00:36:32.882Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}