There’s a link provided at the bottom of a subscription confirmation email that allows the user to manage their subscription. Until we get a full account management interface built out in our app, I’d like to have this link available to all of our customers in their account settings. I noticed a “buyer_management_token” is passed to this url, but i don’t see it returned in the subscription webhook (only a “buyer_self_management_token, which doesn’t work”). I couldn’t find anything in the docs either. Can I fetch this token from one of the API’s? Or is there another way to get this link?
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:
https://developer.squareup.com/docs/app-marketplace/requirements/subscriptions-api
Additional Documentation
Manage Checkout
Receive Seller Authorization and Manage Seller OAuth Tokens
Get Developer Credentials
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.
The “buyer_management_token” is not directly accessible via Square’s APIs. The “buyer_self_management_token” you’re seeing in the webhook payload is used to generate a URL that allows the buyer to manage their subscription. However, this token is only valid for a single use and expires after 24 hours.
Currently, there isn’t a way to fetch a reusable management token or link for a customer’s subscription through the API. The management link in the subscription confirmation email is generated by Square and isn’t exposed for developers to fetch or reuse.
For your use case, you might consider implementing your own system for managing subscriptions within your application until you have a full account management interface built out.
This answer was reviewed by @Bryan-Square.
