InvoiceItem
Line items for invoices.
Examples
Create InvoiceItem
PaymentsApi.PUBLIC_KEY = "YOUR_PUBLIC_API_KEY";
PaymentsApi.PRIVATE_KEY = "YOUR_PRIVATE_API_KEY";
InvoiceItem invoiceItem = InvoiceItem.create(new PaymentsMap()
.set("amount", 1000L)
.set("description", "Invoice Item1")
.set("invoice", "[INVOICE ID]")
.set("reference", "ref111")
);
System.out.println(invoiceItem);
require 'simplify'
Simplify::public_key = "YOUR_PUBLIC_API_KEY"
Simplify::private_key = "YOUR_PRIVATE_API_KEY"
invoiceItem = Simplify::InvoiceItem.create({
"reference" => "ref111",
"amount" => "1000",
"description" => "Invoice Item1",
"invoice" => "[INVOICE ID]"
})
puts invoiceItem.inspect
import simplify
simplify.public_key = "YOUR_PUBLIC_API_KEY"
simplify.private_key = "YOUR_PRIVATE_API_KEY"
invoiceItem = simplify.InvoiceItem.create({
"reference" : "ref111",
"amount" : "1000",
"description" : "Invoice Item1",
"invoice" : "[INVOICE ID]"
})
print(invoiceItem)
<?php
require_once("./lib/Simplify.php");
Simplify::$publicKey = 'YOUR_PUBLIC_API_KEY';
Simplify::$privateKey = 'YOUR_PRIVATE_API_KEY';
$invoiceItem = Simplify_InvoiceItem::createInvoiceItem(array(
'reference' => 'ref111',
'amount' => '1000',
'description' => 'Invoice Item1',
'invoice' => '[INVOICE ID]'
));
print_r($invoiceItem);
?>
use Net::Simplify;
$Net::Simplify::public_key = "YOUR_PUBLIC_API_KEY";
$Net::Simplify::private_key = "YOUR_PRIVATE_API_KEY";
my $invoiceItem = Net::Simplify::InvoiceItem->create({
reference => "ref111",
amount => "1000",
description => "Invoice Item1",
invoice => "[INVOICE ID]"
});
print "InvoiceItem ID ", $invoiceItem->{id}, "\n";
using SimplifyCommerce.Payments;
PaymentsApi.PublicApiKey = "YOUR_PUBLIC_KEY";
PaymentsApi.PrivateApiKey = "YOUR_PRIVATE_KEY";
PaymentsApi api = new PaymentsApi();
InvoiceItem invoiceItem = new InvoiceItem();
invoiceItem.Amount = 1000;
invoiceItem.Description = "Invoice Item1";
invoiceItem.Invoice = "[INVOICE ID]";
invoiceItem.Reference = "ref111";
try
{
invoiceItem = (InvoiceItem)api.Create(invoiceItem);
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
var Simplify = require("simplify-commerce"),
client = Simplify.getClient({
publicKey: 'YOUR_PUBLIC_API_KEY',
privateKey: 'YOUR_PRIVATE_API_KEY'
});
client.invoiceitem.create({
reference : "ref111",
amount : "1000",
description : "Invoice Item1",
invoice : "[INVOICE ID]"
}, function(errData, data){
if(errData){
console.error("Error Message: " + errData.data.error.message);
// handle the error
return;
}
console.log("Success Response: " + JSON.stringify(data));
});
INPUT PARAMETERS
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]
optional
invoice
The ID of the invoice this item belongs to.
optional
product
Product ID this item relates to.
optional
quantity
Quantity of the item. This total amount of the invoice item is the amount * quantity.
[min value: 1, max value: 999999, default:
optional
1
]
reference
User defined reference field.
[max length: 255]
optional
tax
The tax ID of the tax charge in the invoice item.
optional
OUTPUT
id
Unique id of the invoice item
tax.id
Unique id of the tax object.
amount
Amount of the invoice item in the smallest unit of your currency. Example: 100 = $1.00
dateCreated
Date in UTC millis the invoice line item was created in the system
description
Description of the invoice item
quantity
Quantity of the item. This total amount of the invoice item is the amount * quantity.
reference
User defined reference field.
tax
The tax ID of the tax charge in the invoice item.
tax.label
The label of the tax object.
tax.rate
The tax rate. Decimal value up three decimal places. e.g 12.501.
totalAmount
The total amount of this line item. e.g. amount * quantity.
Examples
Delete InvoiceItem
PaymentsApi.PUBLIC_KEY = "YOUR_PUBLIC_API_KEY";
PaymentsApi.PRIVATE_KEY = "YOUR_PRIVATE_API_KEY";
InvoiceItem invoiceItem = InvoiceItem.find("4TR6Bc");
invoiceItem = invoiceItem.delete();
System.out.println(invoiceItem);
require 'simplify'
Simplify::public_key = "YOUR_PUBLIC_API_KEY"
Simplify::private_key = "YOUR_PRIVATE_API_KEY"
invoiceItem = Simplify::InvoiceItem.find('4TR6Bc')
invoiceItem = invoiceItem.delete()
puts invoiceItem.inspect
import simplify
simplify.public_key = "YOUR_PUBLIC_API_KEY"
simplify.private_key = "YOUR_PRIVATE_API_KEY"
invoiceItem = simplify.InvoiceItem.find('4TR6Bc')
invoiceItem.delete()
<?php
require_once("./lib/Simplify.php");
Simplify::$publicKey = 'YOUR_PUBLIC_API_KEY';
Simplify::$privateKey = 'YOUR_PRIVATE_API_KEY';
$obj = Simplify_InvoiceItem::findInvoiceItem('4TR6Bc');
$obj = $obj->deleteInvoiceItem();
?>
use Net::Simplify;
$Net::Simplify::public_key = "YOUR_PUBLIC_API_KEY";
$Net::Simplify::private_key = "YOUR_PRIVATE_API_KEY";
$invoiceItem = Net::Simplify::InvoiceItem->find('4TR6Bc');
$invoiceItem->delete();
using SimplifyCommerce.Payments;
PaymentsApi.PublicApiKey = "YOUR_PUBLIC_KEY";
PaymentsApi.PrivateApiKey = "YOUR_PRIVATE_KEY";
PaymentsApi api = new PaymentsApi();
try
{
String id = "1234";
InvoiceItem invoiceItem = (InvoiceItem)api.Find(typeof(InvoiceItem), id);
invoiceItem = (InvoiceItem)api.Delete(typeof(InvoiceItem), invoiceItem.Id);
Console.WriteLine (invoiceItem.Id);
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
var Simplify = require("simplify-commerce"),
client = Simplify.getClient({
publicKey: 'YOUR_PUBLIC_API_KEY',
privateKey: 'YOUR_PRIVATE_API_KEY'
});
client.invoiceitem.delete("4TR6Bc", function(errData, data){
if(errData){
console.error("Error Message: " + errData.data.error.message);
// handle the error
return;
}
console.log("Success Response: " + JSON.stringify(data));
});
INPUT PARAMETERS
id
Object ID
required
OUTPUT
id
Unique id of the invoice item
tax.id
Unique id of the tax object.
amount
Amount of the invoice item in the smallest unit of your currency. Example: 100 = $1.00
dateCreated
Date in UTC millis the invoice line item was created in the system
description
Description of the invoice item
quantity
Quantity of the item. This total amount of the invoice item is the amount * quantity.
reference
User defined reference field.
tax
The tax ID of the tax charge in the invoice item.
tax.label
The label of the tax object.
tax.rate
The tax rate. Decimal value up three decimal places. e.g 12.501.
totalAmount
The total amount of this line item. e.g. amount * quantity.
Examples
Find InvoiceItem
PaymentsApi.PUBLIC_KEY = "YOUR_PUBLIC_API_KEY";
PaymentsApi.PRIVATE_KEY = "YOUR_PRIVATE_API_KEY";
InvoiceItem invoiceItem = InvoiceItem.find("4TR6Bc");
System.out.println (invoiceItem);
require 'simplify'
Simplify::public_key = "YOUR_PUBLIC_API_KEY"
Simplify::private_key = "YOUR_PRIVATE_API_KEY"
invoiceItem = Simplify::InvoiceItem.find('4TR6Bc')
puts invoiceItem.inspect
import simplify
simplify.public_key = "YOUR_PUBLIC_API_KEY"
simplify.private_key = "YOUR_PRIVATE_API_KEY"
invoiceItem = simplify.InvoiceItem.find('4TR6Bc')
print(invoiceItem)
<?php
require_once("./lib/Simplify.php");
Simplify::$publicKey = 'YOUR_PUBLIC_API_KEY';
Simplify::$privateKey = 'YOUR_PRIVATE_API_KEY';
$obj = Simplify_InvoiceItem::findInvoiceItem('4TR6Bc');
print_r($obj);
?>
use Net::Simplify;
$Net::Simplify::public_key = "YOUR_PUBLIC_API_KEY";
$Net::Simplify::private_key = "YOUR_PRIVATE_API_KEY";
$invoiceItem = Net::Simplify::InvoiceItem->find('4TR6Bc');
print $invoiceItem->{id}, "\n";
using SimplifyCommerce.Payments;
using Newtonsoft.Json;
PaymentsApi.PublicApiKey = "YOUR_PUBLIC_KEY";
PaymentsApi.PrivateApiKey = "YOUR_PRIVATE_KEY";
PaymentsApi api = new PaymentsApi();
try
{
String id = "1234";
InvoiceItem invoiceItem = (InvoiceItem)api.Find(typeof(InvoiceItem), id);
// output all properties
Console.WriteLine(JsonConvert.SerializeObject(invoiceItem).ToString());
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
var Simplify = require("simplify-commerce"),
client = Simplify.getClient({
publicKey: 'YOUR_PUBLIC_API_KEY',
privateKey: 'YOUR_PRIVATE_API_KEY'
});
client.invoiceitem.find("4TR6Bc", function(errData, data){
if(errData){
console.error("Error Message: " + errData.data.error.message);
// handle the error
return;
}
console.log("Success Response: " + JSON.stringify(data));
});
INPUT PARAMETERS
id
Object ID
required
OUTPUT
id
Unique id of the invoice item
tax.id
Unique id of the tax object.
amount
Amount of the invoice item in the smallest unit of your currency. Example: 100 = $1.00
dateCreated
Date in UTC millis the invoice line item was created in the system
description
Description of the invoice item
quantity
Quantity of the item. This total amount of the invoice item is the amount * quantity.
reference
User defined reference field.
tax
The tax ID of the tax charge in the invoice item.
tax.label
The label of the tax object.
tax.rate
The tax rate. Decimal value up three decimal places. e.g 12.501.
totalAmount
The total amount of this line item. e.g. amount * quantity.
Examples
Update InvoiceItem
PaymentsApi.PUBLIC_KEY = "YOUR_PUBLIC_API_KEY";
PaymentsApi.PRIVATE_KEY = "YOUR_PRIVATE_API_KEY";
InvoiceItem invoiceItem = InvoiceItem.find("4TR6Bc");
invoiceItem.set("amount", 2000L);
invoiceItem.set("description", "Invoice Item2");
invoiceItem.update();
require 'simplify'
Simplify::public_key = "YOUR_PUBLIC_API_KEY"
Simplify::private_key = "YOUR_PRIVATE_API_KEY"
invoiceItem = Simplify::InvoiceItem.find('4TR6Bc')
updates = {
"amount" => "2000",
"description" => "Invoice Item2"
}
invoiceItem.merge!(updates)
invoiceItem = invoiceItem.update()
puts invoiceItem.inspect
import simplify
simplify.public_key = "YOUR_PUBLIC_API_KEY"
simplify.private_key = "YOUR_PRIVATE_API_KEY"
invoiceItem = simplify.InvoiceItem.find('4TR6Bc')
invoiceItem["amount"] = '2000'
invoiceItem["description"] = 'Invoice Item2'
invoiceItem.update()
<?php
require_once("./lib/Simplify.php");
Simplify::$publicKey = 'YOUR_PUBLIC_API_KEY';
Simplify::$privateKey = 'YOUR_PRIVATE_API_KEY';
$invoiceItem = Simplify_InvoiceItem::findInvoiceItem('4TR6Bc');
$updates = array(
'amount' => '2000',
'description' => 'Invoice Item2'
);
$invoiceItem->setAll($updates);
$invoiceItem->updateInvoiceItem();
?>
use Net::Simplify;
$Net::Simplify::public_key = "YOUR_PUBLIC_API_KEY";
$Net::Simplify::private_key = "YOUR_PRIVATE_API_KEY";
$invoiceItem = Net::Simplify::InvoiceItem->find('4TR6Bc');
$invoiceItem->{amount} = "2000";
$invoiceItem->{description} = "Invoice Item2";
$invoiceItem->update();
using SimplifyCommerce.Payments;
PaymentsApi.PublicApiKey = "YOUR_PUBLIC_KEY";
PaymentsApi.PrivateApiKey = "YOUR_PRIVATE_KEY";
PaymentsApi api = new PaymentsApi();
string id = "1234";
InvoiceItem invoiceItem = (InvoiceItem)api.Find(typeof(InvoiceItem), id);
invoiceItem.Amount = 2000;
invoiceItem.Description = "Invoice Item2";
try
{
invoiceItem = (InvoiceItem)api.Update(invoiceItem);
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
var Simplify = require("simplify-commerce"),
client = Simplify.getClient({
publicKey: 'YOUR_PUBLIC_API_KEY',
privateKey: 'YOUR_PRIVATE_API_KEY'
});
client.invoiceitem.update({
id: "4TR6Bc", // ID of object to update
amount : "2000",
description : "Invoice Item2"
}, function(errData, data){
if(errData){
console.error("Error Message: " + errData.data.error.message);
// handle the error
return;
}
console.log("Success Response: " + JSON.stringify(data));
});
INPUT PARAMETERS
id
ID of the invoice item to update.
required
amount
Amount of the invoice item in the smallest unit of your currency. Example: 100 = $1.00
[min value: 1, max value: 9999900]
optional
description
Individual items of an invoice
optional
quantity
Quantity of the item. This total amount of the invoice item is the amount * quantity.
[min value: 1, max value: 999999]
optional
reference
User defined reference field.
optional
tax
The tax ID of the tax charge in the invoice item.
optional
OUTPUT
id
Unique id of the invoice item
tax.id
Unique id of the tax object.
amount
Amount of the invoice item in the smallest unit of your currency. Example: 100 = $1.00
dateCreated
Date in UTC millis the invoice line item was created in the system
description
Description of the invoice item
quantity
Quantity of the item. This total amount of the invoice item is the amount * quantity.
reference
User defined reference field.
tax
The tax ID of the tax charge in the invoice item.
tax.label
The label of the tax object.
tax.rate
The tax rate. Decimal value up three decimal places. e.g 12.501.
totalAmount
The total amount of this line item. e.g. amount * quantity.