DISCOUNT_CODES_READ/WRITE OAuth scopes present, but /v2/discount-codes returns NOT_FOUND

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:

  1. an OAuth scope issue
  2. an application/partner entitlement
  3. 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.

Hi @twoflatlabs - access to the Discount Codes API is available through special request - I’ve started the process on our side and will follow up with more details via DM.

That’s great news, looking forward to hearing from you. Thanks so much!

Hi Square Developer team,

We’re developing a Square integration and would like to request access to the Discount Codes API, including DISCOUNT_CODES_READ and DISCOUNT_CODES_WRITE.

We’ve seen previous forum posts indicating that access to /v2/discount-codes may be available by special request.

Could someone from the Square team please assist with the process for requesting access for our application?

Happy to provide our application ID and further details about our use case privately.

Thanks.

Hi @pehughes - I’ve sent you a private message.