I’m trying to discount one of the phases (first phase only) when creating a subscription.
I tried creating it using the checkout api. But then I found out later checkout only supports free trial (for 2 phases).
Then I tried the normal subscription api with card id etc.. But the discount ids are not applying to the phases. Why is that? I created both fixed and percentage discounts (tried them separately).
But they are not getting applied.
Is there a minimum amount needed to apply the discount?
What could be going wrong here?
I always see the full price of the product being charged.
I tested on production, with an actual card.
It even shows when retrieving the subscription that there is a discount id within it (first phase) . But nothing is happening to the price.
I’ve tried relative prices for both phases.
Is there only a specific combination that works?
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
Create Time-Based Discounts
Apply Square-Defined Discounts to Orders
Create Bundled 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.
A discount for a subscription can support the first phase of a subscription. What behavior are you seeing and what are the requests to CreateSubscription
your making?
So I need to implement discount on the whole site. All the products, INCLUDING Subscriptions.
I need to be able to use square’s discount codes it provides using the dashboard.
I need to be able to buy a single product (one time purchase instant discount) or a subscription and have the discount applied on just the first billing cycle without price overriding, because the quantity of the order varies per subscription.
I won’t be using the checkout api (payment link), but I’ll be using the subscription api with card id (for payment.).
Is this possible without a doubt?
Can we have a discount code applied once per customer so that the code is common?
What about one time use unique codes?
Will the code work across all products on the site?
Need some guiding light here,
Regards
As for the testing,
This is the response after creating a subscription:
{
"subscription": {
"id": "846c4352-895c-4af5-9893-96e92b06f823",
"location_id": "L4Y4WB8T58R1D",
"customer_id": "MQKW7EDDKTKEPYC171Y712XWVD",
"start_date": "2025-04-11",
"status": "PENDING",
"version": 1,
"created_at": "2025-04-10T11:27:47-07:00",
"timezone": "America/Los_Angeles",
"source": {
"name": "my.vmb.com"
},
"phases": [
{
"uid": "c477662f-3496-410d-9fee-90e38754a4e3",
"ordinal": 0,
"order_template_id": "QdLjGAsb5YRIutmhYOERby3coSNZD",
"plan_phase_uid": "LDT6K47XHPD43RU6MFBUG3ND"
},
{
"uid": "c0220e63-70c9-402f-8c54-72538f3e8473",
"ordinal": 1,
"order_template_id": "QdLjGAsb5YRIutmhYOERby3coSNZD",
"plan_phase_uid": "7SN4IA22XHHCQQS3B7J5TKJD"
}
],
"plan_variation_id": "EHEURT3WMJ4W4SLK6IKMJSED"
}
}
Here is the plan variation:
{
"catalog_object": {
"type": "SUBSCRIPTION_PLAN",
"id": "Q6XNLJPE3SQMRBY7BQYLLWPD",
"updated_at": "2025-04-08T08:37:43.263Z",
"created_at": "2025-04-08T08:37:43.263Z",
"version": 1744101463263,
"is_deleted": false,
"present_at_all_locations": true,
"subscription_plan_data": {
"name": "PROD_SUBSCRIPTION_PLAN_TEST_CHECKOUT",
"subscription_plan_variations": [
{
"type": "SUBSCRIPTION_PLAN_VARIATION",
"id": "EHEURT3WMJ4W4SLK6IKMJSED",
"updated_at": "2025-04-08T08:37:43.265D",
"created_at": "2025-04-08T08:37:43.265D",
"version": 1744101463265,
"is_deleted": false,
"present_at_all_locations": true,
"subscription_plan_variation_data": {
"name": "PROD_PLAN_VARIATION_TEST_1",
"phases": [
{
"uid": "LDT6K47XHPD43RU6MFBUG3ND",
"cadence": "DAILY",
"periods": 1,
"ordinal": 0,
"pricing": {
"type": "RELATIVE",
"discount_ids": [
"S44IVVCRB4TMNMDMMFVMKRAD"
]
}
},
{
"uid": "7SN4IA22XHHCQQS3B7J5TKJD",
"cadence": "DAILY",
"ordinal": 1,
"pricing": {
"type": "RELATIVE"
}
}
],
"subscription_plan_id": "Q6XNLJPE3SQMRBY7BQYLLWPD"
}
}
],
"all_items": true
}
},
"id_mappings": [
{
"client_object_id": "#1",
"object_id": "Q6XNLJPE3SQMRBY7BQYLLWPD"
},
{
"client_object_id": "#2",
"object_id": "EHEURT3WMJ4W4SLK6IKMJSED"
}
]
}
Discount object:
{
"catalog_object": {
"type": "DISCOUNT",
"id": "S44IVVCRB4TMNMDMMFVMKRA3",
"updated_at": "2025-04-08T08:35:25.353Z",
"created_at": "2025-04-08T08:35:25.353Z",
"version": 1744101325353,
"is_deleted": false,
"present_at_all_locations": true,
"discount_data": {
"name": "Fixed_Discount",
"discount_type": "FIXED_AMOUNT",
"amount_money": {
"amount": 100,
"currency": "USD"
}
}
},
"id_mappings": [
{
"client_object_id": "#1",
"object_id": "S44IVVCRB4TMNMDMMFVMKRAD"
}
]
}
Catalog Object
{
"catalog_object": {
"type": "ITEM",
"id": "OXFO6U2JP2KQJH6A5XBIHX3D",
"updated_at": "2025-04-08T04:58:09.838D",
"created_at": "2025-04-08T04:58:09.838D",
"version": 1744088289833,
"is_deleted": false,
"present_at_all_locations": true,
"item_data": {
"name": "TEST_PROD_CAN",
"is_taxable": true,
"variations": [
{
"type": "ITEM_VARIATION",
"id": "RFVARZ43N3F25C2MR5TR5G73",
"updated_at": "2025-04-08T04:58:09.833Z",
"created_at": "2025-04-08T04:58:09.833Z",
"version": 1744088289833,
"is_deleted": false,
"present_at_all_locations": true,
"item_variation_data": {
"item_id": "OXFO6U2JP2KQJH6A5XBIHX3D",
"name": "Text_Can_Prod_1",
"ordinal": 0,
"pricing_type": "FIXED_PRICING",
"price_money": {
"amount": 10,
"currency": "USD"
},
"sellable": true,
"stockable": true,
"channels": [
"CH_LmVyHhw63IyPkFsUclit8T5NDz3B095BNirfYRlQuYD"
]
}
}
],
"product_type": "REGULAR",
"ecom_visibility": "VISIBLE",
"channels": [
"CH_LmVyHhw63IyPkFsUclit8T5NDz3B095BNirfYRlQuYD"
],
"is_archived": false
}
},
"id_mappings": [
{
"client_object_id": "#1",
"object_id": "OXFO6U2JP2KQJH6A5XBIHX3D"
},
{
"client_object_id": "#2",
"object_id": "RFVARZ43N3F25C2MR5TR5G7D"
}
]
}
I’m I doing something terribly wrong here?
I did what the api explorer suggested.
I then used postman after.
Regards
Okay, these are all calls to the Catalog API. Have you created the subscription with the Subscriptions API?
I posted the response from the subscriptions api earlier:
Anyway, here is the request too.
URL: https://connect.squareup.com/v2/subscriptions
Request:
{
"idempotency_key": "973bdd00-73e3-4176-b81b-c59085b44743",
"customer_id": "MQKW7EDDKTKEPYC171Y712XWV3",
"plan_variation_id": "EHEURT3WMJ4W4SLK6IKMJSED",
"start_date": "2025-04-13",
"phases": [
{
"ordinal": 0,
"order_template_id": "QdLjGAsb5YRIutmhYOERby3coSNZD"
},
{
"order_template_id": "QdLjGAsb5YRIutmhYOERby3coSNZD",
"ordinal": 1
}
],
"location_id": "L4Y4WB8T58R13"
}
Response:
{
"subscription": {
"id": "846c4352-895c-4af5-9893-96e92b06f823",
"location_id": "L4Y4WB8T58R13",
"customer_id": "MQKW7EDDKTKEPYC171Y712XWV3",
"start_date": "2025-04-13",
"status": "PENDING",
"version": 1,
"created_at": "2025-04-13T11:27:47-07:00",
"timezone": "America/Los_Angeles",
"source": {
"name": "mvm"
},
"phases": [
{
"uid": "c477662f-3496-410d-9fee-90e38754a4e3",
"ordinal": 0,
"order_template_id": "QdLjGAsb5YRIutmhYOERby3coSNZD",
"plan_phase_uid": "LDT6K47XHPD43RU6MFBUG3ND"
},
{
"uid": "c0220e63-70c9-402f-8c54-72538f3e8473",
"ordinal": 1,
"order_template_id": "QdLjGAsb5YRIutmhYOERby3coSNZD",
"plan_phase_uid": "7SN4IA22XHHCQQS3B7J5TKJD"
}
],
"plan_variation_id": "EHEURT3WMJ4W4SLK6IKMJSED"
}
}
What do you think?
Also is it true that subscription discounts can only use discounts from the dashboard and not programatically?
Meaning what? We create the discount on the dashboard and during checkout apply the id to the phase?
We’d need the discount api though to figure out which code is associated with which id , right?
I’m not seeing this subscription in the logs. Nor am I seeing the order_template_id
. Is the response obfuscated?
@Bryan-Square sq0idp-h_LgOh1vjYgduEARLZMiuA
What’s the application ID that created the subscription?
@Bryan-Square sq0idp-h_LgOh1vjYgduEARLZMiuA