Discount on subscriptions api

I’m running into an issue applying subscription discounts via the Square Subscriptions API. Here’s my full setup and the behavior I’m seeing:


Setup

  • Subscription has 2 phases.
    • Phase 1 uses Order Template A (with delivery fee, discount).
    • Phase 2 uses Order Template B (same delivery fee, no discount).
  • I created a “first-phase” discount in the Discounts API, then added its discount ID to Order Template A only.
  • I defined discount “rules” (activation date, usage limits, max discount amount), but those rules appear to be ignored:
    • The discount still applies even when “active_from” is set to a future date.
    • Setting a max-discount value on the discount object has no effect.
  • I am creating the subscription entirely via the Subscriptions API (providing card_id, future start_date, etc.), not via a hosted Checkout page or Payment Link.
  • All testing is done in Sandbox.
  • Subscription ID: 0bd082bb-3d72-45a4-9ec3-642aab25190e
  • Sandbox App ID: sandbox-sq0idb-VoRB78KTuh4w7ljdWjrYcw

Observed Behavior

  • The discount is applied successfully to Phase 1 (as expected), but its “rules” (start date, max value) are never enforced.
  • Phase 2 correctly shows no discount.
  • Changing the discount’s activation date or max amount in the Dashboard or via API has no impact on new subscriptions created via the API.

Questions

  1. When you attach a discount ID in an order template for a subscription created through the Subscriptions API, are discount rules (activation date, usage limits, max amount) supposed to be enforced?
  2. Or do those rules only apply when a customer redeems a discount code on Square’s hosted Checkout page or via a Payment Link?
  3. If rules are not enforced via the Subscriptions API, what is the recommended way to schedule a discount to start on a future date (or enforce a max-discount amount) for API-created subscriptions?
  4. Is there any difference in behavior when applying discounts to multi-phase subscriptions via multiple order templates?

Any pointers, workarounds, or links to the official Square documentation would be greatly appreciated!

:waving_hand: 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

Subscription Plan Checkout
Create Time-Based Discounts
Automatically Apply Discounts

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.

Hey @bTrustedComm! Happy to look into this. Do you mind pasting a snippet of your request where you’re setting your discount rules? I just want to make sure I’m looking at the same thing as you. Thanks!

        // Define the discount at the order level
        const orderLevelDiscounts = [
          {
            catalogObjectId: validatedDiscountDetails.id,
            scope: 'ORDER', // Or 'LINE_ITEM' based on Square setup
          },
        ];

        const discountedTemplateParams = {
          idempotencyKey: crypto.randomUUID(),
          order: {
            locationId: process.env.NEXT_SQUARE_LOCATION_ID as string,
            customerId: customerId,
            state: 'DRAFT',
            lineItems: baseLineItems,
            discounts: orderLevelDiscounts,
            fulfillments: [fulfillmentDetails],
          },
        };

Here ya go

Discount is being applied. But the discount rules are not getting enforced.

Oh, this also may be because your using sandbox. The sandbox experience for subscriptions with payment links is very incomplete. :slight_smile:

Nope, same thing happens with production.
Only discount rule that works is maximum_amount_money.
That’s the only thing I can see in the discount catalog object too in an api call.
I applied the discount to an order template in one of the subscription phases.
The payment bypassed all of the checks I set for the discount code except for the maximum amount.