|
► Read Invoice
curl –H 'X-api_key{value}' http://companyid.seasoo.net/api/Invoice/402881cd2feb18e8012feb18e8de0000
-> Return one JSON object of invoice
► Query Invoices
curl –H 'X-api_key: {value}' http://companyid.seasoo.net/api/Invoice?invoiceDate>'2010-09-07'&&clientId==201
-> Return array of JSON object of invoice, which has invoice date after 07.Sep.2011 and client with clientId=201
invoiceDate is filter-parameter. Following filter-parameters are supported:
|
Parameter
|
Type
|
Description
|
|
clientId
|
Long
|
Id of client, whom this invoice belongs to. E.g. clientId=23
|
|
invoiceNumber
|
String
|
Invoice number, which displays in invoice. E.g. invoiceNumber=’RG2010/02/0002’
|
|
State
|
Short
|
Draft=0, Sent=2, Posted=4, Viewed=6, Partial=8, Disputed=10, Paid=12
|
|
invoiceDate
|
Datetime
|
Date of issuing of this invoice, with format of yyyy-mm-dd. E.g. invoiceDate=’2010-09-07’, invoiceDate > ’2010-09-01’ && invoiceDate < ’2010-09-07’
|
|
creatorEmail
|
String
|
Email of creator
|
|
dueDate
|
Datetime
|
Due date of this invoice
|
|
invoiceTotal
|
Double
|
Total amount of this invoice. E.g. invoiceTotal < 2000.34 && invoiceTotal > 1000.25
|
► Insert Invoice
POST/PUT http://companyid.seasoo.net/api/Invoice
with api_key and following request body:
{"clientId":204,
"invoiceDate":"2010-09-07",
"itemInvoiceLines":[{"item":"first item name","description":"some
description","unitCost":20.50, "quantity":35.76, "tax1Name":"TAX"},
{"item":"second item name","description":"some
description","unitCost":20, "quantity":40}],
"hourInvoiceLines":[{"task":"task name","description":"some description","rate":20.70,
"hours":6.75,"tax1Name":"MwSt"}]
}
-> Response has http status code = 201 if successfully. Otherwise it returns status code 500.
Following field-names for invoice are supported:
|
Field-name
|
Type
|
Description
|
|
clientId
|
Long
|
Mandatory. The id of client in system.
|
|
invoiceDate
|
Datetime
|
Default is today.
|
|
invoiceNumber
|
String
|
Optional. If not available, system will assign the next number base on last invoice number in system.
|
|
dueDate
|
Datetime
|
Default date is calculated bases on default term of payment in system.
|
|
invoiceLanguage
|
String
|
The language of this invoice, "en" for English and "de" for German. Default is default invoice language in system.
|
|
currency
|
String
|
ISO-currency code. E.g. "EUR","USD","CAD"
|
|
poNr
|
String
|
Purchase order number
|
|
paymentGateway
|
Short
|
Default is -1. It means no payment gateway. The following gateways are supported: 0 for PayPal Standard, 5 for Google Checkout and 10 for Authorize.Net
|
itemInvoiceLines contains array of itemInvoiceLine, which presents one line of item in invoice. The following field-names for itemInvoiceLine are supported:
|
Field-name
|
Type
|
Description
|
|
item
|
String
|
Name or ID of item
|
|
description
|
String
|
Description about this item
|
|
unitCost
|
Double
|
Unit cost of this item
|
|
quantity
|
Double
|
Quantity of item
|
|
discountPercentage
|
Double
|
Optional. From 0.00 to 100. E.g. 1.50 means discount 1.5% of price
|
|
discountFlat
|
Double
|
Optional. Amount of currency. E.g. Invoice has currency = EUR, discountFlat=19.87 means discount 19.87 EUR.
|
|
tax1Name
|
String
|
Name of tax in system.
|
|
tax2Name
|
String
|
Name of tax in system.
|
hourInvoiceLines contains array of hourInvoiceLine, which presents one line of hour in invoice. The following field-names for hourInvoiceLine are supported:
|
Field-name
|
Type
|
Description
|
|
task
|
String
|
Name of task
|
|
description
|
String
|
Description about this task
|
|
rate
|
Double
|
Cost of this task in one hour
|
|
hours
|
Double
|
Amount of hour for this task
|
|
discountPercentage
|
Double
|
Optional. From 0.00 to 100. E.g. 1.50 means discount 1.5% of price
|
|
discountFlat
|
Double
|
Optional. Amount of currency. E.g. Invoice has currency = EUR, discountFlat=19.87 means discount 19.87 EUR.
|
|
tax1Name
|
String
|
Name of tax in system.
|
|
tax2Name
|
String
|
Name of tax in system.
|
► Update Invoice
Like insert invoice, only URL is different:
POST/PUT http://companyid.seasoo.net/api/Invoice/{id}
with request body is content of invoice.
► Delete Invoice
DELETE http://companyid.seasoo.net/api/Invoice/{id}
-> Response has status code = 204 in case of success and 404 in case of not success.
|