No Billing Postal Code? No Problem!

How To Remove the Postal Code Field (Square Payment Form)

Heads up, we’ve moved! If you’d like to continue keeping up with the latest technical content from Square please visit us at our new home https://developer.squareup.com/blog

As Square’s eCommerce platform expands outside the United States and Canada, we’ve heard feedback from developers in other countries (e.g. Japan & Australia), where requesting billing postal codes is uncommon, that they’d like to remove the postal code field in their eCommerce Payment Form.

Good news! Effective today, to remove the postal code field, all you need to do is change one line of code.

When you load the eCommerce Payment Form — replace:

postalCode: {
elementId: 'sq-postal-code'
}

With the following:

postalCode: false

Once this is done, the payment form will load without the postal code field!

Warning: the postal code field is still required to process payment online for merchants based in the United States, Canada, and United Kingdom. Removing the field will result in these transactions being declined. With the following error message:

{
"errors": [
{
"category": "INVALID_REQUEST_ERROR",
"code": "INVALID_VALUE",
"detail": "Postal code is required for nonces used by merchants in `US`"
}
]
}

Additional Reading

If you are interested in learning more about how to style the payment form, you can read about it here.

Square Corner Blog

Buying and selling sound like simple things - and they should be. Somewhere along the way, they got complicated. At Square, we're working hard to make commerce easy for everyone.

Unlisted

Matan-Paul Shetrit

Written by

Product @Square

Square Corner Blog

Buying and selling sound like simple things - and they should be. Somewhere along the way, they got complicated. At Square, we're working hard to make commerce easy for everyone.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade