I’m building a Square OAuth integration and am trying to determine whether the Discount Codes API is available to third-party applications.
I’ve discovered that the Square Dashboard is actively using the following endpoints:
POST /v2/discount-codes/search
POST /v2/discount-codes
GET /v2/discount-codes/{discount_code_id}/qr-codes
The Dashboard is able to create and retrieve discount codes through these endpoints. For example, creating a code produces an object like:
{
"discount_code": {
"id": "555555-67e3-4b66-b79a-1eb0fd9b4734",
"code": "INTERNAL",
"pricing_rule_id": "IQN84nfKJS94",
"max_redemptions": -1,
"reason": "COUPON_BUILDER",
"pricing_rule_version": 1787031257029,
"max_redemptions_per_customer": 1
}
}
The QR endpoint also returns a Square coupon QR identifier:
{
"qr_code": {
"id": "sqcw:8fhefh9ufh9urhf2",
"content_type": "IMAGE_PNG"
}
}
My OAuth access token has the following scopes:
DISCOUNT_CODES_READ
DISCOUNT_CODES_WRITE
However, when I make the same requests through the public Connect API using the OAuth access token, I receive:
{
"errors": [{
"category": "INVALID_REQUEST_ERROR",
"code": "NOT_FOUND",
"detail": "API endpoint for URL path `/v2/discount-codes` and HTTP method `CreateDiscountCode` is not found."
}]
}
I’ve tested multiple current and older Square API versions, and the result is the same.
Interestingly, the Square Dashboard’s authenticated session can successfully call the endpoint. I can also see the Dashboard making the request directly in the browser’s network inspector.
My question is:
Are DISCOUNT_CODES_READ and DISCOUNT_CODES_WRITE restricted to particular Square applications, programs, or merchant/app entitlements?
If so, what is required for a third-party OAuth application to obtain access to these endpoints?
I’m specifically trying to determine whether this is:
- an OAuth scope issue
- an application/partner entitlement
- a merchant eligibility restriction
Unblocking this would enable my merchant to have an omni-channel solution for discount codes and could increase in-store returns. I would appreciate any clarification from the Square developer/API team.