{"record":{"id":"6b09ecd8e1eb8895","repo":"juspay/hyperswitch","slug":"merchante-requires-bodykey-auth-type","errorCode":null,"errorMessage":"Merchante requires BodyKey auth type","messagePattern":"Merchante requires BodyKey auth type","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/router/src/core/unified_connector_service/connector_config.rs","lineNumber":1454,"sourceCode":"                    api_key,\n                    key1,\n                    api_secret,\n                } => Ok(Self::Etisalat {\n                    user_name: api_key.clone(),\n                    password: key1.clone(),\n                    customer: api_secret.clone(),\n                }),\n                _ => Err(err(\"Etisalat requires SignatureKey auth type\")),\n            },\n            Connector::Merchante => match auth {\n                // api_key -> Merchante Profile Key (32-char secret),\n                // key1    -> Merchante Profile ID  (20-digit merchant id).\n                // Mirrors the hyperswitch-prism `ConnectorEnum::Merchante` arm.\n                ConnectorAuthType::BodyKey { api_key, key1 } => Ok(Self::Merchante {\n                    profile_key: api_key.clone(),\n                    profile_id: key1.clone(),\n                }),\n                _ => Err(err(\"Merchante requires BodyKey auth type\")),\n            },\n            Connector::Noon => match auth {\n                ConnectorAuthType::SignatureKey {\n                    api_key,\n                    key1,\n                    api_secret,\n                } => Ok(Self::Noon {\n                    api_key: api_key.clone(),\n                    business_identifier: key1.clone(),\n                    application_identifier: api_secret.clone(),\n                }),\n                _ => Err(err(\"Noon requires SignatureKey auth type\")),\n            },\n            Connector::Novalnet => match auth {\n                ConnectorAuthType::SignatureKey {\n                    api_key,\n                    key1,\n                    api_secret,","sourceCodeStart":1436,"sourceCodeEnd":1472,"githubUrl":"https://github.com/juspay/hyperswitch/blob/afd92843521ced2c6856b98ae4ea332e75102d88/crates/router/src/core/unified_connector_service/connector_config.rs#L1436-L1472","documentation":"Merchante authenticates with a profile key and profile ID carried in the request body, so only `ConnectorAuthType::BodyKey` is accepted (api_key -> 32-char profile key, key1 -> 20-digit profile ID). Any other auth type falls through to the catch-all arm and returns this error instead of building `Self::Merchante`.","triggerScenarios":"Configuring the Merchante connector with `SignatureKey`, `HeaderKey`, `CertificateKey`, or `NoKey` auth types, then executing any operation that resolves the Merchante connector config in `connector_config.rs`.","commonSituations":"Merchant mistakenly chooses a SignatureKey-based template (e.g. copying an Etisalat/Noon config); automation stores credentials as HeaderKey; profile ID entered into the api_key slot so the shape no longer matches.","solutions":["Re-save the Merchante credential as `ConnectorAuthType::BodyKey` with the 32-char profile key in `api_key` and the 20-digit profile ID in `key1`","Check the values are in the right fields (profile_key/profile_id mapping shown in the source comments)","Migrate any wrongly-shaped stored credentials for Merchante merchants","Retry a test payment after updating the connector config"],"exampleFix":"// before\nConnectorAuthType::HeaderKey { api_key: profile_key }\n// after\nConnectorAuthType::BodyKey {\n    api_key: merchante_profile_key,\n    key1: merchante_profile_id,\n}","handlingStrategy":"validation","validationCode":"fn is_merchante_auth(auth: &ConnectorAuthType) -> bool {\n    matches!(auth, ConnectorAuthType::BodyKey { .. })\n}\nif !is_merchante_auth(&auth) {\n    return Err(report!(ConfigError::InvalidConnectorAuth(\"Merchante requires BodyKey\")));\n}","typeGuard":"fn as_body_key(auth: &ConnectorAuthType) -> Option<(&String, &String)> {\n    match auth {\n        ConnectorAuthType::BodyKey { api_key, key1 } => Some((api_key, key1)),\n        _ => None,\n    }\n}","tryCatchPattern":"match build_connector_config(Connector::Merchante, &auth, metadata) {\n    Ok(cfg) => use_config(cfg),\n    Err(e) if e.current_context().to_string().contains(\"BodyKey\") => {\n        // re-collect Merchante profile_key/profile_id as BodyKey\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Check api_key is the 32-char profile key and key1 is the 20-digit profile ID before saving","Use the Merchante-specific onboarding template rather than copying SignatureKey connectors","Validate field lengths/types at credential entry time"],"tags":["rust","authentication","connector-config","merchante"],"backgroundTag":"unsupported-enum-value","analyzedSha":"afd92843521ced2c6856b98ae4ea332e75102d88","analyzedAt":"2026-09-18T01:18:02.947Z","contentChangedAt":"2026-09-18T01:18:02.947Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}