CaspitWeb API Help

BankDeposits

APIDescription
GET api/v1/BankDeposits?token={token}&page={page}&startDate={startDate}&endDate={endDate}&number={number}

ChargeCreditCard

Charge a credit card using a token, expiration date, CVV and TZ

APIDescription
POST api/v1/ChargeCreditCard?token={token}&inCaseOfErrorReturnHttpCode={inCaseOfErrorReturnHttpCode}

Charge a credit card using a token, expiration date, CVV and TZ

Contacts

Get contacts (customers, suppliers)

APIDescription
GET api/v1/Contacts?token={token}&page={page}

Get a list of contacts

GET api/v1/Contacts/{id}?token={token}

Get a contact via its id

GET api/v1/Contacts?token={token}&osekMorshe={osekMorshe}&d={d}

Get a contact by its tax number (מספר עוסק מורשה)
Examples:
GET api/v1/Contacts/?token=_TOKEN_&osekMorshe=123456789&d=1
If the contact is not found ==> Exception

GET api/v1/Contacts?token={token}&email={email}&page={page}

Get contacts by email address
Examples:
GET api/v1/Contacts/?token=_TOKEN_&email=support@caspit.biz
or GET api/v1/Contacts/?token=_TOKEN_&email=support@caspit.biz&page=1
If the contact is not found ==> Exception

GET api/v1/Contacts/{id}/{association}?token={token}&d={d}

Get the documents of a customer (e.g. Invoices, Receipts) or Expenses of a supplier for the given contact
Examples:
GET /api/v1/Contacts/Cust6268/expenses?d=1&token=_TOKEN_
GET /api/v1/Contacts/Supplier3909/documents?token=_TOKEN_&d=1
If the contact is not found ==> Exception

POST api/v1/Contacts?token={token}&inCaseOfErrorReturnHttpCode={inCaseOfErrorReturnHttpCode}

יצירת לקוח חדש

PUT api/v1/Contacts/{id}?token={token}

עדכון לקוח קיים
If the contact is not found ==> Exception

DELETE api/v1/Contacts/{id}?token={token}

Delete a contact.
If the contact is not found ==> Exception

CreditCard

APIDescription
POST api/v1/CreditCard?token={token}&inCaseOfErrorReturnHttpCode={inCaseOfErrorReturnHttpCode}

Get a credit card token

Currencies

Get a list of currencies. The list is a list of CaspitCurrency. Take a look at the CaspitCurrency class located in the SDK under CaspitWeb.Api project in the Models directory

APIDescription
GET api/v1/Currencies?token={token}&page={page}

Get a list of Currencies

Documents

Create or modify CaspitWeb's documents. A document is an Invoice, a Receipt, etc.

APIDescription
GET api/v1/Documents?token={token}&trxTypeId={trxTypeId}&page={page}&CustomerId={CustomerId}&Number={Number}&onlyOpenDocuments={onlyOpenDocuments}&datStart={datStart}&datEnd={datEnd}

No documentation available.

GET api/v1/Documents/{id}?token={token}

Get a document by its id

POST api/v1/Documents?token={token}&inCaseOfErrorReturnHttpCode={inCaseOfErrorReturnHttpCode}

Create a new document

PUT api/v1/Documents?token={token}&inCaseOfErrorReturnHttpCode={inCaseOfErrorReturnHttpCode}

Update an existing document

EMAIL api/v1/Documents/{id}?token={token}&documentNumber={documentNumber}&trxTypeId={trxTypeId}&lan={lan}&inCaseOfErrorReturnHttpCode={inCaseOfErrorReturnHttpCode}

Send an Hebrew document via mail.
Note: To invoke this call you will have to use a non-standard Http verb: EMAIL
Example:
curl.exe --verbose -X EMAIL "http://app.caspitweb.biz/api/v1/Documents/doc14245?token=zzzz"

PRINT api/v1/Documents/{id}?token={token}&documentNumber={documentNumber}&trxTypeId={trxTypeId}&lan={lan}&createSignedPdf={createSignedPdf}

Emulate the printing of a document to paper.
If the document in status חדש then Caspit will change the status to הודפס and will run all the logic relevant
to printing a document, e.g. decreasing the number of items in the inventory.
If the document is in status הודפס or מבוטל then Caspit will skip the printing logic.
Will return the URL for fetching the PDF in the location header of the response similar to
http://casp.it/MvBmPgljEb

ExpensePayments

Get a list of Expenses for a given period

