InvoiceItem Class
This is a Simplify domain object. In order to get access to a domain object, a client needs to be created. The client is then used to invoke the different methods e.g.
var client = Simplify.getClient({
publicKey: 'YOUR_PUBLIC_API_KEY',
privateKey: 'YOUR_PRIVATE_API_KEY'
});
client.invoiceitem.METHOD_NAME(params, function(error, data){
if(error){
// handle the error
}
// Awesome...no error, handle the data
});
Constructor
InvoiceItem
-
appKeys
Parameters:
-
appKeys
ObjectObject containing the public & private API keys
Methods
create
-
params
-
callback
Function to create a InvoiceItem object.
Parameters:
-
params
ObjectA map of parameters in which to create the InvoiceItem from.
Valid parameters include:- amount : Amount of the invoice item in the smallest unit of your currency. Example: 100 = $1.00 (REQUIRED)
- description : Individual items of an invoice [max length: 1024]
- invoice : The ID of the invoice this item belongs to.
- product : Product ID this item relates to.
- quantity : Quantity of the item. This total amount of the invoice item is the amount * quantity. [min value: 1, max value: 999999, default: 1]
- reference : User defined reference field. [max length: 255]
- tax : The tax ID of the tax charge in the invoice item.
NOTE: Any parameters with a sub-parameter (e.g. param.subParam) need to be nested when passed as an argument in e.g.{ param: { subParam1: 'value', subParam2: 'value' } }
-
callback
FunctionA function to handle success/error responses from the API.
The function takes 2 parameters, the first is an error object. This is null if no error occurs. The second parameter is the response data. This is null if an error occurs.
delete
-
A
-
callback
Function to delete a InvoiceItem object.
Parameters:
-
A
Objectstring ID of the InvoiceItem to delete.
-
callback
FunctionA function to handle success/error responses from the API.
The function takes 2 parameters, the first is an error object. This is null if no error occurs. The second parameter is the response data. This is null if an error occurs.
find
-
id
-
callback
Function to retrieve a InvoiceItem object from the API.
Parameters:
-
id
StringThe ID of the InvoiceItem to retrieve
-
callback
FunctionA function to handle success/error responses from the API.
The function takes 2 parameters, the first is an error object. This is null if no error occurs. The second parameter is the response data. This is null if an error occurs.
update
-
params
-
callback
Function to update a InvoiceItem object.
Parameters:
-
params
ObjectA map of parameters on which to update the InvoiceItem object.
Valid parameters include:- id : A string ID of the InvoiceItem object to update
- amount : Amount of the invoice item in the smallest unit of your currency. Example: 100 = $1.00 [min value: 1]
- description : Individual items of an invoice
- quantity : Quantity of the item. This total amount of the invoice item is the amount * quantity. [min value: 1, max value: 999999]
- reference : User defined reference field.
- tax : The tax ID of the tax charge in the invoice item.
NOTE: Any parameters with a sub-parameter (e.g. param.subParam) need to be nested when passed as an argument in e.g.{ param: { subParam1: 'value', subParam2: 'value' } }
-
callback
FunctionA function to handle success/error responses from the API.
The function takes 2 parameters, the first is an error object. This is null if no error occurs. The second parameter is the response data. This is null if an error occurs.