juspay/hyperswitch · error · ErrorResponse

WEBHOOK_ACCESS_TOKEN_ERROR

WEBHOOK_ACCESS_TOKEN_ERROR

Error message

Failed to obtain access token for webhook registration

What it means

Error "Failed to obtain access token for webhook registration" thrown in juspay/hyperswitch.

Source

Thrown at crates/router/src/core/merchant_connector_webhook_management.rs:44

use crate::{
    consts,
    core::{
        errors::{self, ConnectorErrorExt, RouterResponse, StorageErrorExt},
        payments::helpers,
        utils as core_utils,
    },
    routes::{metrics, SessionState},
    services::{
        self,
        api::{self as service_api},
    },
    types::{self, api, domain},
};

fn to_error_response<E: std::fmt::Display>(err: E) -> types::ErrorResponse {
    router_env::logger::error!(error=%err, "Webhook access token error");
    types::ErrorResponse {
        code: "WEBHOOK_ACCESS_TOKEN_ERROR".to_string(),
        message: "Failed to obtain access token for webhook registration".to_string(),
        status_code: 500,
        attempt_status: None,
        connector_transaction_id: None,
        connector_response_reference_id: None,
        reason: Some(err.to_string()),
        network_advice_code: None,
        network_decline_code: None,
        network_error_message: None,
        connector_metadata: None,
    }
}

async fn fetch_access_token_for_webhook(
    state: &SessionState,
    connector_data: &api::ConnectorData,
    router_data: &types::RouterData<
        api::ConnectorWebhookRegister,

View on GitHub (pinned to 705a321950)

Solutions

  1. Verify the connector credentials (client id/secret) used for webhook registration are valid and not expired
  2. Check network connectivity to the connector token endpoint and inspect the token error response

When it happens

Trigger: Thrown at crates/router/src/core/merchant_connector_webhook_management.rs:44 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of juspay/hyperswitch@705a321950 (2026-08-19). Data as JSON: /api/errors/dbd9ad96f8d2837e. Report an issue: GitHub.