APIs are HTTP-based APIs for authorization. API request and response bodies are formatted in JSON.
When you click on Generate Keys button from the InsurePay Website API's section, you will get two keys that is Public Key and Private Key. Refresh Key can be generated via API.
Key | Description |
---|---|
Public | Public key will not change once it is generated in other words it's a Unique Key |
Private | Private Key can be generated as many times as you click on Generate Key button and of course once you change/ click on generate key button the previous generated key will not work |
Refresh | Required for making the payment. It is valid for only one time |
To construct a REST API request, combine below components and return response in json format:
Attribute | Description |
---|---|
HTTP Method | POST |
End Point |
https://zifflepay.com/v2/states
|
Header | Required. Includes the Authorization header with the access identifier and token
Accept Content-Type Access-Identifier Access-Token Refresh-Token
|
Request Data | Optional. accept only JSON format
{"country_code": "US"}
|
Response Data | Return the JSON format with success/error code
{"code":"200","message":"success","country": [{"State": {"id": "123","name": "Alaska","code": "AK"}}]}
|
Request
curl POST https://zifflepay.com/v2/states/
-H "Accept : application/json"
-H "Content-Type : application/json"
-H "Access-Identifier : Access-Identifier
"
-H "Access-Token : Access-Token
"
-d
{"country_code":"US"}
Response
{ "code": "200", "message": "success", "country": [ { "State": { "id": "123", "name": "Alaska", "code": "AK" } } ] }
To construct the API, combine these components to generate results.
Header | Type | Is Required | Description |
---|---|---|---|
Accept | JSON | Required |
Required for operations with a response body. Specifies the response format |
Content-Type | JSON | Required |
Required for operations with a response body. Specifies the response format |
Access-Identifier | JSON | Required |
Required to get an access identifiers |
Access-Token | JSON | Optional |
Required to get an access identifiers |
Refresh-Token | JSON | Optional |
Required to get an access identifiers |
A unique URL that represents an object or collection of objects
Type | End-Point | Description |
---|---|---|
Token | ||
Refresh Token | https://zifflepay.com/v2/tokens/refresh/ | Generate Regresh Token |
Client | ||
Create | https://zifflepay.com/v2/clients/create/ | Create new client |
Item | ||
Create | https://zifflepay.com/v2/items/create/ | Create new item |
Invoice | ||
Send | https://zifflepay.com/v2/invoices/send/ | Create new invoice and send |
Payment | https://zifflepay.com/v2/invoices/payment/ | Create new invoice and payment |
Country | ||
List | https://zifflepay.com/v2/countries/ | Get country list |
State | ||
List | https://zifflepay.com/v2/states/ | Get state list basis of country-code |
API calls return HTTP status codes. API calls also return JSON response bodies that include information. Each REST API request returns a success or error HTTP status code
Code | Description | |
---|---|---|
1 | Success | |
2 | Header missing | |
3 | Body missing | |
4 | Header invalid | |
5 | Body invalid | |
Token | ||
101 | Token missing | |
102 | Token invalid | |
Client | ||
201 | Client missing | |
202 | Client invalid | |
Item | ||
301 | Item missing | |
302 | Item invalid | |
Invoice | ||
401 | Invoice missing | |
402 | Invoice invalid |
The Client's API allows you to create, delete, and update your customers. You can retrieve individual customers as well as a list of all your customers. The client object define client's details, such as action
, company_name
, first_name
, last_name
, email
, username
, address
, country_code
, state_code
, city
, zip
, phone_number
, cell_phone
and so on.
Add new client.
username
, password
, login_url
).
Request
curl POST https://zifflepay.com/v2/clients/create/
-H "Accept : application/json"
-H "Content-Type : application/json"
-H "Access-Identifier : Access-Identifier
"
-H "Access-Token : Access-Token
"
-d
{ "action": "client_create", "company_name": "Superior Insurance", "first_name": "Derick ", "last_name": "Pegram", "email": "derick.pegram@superiorInsurance.com", "username": "derick123", "address": "12000 Washington Street Suite 290", "country_code": "US", "state_code": "CO", "city": "Denver", "zip": "80022", "phone_number": "8574558555", "cell_phone": "8456985225", "send_notification": false }
Response
{ "code": 200, "message": "success", "client": { "company_name": "Superior Insurance", "first_name": "Derick ", "last_name": "Pegram", "email": "derick.pegram@superiorInsurance.com", "username": "derick123", "password": "THZXEFO@SW", "login_url": "https://zifflepay.com/users/login/", "address": "12000 Washington Street Suite 290", "country_code": "US", "state_code": "CO", "city": "Denver", "zip": "80022", "phone_number": "8574558555", "cell_phone": "8456985225" } }
The Item's API allows you to create, delete, and update item. An array of item object. The item object define item's details, such as action
, name
, description
, unit_cost
, quantity
, tax1
, tax2
, service_type
and unit_in_stock
.
Add new item.
Request
curl POST https://zifflepay.com/v2/items/create/
-H "Accept : application/json"
-H "Content-Type : application/json"
-H "Access-Identifier : Access-Identifier
"
-H "Access-Token : Access-Token
"
-d
{ "action": "item_create", "name": "Health Insurance", "description": "Long terms. 35 years plan.", "unit_cost": "100", "tax1": "2.00", "tax2": "3.00", "service_type": true, "unit_in_stock": "0" }
Response
{ "code": 200, "message": "success", "item": { "name": "Health Insurance", "description": "Long terms. 35 years plan.", "unit_cost": "100", "tax1": "2.00", "tax2": "3.00", "service_type": true, "unit_in_stock": "0" } }
Use the Invoice API to create, send, and manage invoices. To manage invoices, you can also list invoices, show details for invoices, delete draft invoices, and cancel sent invoices. The invoice object include invoice's details such as client's details, item's details, amount's details and so on.
Creates a invoice and sent to client
send_notification
must be send_invoice_pdf
is set as send_notification
must be inform_via
is defined.
action
, company_name
, first_name
, last_name
, email
, username
, address
, country_code
, state_code
, city
, zip
, phone_number
, cell_phone
and so on.
action
, name
, description
, unit_cost
, quantity
, tax1
, tax2
, service_type
and unit_in_stock
.
Request
curl POST https://zifflepay.com/v2/invoices/send/
-H "Accept : application/json"
-H "Content-Type : application/json"
-H "Access-Identifier : Access-Identifier
"
-H "Access-Token : Access-Token
"
-d
{ "action": "invoice_create", "invoice_action": "send", "type": "simple", "po_number": "123456", "date_of_issue": "2018-08-25", "discount": "0.00", "send_notification": "False", "send_invoice_pdf": "False", "inform_via": "Email", "terms": "", "notes": "", "client": { "action": "client_create", "company_name": "Superior Insurance", "first_name": "Derick ", "last_name": "Pegram", "email": "derick.pegram@superiorInsurance.com", "username": "derick123", "address": "12000 Washington Street Suite 290", "country_code": "US", "state_code": "CO", "city": "Denver", "zip": "80022", "phone_number": "8574558555", "cell_phone": "8456985225", "send_notification": false }, "items": [ { "action": "item_create", "name": "Health Insurance", "description": "Long terms. 35 years plan.", "unit_cost": "10", "quantity": "1", "tax1": "2.00", "tax2": "3.00", "service_type": true, "unit_in_stock": "0" } ] }
Response
{ "code": 1, "message": "success", "invoice": { "id": "1998", "invoice_no": "000006", "action": "invoice_create", "invoice_action": "send", "type": "simple", "po_number": "123456", "discount": "0.00", "send_notification": true, "send_invoice_pdf": true, "send_invoice_reminder": false, "inform_via": "Email", "invoice_status": "sent", "terms": "", "notes": "", "client": { "company_name": "Superior Insurance", "first_name": "Derick ", "last_name": "Pegram", "email": "derick.pegram@superiorInsurance.com", "username": "derick123", "password": "THZXEFO@SW", "login_url": "https://zifflepay.com/users/login/", "address": "12000 Washington Street Suite 290", "country_code": "US", "state_code": "CO", "city": "Denver", "zip": "80022", "phone_number": "8574558555", "cell_phone": "8456985225", "send_notification": false }, "items": [ { "name": "Health Insurance", "description": "Long terms. 35 years plan.", "unit_cost": "10", "quantity": "1", "tax1": "2.00", "tax2": "3.00", "service_type": true, "unit_in_stock": "0" } ], "amount": { "total": "10.00", "tax": "0.00", "discount": "0.00", "processing_fees": "5.00", "paid": "0.00", "balance": "15.00" } } }
The fundamental concept in any RESTful API is the resource. A resource is an object with a type, associated data, relationships to other resources
The client details, such as first name, last name, email, username, password, login url and so on.
{ "company_name": "Superior Insurance", "first_name": "Derick ", "last_name": "Pegram", "email": "derick.pegram@superiorInsurance.com", "username": "derick123", "password": "THZXEFO@SW", "login_url": "https://zifflepay.com/users/login/", "address": "12000 Washington Street Suite 290", "country_code": "US", "state_code": "CO", "city": "Denver", "zip": "80022", "phone_number": "8574558555", "cell_phone": "8456985225" }
The item details, such as name, description, unit cost and so on.
{ "name": "Health Insurance", "description": "Long terms. 35 years plan.", "unit_cost": "100", "quantity": "1", "tax1": "2.00", "tax2": "3.00", "service_type": true, "unit_in_stock": "0" }