APIDescription
GET api/v1/ExpensePayments?token={token}&page={page}&startDate={startDate}&endDate={endDate}

Get ExpensePayments for a given period.
Returns a max of 50 records from the given page

Expenses

Get a list of Expenses for a given period

APIDescription
GET api/v1/Expenses?token={token}&page={page}&startDate={startDate}&endDate={endDate}

Get Expenses for a given period.
Returns a max of 50 records from the given page

GenerateDeferredPaymentsInvoices

APIDescription
POST api/v1/GenerateDeferredPaymentsInvoices?token={token}

This method can only be used by Account 0

POST api/v1/GenerateDeferredPaymentsInvoices?businessId={businessId}&endDate={endDate}

No documentation available.

Hashavshevet

יצוא של חשבונות או תנועות לקובץ בפורמט חשבשבת

APIDescription
GET api/v1/Hashavshevet?token={token}&startDate={startDate}&endDate={endDate}&exportType={exportType}

Get either movein or heshin for Hashavshevet.
movein.dat is formatted as described in http://www.caspit.biz/FaqItem.aspx?id=161
heshin.dat is formatted as described in Caspit's heshin.prm file. (https://app.caspitweb.biz/uploads/heshin.prm)

Kupa

APIDescription
GET api/v1/Kupa?token={token}&page={page}&startDate={startDate}&endDate={endDate}&deposited={deposited}

שליפה של התקבולים שהתקבלו ונמצאים בקופה או שהופקדו לבנק

LastDocumentsNumbers

APIDescription
GET api/v1/LastDocumentsNumbers?token={token}

Get the last document numbers of all the TrxTypes in Caspit
Last is based on the max Document id (and not date, not biggest number)

Log

Get the Caspit log entries. This is helpfull if you receive an error containing no description, only a log id

APIDescription
GET api/v1/Log?token={token}&page={page}&startDate={startDate}&endDate={endDate}&logId={logId}

Get the log records filtered by the login user name
The login user name is what you used to get the token.

Pdf

Get PDF documents

APIDescription
GET api/v1/Pdf/{id}?token={token}&documentNumber={documentNumber}&trxTypeId={trxTypeId}&lan={lan}

Stream the PDF file of the given document.
If the document is a Computerized Document then the method returns a digitally-signed "Original" PDF document.
If the document was printed to paper then the method returns a "Copy" non-signed PDF document.

PrintDocument

Create or modify CaspitWeb's documents. A document is an Invoice, a Receipt, etc.

APIDescription
POST api/v1/PrintDocument/{id}?token={token}&documentNumber={documentNumber}&trxTypeId={trxTypeId}&lan={lan}&createSignedPdf={createSignedPdf}

Emulate the printing of a document to paper.
If the document in status חדש then Caspit will change the status to הודפס and will run all the logic relevant
to printing a document, e.g. decreasing the number of items in the inventory.
If the document is in status הודפס or מבוטל then Caspit will skip the printing logic.
Will return the URL for fetching the PDF in the location header of the response similar to
http://casp.it/MvBmPgljEb

Products

APIDescription
GET api/v1/Products?token={token}&page={page}

Get all the products from Caspit

GET api/v1/Products/{id}?token={token}

Get an existing product from Caspit

GET api/v1/Products?token={token}&catalogNumber={catalogNumber}&page={page}

Get a product by its catalog number

POST api/v1/Products?token={token}&inCaseOfErrorReturnHttpCode={inCaseOfErrorReturnHttpCode}

Create a product.
Usage: POST api/v1/Product

PUT api/v1/Products/{id}?token={token}

Update a product.
Usage: PUT api/v1/Products/5

DELETE api/v1/Products/{id}?token={token}

Delete a product by its id
Return Http status code 204 No Content

Token

Get a token that will allow you to use the API calls.

APIDescription
GET api/v1/Token?user={user}&pwd={pwd}&osekMorshe={osekMorshe}

Get a new Token. A token will allow you to access CaspitWeb for 10 minutes.
The time window is sliding. That is you get a new 10 minute window every time you access Caspit.
The token is relevant to only one busineess. If you have more than one business in your account
you will need to get a seperate token to each of them.

VatData

Get the VAT payments to be paid.

APIDescription
GET api/v1/VatData?token={token}&year={year}&month={month}

Get the VAT payemnt details for the given month

VatRate

Get historical VAT rates

APIDescription
GET api/v1/VatRate?token={token}&date={date}

Get a list of historical VAT rates
Usage: GET /api/v1/VatRate/?token=_TOKEN_

Caspit Objects

Enumerations