# Integrating hosted checkout page to react app

**URL:** <https://developer.squareup.com/forums/t/integrating-hosted-checkout-page-to-react-app/9073>\
**Category:** Questions\
**Tags:** checkout-api\
**Created:** [April 1, 2023, 11:44am UTC](https://developer.squareup.com/forums/t/integrating-hosted-checkout-page-to-react-app/9073 "2023-04-01T11:44:35Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![eveholiday](https://avatars.discourse-cdn.com/v4/letter/e/b19c9b/32.png) [@eveholiday](https://developer.squareup.com/forums/u/eveholiday)\
**Post date:** [April 1, 2023, 11:44am UTC](https://developer.squareup.com/forums/t/integrating-hosted-checkout-page-to-react-app/9073/1 "2023-04-01T11:44:36Z")

</div>

Hi there,

I’m trying to integrate Square hosted checkout page to my react app but I just don’t know where to start. There are a lot of code snippets out there but I just don’t know where to put the code ( clients side or backend or both). I’m using React as frontend and AWS Amplify as backend. Appreciate any help!

---

<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:** [April 1, 2023, 3:24pm UTC](https://developer.squareup.com/forums/t/integrating-hosted-checkout-page-to-react-app/9073/2 "2023-04-01T15:24:43Z")

</div>

Unfortunately, we don’t have a React wrapper for the Checkout API. We do have a supported partner [React Web Payments SDK](https://github.com/weareseeed/react-square-web-payments-sdk). As for where to put the code all the calls to the Checkout API will need to be server side code. You can configure all client side form fields to collect information to build the payment link and then submit it to your server to make the server side request. 🙂

---

<div class="post-metadata">

**Author:** ![eveholiday](https://avatars.discourse-cdn.com/v4/letter/e/b19c9b/32.png) [@eveholiday](https://developer.squareup.com/forums/u/eveholiday)\
**Post date:** [April 2, 2023, 11:05pm UTC](https://developer.squareup.com/forums/t/integrating-hosted-checkout-page-to-react-app/9073/3 "2023-04-02T23:05:10Z")

</div>

Hi Bryan,

Thank you so much for getting back to me! I I went through the React Web Payments SDK docs and managed to do the client side part (the PaymentForm), but I’m unable to call the createPayment method from Lambda function. I get an internet server error.  
attached my lambda function code.

Best,  
Atef

 ![Screenshot 2023-04-03 at 12.26.53 AM](https://global.discourse-cdn.com/square/original/2X/4/4073e6f06f38a853abdc8f6ea99d5f8de948cb22.png)

---

<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:** [April 3, 2023, 2:38pm UTC](https://developer.squareup.com/forums/t/integrating-hosted-checkout-page-to-react-app/9073/4 "2023-04-03T14:38:57Z")

</div>

What’s the error message your getting? 🙂

---

<div class="post-metadata">

**Author:** ![eveholiday](https://avatars.discourse-cdn.com/v4/letter/e/b19c9b/32.png) [@eveholiday](https://developer.squareup.com/forums/u/eveholiday)\
**Post date:** [April 3, 2023, 10:56pm UTC](https://developer.squareup.com/forums/t/integrating-hosted-checkout-page-to-react-app/9073/5 "2023-04-03T22:56:25Z")

</div>

I’m getting “internal server error”!

---

<div class="post-metadata">

**Author:** ![eveholiday](https://avatars.discourse-cdn.com/v4/letter/e/b19c9b/32.png) [@eveholiday](https://developer.squareup.com/forums/u/eveholiday)\
**Post date:** [April 3, 2023, 10:57pm UTC](https://developer.squareup.com/forums/t/integrating-hosted-checkout-page-to-react-app/9073/6 "2023-04-03T22:57:43Z")

</div>

could you please go through my code maybe I did something wrong.

---

<div class="post-metadata">

**Author:** ![spycedev](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@spycedev](https://developer.squareup.com/forums/u/spycedev)\
**Post date:** [April 3, 2023, 11:01pm UTC](https://developer.squareup.com/forums/t/integrating-hosted-checkout-page-to-react-app/9073/7 "2023-04-03T23:01:25Z")

</div>

Hello, just thought i’d chime in here.

> **[Introduction | react-square-web-payments-sdk](https://react-square-payments.weareseeed.com/docs)**
>
> ⚡️ A wrapper that will help you take payments using Square in no time.

That’s what i use, and seems to work quite well

---

<div class="post-metadata">

**Author:** ![eveholiday](https://avatars.discourse-cdn.com/v4/letter/e/b19c9b/32.png) [@eveholiday](https://developer.squareup.com/forums/u/eveholiday)\
**Post date:** [April 3, 2023, 11:13pm UTC](https://developer.squareup.com/forums/t/integrating-hosted-checkout-page-to-react-app/9073/8 "2023-04-03T23:13:54Z")

</div>

Hi, thanks so much!  
That’s exactly what I’m using and it works well on frontend side. My issue is that I don’t know how to call Create Payment API from an AWS lambda function. Any past experience with calling an API from Lambda?

---

<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:** [April 4, 2023, 12:08am UTC](https://developer.squareup.com/forums/t/integrating-hosted-checkout-page-to-react-app/9073/9 "2023-04-04T00:08:38Z")

</div>

We have a few [videos](https://www.youtube.com/watch?v=c3OoYiAjXoE) on this but it they’re for payments with our In-App Payments SDK. 🙂

---

<div class="post-metadata">

**Author:** ![eveholiday](https://avatars.discourse-cdn.com/v4/letter/e/b19c9b/32.png) [@eveholiday](https://developer.squareup.com/forums/u/eveholiday)\
**Post date:** [April 4, 2023, 1:22am UTC](https://developer.squareup.com/forums/t/integrating-hosted-checkout-page-to-react-app/9073/10 "2023-04-04T01:22:55Z")

</div>

Bryan, you are giving me short answers. These videos aren’t much related. Please give me full answer if you would to help me. Again, I’m running a Node application with React as frontend and Lambda function as a backend. I need help calling the Create Payment from the lambda function.

---

<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:** [April 4, 2023, 2:57pm UTC](https://developer.squareup.com/forums/t/integrating-hosted-checkout-page-to-react-app/9073/11 "2023-04-04T14:57:45Z")

</div>

Unfortunately we don’t have any Lambda backend examples. We do have a Node example however you may want to reach out to Amazon for more information on making server side request with Lambda. 🙂
