Does the Checkout API Sandbox Testing Panel create subscriptions, and how can I link a Payment Link to its Subscription?

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

  1. Create a subscription Payment Link using CreatePaymentLink, with a monthly Subscription Plan Variation (500 JPY).

  2. Set a unique application UUID in order.reference_id.

  3. Store the Payment Link ID and the returned order_id.

  4. Complete the payment using the Checkout API Sandbox Testing Panel.

  5. Call SearchSubscriptions and compare each subscription’s phases[].order_template_id with the Payment Link’s order_id.

Sandbox test results

  • CreatePaymentLink succeeded.

  • 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 DRAFT to OPEN.

  • However, no new subscription appeared in the Sandbox Dashboard.

  • SearchSubscriptions returned three existing subscriptions, but none matched the Payment Link’s order template ID.

My questions

  1. 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?

  2. In Production, does completing a subscription Payment Link checkout create a Subscription that can be retrieved through SearchSubscriptions or RetrieveSubscription?

  3. Is comparing Subscription.phases[].order_template_id with the Payment Link’s order_id a supported and reliable way to identify the resulting subscription?

  4. 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?

  5. 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.

Hi @fumizoh , I see it’s your first time here, welcome to the forums!

So what you’ve run into here is (unfortunately) some of the current limitation of the Sandbox.

To awnser your questions:

  1. No it does not create a subscription. In Sandbox the testing panel only simulates the payment for the payment link’s order. This means the it creates an order, a payment, and a customer. But it does not create a subscription.
  2. Yes, production does create a retrievable subscription. It is retrievable with either SearchSubscriptions or RetrieveSubscription
  3. Yes this is reliable and a good approach.
  4. N/a, use the retrieved order_id as suggested in point 3.
  5. Unfortunately you can’t test the full flow end-to-end in sandbox. You can test each individual piece of the flow but not the full flow due to the limitations of sandbox.
    I would recommend actually going to production and testing with a very cheap checkout (500JPY) so you can see the full flow and confirm the subscription appears as expected. You can cancel it afterwards and refund the payment.

Hope that helps! Let me know if you have any other questions.