Square API Question

Hi, I’m developing a website similar to Patreon.com where each user will have their own subscription and have their own subscriber base via in digital subscriptions. I’m using Square for subscriptions and payments. I have several problems.

  1. how to generate payment link with subscription and redirect to our website after complete?

2.do they have webhook for subscription succeed or failed?

  1. how can I know which webhook I received, because I cannot add custom data on my payments, so that I can get it with webhook and know to which user the payment belongs ?

Please help me if you can with solutions to these problems.

Thank you so much

Hi @Igor9805,

Square’s Subscriptions API currently creates an invoice that either charges the card on file or will send an invoice via email. Unfortunately a payment link and a configurable redirect isn’t currently available with the Subscriptions API.

Also in order to monitor if a subscription payment succeeded or failed you would subscribe to Invoices webhook events. With the invoice.payment_made event you get the order_id that you can use to call the Orders API to get the order associated to the webhook.