x

How to pre-populate a Square zip code field?

I'm working with a Square API form where I have a zip code field  <div id="sq-postal-code"></div>.

 

I know how to get the zip code from an existing client in Square, but I don't know how to pre-populate this field with a value. The field is inside an iframe loaded from squareup.com so it's kind of difficult to just send some value to this field with jQuery or any other way.

 

What can I do to pre-populate this field?

 

Thanks.

677 Views
Message 1 of 3
Report
2 REPLIES 2
Alumni

Reaching out to our API Team to pick their brains. We'll circle back once we get a response.

 

Thanks for your patience! 

Justin
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
602 Views
Message 2 of 3
Report
Alumni

Back with a word from the API Team: The payment form has a setPostalCode function that will accomplish what you're looking to do. Here's a resource - https://developer.squareup.com/docs/api/paymentform#setpostalcode

 

@luenib1

Justin
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
587 Views
Message 3 of 3
Report