Saturday, April 13, 2019

Web Services > Unable to Add/Update Address on a Customer Record due to Error: COUNTRY_STATE_MISMATCH

When performing Add/Update operation via WS on an Entity record, if incorrect value/short name for state is provided then it throws a country and state/province are mismatched error. Please refer to the sample SOAP below :

platformMsgs:update
         platformMsgs:record xsi:type="s0:Customer" internalId="1010"
            s0:addressbookList
               s0:addressbook>
                  s0:defaultShipping true s0:defaultShipping
                  s0:addressee Randall test s0:addressee
                  s0:addr11 Blackthorn crescent s0:addr1
                  s0:city Bacup s0:city
                  s0:zip 0L13 s0:zip
                  s0:country _unitedKingdomGB s0:country
                  s0:stateLancs.s0:state  // Make sure of the State Name
               s0:addressbook
            s0:addressbookList
         platformMsgs:record
      platformMsgs:update

On the example above, using "Lancashire" instead of "Lancs." will throw the error : COUNTRY_STATE_MISMATCH

To get the short names along with all state values please perform a "getAll" operation, refer to the sample SOAP below :

soapenv:Header
   soapenv:Body
      platformMsgs:getAll
         platformMsgs:record recordType="state" 
      platformMsgs:getAll
   soapenv:Body 

No comments:

Post a Comment