Create an Invoice
Use this method to create an invoice in Komet Sales with its corresponding product items.
Valid Tokens: Company.
Invoices created through this method are subject to a transaction fee. Internal company transactions are generally exempt from this transaction fee.
For Multi-Currency Customers:
If the customer you are creating an invoice for has a different currency, you must enter prices in your customer's currency.
The system will automatically generate the invoice in your company's currency based on the exchange rate set up at the transaction time.
Request
URL: https://api.kometsales.com/api/invoice.create
Method: POST
Content-Type: Application/JSON
Input Parameters
authenticationToken (required)(string:50)
Komet Sales security token.
customerId (required if customerCode
is not given)(integer:20)
Customer ID.
You can get this value from the customer.list API method.
customerCode (required if customerId
is not given)(string:20)
Customer code.
customerDescription (required: if customerId
is not given) (string:200)
Customer name.
carrierId (required if carrierCode
is not given)(integer:20)
Carrier ID.
You can get this value from the carrier.list API method.
carrierCode (required if carrierId
is not given)(string:20)
Carrier code.
carrierDescription (required if carrierId
is not given)(string:200)
Carrier name.
shipDate (required)(date)
Shipping date.
Date format: YYYY-MM-DD
shipToId (optional)(integer:20)
Ship-To ID.
You can get this value from the customer.shipto.list API method.
poNumber (optional)(string:20)
Customer PO#.
reference (optional)(string:20)
Reference or AWB number.
warehouseInstructions (optional)(string:200)
Instructions for warehouse.
invoiceNotes (optional)(string:200)
Notes to print on the invoice.
returnAvailableBoxes (optional)(boolean)
If the system should return available boxes.
Valid values: 0 = No | 1 = Yes
Default is zero.
statusDraft (optional)(boolean)
Leave the order status as Draft instead of Pending Approval.
Valid values: 0 = Pending Approval | 1 = Draft
Default is zero.
This value must be 1 if you want to use the invoice.checkout API method once the order is finalized within your site.
locationId (optional)(integer:20)
Komet Sales internal Location ID.
Only applies to Multi-Location companies.
You can get this value from the location.list API method.
locationCode (optional)(string:10)
Location code.
Only applies to Multi-Location companies.
You can get this value from the location.list API method.
autoConfirm (optional)(boolean)
If you want the system to automatically confirm the order.
Valid values: True | False
Default is false.
createCarrierIfNotExists (optional)(boolean)
Create a Carrier.
If you want to create a new Carrier, you must send the carrierCode
and carrierDescription
parameters with valid values.
Valid values: True | False
Default is False.
useUnknownCustomerIfNotExists (optional)(boolean)
Use Unknown Customer if the specified Customer does not exist.
Valid values: True = Use Unknown Customer | False = Return an error requesting the correct Customer
additionalCharges (optional)(array)
An array of additional charges associated with the order.
code (required)(string:10)
Additional charge code.
If it's doesn't exist, the system will create it automatically.
name (optional)(string: 50)
Additional charge name. This field is required if the code
does not exist.
value (required)(decimal:10,3)
The amount of the additional charge.
items (array)
An array containing item lines that will be added to the invoice.
orderItemId (required: if productCode
is not given)(integer:20)
Komet Sales internal inventory item ID.
You can get this value from the inventory.list API method.
productCode (required if orderItemId
is not given)(string:20)
Komet Sales inventory item product code.
You can get this value from the product.list API method.
boxTypeCode (required if orderItemId
is not given)(string:3)
Komet Sales inventory item box type code.
You can get this value from the boxtype.list API method.
unitsPerBox (required if orderItemId
is not given)(integer:10)
Total units per box.
unitType (required if orderItemId
is not given)(string:5)
Unit type.
Valid values: Stem or Bunch
boxes (required)(integer:10)
Number of boxes.
price (required)(decimal:10,2)
Unit price.
markCode (optional)(string:20)
Item mark code.
productAlias (optional)(string:50)
Product description alias.
notes (optional)(string:200)
Item notes.
{
"authenticationToken": "token_info_goes_here",
"customerCode": "ANG",
"customerDescription": "Ang Flowers LLC",
"carrierCode": "AR",
"carrierDescription": "Armellini",
"poNumber": "2728",
"reference": "This is a reference",
"shipDate": "2014-09-10",
"warehouseInstructions": "This is where the instructions to the warehouse go.",
"invoiceNotes": "Invoice notes go here",
"returnAvailableBoxes":1,
"items":
[
{
"productCode": "RSAS60",
"boxes": 10,
"price":0.30,
"boxTypeCode": "HB",
"unitsPerBox": 6,
"unitType": "Bunch"
}
]
}
Response
status (integer:1)
Transaction status.
Valid values: 1 = Success | 0 = Failure
message (string:500)
Transaction status description.
invoiceId (integer:20)
Invoice ID.
invoiceNumber (integer:10)
Invoice number.
items (array)
An array containing items in the Invoice.
orderItemId (integer:10)
Item Id, only applies if you sent the orderItemId
.
productCode (string:20)
Product code.
Only applies if you sent the productCode
.
status: (integer:1)
Transaction status.
Valid values: 1 = Success | 0 = Failure
availableBoxes (integer:10)
Number of boxes that are available if returnAvailableBoxes
was requested.
invoiceItemId (array)
An array containing product line IDs that were added to the order.
When orderItemId
is given, the system will add only 1 item to the invoice. However, when productCode
is given, the system may add more than 1 line to order and for that reason, the system may return a few IDs.
{
"status": "0",
"message": "Item is not available",
"invoiceId": 111111111,
"invoiceNumber": 85443,
"items": [
{
"availableBoxes": 9,
"productCode": "RSAS60",
"status": 1,
"invoiceItemId": [
3427612,
3427613,
3427614
]
}
]
}
Related Articles
-
-
-
Add Invoice Notes to Prebooks (Knowledge Base)
-
Create a New Invoice (Knowledge Base)
-
Create an Invoice (API)