# Javascript "Square" is not defined in new Payment API sample

**URL:** <https://developer.squareup.com/forums/t/javascript-square-is-not-defined-in-new-payment-api-sample/7524>\
**Category:** Questions\
**Created:** [November 10, 2022, 10:44pm UTC](https://developer.squareup.com/forums/t/javascript-square-is-not-defined-in-new-payment-api-sample/7524 "2022-11-10T22:44:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SeanD](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@SeanD](https://developer.squareup.com/forums/u/SeanD)\
**Post date:** [November 10, 2022, 10:44pm UTC](https://developer.squareup.com/forums/t/javascript-square-is-not-defined-in-new-payment-api-sample/7524/1 "2022-11-10T22:44:47Z")

</div>

I am trying the EXACT code from the “Web Payments SDK Overview” page’s video. I did change the v0 to v1 in the and I am trying the production environment.  
\< s c r i p t href=“[https://web.squarecdn.com/v1/square.js](https://web.squarecdn.com/v1/square.js)”\>\</s c r i p t\>

Then script tag …  
(async () =\> {  
console.log(“first async…”)  
const payments = Square.payments(  
'My App ID,  
'My token  
);  
[snip]

On that const payment = line I get:  
Uncaught (in promise) ReferenceError: Square is not defined

Can anyone just send me a link to a working HTML page that displays the CC form?

Help. They turned off the old payment API with no notification to me or my customer.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [November 11, 2022, 12:34am UTC](https://developer.squareup.com/forums/t/javascript-square-is-not-defined-in-new-payment-api-sample/7524/2 "2022-11-11T00:34:32Z")

</div>

Yeah, here is the link to our [Quickstart](https://github.com/square/web-payments-quickstart) and other [examples of the Web Payments SDK](https://github.com/square/connect-api-examples/tree/master/connect-examples/v2). 🙂
