Hello Square Developer Support,
I’m developing a WordPress-based subscription service using Square’s Checkout API.
My goal is to create a unique Payment Link for each logged-in WordPress user, allow the customer to enter their card information on Square’s hosted checkout page, and then retrieve the resulting Subscription ID and Customer ID through the Square API.
I would like to do this without webhooks. An administrator will manually trigger the API lookup and approve the subscription.
My implementation
-
Create a subscription Payment Link using
CreatePaymentLink, with a monthly Subscription Plan Variation (500 JPY). -
Set a unique application UUID in
order.reference_id. -
Store the Payment Link ID and the returned
order_id. -
Complete the payment using the Checkout API Sandbox Testing Panel.
-
Call
SearchSubscriptionsand compare each subscription’sphases[].order_template_idwith the Payment Link’sorder_id.
Sandbox test results
-
CreatePaymentLinksucceeded. -
The Sandbox Testing Panel reported that the test payment was successful.
-
The panel reported that an order, payment, and customer were created.
-
The order state changed from
DRAFTtoOPEN. -
However, no new subscription appeared in the Sandbox Dashboard.
-
SearchSubscriptionsreturned three existing subscriptions, but none matched the Payment Link’s order template ID.
My questions
-
Does the Checkout API Sandbox Testing Panel actually create a Subscription when testing a Payment Link configured with
checkout_options.subscription_plan_id? Or does it only simulate a one-time payment? -
In Production, does completing a subscription Payment Link checkout create a Subscription that can be retrieved through
SearchSubscriptionsorRetrieveSubscription? -
Is comparing
Subscription.phases[].order_template_idwith the Payment Link’sorder_ida supported and reliable way to identify the resulting subscription? -
If not, what is the recommended API-based method to retrieve the Subscription ID and Customer ID associated with a specific Payment Link or its
order.reference_id, without using webhooks? -
Is there a supported way to test this complete subscription creation and lookup flow in Sandbox before implementing it in Production?
I want Square to handle all card information and recurring billing, while WordPress only stores the subscription identifiers and manages administrator approval.
Thank you for your guidance.