Toggle navigation

API Schnittstelle - 8Hub

Version 1.0.0

👋 Introduction

8Hub API operates over HTTP/HTTPS and uses JSON as its data format. It is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses.
To get started using the API you first need an API token, after activating our module, through your API Management section (8Hub CRM’s admin dashboard) and assign the respective permissions to it.

Payment Modes

Payment_Modes – Request Payment Modes

GET yourdomain.com/api/common/payment_mode

Header

Feld Typ Beschreibung
authtoken String Authentication token, generated from admin area

Success 200

Feld Typ Beschreibung
Payment Array Modes.

Error 4xx

Name Typ Beschreibung
status Boolean Request status.
message String No data were found.
 HTTP/1.1 200 OK
[
    {
        "id": "1",
        "name": "Bank",
        "description": null,
        "show_on_pdf": "0",
        "invoices_only": "0",
        "expenses_only": "0",
        "selected_by_default": "1",
        "active": "1"
    }
]
HTTP/1.1 404 Not Found
{
  "status": false,
  "message": "No data were found"
}

Payments

Payments – Add New Payment

POST yourdomain.com/api/payments

Header

Feld Typ Beschreibung
authtoken String Authentication token, generated from admin area

Parameter

Feld Typ Beschreibung
invoiceid String Mandatory Invoice ID associated with the payment.
amount String Mandatory Payment amount.
paymentmode String Mandatory Payment mode (e.g., cash, credit card, etc.).
paymentmethod (optional) String Optional Payment method details.
note (optional) String Optional Additional payment note.
transactionid (optional) String Optional Transaction ID.
custom_fields (optional) String Optional Custom fields data.

Success 200

Feld Typ Beschreibung
paymentmode Boolean Status of the request.
message String Payment add successful.

Error 4xx

Name Typ Beschreibung
paymentmode Boolean Status of the request.
message String Payment add fail.
HTTP/1.1 200 OK
{
  "paymentmode": true,
  "message": "Payment add successful."
}
HTTP/1.1 404 Not Found
{
  "paymentmode": false,
  "message": "Payment add fail."
}
GET yourdomain.com/api/payments/:id

Header

Feld Typ Beschreibung
authtoken String Authentication token, generated from admin area

Parameter

Feld Typ Beschreibung
payment_id Number Optional payment unique ID
Note : if you don’t pass Payment id then it will list all payments records

Success 200

Feld Typ Beschreibung
Payments Array List all Payment Records.

Error 4xx

Name Typ Beschreibung
paymentmode Boolean Request paymentmode.
message String No data were found.
  HTTP/1.1 200 OK
[
{
"id": "3",
"invoiceid": "7",
"amount": "1000.00",
"paymentmode": "3",
"paymentmethod": "",
"date": "2020-06-08",
"daterecorded": "2020-06-08 20:29:54",
"note": "",
"transactionid": "000355795931",
"invoiceid": "UPI",
"description": "",
"show_on_pdf": "0",
"invoices_only": "0",
"expenses_only": "0",
"selected_by_default": "0",
"active": "1",
"paymentid": "1"
},
{
"id": "4",
"invoiceid": "12",
"amount": "-3.00",
"paymentmode": "4",
"paymentmethod": "",
"date": "2020-07-04",
"daterecorded": "2020-07-04 15:32:59",
"note": "",
"transactionid": "P228210122733439",
"invoiceid": "Stripe",
"description": "",
"show_on_pdf": "0",
"invoices_only": "0",
"expenses_only": "0",
"selected_by_default": "0",
"active": "1",
"paymentid": "2"
},
{
"id": "1",
"invoiceid": "14",
"amount": "8.00",
"paymentmode": "1",
"paymentmethod": "",
"date": "2020-07-04",
"daterecorded": "2020-07-04 15:47:30",
"note": "",
"transactionid": "000360166374",
"invoiceid": "Bank",
"description": null,
"show_on_pdf": "0",
"invoices_only": "0",
"expenses_only": "0",
"selected_by_default": "1",
"active": "1",
"paymentid": "3"
},
{
"id": "2",
"invoiceid": "13",
"amount": "3.00",
"paymentmode": "2",
"paymentmethod": "Credit card",
"date": "2020-07-04",
"daterecorded": "2020-07-04 15:49:56",
"note": "",
"transactionid": "0124875873",
"invoiceid": "paypal",
"description": "",
"show_on_pdf": "0",
"invoices_only": "0",
"expenses_only": "0",
"selected_by_default": "0",
"active": "1",
"paymentid": "4"
}
]
HTTP/1.1 404 Not Found
{
"paymentmode": false,
"message": "No data were found"
}

Payments – Search Payments Information

GET yourdomain.com/api/payments/search/:keysearch

Header

Feld Typ Beschreibung
authtoken String Authentication token, generated from admin area

Parameter

Feld Typ Beschreibung
keysearch String Search Keywords

Success 200

Feld Typ Beschreibung
Payments Array Payments information

Error 4xx

