Skip to content

Error using Invoices->update_status($invoiceId) method: Unexpected token 'n', "null" is not valid JSON #40

@JuanDeLeon

Description

@JuanDeLeon

When calling $facturapi->Invoices->update_status("xxxxxxxxxxxxxxx")
I get the following error:

{#1231 ▼
  +"message": "Unexpected token 'n', "null" is not valid JSON"
  +"status": 400
  +"ok": false
}

I noticed the issue is in Invoices.php class, in the method execute_JSON_put_request it is sending null as the $body parameter.

Image

This is in PHP 8.1, not sure if that's the problem.
Anyway, changing the null for an empty array [] seems to solve the issue.

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