Versions Compared

Key

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

Overview

Excerpt

This method allows you to create an invoice on Komet Sales with their its corresponding product items.

 

Request

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 Idcustomer ID. You can obtain this value from thecustomer.list API method.
  • customerCode (required: if customerId is not given) (string:20): Customer customer Code.
  • customerDescription (required: if customerId is not given) (string:200): Customer Namecustomer name.
  • carrierId (required: if carrierCode is not given)(integer:20): Carrier Idcarrier ID. You can obtain this value from thecarrier.list API method.
  • carrierCode (required: if carrierId is not given) (string:20): Carrier Codecarrier code.
  • carrierDescription (required: if carrierId is not given) (string:200): Carrier Namecarrier name.
  • shipDate (required) (date): Shipping date (date format YYYY-MM-DD).
  • poNumber (optional)(string:20) : Customer customer PO #.
  • reference (optional)(string:20): Reference reference or Way Bill way 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 default 0. If it's 1, the response will include the number of boxes available for each given item.
  • statusDraft (optional)(boolean: 1 or 0): Default 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 in within your site.
  • items: Array 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.
    • 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.
    • unitsPerBox (required: if orderItemId is not given)(integer:10): Units units per box.
    • unitType (required: if orderItemId is not given)(string:5): Stem stem or Bunch bunch are the unique valid values.
    • 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.

Code Block
themeConfluence
languagejs
titleSample 1
{
  "authenticationToken": "token_info_goes_here",
  "customerId": 99999,
  "carrierId": 423, 
  "shipDate": "2014-04-10",
  "poNumber": "PO9999",
  "reference" : "R99999", 
  "warehouseInstructions": "Text for instructions", 
  "invoiceNotes": "Text for label instructions",
  "items": 
   [
    {
      "orderItemId": 9999999,   
      "boxes": 5, 
      "price": 2.50,
      "markCode": "text for mark code", 
      "productAlias" : "text for product alias", 
      "notes": "text for notes"
    }
 ]
}
Code Block
themeConfluence
languagejs
titleSample 2
{
  "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.
  • message (string:500): Description description of the status of the transaction.
  • invoiceId (integer:20): Invoice idinvoice ID.
  • invoiceNumber (integer:10): Invoice invoice number.
  • items (array)
    • status: (integer:1): Transaction 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 number of boxes that are available if returnAvailableBoxes is given.
    • invoiceItemId (array): 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.
Code Block
themeConfluence
languagejs
titleSample 1
{
  "status": "1",
  "message": "success",
  "invoiceId": 111111111,
  "invoiceNumber": 85443,
  "items": [
    {
        "status": 1,
        "orderItemId": 9999999,
        "invoiceItemId": [
            3427615
         ]
    }
   ]
 }
Code Block
themeConfluence
languagejs
titleSample 2
 {
  "status": "0",
  "message": "Item is not available",
  "invoiceId": 111111111,
  "invoiceNumber": 85443,
   "items": [
    {
        "availableBoxes": 9,
        "productCode": "RSAS60",
        "status": 1,
        "invoiceItemId": [
            3427612,
            3427613,
            3427614
        ]
    }
   ]   
 }