applyShippingAddressChange doing strange things

Hi,

I’m trying to update the shipping address details using the below function:

const result = await api.applyShippingAddressChange({
      type: 'updateShippingAddress',
      address: {
        countryCode:    countryCode,
        address1:       address1,
        address2:       address2,
        city:           city,
        provinceCode:   provinceCode,
        zip:            zip
      }
});

The data that is going in (this is random test data) is this:

{
  countryCode: 'AU',
  address1: '198 AUGUST ST',
  address2: 'testing',
  city: 'GEELONG EAST',
  provinceCode: 'VICTORIA',
  zip: '3227'
}

But I get the following errors testing each value individually:

AddressApiError: Enter a ZIP / postal code

Oddly, I can make the zip error go away by changing the field to postalCode but that is nowhere in the documentation that I can find. But then I get an error saying I didn’t set an address field:

errors: 
  0: 
    field: "address1"
    message: "Enter an address"

If I remove Zip completely I get a success message.

But in none of the cases above has the data actually updated in the checkout other than the city and state. The rest are unchanged.

I’ve also tried updating them one at a time.

In the checkout settings I’ve turned off address to see if it’s that but it’s not.

Anyone got any pointers to why this is failing? It’s the latest api library.

Thanks in advance.

Greg

I resolved this by upgrading my node instance to 18 and switching to the REACT framework. All started working after that.