REST API for StartupCRM : Available commands documentation & examples
Introduction
The Startup CRM API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. A token is bound to a whole Startup CRM installation. To interact with the API of another Startup CRM's installation, you have to create a new token inside this installation.
Create your API token
Step 1) Sign in into Startup's CRM backend as an admin, go to API → API Management, and create a new token. Make sure to copy the token and that you fill all necessary information.
Usage of the API
Available commands of the API are described below, along with their responses.
For this example, we will use a dummy token and a random command.
Let’s say your new token is
jEheVytlAoFl7F8MqUQ7jAo2hOXASztXjEheVytlAoFl7F8MqUQ7jAo2hOXASztXjEheVytlAoFl7F8MqUQ7jAo2hOXASztX and that you need to list all available customers of the Startup CRM's installation, using the API, through a cURL request.
Command Request
curl -H "authtoken: jEheVytlAoFl7F8MqUQ7jAo2hOXASztXjEheVytlAoFl7F8MqUQ7jAo2hOXASztXjEheVytlAoFl7F8MqUQ7jAo2hOXASztX" https://mysite.com/api/customers
Response of command request
[
{
"stripe_id" : null,
"active" : "1",
"vat" : "1234567890",
"address" : "Test Address",
"billing_country" : "0",
"phonenumber" : "1234567890",
"registration_confirmed" : "1",
"longitude" : null,
"billing_city" : "",
"state" : "Test State",
"shipping_zip" : "",
"billing_zip" : "",
"city" : "Test City",
"shipping_country" : "0",
"billing_street" : "",
"datecreated" : "2019-11-29 12:34:56",
"company" : "Jk Technologies",
"shipping_street" : "",
"zip" : "123456",
"billing_state" : "",
"leadid" : null,
"addedfrom" : "8",
"userid" : "3",
"default_language" : "english",
"shipping_state" : "",
"show_primary_contact" : "0",
"country" : "102",
"default_currency" : "3",
"shipping_city" : "",
"latitude" : null,
"website" : "https://jkdot.com"
},
{
"website" : "https://www.test.com",
"latitude" : null,
"default_currency" : "0",
"shipping_city" : "London",
"country" : "235",
"show_primary_contact" : "0",
"shipping_state" : "Greater London",
"default_language" : "",
"addedfrom" : "1",
"userid" : "1",
"leadid" : null,
"billing_state" : "Greater London",
"zip" : "WC1 ASW",
"shipping_street" : "123 Road Street",
"company" : "Sample Company LTD",
"datecreated" : "2019-04-02 13:38:28",
"billing_street" : "123 Road Street",
"shipping_country" : "235",
"city" : "London",
"billing_zip" : "WC1 ASW",
"shipping_zip" : "WC1 ASW",
"longitude" : null,
"registration_confirmed" : "1",
"billing_city" : "London",
"state" : "Greater London",
"phonenumber" : "+44 210 7298299",
"billing_country" : "235",
"address" : "123 Road Street",
"vat" : "123456789",
"active" : "1",
"stripe_id" : null
}
]
End of documentation intro part. Below, you will find all available commands that can be used with Rest API of Startup CRM, along with their methods.
Customer
Customer - Add New Customer
api/customers
Header
Champ | Type | Description |
---|---|---|
authtoken | String |
Basic Access Authentication token. |
Paramètre
Champ | Type | Description |
---|---|---|
company | String |
Mandatory Customer company. |
vatoptionnel | String |
Optional Vat. |
phonenumberoptionnel | String |
Optional Customer Phone. |
websiteoptionnel | String |
Optional Customer Website. |
groups_inoptionnel | Number[] |
Optional Customer groups. |
default_languageoptionnel | String |
Optional Customer Default Language. |
default_currencyoptionnel | String |
Optional default currency. |
addressoptionnel | String |
Optional Customer address. |
cityoptionnel | String |
Optional Customer City. |
stateoptionnel | String |
Optional Customer state. |
zipoptionnel | String |
Optional Zip Code. |
countryoptionnel | String |
Optional country. |
billing_streetoptionnel | String |
Optional Billing Address: Street. |
billing_cityoptionnel | String |
Optional Billing Address: City. |
billing_stateoptionnel | Number |
Optional Billing Address: State. |
billing_zipoptionnel | String |
Optional Billing Address: Zip. |
billing_countryoptionnel | String |
Optional Billing Address: Country. |
shipping_streetoptionnel | String |
Optional Shipping Address: Street. |
shipping_cityoptionnel | String |
Optional Shipping Address: City. |
shipping_stateoptionnel | String |
Optional Shipping Address: State. |
shipping_zipoptionnel | String |
Optional Shipping Address: Zip. |
shipping_countryoptionnel | String |
Optional Shipping Address: Country. |
array (size=22)
'company' => string 'Kakuz' (length=38)
'vat' => string '123456789' (length=9)
'phonenumber' => string '123456789' (length=9)
'website' => string 'AAA.com' (length=7)
'groups_in' =>
array (size=2)
0 => string '1' (length=1)
1 => string '4' (length=1)
'default_currency' => string '3' (length=1)
'default_language' => string 'english' (length=7)
'address' => string '1 Silk Point' (length=12)
'city' => string 'John Test' (length=9)
'state' => string 'John Test' (length=9)
'zip' => string '700000' (length=6)
'country' => string '243' (length=3)
'billing_street' => string '1 Silk Point' (length=12)
'billing_city' => string 'John Test' (length=9)
'billing_state' => string 'John Test' (length=9)
'billing_zip' => string '700000' (length=6)
'billing_country' => string '243' (length=3)
'shipping_street' => string '1 Silk Point' (length=12)
'shipping_city' => string 'John Test' (length=9)
'shipping_state' => string 'John Test' (length=9)
'shipping_zip' => string '700000' (length=6)
'shipping_country' => string '243' (length=3)
Success 200
Champ | Type | Description |
---|---|---|
status | Boolean |
Request status. |
message | String |
Customer add successful. |
HTTP/1.1 200 OK
{
"status": true,
"message": "Customer add successful."
}
Error 4xx
Nom | Type | Description |
---|---|---|
status | Boolean |
Request status. |
message | String |
Customer add fail. |
HTTP/1.1 404 Not Found
{
"status": false,
"message": "Customer add fail."
}
Customer - Delete a Customer
api/delete/customers/:id
Header
Champ | Type | Description |
---|---|---|
authtoken | String |
Basic Access Authentication token. |
Paramètre
Champ | Type | Description |
---|---|---|
id | Number |
Customer unique ID. |
Success 200
Champ | Type | Description |
---|---|---|
status | String |
Request status. |
message | String |
Customer Delete Successful. |
HTTP/1.1 200 OK
{
"status": true,
"message": "Customer Delete Successful."
}
Error 4xx
Nom | Type | Description |
---|---|---|
status | Boolean |
Request status. |
message | String |
Customer Delete Fail. |
HTTP/1.1 404 Not Found
{
"status": false,
"message": "Customer Delete Fail."
}
Customer - Request customer information
api/customers/:id
Header
Champ | Type | Description |
---|---|---|
authtoken | String |
Basic Access Authentication token. |
Paramètre
Champ | Type | Description |
---|---|---|
id | Number |
customer unique ID. |
Success 200
Champ | Type | Description |
---|---|---|
customer | Object |
information. |
HTTP/1.1 200 OK
{
"id": "28",
"name": "Test1",
"description": null,
"status": "1",
"clientid": "11",
"billing_type": "3",
"start_date": "2019-04-19",
"deadline": "2019-08-30",
"customer_created": "2019-07-16",
"date_finished": null,
"progress": "0",
"progress_from_tasks": "1",
"customer_cost": "0.00",
"customer_rate_per_hour": "0.00",
"estimated_hours": "0.00",
"addedfrom": "5",
"rel_type": "customer",
"potential_revenue": "0.00",
"potential_margin": "0.00",
"external": "E",
...
}
Error 4xx
Nom | Type | Description |
---|---|---|
status | Boolean |
Request status. |
message | String |
No data were found. |
HTTP/1.1 404 Not Found
{
"status": false,
"message": "No data were found"
}
Customer - Search Customer Information.
api/customers/search/:keysearch
Header
Champ | Type | Description |
---|---|---|
authtoken | String |
Basic Access Authentication token. |
Paramètre
Champ | Type | Description |
---|---|---|
keysearch | String |
Search Keywords. |
Success 200
Champ | Type | Description |
---|---|---|
customer | Object |
information. |
HTTP/1.1 200 OK
{
"id": "28",
"name": "Test1",
"description": null,
"status": "1",
"clientid": "11",
"billing_type": "3",
"start_date": "2019-04-19",
"deadline": "2019-08-30",
"customer_created": "2019-07-16",
"date_finished": null,
"progress": "0",
"progress_from_tasks": "1",
"customer_cost": "0.00",
"customer_rate_per_hour": "0.00",
"estimated_hours": "0.00",
"addedfrom": "5",
"rel_type": "customer",
"potential_revenue": "0.00",
"potential_margin": "0.00",
"external": "E",
...
}
Error 4xx
Nom | Type | Description |
---|---|---|
status | Boolean |
Request status. |
message | String |
No data were found. |
HTTP/1.1 404 Not Found
{
"status": false,
"message": "No data were found"
}
Customer - Update a Customer
api/customers/:id
Header
Champ | Type | Description |
---|---|---|
authtoken | String |
Basic Access Authentication token. |
Paramètre
Champ | Type | Description |
---|---|---|
company | String |
Mandatory Customer company. |
vatoptionnel | String |
Optional Vat. |
phonenumberoptionnel | String |
Optional Customer Phone. |
websiteoptionnel | String |
Optional Customer Website. |
groups_inoptionnel | Number[] |
Optional Customer groups. |
default_languageoptionnel | String |
Optional Customer Default Language. |
default_currencyoptionnel | String |
Optional default currency. |
addressoptionnel | String |
Optional Customer address. |
cityoptionnel | String |
Optional Customer City. |
stateoptionnel | String |
Optional Customer state. |
zipoptionnel | String |
Optional Zip Code. |
countryoptionnel | String |
Optional country. |
billing_streetoptionnel | String |
Optional Billing Address: Street. |
billing_cityoptionnel | String |
Optional Billing Address: City. |
billing_stateoptionnel | Number |
Optional Billing Address: State. |
billing_zipoptionnel | String |
Optional Billing Address: Zip. |
billing_countryoptionnel | String |
Optional Billing Address: Country. |
shipping_streetoptionnel | String |
Optional Shipping Address: Street. |
shipping_cityoptionnel | String |
Optional Shipping Address: City. |
shipping_stateoptionnel | String |
Optional Shipping Address: State. |
shipping_zipoptionnel | String |
Optional Shipping Address: Zip. |
shipping_countryoptionnel | String |
Optional Shipping Address: Country. |
{
"company": "Kakuz",
"vat": "",
"phonenumber": "0123456789",
"website": "",
"default_language": "",
"default_currency": "0",
"country": "243",
"city": "Paris",
"zip": "700000",
"state": "Quáºn 12",
"address": "1 rue",
"billing_street": "1 rue",
"billing_city": "Paris",
"billing_state": "Quáºn 12",
"billing_zip": "700000",
"billing_country": "143",
"shipping_street": "",
"shipping_city": "",
"shipping_state": "",
"shipping_zip": "",
"shipping_country": "0"
}
Success 200
Champ | Type | Description |
---|---|---|
status | Boolean |
Request status. |
message | String |
Customer Update Successful. |
HTTP/1.1 200 OK
{
"status": true,
"message": "Customer Update Successful."
}
Error 4xx
Nom | Type | Description |
---|---|---|
status | Boolean |
Request status. |
message | String |
Customer Update Fail. |
HTTP/1.1 404 Not Found
{
"status": false,
"message": "Customer Update Fail."
}
Lead
Lead - Add New Lead
api/leads
Header
Champ | Type | Description |
---|---|---|
authtoken | String |
Basic Access Authentication token. |
Paramètre
Champ | Type | Description |
---|---|---|
source | String |
Mandatory Lead source. |
status | String |
Mandatory Lead Status. |
name | String |
Mandatory Lead Name. |
file[]optionnel | File |
Optional Lead attachments. |
assignedoptionnel | String |
Optional Lead assigned. |
tagsoptionnel | String |
Optional Lead tags. |
titleoptionnel | String |
Optional Position. |
emailoptionnel | String |
Optional Lead Email Address. |
websiteoptionnel | String |
Optional Lead Website. |
phonenumberoptionnel | String |
Optional Lead Phone. |
companyoptionnel | String |
Optional Lead company. |
addressoptionnel | String |
Optional Lead address. |
cityoptionnel | String |
Optional Lead City. |
stateoptionnel | String |
Optional Lead state. |
countryoptionnel | String |
Optional Lead Country. |
default_languageoptionnel | String |
Optional Lead Default Language. |
descriptionoptionnel | String |
Optional Lead description. |
custom_contact_dateoptionnel | String |
Optional Lead From Customer. |
contacted_todayoptionnel | String |
Optional Lead Contacted Today. |
is_publicoptionnel | String |
Optional Lead google sheet id. |
array (size=20)
'status' => string '2' (length=1)
'source' => string '6' (length=1)
'assigned' => string '1' (length=1)
'client_id' => string '5' (length=1)
'tags' => string '' (length=0)
'name' => string 'Lead Name' (length=9)
'contact' => string 'Contact A' (length=9)
'title' => string 'Position A' (length=10)
'email' => string 'AAA@gmail.com' (length=13)
'website' => string '' (length=0)
'phonenumber' => string '123456789' (length=9)
'company' => string 'TheCompany' (length=51)
'address' => string '1 Silk Point' (length=53)
'city' => string 'John Test' (length=9)
'state' => string '' (length=0)
'default_language' => string 'english' (length=10)
'description' => string 'Description' (length=11)
'custom_contact_date' => string '' (length=0)
'is_public' => string 'on' (length=2)
'contacted_today' => string 'on' (length=2)
Success 200
Champ | Type | Description |
---|---|---|
status | Boolean |
Request status. |
message | String |
Lead add successful. |
HTTP/1.1 200 OK
{
"status": true,
"message": "Lead add successful."
}
Error 4xx
Nom | Type | Description |
---|---|---|
status | Boolean |
Request status. |
message | String |
add fail. |
HTTP/1.1 404 Not Found
{
"status": false,
"message": "Lead add fail."
}
Lead - Delete a Lead
api/delete/leads/:id
Header
Champ | Type | Description |
---|---|---|
authtoken | String |
Basic Access Authentication token. |
Paramètre
Champ | Type | Description |
---|---|---|
id | Number |
lead unique ID. |
Success 200
Champ | Type | Description |
---|---|---|
status | String |
Request status. |
message | String |
Lead Delete Successful. |
Invoice - Add New invoice
api/invoices/:id
Header
Champ | Type | Description |
---|---|---|
Authorization | String |
Basic Access Authentication token. |
Paramètre
Champ | Type | Description |
---|---|---|
clientid | Number |
Mandatory. Customer id |
number | Number |
Mandatory. Invoice Number |
date | Date |
Mandatory. Invoice Date |
currency | Number |
Mandatory. currency field |
newitems | Array |
Mandatory. New Items to be added |
subtotal | Decimal |
Mandatory. calculation based on item Qty, Rate and Tax |
total | Decimal |
Mandatory. calculation based on subtotal, Discount and Adjustment |
billing_street | String |
Mandatory. Street Address |
allowed_payment_modes | Array |
Mandatory. Payment modes |
billing_cityoptionnel | String |
Optional. City Name for billing |
billing_stateoptionnel | String |
Optional. Name of state for billing |
billing_zipoptionnel | Number |
Optional. Zip code |
billing_countryoptionnel | Number |
Optional. Country code |
include_shippingoptionnel | boolean |
Optional. set yes if you want add Shipping Address Valeur par défaut : |
show_shipping_on_invoiceoptionnel | boolean |
Optional. Shows shipping details in invoice. |
shipping_streetoptionnel | String |
Optional. Address of shipping |
shipping_cityoptionnel | String |
Optional. City name for shipping |
shipping_stateoptionnel | String |
Optional. Name of state for shipping |
shipping_zipoptionnel | Number |
Optional. Zip code for shipping |
shipping_countryoptionnel | Number |
Optional. Country code |
duedateoptionnel | Date |
Optional. Due date for Invoice |
cancel_overdue_remindersoptionnel | boolean |
Optional. Prevent sending overdue remainders for invoice |
tagsoptionnel | String |
Optional. TAGS comma separated |
sale_agentoptionnel | Number |
Optional. Sale Agent name |
recurringoptionnel | String |
Optional. recurring 1 to 12 or custom |
discount_typeoptionnel | String |
Optional. before_tax / after_tax discount type |
repeat_every_customoptionnel | Number |
Optional. if recurring is custom set number gap |
repeat_type_customoptionnel | String |
Optional. if recurring is custom set gap option day/week/month/year |
cyclesoptionnel | Number |
Optional. number of cycles 0 for infinite |
adminnoteoptionnel | String |
Optional. notes by admin |
itemsoptionnel | Array |
Optional. Existing items with Id |
removed_itemsoptionnel | Array |
Optional. Items to be removed |
clientnoteoptionnel | String |
Optional. client notes |
termsoptionnel | String |
Optional. Terms |
[
"clientid"=>1,
"number"=>"00001",
"date"=>"2020-09-07",
"currency"=>1,
"newitems[0][description]"=>"item 1 description",
"newitems[0][long_description]"=>"item 1 long description",
"newitems[0][qty]"=>1,
"newitems[0][rate]"=>100,
"newitems[0][order]"=>1,
"newitems[0][taxname][]"=>CGST|9.00,
"newitems[0][taxname][]"=>SGST|9.00,
"newitems[0][unit]"=>"",
"newitems[1][description]"=>"item 2 description",
"newitems[1][long_description]"=>"item 2 long description",
"newitems[1][qty]"=>1,
"newitems[1][rate]"=>100,
"newitems[1][order]"=>1,
"newitems[1][taxname][]"=>CGST|9.00,
"newitems[1][taxname][]"=>SGST|9.00,
"newitems[1][unit]"=>"",
"subtotal"=>236.00,
"total"=>236.00,
"billing_street"=>"billing address",
"allowed_payment_modes[0]"=>1,
"allowed_payment_modes[1]"=>2,
....
]
Success 200
Champ | Type | Description |
---|---|---|
status | Boolean |
Request status. |
message | String |
Invoice Added Successfully |
HTTP/1.1 200 OK
{
"status": true,
"message": "Invoice Added Successfully"
}
Error 4xx
Nom | Type | Description |
---|---|---|
status | Boolean |
Request status. |
message | String |
Invoice add fail |
newitems[] | String |
The Items field is required |
number | String |
The Invoice number is already in use |
allowed_payment_modes[] | String |
The Allow Payment Mode field is required |
billing_street | String |
The Billing Street field is required |
subtotal | String |
The Sub Total field is required |
total | String |
The Total field is required |
HTTP/1.1 404 Not Found
{
"status": false,
"message": "Invoice Add Fail"
}
Invoice - Delete invoice
api/invoices/:id
Header
Champ | Type | Description |
---|---|---|
Authorization | String |
Basic Access Authentication token. |
Success 200
Champ | Type | Description |
---|---|---|
status | Boolean |
Request status. |
message | String |
Invoice Deleted Successfully |
HTTP/1.1 200 OK
{
"status": true,
"message": "Invoice Deleted Successfully"
}
Error 4xx
Nom | Type | Description |
---|---|---|
status | Boolean |
Request status. |
message | String |
Invoice Delete Fail |
HTTP/1.1 404 Not Found
{
"status": false,
"message": "Invoice Delete Fail"
}
Invoice - Request invoice information
api/invoices/:id
Header
Champ | Type | Description |
---|---|---|
Authorization | String |
Basic Access Authentication token. |
Paramètre
Champ | Type | Description |
---|---|---|
id | Number |
Contact unique ID |
Success 200
Champ | Type | Description |
---|---|---|
Invoice | Object |
Invoice information. |
HTTP/1.1 200 OK
{
"id": "2",
"sent": "0",
"datesend": null,
"clientid": "1",
"deleted_customer_name": null,
"number": "2",
"prefix": "INV-",
"number_format": "1",
"datecreated": "2020-05-26 19:53:11",
"date": "2020-05-26",
"duedate": "2020-06-25",
"currency": "1",
"subtotal": "5.00",
"total_tax": "0.00",
"total": "5.00",
"adjustment": "0.00",
"addedfrom": "0",
"hash": "7bfac86da004df5364407574d4d1dbf2",
"status": "1",
"clientnote": null,
"adminnote": null,
"last_overdue_reminder": null,
"cancel_overdue_reminders": "0",
"allowed_payment_modes": "['1']",
"token": null,
"discount_percent": "0.00",
"discount_total": "0.00",
"discount_type": "",
"recurring": "0",
"recurring_type": null,
"custom_recurring": "0",
"cycles": "0",
"total_cycles": "0",
"is_recurring_from": null,
"last_recurring_date": null,
"terms": null,
"sale_agent": "0",
"billing_street": "",
"billing_city": "",
"billing_state": "",
"billing_zip": "",
"billing_country": null,
"shipping_street": null,
"shipping_city": null,
"shipping_state": null,
"shipping_zip": null,
"shipping_country": null,
"include_shipping": "0",
"show_shipping_on_invoice": "1",
"show_quantity_as": "1",
"project_id": "0",
"subscription_id": "0",
"symbol": "$",
"name": "USD",
"decimal_separator": ".",
"thousand_separator": ",",
"placement": "before",
"isdefault": "1",
"currencyid": "1",
"currency_name": "USD",
"total_left_to_pay": "5.00",
"items": [
{
"id": "2",
"rel_id": "2",
"rel_type": "invoice",
"description": "12MP Dual Camera with cover",
"long_description": "The JBL Cinema SB110 is a hassle-free soundbar",
"qty": "1.00",
"rate": "5.00",
"unit": "",
"item_order": "1"
}
],
"attachments": [],
"visible_attachments_to_customer_found": false,
"client": {
"userid": "1",
"company": "trueline",
"vat": "",
"phonenumber": "",
"country": "0",
"city": "",
"zip": "",
"state": "",
"address": "",
"website": "",
"datecreated": "2020-05-19 20:07:49",
"active": "1",
"leadid": null,
"billing_street": "",
"billing_city": "",
"billing_state": "",
"billing_zip": "",
"billing_country": "0",
"shipping_street": "",
"shipping_city": "",
"shipping_state": "",
"shipping_zip": "",
"shipping_country": "0",
"longitude": null,
"latitude": null,
"default_language": "english",
"default_currency": "0",
"show_primary_contact": "0",
"stripe_id": null,
"registration_confirmed": "1",
"addedfrom": "1"
},
"payments": [],
"scheduled_email": null
}
Error 4xx
Nom | Type | Description |
---|---|---|
status | Boolean |
Request status. |
message | String |
No data were found. |
HTTP/1.1 404 Not Found
{
"status": false,
"message": "No data were found"
}
Invoice - Search invoice information
api/invoices/search/:keysearch
Header
Champ | Type | Description |
---|---|---|
Authorization | String |
Basic Access Authentication token. |
Paramètre
Champ | Type | Description |
---|---|---|
keysearch | String |
Search Keywords. |
Success 200
Champ | Type | Description |
---|---|---|
Invoice | Object |
Information. |
HTTP/1.1 200 OK
{
"id": "19",
"sent": "0",
"datesend": null,
"clientid": "3",
"deleted_customer_name": null,
"number": "19",
"prefix": "INV-",
"number_format": "1",
"datecreated": "2020-08-18 21:19:51",
"date": "2020-07-04",
"duedate": "2020-08-03",
"currency": "1",
"subtotal": "20.00",
"total_tax": "1.80",
"total": "21.80",
"adjustment": "0.00",
"addedfrom": "1",
"hash": "809c0e4c9efba2a3bedfdb5871dc6240",
"status": "2",
"clientnote": "",
"adminnote": "",
"last_overdue_reminder": null,
"cancel_overdue_reminders": "0",
"allowed_payment_modes": "['1']",
"token": null,
"discount_percent": "0.00",
"discount_total": "0.00",
"discount_type": "",
"recurring": "0",
"recurring_type": null,
"custom_recurring": "0",
"cycles": "0",
"total_cycles": "0",
"is_recurring_from": null,
"last_recurring_date": null,
"terms": "",
"sale_agent": "0",
"billing_street": "",
"billing_city": "",
"billing_state": "",
"billing_zip": "",
"billing_country": "0",
"shipping_street": "",
"shipping_city": "",
"shipping_state": "",
"shipping_zip": "",
"shipping_country": "0",
"include_shipping": "0",
"show_shipping_on_invoice": "1",
"show_quantity_as": "1",
"project_id": "0",
"subscription_id": "0",
"userid": "3",
"company": "xyz",
"vat": "",
"phonenumber": "",
"country": "0",
"city": "",
"zip": "",
"state": "",
"address": "",
"website": "",
"active": "1",
"leadid": null,
"longitude": null,
"latitude": null,
"default_language": "",
"default_currency": "0",
"show_primary_contact": "0",
"stripe_id": null,
"registration_confirmed": "1",
"invoiceid": "19"
}
Error 4xx
Nom | Type | Description |
---|---|---|
status | Boolean |
Request status. |
message | String |
No data were found. |
HTTP/1.1 404 Not Found
{
"status": false,
"message": "No Data Were Found"
}
Invoice - Update invoice
api/invoices/:id
Header
Champ | Type | Description |
---|---|---|
Authorization | String |
Basic Access Authentication token. |
Paramètre
Champ | Type | Description |
---|---|---|
clientid | Number |
Mandatory Customer id. |
number | Number |
Mandatory. Invoice Number |
date | Date |
Mandatory. Invoice Date |
currency | Number |
Mandatory. currency field |
newitems | Array |
Mandatory. New Items to be added |
subtotal | Decimal |
Mandatory. calculation based on item Qty, Rate and Tax |
total | Decimal |
Mandatory. calculation based on subtotal, Discount and Adjustment |
billing_street | String |
Mandatory. Street Address |
allowed_payment_modes | Array |
Mandatory. Payment modes |
billing_cityoptionnel | String |
Optional. City Name for billing |
billing_stateoptionnel | String |
Optional. Name of state for billing |
billing_zipoptionnel | Number |
Optional. Zip code |
billing_countryoptionnel | Number |
Optional. Country code |
include_shippingoptionnel | boolean |
Optional. set yes if you want add Shipping Address Valeur par défaut : |
show_shipping_on_invoiceoptionnel | boolean |
Optional. Shows shipping details in invoice. |
shipping_streetoptionnel | String |
Optional. Address of shipping |
shipping_cityoptionnel | String |
Optional. City name for shipping |
shipping_stateoptionnel | String |
Optional. Name of state for shipping |
shipping_zipoptionnel | Number |
Optional. Zip code for shipping |
shipping_countryoptionnel | Number |
Optional. Country code |
duedateoptionnel | Date |
Optional. Due date for Invoice |
cancel_overdue_remindersoptionnel | boolean |
Optional. Prevent sending overdue remainders for invoice |
tagsoptionnel | String |
Optional. TAGS comma separated |
sale_agentoptionnel | Number |
Optional. Sale Agent name |
recurringoptionnel | String |
Optional. recurring 1 to 12 or custom |
discount_typeoptionnel | String |
Optional. before_tax / after_tax discount type |
repeat_every_customoptionnel | Number |
Optional. if recurring is custom set number gap |
repeat_type_customoptionnel | String |
Optional. if recurring is custom set gap option day/week/month/year |
cyclesoptionnel | Number |
Optional. number of cycles 0 for infinite |
adminnoteoptionnel | String |
Optional. notes by admin |
itemsoptionnel | Array |
Optional. Existing items with Id |
removed_itemsoptionnel | Array |
Optional. Items to be removed |
clientnoteoptionnel | String |
Optional. client notes |
termsoptionnel | String |
Optional. Terms |
{
"clientid": "1",
"billing_street": "billing address",
"billing_city": "billing city name",
"billing_state": "billing state name",
"billing_zip": "billing zip code",
"billing_country": "",
"include_shipping": "on",
"show_shipping_on_invoice": "on",
"shipping_street": "shipping address",
"shipping_city": "city name",
"shipping_state": "state name",
"shipping_zip": "zip code",
"shipping_country": "",
"number": "000001",
"date": "2020-08-28",
"duedate": "2020-09-27",
"cancel_overdue_reminders": "on",
"tags": "TAG 1,TAG 2",
"allowed_payment_modes": [
"1",
"2"
],
"currency": "1",
"sale_agent": "1",
"recurring": "custom",
"discount_type": "before_tax",
"repeat_every_custom": "7",
"repeat_type_custom": "day",
"cycles": "0",
"adminnote": "TEST",
"show_quantity_as": "1",
"items": {
"1": {
"itemid": "1",
"order": "1",
"description": "item description",
"long_description": "item long description",
"qty": "1",
"unit": "1",
"rate": "10.00"
}
},
"removed_items": [
"2",
"3"
],
"newitems": {
"2": {
"order": "2",
"description": "item 2 description",
"long_description": "item 2 logn description",
"qty": "1",
"unit": "",
"rate": "100.00"
}
},
"subtotal": "10.00",
"discount_percent": "10",
"discount_total": "1.00",
"adjustment": "1",
"total": "10.00",
"clientnote": "client note",
"terms": "terms"
}
HTTP/1.1 200 OK
{
"status": false,
"message": "Invoice Updated Successfully"
}
Error 4xx
Nom | Type | Description |
---|---|---|
number | String |
The Invoice number is already in use |
HTTP/1.1 404 Not Found
{
"status": false,
"message": "Invoice Update Fail"