Overview


The Komet Sales API helps you develop additional tools that are directly tied into the system. This will allow growers, customers or 3rd parties (such as other technology companies or your in-house developers) to expand and build on the Komet Sales platform.



The API is an interface for accessing the Komet Sales data using HTTP and JSON. The API makes it easy to create web and desktop applications that integrate with the Komet Sales. Some potential uses include:


The Komet Sales API has a single point of entry:


https://api.kometsales.com/api/method.action


Please note that all requests must be submitted using SSL. You must send an authentication token per each request. Please use the login method to get your token and save it into your application. You will be able to use the same token from this point forward. You can also create tokens that are not linked to a user and access to a specific set of API methods can be limited.

Please note that the API is limited to 1,000 requests per user per day, based on the plan that the company has in Komet Sales. In other words, if the company is paying for 3 users in Komet Sales, your external system can only call the Komet Sales API 3,000 times (1,000 x 3) per day.


Tokens are an authentication mechanism that allows access to the API methods for the company. To set up a token, please follow these instructions:

  


Go to Setup > Settings and click on the "Tokens" link.


 If a new token needs to be created, click on the New Token green button located on the right-hand side of the window.


 Select which Token Type needs to be added: CompanyCustomer or Vendor.


 Input the information requested in order to complete the process:

  • Enter the token description, for example, "managing inventory".
  • Select the API method needed from the list available, in this case, "inventory.add".
  • Click on the Generate button and the system will create a token composed of numbers and letters. If the token was created for a Customer, the token must be sent to the customer.
  • Click on Save.


If the token needs to be edited, go to the "Actions" column, click on "Edit" and Save. 



  • Items in bold are required.
  • Date and time values are of the form YYYY-MM-DD HH:MM:SS.
  • All time values are returned in UTC timezone. You can learn more about UTC here.
  • Booleans are either 1 (true) or 0 (false).


Some of the responses may contain HTTP status codes as the following:

CodeStatusDescription
200OKThe request succeeded.
201CreatedThe request has been fulfilled and the resource created.
204No contentThe request succeeded. However, the response does not have any content.
400Bad requestThe request was invalid.
401Not authorizedThe authentication token does not have enough privileges.
403ForbiddenThe server has rejected the request.
404Not foundThe resource requested does not exist on the server.
408TimeoutThe time allowed for the server to complete the request has been reached.
429Too many requestYou have exceeded the rate limit.
500Server ErrorMalfunctioning script, server configuration error or similar.



Komet is integrated directly with cargo agencies and grower systems such as Unosof, Ventures, Vida 18, Cargo Master and some other systems. You can also virtually connect Komet with your system through the next methods.

NeedUtilidad
Change box codesThe method box.code.change allows changing one or more box codes.
Obtain a list of box typesThe method boxtype.list allows to obtain a list of box types sorted by box type code.
Obtain a list of productsThe method product.list allows to obtain a list of products with its description.
Create Purchase OrdersThe method purchase.order.create allows to create Purchase Orders based on Prebooks.
Add products to an AWBThe method purchase.order.item.awb.add allows adding product lines of a Purchase Order to an AWB.
Delete items from a Purchase OrderThrough the method purchase.order.item.delete users can delete products from a Purchase Order.
Obtain a list of Purchase OrdersThe method purchase.order.list returns a list of Purchase Orders with its corresponding details.
Create Purchase Orders with assorted productThrough the method purchase.order.mixed.create users can create Purchase Orders with assorted products of Prebooks in units.




NeedAvailable Methods

Create/Update Prebooks

The method prebook.create allows users to add a Prebook to Komet Sales and update existing Prebooks.

Delete Prebooks

With the method prebook.item.delete users can delete Prebooks from Komet Sales. In case this method is used with a vendor token, the system will update the quantities to 0.

Obtain a list of Prebooks created in Komet

This method returns a list of Prebooks with their corresponding details.
Create Purchase OrdersThe method purchase.order.create allows to create Purchase Orders based on Prebooks.
Add items to a AWBThe method purchase.order.item.awb.add allows to add product lines of a Purchase Order to an AWB.
Delete items from Purchase OrdersThrough the method purchase.order.item.delete users can delete products from a Purchase Order.
Obtain a list of Purchase Orders created in KometThe method purchase.order.list returns a list of Purchase Orders with its corresponding details.
Create Purchase Orders with assorted productThrough the method purchase.order.mixed.create users can create Purchase Orders with assorted products of Prebooks in units.




In the next example, we use Postman to test API methods. Postman is a API Development Environment. Other API Development Environment include Insomnia, SoapUI, curl, etc.


Within Komet, there are two basic types of request: POST and GET.


Instructions to test POST methods

POST methods are used to send data to a server to create/update a resource.

Open the Postman App.


Choose the request type (POST).


Select the format. This can be selected from the Body Type. In this case, is JSON.


Click on the Body tab. Check the raw option. The "Text" dropdown menu and select JSON (application/json).


Enter the URL of the request and then proceed to enter the parameters.


To enter the parameters, you can copy and paste the sample request. Click on Beautify so the format is corrected.


Verify the parameters and once you have finished click on Send. The method should return the results, as it is shown on the documentation response sample.


Instructions to test GET methods


GET methods are used to request data from a specified resource.

Open the Postman App.


Choose the request type (GET).


Enter the URL that correspond to the request.


For GET methods, you must enter the URL params.



Click on Params. Proceed to enter each input parameter required (e.g. authentication token). Once you have finished, click on Send.



Some methods will require additional information on the header, such as X-SALES-CHANNEL, X-ACCOUNT. This information must be entered in the same way the input parameters are entered.