juspay/hyperswitch · error · ApiErrorResponse

Iatapay requires SignatureKey auth type

Error message

Iatapay requires SignatureKey auth type

What it means

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.

Source

Thrown at crates/router/src/core/unified_connector_service/connector_config.rs:1383

                    api_secret,
                } => Ok(Self::Hyperpg {
                    username: api_key.clone(),
                    password: key1.clone(),
                    merchant_id: api_secret.clone(),
                }),
                _ => Err(err("Hyperpg requires SignatureKey auth type")),
            },
            Connector::Iatapay => match auth {
                ConnectorAuthType::SignatureKey {
                    api_key,
                    key1,
                    api_secret,
                } => Ok(Self::Iatapay {
                    client_id: api_key.clone(),
                    merchant_id: key1.clone(),
                    client_secret: api_secret.clone(),
                }),
                _ => Err(err("Iatapay requires SignatureKey auth type")),
            },
            Connector::Moneris => match auth {
                ConnectorAuthType::SignatureKey {
                    api_key,
                    key1,
                    api_secret,
                } => Ok(Self::Moneris {
                    client_secret: api_key.clone(),
                    client_id: key1.clone(),
                    merchant_id: api_secret.clone(),
                }),
                _ => Err(err("Moneris requires SignatureKey auth type")),
            },
            Connector::Noon => match auth {
                ConnectorAuthType::SignatureKey {
                    api_key,
                    key1,
                    api_secret,

View on GitHub (pinned to 3093f22cc4)

Solutions

  1. Set the Iatapay connector account auth to SignatureKey with the correct field mapping: api_key = client_id, key1 = merchant_id, api_secret = client_secret.
  2. Confirm all three values are non-empty strings in the update payload; a missing field can silently change the stored variant.
  3. If you only have two credentials, obtain the Iatapay merchant_id from the provider — it is mandatory for this variant, not optional.
  4. Prefer fixing the stored account over catching the error downstream: this error aborts header construction and the whole UCS call fails.

Example fix

// before — connector account auth for Iatapay
"auth_type": { "auth_type": "BodyKey", "api_key": "client_id_here", "key1": "client_secret_here" }

// after
"auth_type": {
  "auth_type": "SignatureKey",
  "api_key": "<client_id>",
  "key1": "<merchant_id>",
  "api_secret": "<client_secret>"
}
Defensive patterns

Strategy: type-guard

Validate before calling

// Before creating/updating an Iatapay connector account
let auth_ok = matches!(
    &payload.auth_type,
    ConnectorAuthType::SignatureKey { .. }
);
assert!(auth_ok, "Iatapay requires SignatureKey: api_key=client_id, key1=merchant_id, api_secret=client_secret");

Type guard

fn is_iatapay_compatible(auth: &ConnectorAuthType) -> bool {
    matches!(auth, ConnectorAuthType::SignatureKey { .. })
}

Try / catch

// Rust: match on the config error and degrade to a setup-required state instead of failing payments blindly
let header = match build_connector_config_header(Connector::Iatapay, &auth, metadata) {
    Ok(h) => h,
    Err(e) if e.current_context().message.contains("Iatapay requires") => {
        disable_connector_and_alert("iatapay", "auth_type must be SignatureKey");
        return Err(e);
    }
    Err(e) => return Err(e),
};

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of juspay/hyperswitch@3093f22cc4 (2026-08-23). Data as JSON: /api/errors/14a0eb94093e6db1. Report an issue: GitHub.