Hi Square Team,
I’m looking for guidance on how to create a manually applied “Buy One Get One Free” Discount Code using the Catalog API.
I understand that the Square Dashboard allows for the creation of automatically applied BOGO discounts, but in my case, I’d like the discount to be redeemed only when the customer enters a discount code at checkout.
I referred to your official documentation here:
Create Volume Discounts
and successfully created a CatalogPricingRule.
However, when I tried to use this pricing rule to create a Discount Code, I encountered the following error:
Invalid object: CatalogPricingRules with multiple CatalogProductSets are unsupported.
Here is a simplified version of the request I used to create the discount and pricing rule:
# Discount and Pricing Rule creation via /v2/catalog/batch-upsert
{
"idempotency_key": "bogo-20250804-0000004",
"batches": [
{
"objects": [
{
"id": "#BOGODiscount",
"type": "DISCOUNT",
"discount_data": {
"name": "\"BOGO Free 202508040004\"",
"discount_type": "FIXED_PERCENTAGE",
"percentage": "100",
"application_mode": "MANUALLY_APPLIED"
}
},
{
"id": "#AnyTwoBeers",
"type": "PRODUCT_SET",
"product_set_data": {
"product_ids_any": [
"YTRHDE7EIRVDKG4ECEOX33AK"
],
"quantity_exact": 2
}
},
{
"id": "#OneFreePizza",
"type": "PRODUCT_SET",
"product_set_data": {
"product_ids_any": [
"YTRHDE7EIRVDKG4ECEOX33AK"
],
"quantity_exact": 1
}
},
{
"id": "#MatchProductSet",
"type": "PRODUCT_SET",
"product_set_data": {
"product_ids_all": [
"#AnyTwoBeers",
"#OneFreePizza"
],
"quantity_exact": 1
}
},
{
"id": "#BOGOPricingRule",
"type": "PRICING_RULE",
"pricing_rule_data": {
"application_mode": "ATTACHED",
"max_applications_per_attachment": 1,
"discount_target_scope": "LINE_ITEM",
"discount_id": "#BOGODiscount",
"match_products_id": "#MatchProductSet",
"name": "BOGO 20250804000004",
"exclude_products_id": "#AnyTwoBeers"
}
}
]
}
]
}
And here’s the request I used to create the discount code:
# Discount Code creation via /v2/discount-codes
{
"discount_code": {
"code": "M082401",
"pricing_rule_id": "....",
"max_redemptions": 1
},
"idempotency_key": "discount-code-M00006-202508040002"
}
Could you please advise:
- Is it currently possible to create a manually applied “Buy One Get One” discount that is triggered only with a discount code?
- If so, what is the correct structure for the
CatalogPricingRuleandCatalogProductSetto make it work withdiscount-codes?
Thank you very much for your help!
Best regards,
Murphy
