Error while adding client through sdk-php


I have install invoice ninja using sdk-php from this url(GitHub - invoiceninja/sdk-php: PHP wrapper for Invoice Ninja's REST API).

And then create one file to add client in invoice ninja. And then run that file on server but it show this error.

I have attach the SS Please refer to that


The PHP SDK is for the v4 app, it doesn’t yet support v5.

Thank for reply

but i have two questions

  1. do you have php-sdk for v5
  2. do we have swagger for v5
  1. We have a Dart SDK but not a PHP one (yet)
  1. Build, Collaborate & Integrate APIs | SwaggerHub


Thank you for your reply

Currently I’m testing in postman to create client but in that the same error is showing
I’m attaching SS of Postman please check

I have attach postman header SS and body SS

Body SS

Contacts should be an array of objects but I don’t think it explains the error.

@david do you have any thoughts?

couple of things,

  1. don’t include clients on the clients routes
  2. contacts is an array
  3. your route doesn’t include the prefix api/v1 - full route look like /api/v1/clients

Here aer some resources

@david the url is contains /api/v1/clients are we missing anything?

and 1st point we don’t understand.

I’d suggest testing with curl first using the examples in the docs i sent.

@david I have created simple curl example for creating client in invoice ninja as you suggest to look in docs.

But the same error “{“message”:“Method not supported for this route”}” is displaying

Please suggest…

I wonder if this is due to you having the app in a subdirectory…

Means i have to remove app from invoiceninja folder

or install on a subdomain.