Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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

Request

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

The method requires a JSON format request.

Input Parameters:

  • authenticationToken (required)(string:50): Komet Sales security token.
  • customerId (required: if customerCode is not given)(integer:20): Customer Id. You can obtain this value from thecustomer.list API method.
  • customerCode (required: if customerId is not given) (string:20): Customer Code. Under construction
  • customerName (required: if customerId is not given) (string:200): Customer Name. Under construction
  • carrierId (required: if carrierCode is not given)(integer:20) : Carrier Id. You can obtain this value from thecarrier.list API method.
  • carrierCode (required: if carrierId is not given) (string:20) : Carrier Code. Under construction
  • carrierName (required: if carrierId is not given) (string:200) : Carrier Name. Under construction
  • shipDate (required) (date): Shipping date (date format YYYY-MM-DD).
  • poNumber (optional)(string:20) : Customer PO #.
  • reference (optional)(string:20): Reference or Way Bill number.
  • warehouseInstructions (optional)(string:200): Instructions for warehouse.
  • invoiceNotes (optional)(string:200): Notes to print on the invoice.
  • items: Array of 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 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. You can obtain this value from the product.list API method. Under construction
    • 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 this value from the boxtype.list API method. Under construction
    • unitsPerBox (required: if orderItemId is not given)(integer:10): Units per box. Under construction
    • unitType (required: if orderItemId is not given)(string:5): Stem or Bunch are the unique valid values. Under construction
    • 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.

You can use either customerId or the customerCode and customerName but you cannot use both parameters at the same time. We recommend 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 to use the carrierId which can be obtained from the carrier.list API method.

 

 

Sample 1


{
  "authenticationToken": "token_info_goes_here",
  "customerId": 99999,
  "carrierCode": "AR", 
  "carrierName": "Armellini", 
  "shipDate": "2014-04-10",
  "poNumber": "PO9999",
  "reference" : "R99999", 
  "instructions": "Text for instructions", 
  "labelInstructions": "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"
    }
 ]
}


 





Sample 2

{
  "authenticationToken": "token_info_goes_here",
  "customerId": 99999,
  "carrierCode": "AR", 
  "carrierName": "Armellini", 
  "shipDate": "2014-04-10",
  "poNumber": "PO9999",
  "reference" : "R99999", 
  "instructions": "Text for instructions", 
  "labelInstructions": "Text for label instructions",
  "items": 
   [
    {
      "productCode": "RS50",
      "boxTypeCode": "HB",
      "unitsPerBox": 150,
      "unitType": "Stem",   
      "boxes": 5, 
      "price": 2.50,
      "markCode": "text for mark code", 
      "productAlias" : "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

 

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


Sample 2

 

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


 

 

  • No labels