Add update client example to API docs

This commit is contained in:
Hillel Coren 2017-04-24 18:39:39 +03:00
parent 764310eefd
commit bc94d02e4a

View File

@ -73,7 +73,7 @@ Heres an example of creating a client. Note that email address is a property
.. code-block:: shell
curl -X POST ninja.dev/api/v1/clients -H "Content-Type:application/json"
-d '{"name":"Client","contact":{"email":"test@gmail.com"}}' -H "X-Ninja-Token: TOKEN"
-d '{"name":"Client","contact":{"email":"test@example.com"}}' -H "X-Ninja-Token: TOKEN"
You can also update a client by specifying a value for id. Next, heres an example of creating an invoice.
@ -85,6 +85,17 @@ You can also update a client by specifying a value for id. Next, heres
If the product_key is set and matches an existing record the product fields will be auto-populated. If the email field is set then well search for a matching client. If no matches are found a new client will be created.
Updating Data
"""""""""""""
.. NOTE:: When updating a client it's important to include the contact ids.
.. code-block:: shell
curl -X PUT ninja.dev/api/v1/clients/1 -H "Content-Type:application/json"
-d '{"name":"test", "contacts":[{"id": 1, "first_name": "test"}]}'
-H "X-Ninja-Token: TOKEN"
Options
^^^^^^^
- ``email_invoice``: Email the invoice to the client.