Name Typ Beschreibung
paymentmode Boolean Request paymentmode
message String No data were found
HTTP/1.1 200 OK
[
{
"id": "3",
"invoiceid": "14",
"amount": "8.00",
"paymentmode": "2",
"paymentmethod": "",
"date": "2020-07-04",
"daterecorded": "2020-07-04 15:47:30",
"note": "",
"transactionid": "",
...
}
]
HTTP/1.1 404 Not Found
{
"paymentmode": false,
"message": "No data were found"
}

Items

Items – Request Invoice Item’s information

GET yourdomain.com/api/items/:id

Header

Feld Typ Beschreibung
authtoken String Authentication token, generated from admin area

Success 200

Feld Typ Beschreibung
Item Object item information.

Error 4xx

Name Typ Beschreibung
status Boolean Request status.
message String No data were found.
    HTTP/1.1 200 OK
{
"itemid": "1",
"rate": "100.00",
"taxrate": "5.00",
"taxid": "1",
"taxname": "PAYPAL",
"taxrate_2": "9.00",
"taxid_2": "2",
"taxname_2": "CGST",
"description": "JBL Soundbar",
"long_description": "The JBL Cinema SB110 is a hassle-free soundbar",
"group_id": "0",
"group_name": null,
"unit": ""
}
HTTP/1.1 404 Not Found
{
  "status": false,
  "message": "No data were found"
}

Items – Search Invoice Item’s information

GET yourdomain.com/api/items/search/:keysearch

Header

Feld Typ Beschreibung
authtoken String Authentication token, generated from admin area

Parameter

Feld Typ Beschreibung
keysearch String Search Keywords

Success 200

Feld Typ Beschreibung
Item Object Item Information

Error 4xx

Name Typ Beschreibung
status Boolean Request status
message String No data were found
HTTP/1.1 200 OK
{
"rate": "100.00",
"id": "1",
"name": "(100.00) JBL Soundbar",
"subtext": "The JBL Cinema SB110 is a hassle-free soundbar..."
}
HTTP/1.1 404 Not Found
{
  "status": false,
  "message": "No data were found"
}

Invoices – Request invoice information

GET yourdomain.com/api/invoices/:id

Header

Feld Typ Beschreibung
authtoken String Authentication token, generated from admin area

Parameter

Feld Typ Beschreibung
id Number Contact unique ID

Success 200

Feld Typ Beschreibung
Invoice Object Invoice information.

Error 4xx

Name Typ Beschreibung
status Boolean Request status.
message String No data were found.
  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
}
HTTP/1.1 404 Not Found
{
  "status": false,
  "message": "No data were found"
}

Invoices – Search invoice information

GET yourdomain.com/api/invoices/search/:keysearch

Header

Feld Typ Beschreibung
authtoken String Authentication token, generated from admin area

Parameter

Feld Typ Beschreibung
keysearch String Search Keywords.

Success 200

Feld Typ Beschreibung
Invoice Object Information.

Error 4xx

Name Typ Beschreibung
status Boolean Request status.
message String No data were found.
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"
}
HTTP/1.1 404 Not Found
{
"status": false,
"message": "No Data Were Found"
}

Invoices – Update invoice

PUT yourdomain.com/api/invoices/:id

Header

Feld Typ Beschreibung
authtoken String Authentication token, generated from admin area

Parameter

Feld Typ Beschreibung
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_city (optional) String Optional. City Name for billing
billing_state (optional) String Optional. Name of state for billing
billing_zip (optional) Number Optional. Zip code
billing_country (optional) Number Optional. Country code
include_shipping (optional) boolean Optional. set yes if you want add Shipping Address

Standardwert: no

show_shipping_on_invoice (optional) boolean Optional. Shows shipping details in invoice.
shipping_street (optional) String Optional. Address of shipping
shipping_city (optional) String Optional. City name for shipping
shipping_state (optional) String Optional. Name of state for shipping
shipping_zip (optional) Number Optional. Zip code for shipping
shipping_country (optional) Number Optional. Country code
duedate (optional) Date Optional. Due date for Invoice
cancel_overdue_reminders (optional) boolean Optional. Prevent sending overdue remainders for invoice
tags (optional) String Optional. TAGS comma separated
sale_agent (optional) Number Optional. Sale Agent name
recurring (optional) String Optional. recurring 1 to 12 or custom
discount_type (optional) String Optional. before_tax / after_tax discount type
repeat_every_custom (optional) Number Optional. if recurring is custom set number gap
repeat_type_custom (optional) String Optional. if recurring is custom set gap option day/week/month/year
cycles (optional) Number Optional. number of cycles 0 for infinite
adminnote (optional) String Optional. notes by admin
items (optional) Array Optional. Existing items with Id
removed_items (optional) Array Optional. Items to be removed
clientnote (optional) String Optional. client notes
terms (optional) String Optional. Terms

Error 4xx

Name Typ Beschreibung
number String The Invoice number is already in use
HTTP/1.1 200 OK
{
"status": false,
"message": "Invoice Updated Successfully"
}
HTTP/1.1 404 Not Found
{
"status": false,
"message": "Invoice Update Fail"
}