Square Webhook doesn't give confirmation if the payment is done or not to Python-django

Hey folks, I'm encountering a critical issue where my Django backend is unable to receive confirmation from Square about whether a payment has been completed.

 

Here are the environment details for reference:
  • Python: 3.13.2
  • Django: 5.1.6
  • Square SDK: 43.0.0.20250618
    Problem Summary:
    The core flow of the payment process is as follows:
    • The user creates an order via the CreateSquareOrder method.
    • This successfully generates a Square-hosted checkout page where the user completes the payment.
    • The payment is processed correctly—I can confirm the funds are reaching my Square account.
      However, the issue arises after payment is completed:
      • The webhook I’ve configured (https://api.betakplus.com/api/wallet/webhooks/square/
        is supposed to be triggered automatically by Square to confirm the payment.
      • Unfortunately, this webhook is not being triggered properly. I’ve checked the server logs, and I consistently receive a 401 Unauthorized response from Square's webhook call attempts.
      • Because the webhook is failing, the subsequent logic in my Django app—specifically, the VerifySquareOrder method—is not executed, meaning critical application records are never created.
        Additional Information:
        Below is the backend code I’m currently using to handle CreateSquareOrder, SquareWebhookView and VerifySquareOrder requests. I’ve followed the latest version guidelines and best practices as per the Square documentation:
         
        Click here to see full code that i am using in backend

        What I Need:
        • Can you please verify why Square is returning a 401 error for the webhook URL?
        • Is there any additional authentication or header setup required that might be missing?
        • I need to resolve this urgently, as this issue is blocking the payment verification and data sync process for our users.
          I’d appreciate your immediate assistance, as this issue is affecting users and blocking payment verification in production.
          Thank you
298 Views
Message 1 of 2
Report
1 Solution
Admin

Solution

Hey @BS111, it looks like you are currently using Square API. I recommend reaching out directly to our Developer team here, who can help troubleshoot with you and resolve this more quickly. 

Tra | she/her
Community Program Manager, Square

View Solution >

229 Views
Message 2 of 2
Report
1 REPLY 1
Admin

Solution

Hey @BS111, it looks like you are currently using Square API. I recommend reaching out directly to our Developer team here, who can help troubleshoot with you and resolve this more quickly. 

Tra | she/her
Community Program Manager, Square
230 Views
Message 2 of 2
Report