Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This method allows you to create an invoice on Komet Sales with

their

its corresponding product items.

Info

Invoices created through this method are subject to a transaction fee of 1.5%.

Request

URL: https://api.kometsales.com/api/invoice.create

The method requires a JSON format request.

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
  • customer ID. You can obtain this value from

the
  • the customer.list API method.

  • customerCode (required: if customerId is not given) (string:20):

Customer
  • customer Code.

 Under construction
customerName
  • customerDescription (required: if customerId is not given) (string:200):

Customer Name. Under construction
  • customer name.

  • carrierId (required: if carrierCode is not given)(integer:20):

Carrier Id
  • carrier ID. You can obtain this value from

the
  • the carrier.list API method.

  • carrierCode (required: if carrierId is not given) (string:20):

Carrier Code. Under constructioncarrierName
  • carrier code.

  • carrierDescription (required: if carrierId is not given) (string:200):

Carrier Name. Under construction
  • carrier name.

  • shipDate (required) (date): Shipping date (date format YYYY-MM-DD).

  • shipToId (integer:20): The Ship To ID. You can obtain this value from the customer.shipto.list API method.

  • poNumber (optional)(string:20) :

Customer
  • customer PO #.

  • reference (optional)(string:20): Reference or

Way
  • Airway Bill number.

  • warehouseInstructions (optional)(string:200):

Instructions
  • instructions for warehouse.

  • invoiceNotes (optional)(string:200):

Notes
  • notes to print on the invoice.

  • returnAvailableBoxes (optional)(boolean: 1 or 0): default 0. If it's 1, the response will include the number of boxes available for each given item.

items: Array
  • statusDraft (optional)(boolean: 1 or 0): default 0. If it's 1, the order will be left as Draft instead of Pending Approval. This value must be given as 1 if you want to use the invoice.checkout API method once the order is finalized within your site.

  • locationId (optional)(integer:20): location Komet Sales internal ID. You can obtain this value from the location.list API method. This only applies to companies in Multi-Location mode. 

  • locationCode (optional)(string:10): location code. You can obtain this value from the location.list API method. This only applies to companies in Multi-Location mode. 

  • autoConfirm (optional)(boolean): "True" if you want the system automatically confirm the order. By default is False. 

  • createCarrierIfNotExists (optional)(boolean): "True" if you want the system to create the carrier if it doesn't exist, in this case, you should send carrierCode and carrierDescription parameters with valid values.  By default is False. 

  • useUnknownCustomerIfNotExists (optional)(boolean): "False" if you don't want the system to use the "Unknown" customer in the case that it doesn't exist, in this case, the system will return an error message if the customer sent as parameter doesn't exist. By default is True. 

  • additionalCharges (optional): array of additional charges associated to the order. 

    • code (required)(string: 10): code of the additional charge. If it's doesn't exist in the system, it will be created automatically. 

    • name (optional)(string: 50): name of the additional charge. This field is important if the code sent doesn't exist. 

    • value (required)(decimal: 10,3): the amount of the additional charge. 

  • items: array of item lines that will be added to the invoice.

    • orderItemId (required: if productCode is not given)(integer:20):

Id
    • ID of the Komet Sales internal inventory item. This field is required if productCode is not given. This value can be obtained from the inventory.list API method.

    • productCode (required: if orderItemId is not given)(string:20):

Product
    • product code of the Komet Sales inventory item. This field is required if orderItemId is not given. You can obtain this value from the product.list API method.

 Under construction
    • boxTypeCode (required: if orderItemId is not given)(string:3):

Box
    • box type code of the Komet Sales inventory item. This field is required if orderItemId is not given. You can obtain this value from the boxtype.list API method.

 Under construction
    • unitsPerBox (required: if orderItemId is not given)(integer:10):

Units
    • units per box.

 Under construction
    • unitType (required: if orderItemId is not given)(string:5):

Stem
    • stem or

Bunch
    • bunch are the unique valid values.

 Under construction
    • boxes (required)(integer:10):

Number
    • number of boxes.

    • price (required) (decimal:10,2):

Unit
    • unit price.

    • markCode (optional)(string:20):

Item
    • item mark code.

    • productAlias (optional)(string:50):

Product
    • product description alias.

    • notes (optional)(string:200):

Item
    • item notes.

You can use either customerId or the customerCode and customerName but you cannot use both parameters at the same time. We recommend you to use the customerId which can be obtained from the customer.list API method.

