Order API return Country Codes as Country

Hello, since this month, i get wrong values from REST API calls to the Order endpoint.
The docs, for the billing_address object part of the Order object, states as follow:

  • country: The name of the country of the billing address.
  • country_code: The two-letter code (ISO 3166-1 format) for the country of the billing address.

instead what I get for the country field is the two-letter code as well instead of the full country name. And not for all orders but just for some. Here is an example:

    'billing_address' => 
    array (
      'first_name' => 'Gianfranco',
      'phone' => '+39ZZZZZZZZZ',
      'province' => 'MO',
      'country' => 'IT',  <-- **THIS SHOULD BE 'Italy' as in other orders.**
      'last_name' => 'MMM',
      'company' => NULL,
      'name' => 'Gianfranco MMM',
      'country_code' => 'IT',
      'province_code' => 'MO',
    ),

Why is that? I have run the app for more than 1 year and have never seen this behaviour before. It also happens with other countries.

Looking at the order details from the shop dashboard, I see that the billing address is correct, with the full country name. So, it is not a user compiling error.

Does someone know the reason for this behaviour? It looks like a bug to me.
Thank you!

1 Like

Hey @VisionLab,

Are you still seeing this behaviour in your order queries? I just tested here using different API versions and I’m seeing the full text for the country. "country": "Canada",