Skip to content

JSON ERROR: The decoded property name is invalid #256

@robmyers82

Description

@robmyers82

We are receiving a 'JSON ERROR: The decoded property name is invalid' error message when trying to retrieve orders. We discovered why this is caused: there is a plugin installed in the store's WC that is adding the Unicode NULL character (\u0000) to a metadata property name. This issue can be resolved by stripping out any instances of the null character in the response body before decoding JSON at https://github.com/woocommerce/wc-api-php/blob/master/src/WooCommerce/HttpClient/HttpClient.php#L372:

$body = str_replace('\u0000', '', $body);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions