# Production token works in API Explorer but gets 401 from AWS Amplify

**URL:** <https://developer.squareup.com/forums/t/production-token-works-in-api-explorer-but-gets-401-from-aws-amplify/27885>\
**Category:** Questions\
**Tags:** payments-api, checkout-api\
**Created:** [September 18, 2026, 11:29am UTC](https://developer.squareup.com/forums/t/production-token-works-in-api-explorer-but-gets-401-from-aws-amplify/27885 "2026-09-18T11:29:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richardmenard](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@Richardmenard](https://developer.squareup.com/forums/u/Richardmenard)\
**Post date:** [September 18, 2026, 11:29am UTC](https://developer.squareup.com/forums/t/production-token-works-in-api-explorer-but-gets-401-from-aws-amplify/27885/1 "2026-09-18T11:29:24Z")

</div>

Our Square Production access token works in Square API Explorer, including:

- `GET /v2/locations`

- `POST /v2/online-checkout/payment-links`

But the same token returns `401 UNAUTHORIZED` from our AWS Amplify server in `us-east-2`.

We confirmed the live server reads the current token from AWS Parameter Store. Its SHA-256 token fingerprint is `79d4b8f8503e`, which matches the fingerprint of the current Production token. The server calls the Production endpoint:

`https://connect.squareup.com/v2/locations`

and receives:

`UNAUTHORIZED (HTTP 401): This request could not be authorized.`

The same happens when our app tries to create a payment link.

Square application ID: `sq0idp-tdlYm8ePWVWFWuCB1h6U-g`  
Location ID: `LJ3WVA30ZJ49G`  
Approximate failing time: September 18, 2026, around 7:12 AM America/New\_York.

Can Square please check why requests from our Amplify-hosted server are rejected while Square API Explorer accepts the matching Production token?

I have not included the access token itself for security.

---

<div class="post-metadata">

**Author:** ![zacstlouis](https://avatars.discourse-cdn.com/v4/letter/z/b5a626/32.png) [@zacstlouis](https://developer.squareup.com/forums/u/zacstlouis)\
**Post date:** [September 18, 2026, 2:52pm UTC](https://developer.squareup.com/forums/t/production-token-works-in-api-explorer-but-gets-401-from-aws-amplify/27885/3 "2026-09-18T14:52:04Z")

</div>

Something on your end is stripping or never adding the `Authorization: Bearer XXXXX` header. Our logs show a bunch of 401s with errors pointing to no auth header.

---

<div class="post-metadata">

**Author:** ![Richardmenard](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@Richardmenard](https://developer.squareup.com/forums/u/Richardmenard)\
**Post date:** [September 18, 2026, 3:18pm UTC](https://developer.squareup.com/forums/t/production-token-works-in-api-explorer-but-gets-401-from-aws-amplify/27885/5 "2026-09-18T15:18:57Z")

</div>

Our deployed AWS production server sends these headers to Square:

For `GET ``https://connect.squareup.com/v2/locations`:

```auto
Authorization: Bearer [production token redacted]
Square-Version: 2026-09-16

```

For `POST ``https://connect.squareup.com/v2/online-checkout/payment-links`:

```auto
Authorization: Bearer [production token redacted]
Square-Version: 2026-09-16
Content-Type: application/json

```

The server sends these through Node’s direct HTTPS client. The production token is trimmed before use, read at runtime from AWS Parameter Store, and its safe fingerprint matches the token that succeeds in API Explorer.

Can you confirm which of these headers Square receives for the requests around 11:14 AM Eastern on September 18, and provide the request ID or timestamp for each?

---

<div class="post-metadata">

**Author:** ![Richardmenard](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@Richardmenard](https://developer.squareup.com/forums/u/Richardmenard)\
**Post date:** [September 18, 2026, 3:19pm UTC](https://developer.squareup.com/forums/t/production-token-works-in-api-explorer-but-gets-401-from-aws-amplify/27885/6 "2026-09-18T15:19:40Z")

</div>

```auto
Authorization: Bearer [production token redacted]
Square-Version: 2026-09-16

Authorization: Bearer [production token redacted]
Square-Version: 2026-09-16
Content-Type: application/json

```

---

<div class="post-metadata">

**Author:** ![zacstlouis](https://avatars.discourse-cdn.com/v4/letter/z/b5a626/32.png) [@zacstlouis](https://developer.squareup.com/forums/u/zacstlouis)\
**Post date:** [September 18, 2026, 4:52pm UTC](https://developer.squareup.com/forums/t/production-token-works-in-api-explorer-but-gets-401-from-aws-amplify/27885/7 "2026-09-18T16:52:45Z")

</div>

I verified that your production endpoint and request shape are correct: production requests should go to `https://connect.squareup.com/v2` and include the production token as `Authorization: Bearer {access_token}`.

Our internal telemetry for the reported time window shows authorization-layer 401 events for `GET /v2/locations` and `POST /v2/online-checkout/payment-links` with the messages correlated to missing credential headers for an authenticated route

However, those entries do not include your application ID, token fingerprint, or a confirmed customer-facing Square request ID. They are also high-volume route-level events, so I cannot definitively attribute them to your requests.

I checked your application’s API Logs in the application dashboard, and cannot see any requests made there so I am unable to tie a specific request to your application directly.

Could you please reproduce the issue **once** from the production server and capture the complete sanitized response (no access token) including:

- exact UTC timestamp, including milliseconds
- HTTP method, path, and destination hostname
- HTTP status
- full response headers and body
- **especially the `x-square-request-id` response header, if present**
- a locally generated correlation ID
- the token fingerprint only (never the token itself)

If `x-square-request-id` is not returned, please provide the complete response headers and exact timestamp anyway. With that information, we can correlate the specific request and determine whether the `Authorization` header was lost, altered, or not recognized before Square’s application-level logging.

---

<div class="post-metadata">

**Author:** ![Richardmenard](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@Richardmenard](https://developer.squareup.com/forums/u/Richardmenard)\
**Post date:** [September 18, 2026, 6:51pm UTC](https://developer.squareup.com/forums/t/production-token-works-in-api-explorer-but-gets-401-from-aws-amplify/27885/8 "2026-09-18T18:51:06Z")

</div>

Resolved — thank you for the guidance.

The authorization problem was resolved after correcting the production endpoint and redeploying. The remaining 404 was caused by our app using outdated subscription-plan variation IDs. We created fixed-price production variations, updated the deployed configuration, and Square Checkout now opens successfully.

No further investigation is needed on this case.
