stripe-payments

Stripe API Webhook vs WebhookEndpoint


In Stripe API documentation you can find WebhookEndpoint, while in Stripe Docs in the chapter Interactive webhook endpoint builder it's used Webhook to verify the event:

try:
        event = stripe.Webhook.construct_event(
            payload, sig_header, endpoint_secret
        )
except stripe.error.SignatureVerificationError as e:
        print('⚠️  Webhook signature verification failed.' + str(e))
        return jsonify(success=False)

but Webhook is nowhere cited in API documentation.

Do you know where to find it, or if it belongs to an old API version?


Solution

  • The stripe.Webhook is just a class in the Python SDK. You can see it in the _webhook.py file. The two classes defined there contain convenience methods for handling webhook event verification.

    This namespace does not relate to any specific Stripe API or object.