Python Django Checkout API

Hello,

I am new to Square Dev and would like to include the Square Checkout API QuickPay on my Django (python) web site. I have found the python code for the API but there is something missing. Is there a Square library / module I need to install to use the API? Any advice in incorporating this into a Django view? I will eventually need a webhook down the road to confirm payment and update my database in real time.

Thanks

:wave: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Set up SDK for a Python Project
Using the Square Python SDK
Payment API: Process Online and In-Person Payments

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

Yes, to use the Square Checkout API with Python, you need to install the Square Python SDK. You can install it using pip, which is a package manager for Python. Once installed, you can import the SDK into your Django views and use it to interact with the Checkout API.

For real-time updates, you can indeed use webhooks. Square provides webhook events that you can listen to. When a payment is completed, Square sends a webhook event to your specified endpoint, and you can then update your database accordingly.

Remember to set your Square credentials in your environment variables for security purposes. This helps avoid the use of hardcoded credentials in the code.

Please note that the Square Python SDK supports Python version 3.7 and later.

This answer was reviewed by @Bryan-Square.

Thank you Square-Dev-AI - (Bryan) I will install the SDK and load the libraries. This was not clear in the Checkout API documentation.