You can use either carrierId or carrierCode and carrierName but you cannot use both parameters at the same time. We recommend you to use the carrierId which can be obtained from the carrier.list API method.

 

 

Sample

1

Request

Code Block
{

"authenticationToken": "token_info_goes_here",
"customerCode": "ANG",
"
customerId
customerDescription":
99999
 "Ang Flowers LLC", 
"carrierCode": "AR",

"
carrierName
carrierDescription": "Armellini",

"
shipDate
poNumber": "
2014-04-10
2728", 
"
poNumber
reference": "
PO9999",
This is a 
"
reference",
"shipDate": "
R99999
2014-09-10",

"
instructions
warehouseInstructions": "
Text for
This is where the instructions
",
 to the warehouse go.",
"
labelInstructions
invoiceNotes": "
Text
Invoice 
for
notes 
label
go 
instructions
here",
"returnAvailableBoxes":1,
"items":

[


{

"
orderItemId
productCode": 
9999999,
"RSAS60", 
"boxes": 
5,
10,
"price":
2
0.
50
30,

"
markCode
boxTypeCode": "
text for mark code
HB",

"
productAlias
unitsPerBox"
: 
"text for product alias", "notes
6,
"unitType": "
text for notes
Bunch"
}

]
}

 

Sample 2

Response

Output

  • status (integer:1): transaction status. 1 for success or 0 for failure.

  • message (string:500): description of the status of the transaction.

  • invoiceId (integer:20): invoice ID.

  • invoiceNumber (integer:10): invoice number.

  • items (array)

    • status: (integer:1): transaction status. 1 for success or 0 for failure.

    • orderItemId (integer:10)(if orderItemId was given).

    • productCode (string:20)(if productCode was given).

    • availableBoxes (integer:10): number of boxes that are available if returnAvailableBoxes is given.

    • invoiceItemId (array): array of the product line IDs that were added to the order. When an orderItemId is given, the system will add only 1 item to the invoice. However, when the productCode is given, the system may add more than 1 line to order and for that reason, the system may return a few IDs.

Sample Response

Code Block
{
  "
authenticationToken
status": "
token_info_goes_here
0",
  "
customerId
message": 
99999,
"Item is not 
"carrierCode": "AR"
available",
  
"
carrierName
invoiceId": 
"Armellini"
111111111,

  "
shipDate
invoiceNumber": 
"2014-04-10"
85443,
   "
poNumber
items": 
"PO9999",
[
  
"reference"
 
:
 
"R99999",
{
   
"instructions":
 
"Text
 
for
 
instructions",
  
"
labelInstructions
availableBoxes": 
"Text for label instructions", "items": [ {
9,
        "productCode": "
RS50
RSAS60",
        "
boxTypeCode
status": 
"HB",
1,
 
"unitsPerBox":
 
150,
      
"
unitType
invoiceItemId": 
"Stem",
[
         
"boxes":
 
5,
  3427612,
     
"price":
 
2.50,
      3427613,
"markCode":
 
"text
 
for
 
mark
 
code",
        
"productAlias"
3427614
:
 
"text
 
for
 
product
 
alias",
    
]
  
"notes":
 
"text
 
for
}
notes"
   ]  
}
 
 }

Response

Output:

  • status (integer:1): Transaction status. 1 for success or 0 for failure.
  • message (string:500): Description of the status of the transaction.
  • invoiceId (integer:20): Invoice id.
  • invoiceNumber (integer:10): Invoice number.
  • availableBoxes (integer:10): Number of boxes that are available if the transactions fails. Under construction

Sample 1

 

Code Block
 {
  "status": "1",
  "message": "success",
  "invoiceId": 111111111,
  "invoiceNumber": 85443
 }

Sample 2

 

Code Block
 {
  "status": "0",
  "message": "Item is not available",
  "invoiceId": 111111111,
  "invoiceNumber": 85443,
  "availableBoxes":2
 }

 

Multicurrency Option Enabled

If the customer for who you are creating an invoice has a different currency, you should enter prices in your customer's currency and the system will generate the invoice in your company's currency, based on the exchange rate set up at the time of the transaction.

Filter by label (Content by label)
showLabelsfalse
max5
sorttitle
titleRelated Articles
cqllabel in ( "invoice" , "order" , "create-invoice" , "invoice-creation" )
labelsinvoice invoice-creation order create-invoice