mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Add update client example to API docs
This commit is contained in:
parent
764310eefd
commit
bc94d02e4a
13
docs/api.rst
13
docs/api.rst
@ -73,7 +73,7 @@ Here’s 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, here’s an example of creating an invoice.
|
||||
|
||||
@ -85,6 +85,17 @@ You can also update a client by specifying a value for ‘id’. Next, here’s
|
||||
|
||||
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 we’ll 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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user