How to Create a Manually Applied "Buy One Get One" Discount Code?

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

  1. Is it currently possible to create a manually applied “Buy One Get One” discount that is triggered only with a discount code?
  2. If so, what is the correct structure for the CatalogPricingRule and CatalogProductSet to make it work with discount-codes?

Thank you very much for your help!

Best regards,
Murphy

: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

Create Bundled Discounts
Create Customer Group Discounts
Apply Square-Defined Discounts to Orders

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.

At this time a manually applied BOGO discount application isn’t currently available with or APIs. We’re constantly working to improve our features based on feedback like this, so I’ll be sure to share your request to the API product team. :slight_smile: