I use the rest api to create and update invoices. It would be extremely useful for me to be able to get back the invoice node id or invoice number when a new invoice is created just like node_save does.

example node save:

$nid = node_save($node) ;

I'd like to do something like this with the rest api.

$nid = response->getId() ;

It doesn't look like this is supported right now. It should be fairly straight forward to do this since node_save already returns it. Please let me know if you need more info.

Thanks,

-Reuben

Comments

Anonymous’s picture

Got it!

$response->json() ; // returns the url that contains the invoice number (not node id) but this is good for me. Hopefully this helps someone.

-Reuben