Versions Compared

Key

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

This method allows you to create an invoice

on

in Komet Sales with its corresponding product items.

Tip

Valid Tokens: Company.

Info

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

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



Request


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

Method: POST

Content-Type: Application/JSON


Input Parameters

authenticationToken 

authenticationToken (required)(string:50)

:

Komet Sales security token.

customerId 

customerId (required

:

if customerCode is not given)(integer:20)

: customer

Customer ID. You can

obtain

get this value from the customer.list API method.


customerCode (required

:

if customerId is not given)(string:20)

: customer Code

Customer code.


customerDescription (required: if customerId is not given) (string:200)

: customer

Customer name.


carrierId (required

:

if carrierCode is not given)(integer:20)

: carrier

Carrier ID.

You can

obtain

get this value from the carrier.list API method.


carrierCode (required

:

if carrierId is not given)(string:20)

: carrier

Carrier code.


carrierDescription (required

:

if carrierId is not given)(string:200)

: carrier

Carrier name.


shipDate (required)(date)

:

Shipping date

(date

.

Date format: YYYY-MM-DD

).


shipToId (optional)(integer:20)

: The

Ship-To ID.

 You

 

You can

obtain

get this value from

the  API

 API method.


poNumber (optional)(string:20)

: customer PO #

Customer PO#.


reference (optional)(string:20)

:

Reference or

Airway Bill

AWB 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

)

If the system should return available boxes.

Valid values: 0 = No | 1 = Yes

Default is zero.


statusDraft (optional)(boolean

: 1 or 0): default 0. If it's 1, the order will be left

)

Leave the order status as Draft instead of Pending Approval.

Valid values: 0 = Pending Approval | 1 = Draft

Default is zero.

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 Location ID.

Only applies to Multi-Location companies. 

You can

obtain

get 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

Location code.

Only applies to Multi-Location companies. 

You can get this value from the location.list API method.

This only applies to companies in Multi-Location mode. 


autoConfirm (optional)(boolean)

: "True" if

If you want the system to automatically confirm the order.

By default is False. 

Valid values: True | False

Default is false.


createCarrierIfNotExists (optional)(boolean)

: "True" if

Create a Carrier.

If you want

the system

to create

the carrier if it doesn't exist, in this case

a new Carrier, you

should

must send the carrierCode and carrierDescription parameters with valid values.

 By default

Valid values: True | False

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. 

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

to

with the order. 


code (required)(string:10)

: code of the additional charge.

Additional charge code.

If it's doesn't exist

in

, the system

,

will create it

will be created

automatically. 


name (optional)(string: 50)

: name of the additional charge

Additional charge name. This field is

important

required if the code

sent doesn't

does not exist. 


value (required)(decimal:10,3)

: the

The amount of the additional charge. 


items

: array of

(array)

An array containing item lines that will be added to the invoice.


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

: ID of the

Komet Sales internal inventory item

. This field is required if productCode is not given. This value can be obtained

ID.

You can get this value from the inventory.list API method.


productCode (required

:

if orderItemId is not given)(string:20)

: product code of the

Komet Sales inventory item

. This field is required if orderItemId is not given.

product code.

You can

obtain

get this value from the product.list API method.


boxTypeCode (required

:

if orderItemId is not given)(string:3)

: box type code of the

Komet Sales inventory item

. This field is required if orderItemId is not given. You can obtain

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 

unitType (required

:

if orderItemId is not given)(string:5)

: stem or bunch are the unique valid values.boxes 

Unit type.

Valid values: Stem or Bunch


boxes (required)(integer:10)

: number

Number of boxes.

price 

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 Request


Code Block
{
"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

Output


status (integer:1)

: transaction

Transaction status. 1

for success or 0 for failure.

= Success | 0 = Failure


message (string:500)

: description of the status of the transaction

Transaction status description.


invoiceId (integer:20)

: invoice

Invoice ID.


invoiceNumber (integer:10)

: invoice

Invoice number.


items (array)

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

An array containing items in the Invoice.


orderItemId (integer:10)

(if orderItemId was given)

Item Id, only applies if you sent the orderItemId.


productCode (string:20)

(if productCode was given).

Product code. Only applies if you sent the productCode.


status: (integer:1)

Transaction status. 1 = Success | 0 = Failure


availableBoxes (integer:10)

: number

Number of boxes that are available if returnAvailableBoxes

 is given

was requested.


invoiceItemId (array)

:

An array

of the

containing 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
{
  "status": "0",
  "message": "Item is not available",
  "invoiceId": 111111111,
  "invoiceNumber": 85443,
   "items": [
    {
        "availableBoxes": 9,
        "productCode": "RSAS60",
        "status": 1,
        "invoiceItemId": [
            3427612,
            3427613,
            3427614
        ]
    }
   ]   
 }

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)showLabelsfalsemax5sorttitletitleRelated Articlescqllabel in ( "invoice" , "order" , "create-invoice" , "invoice-creation" )labelsinvoice invoice-creation order create-invoice