CASULO WEB API (v1)

Download OpenAPI specification:Download

Casulo Software WebApi

Auth

Authentication

Authenticates a user and returns a JWT token if the credentials are valid.

This endpoint allows clients to authenticate using their API key and API secret.

If the credentials are valid, a JWT token is generated and returned.

Request Body schema:

The login data containing API key and API secret.

apiKey
required
string non-empty

The provided Api Key

apiSecret
required
string non-empty

The provided Api Secret

Responses

Request samples

Content type
{
  • "apiKey": "eca3be92-4b5a-4fb8-ac53-3ac9561ff952",
  • "apiSecret": "8c0b88e3-bdcb-4b49-be4f-951b188cc46e"
}

Response samples

Content type
application/json
"string"

Companies

Create

This API method allows you to create a new company entity in the system.

A company entity represents a business organization within the system, which may include details such as company name, identifiers, ERP system information, and related notes.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

Request Body schema:

The company data to create.

licenseId
required
integer <int32>

Foreign key to License

name
required
string [ 1 .. 200 ] characters

Company Name

erpCompanyName
string or null <= 60 characters

ERP Company Name

internalCode
string or null <= 50 characters

Company Internal Code on Casulo Software ERP System. This is the internal code for the client within the Casulo system.

erpSystem
string or null <= 20 characters

ERP System Name

erpVersion
string or null <= 20 characters

ERP Version

notes
string or null

Notes about the company

Responses

Request samples

Content type
{
  • "licenseId": 1,
  • "name": "Acme Corporation",
  • "erpCompanyName": "SAGE",
  • "internalCode": "000001",
  • "erpSystem": "SAGE",
  • "erpVersion": "CRTL",
  • "notes": "Some notes about the company"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "licenseId": 0,
  • "name": "Acme Corporation",
  • "erpCompanyName": "SAGE",
  • "internalCode": "000001",
  • "erpSystem": "SAGE",
  • "erpVersion": "CRTL",
  • "notes": "Some notes about the company",
  • "isActive": true
}

Get All

Retrieves all companies in the system.

This API method retrieves all companies stored in the system.

Companies represent business entities within the system with details such as company name, identifiers, ERP system information, and related notes.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update

Updates an existing company by its unique identifier (ID).

This API method allows you to update an existing company entity in the system.

A company entity represents a business organization within the system, which may include details such as company name, identifiers, ERP system information, and related notes.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
id
required
integer <int32>

The ID of the company to update.

Request Body schema:

The updated company data.

name
string or null

Company Name

erpCompanyName
string or null <= 60 characters

ERP Company Name

internalCode
string or null <= 50 characters

Company Internal Code on Casulo Software ERP System. This is the internal code for the client within the Casulo system.

erpSystem
string or null <= 20 characters

ERP System Name

erpVersion
string or null <= 20 characters

ERP Version

notes
string or null

Notes about the company

isActive
boolean

Indicates if the company is active

Responses

Request samples

Content type
{
  • "name": "Acme Corporation",
  • "erpCompanyName": "SAGE",
  • "internalCode": "000001",
  • "erpSystem": "SAGE",
  • "erpVersion": "CRTL",
  • "notes": "Some notes about the company",
  • "isActive": true
}

Response samples

Content type
application/json
"string"

Delete

Deletes a company from the system by its unique identifier (ID).

This API method allows you to delete a company entity from the system based on its unique identifier (ID).

If the company with the specified ID does not exist, a 404 Not Found response is returned.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
id
required
integer <int32>

The ID of the company to delete.

Responses

Response samples

Content type
application/json
"string"

Get Company By Id

Retrieves a company by its unique identifier (ID), including its preferences.

This API method retrieves a company from the system based on its unique identifier (ID).

If the company with the specified ID does not exist, a 404 Not Found response is returned.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
id
required
integer <int32>

The ID of the company to retrieve.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "licenseId": 0,
  • "name": "Acme Corporation",
  • "erpCompanyName": "SAGE",
  • "internalCode": "000001",
  • "erpSystem": "SAGE",
  • "erpVersion": "CRTL",
  • "notes": "Some notes about the company",
  • "isActive": true
}

Get Company By Licence Id

Retrieves all companies associated with a specified license ID.

This API method retrieves all companies associated with a specified license ID.

If the license with the specified ID does not exist, a 404 Not Found response is returned.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
licenseId
required
integer <int32>

The ID of the license to retrieve companies for.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Customers

Get Customers

Retrieves all customers stored in the system for a specific company.

The response includes details such as customer code, name, address, and contact information.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company to retrieve customers for.

query Parameters
page
integer <int32>
Default: 1

The page number to retrieve.

pageSize
integer <int32>
Default: 10

The number of customers per page.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Customer By Code

Retrieves a customer stored in the system for a specific company by customer code.

The response includes details such as customer code, name, address, and contact information.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company to retrieve the customer for.

customerCode
required
string

The code of the customer to retrieve.

Responses

Response samples

Content type
application/json
{
  • "code": "C123",
  • "name": "John Doe",
  • "address": "123 Main St",
  • "address2": "Apt 4B",
  • "zipCode": "12345",
  • "city": "Springfield",
  • "country": "Portugal",
  • "district": "District 9",
  • "municipality": "Central Municipality",
  • "vatNumber": "123456789",
  • "phone1": "+1234567890",
  • "phone2": "+0987654321",
  • "phone3": "+1122334455",
  • "phone4": "+5566778899",
  • "fax": "+1234567899",
  • "mobilePhone1": "+1987654321",
  • "mobilePhone2": "+1098765432",
  • "email": "customer@example.com",
  • "website": "www.customerwebsite.com",
  • "lineDiscount": 10,
  • "globalDiscount": 5,
  • "sellerCode": "SELL001",
  • "sellerName": "John Seller",
  • "zoneCode": "Z001",
  • "zoneName": "North Zone",
  • "transportCode": "T001",
  • "transportName": "Fast Transport",
  • "defaultPaymentCondition": "Net 30",
  • "defaultPaymentMethod": "Credit Card",
  • "priceTable": "Standard",
  • "createdDateTime": "2024-06-19T09:00:00",
  • "sourceSystemId": "123"
}

Get Company Queue

This endpoint retrieves the list of customers in queue for a specific company.

It returns a list of CustomerQueueResponse objects containing decrypted customer details.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company for which to retrieve the customer queue.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Company Queue History

This endpoint retrieves the list of customer history queue entries for a specific company.

It returns a list of CustomerQueueHistoryResponse objects containing decrypted customer details and integration error logs.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company for which to retrieve the customer history queue.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Customer Status

This endpoint retrieves the status of a customer queue entry identified by its UID for a specific company.

It returns a CustomerQueueStatusResponse object containing decrypted customer details, integration error logs, and ERP reference.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company for which to retrieve the customer queue detail.

uid
required
string <uuid>

The UID of the customer queue entry to retrieve.

Responses

Response samples

Content type
application/json
{
  • "uid": "7a123e45-12ab-1234-abcd-1234567890ab",
  • "vatNumber": "123456789",
  • "name": "John Doe",
  • "address": "123 Main St",
  • "address2": "Apt 4B",
  • "zipCode": "12345",
  • "city": "Springfield",
  • "country": "USA",
  • "billingAddress": "456 Billing St",
  • "billingAddress2": "Suite 100",
  • "billingZipCode": "67890",
  • "billingCity": "Shelbyville",
  • "billingCountry": "USA",
  • "mobilePhone": "+1987654321",
  • "email": "customer@example.com",
  • "notes": "This is a sample note.",
  • "status": "WaitingPendingProcessing",
  • "erpReference": "ERP12345",
  • "errors": [
    ]
}

Create

Creates a new customer entry in the queue

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

Company ID associated with the customer.

Request Body schema:

Customer information.

vatNumber
string or null <= 100 characters

Customer VAT Number.

name
required
string non-empty

Gets or sets the customer name.

address
string or null <= 300 characters

Address of the client.

address2
string or null <= 300 characters

Address line 2 of the customer.

zipCode
string or null <= 50 characters

Zip code of the customer.

city
string or null <= 150 characters

Customer city.

country
string or null <= 100 characters

Customer country.

billingAddress
string or null <= 300 characters

Customer billing address.

billingAddress2
string or null <= 300 characters

Customer billing address line 2.

billingZipCode
string or null <= 50 characters

Customer billing zip code.

billingCity
string or null <= 150 characters

Customer billing city.

billingCountry
string or null <= 100 characters

Customer billing country.

mobilePhone
string or null <= 100 characters

Customer mobile phone number.

email
string or null <= 300 characters

Customer email.

notes
string or null

Notes related to the customer.

Responses

Request samples

Content type
{
  • "vatNumber": "123456789",
  • "name": "John Doe",
  • "address": "123 Main St",
  • "address2": "Apt 4B",
  • "zipCode": "12345",
  • "city": "Springfield",
  • "country": "PRT",
  • "billingAddress": "456 Billing St",
  • "billingAddress2": "Suite 100",
  • "billingZipCode": "67890",
  • "billingCity": "Shelbyville",
  • "billingCountry": "PRT",
  • "mobilePhone": "+1987654321",
  • "email": "customer@example.com",
  • "notes": "This is a sample note."
}

Response samples

Content type
application/json
{
  • "uid": "7a123e45-12ab-1234-abcd-1234567890ab",
  • "vatNumber": "123456789",
  • "name": "John Doe",
  • "address": "123 Main St",
  • "address2": "Apt 4B",
  • "zipCode": "12345",
  • "city": "Springfield",
  • "country": "USA",
  • "billingAddress": "456 Billing St",
  • "billingAddress2": "Suite 100",
  • "billingZipCode": "67890",
  • "billingCity": "Shelbyville",
  • "billingCountry": "USA",
  • "mobilePhone": "+1987654321",
  • "email": "customer@example.com",
  • "notes": "This is a sample note.",
  • "status": "WaitingPendingProcessing",
  • "entryDate": "2024-07-05T12:34:56"
}

Documents

Create

Creates a new document entry in the queue for a specified company.

If the company with the specified ID does not exist, a 400 Bad Request response is returned.

A unique id (UID) referring to the document in the queue is returned, save this UID as it will be required in subsequent invocations

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company associated with the document.

Request Body schema:

The document information to be added to the queue.

type
required
string [ 1 .. 350 ] characters

Type of the document.

series
string or null <= 300 characters

Series of the document.

customerVatNumber
string or null <= 200 characters

VAT number of the Customer.

customerCode
string or null

Code of the Customer.

customerName
string or null

Name of the Customer.

customerAddress
string or null

Address of the Customer.

customerAddress2
string or null

Address line 2 of the Customer.

customerZipCode
string or null <= 300 characters

Zip code of the Customer.

customerCity
string or null

City of the Customer.

sellerCode
string or null

Code of the seller.

sellerName
string or null

Name of the seller.

paymentMethodCode
string or null

Code of type of payment.

paymentMethod
string or null

The type of payment.

notes
string or null

Notes related to the document.

sourceReference
string or null

Reference to the source system of the document.

Array of objects or null (DocumentLineQueue)

Collection navigation property to associated document lines.

Responses

Request samples

Content type
{
  • "type": "NE",
  • "series": "A2024",
  • "customerVatNumber": "123456789",
  • "customerCode": "C12345",
  • "customerName": "John Doe",
  • "customerAddress": "123 Main St",
  • "customerAddress2": "Apt 4B",
  • "customerZipCode": "12345",
  • "customerCity": "Springfield",
  • "sellerCode": "S123",
  • "sellerName": "Jane Smith",
  • "paymentMethodCode": "2",
  • "paymentMethod": "Credit Card",
  • "notes": "This is a sample note.",
  • "sourceReference": "SYSTEM123",
  • "documentLines": [
    ]
}

Response samples

Content type
application/json
{
  • "uid": "12345-abcde",
  • "date": "2024-06-21T10:00:00",
  • "type": "NE",
  • "series": "A2024",
  • "customerVatNumber": "123456789",
  • "customerCode": "C12345",
  • "customerName": "John Doe",
  • "customerAddress": "123 Main St",
  • "customerAddress2": "Apt 4B",
  • "customerZipCode": "12345",
  • "customerCity": "Springfield",
  • "sellerCode": "S123",
  • "sellerName": "Jane Smith",
  • "paymentMethodCode": "2",
  • "paymentMethod": "Credit Card",
  • "notes": "This is a sample note.",
  • "sourceReference": "SYSTEM123",
  • "status": "WaitingPendingProcessing",
  • "processedDate": "2024-06-21T10:00:00",
  • "erpReference": "ERP12345",
  • "documentLines": [
    ]
}

Update

Updates an existing document and its lines for a specified company.

If the company with the specified ID does not exist, a 400 Bad Request response is returned.

If the document with the specified UID is not found, a 404 Not Found response is returned.

The document and line data are encrypted before being saved to the database.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company associated with the document.

Request Body schema:

The document update request containing the document UID and updated information.

uid
string <uuid>

Gets or sets the unique identifier of the document.

type
string or null

Gets or sets the type of the document.

series
string or null

Gets or sets the series of the document.

customerVatNumber
string or null

Gets or sets the VAT number of the Customer.

customerCode
string or null

Gets or sets the code of the Customer.

customerName
string or null

Gets or sets the name of the Customer.

customerAddress
string or null

Gets or sets the address of the Customer.

customerAddress2
string or null

Gets or sets the secondary address of the Customer.

customerZipCode
string or null

Gets or sets the zip code of the Customer.

customerCity
string or null

Gets or sets the city of the Customer.

sellerCode
string or null

Gets or sets the code of the seller.

sellerName
string or null

Gets or sets the name of the seller.

paymentMethodCode
string or null

Code of type of payment.

paymentMethod
string or null

The type of payment.

notes
string or null

Gets or sets the notes associated with the document.

sourceReference
string or null

Gets or sets the source reference of the document.

Array of objects or null (UpdateDocumentLineRequest)

Gets or sets the lines of the document.

Responses

Request samples

Content type
{
  • "uid": "8c54bc33-30f5-4e6e-a5d8-1c3bb36b805f",
  • "type": "NE",
  • "series": "A2024",
  • "customerVatNumber": "123456789",
  • "customerCode": "C12345",
  • "customerName": "John Doe",
  • "customerAddress": "123 Main St",
  • "customerAddress2": "Apt 4B",
  • "customerZipCode": "12345",
  • "customerCity": "Springfield",
  • "sellerCode": "S123",
  • "sellerName": "Jane Smith",
  • "paymentMethodCode": "2",
  • "paymentMethod": "Credit Card",
  • "notes": "This is a sample note.",
  • "sourceReference": "SYSTEM123",
  • "documentLines": [
    ]
}

Response samples

Content type
application/json
"string"

Reprocess

Reprocesses a document by unmarking it as pending and requeuing it for processing.

Reprocesses an existing document by setting its status to waiting and requeuing it for processing for a specified company.

If the company with the specified ID does not exist, a 400 Bad Request response is returned.

If the document with the specified UID is not found, a 404 Not Found response is returned.

The document and related ERP integration logs are updated within a database transaction.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company.

uid
required
string <uuid>

The UID of the document to be reprocessed.

Responses

Response samples

Content type
No sample

Get Company Queue

Retrieves the document queue for a specific company.

This API method allows you to retrieve the document queue for a company based on its unique identifier (ID).

If no documents are found for the given company ID, a 404 Not Found response is returned.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Pending Queue

Retrieves the document queue that requires attention for a specific company based on its unique identifier (ID).

This API method allows you to retrieve documents that need attention for a company.

If no documents needing attention are found for the given company ID, a 404 Not Found response is returned.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Document Status

Retrieves a specific document queue by its unique identifier (ID) for a given company.

If the document with the specified ID is not found in the active queue, it attempts to retrieve it from the historical queue.

If the company with the specified ID does not exist, a 400 Bad Request response is returned.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company.

uid
required
string <uuid>

The unique identifier of the document.

Responses

Response samples

Content type
application/json
{
  • "uid": "12345-abcde",
  • "date": "2024-06-21T10:00:00",
  • "type": "NE",
  • "series": "A2024",
  • "customerVatNumber": "123456789",
  • "customerCode": "C12345",
  • "customerName": "John Doe",
  • "customerAddress": "123 Main St",
  • "customerAddress2": "Apt 4B",
  • "customerZipCode": "12345",
  • "customerCity": "Springfield",
  • "sellerCode": "S123",
  • "sellerName": "Jane Smith",
  • "paymentMethodCode": "2",
  • "paymentMethod": "Credit Card",
  • "notes": "This is a sample note.",
  • "sourceReference": "SYSTEM123",
  • "status": "WaitingPendingProcessing",
  • "processedDate": "2024-06-21T10:00:00",
  • "erpReference": "ERP12345",
  • "documentLines": [
    ]
}

Retrieves a specific document in PDF format encoded in Base64 by its unique identifier (ID) for a given company.

This endpoint first checks if the document is available in the active document queue. If the document is not found, it then searches the historical queue.

If the company with the specified ID is invalid or inactive, a 400 Bad Request response is returned.

If the document with the specified ID is not found in either the active or historical queues, a 404 Not Found response is returned.

Authentication

This endpoint requires a valid Bearer token included in the Authorization header of the request. Ensure that you have obtained a valid token before making the request.

path Parameters
companyId
required
integer <int32>

The ID of the company.

uid
required
string <uuid>

The unique identifier of the document.

Responses

Response samples

Content type
application/json
{
  • "uid": "12345-abcde",
  • "b64": ""
}

Get History Queue

Retrieves the document history queue for a specific company based on its unique identifier (ID).

This API method allows you to retrieve the document history queue for a company.

If no documents are found for the given company ID, a 404 Not Found response is returned.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company.

query Parameters
page
integer <int32>
Default: 1

The page number to retrieve.

pageSize
integer <int32>
Default: 10

The number of stocks per page.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Licenses

Create

This API method allows you to create a new license in the system.

Service licenses are used to manage access to your API or services. When creating a new license, an API key and secret will be generated automatically.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

Request Body schema:

The data to create a new license.

name
required
string [ 1 .. 100 ] characters

License Name

licenseNumber
required
string [ 1 .. 10 ] characters

License Number

dataJobInterval
required
integer <int32>

Interval in seconds for the API run job. Default: 60 seconds (1 minute).

notes
string or null

Notes about the license

Responses

Request samples

Content type
{
  • "name": "License A",
  • "licenseNumber": "SAGE001",
  • "dataJobInterval": 60,
  • "notes": "Some notes about the license"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "License A",
  • "licenseNumber": "SAGE001",
  • "apiKey": "ws_key_123",
  • "apiSecret": "ws_secret_456",
  • "notes": "Some notes about the license",
  • "isActive": true,
  • "preferences": {
    }
}

Get All

This API method retrieves all service licenses available in the system.

The retrieved licenses contain details such as API key, secret, and associated information.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update

Updates an existing license by ID

This API method allows you to update an existing service license in the system.

Service licenses are used to manage access to your API or services. When updating a license, you can modify properties such as name, notes, API key, API secret, and activation status.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
id
required
integer <int32>

The ID of the license to update.

Request Body schema:

The data to update the license.

name
string or null <= 100 characters

License Name

licenseNumber
string or null <= 10 characters

License Number

apiKey
string or null <= 80 characters

API Key

apiSecret
string or null <= 80 characters

API Secret

dataJobInterval
integer or null <int32>

Interval in seconds for the API run job. Default: 60 seconds (1 minute).

notes
string or null

Notes about the license

isActive
boolean or null

Indicates if the license is active

Responses

Request samples

Content type
{
  • "name": "License A",
  • "licenseNumber": "SAGE001",
  • "apiKey": "ws_key_123",
  • "apiSecret": "ws_secret_456",
  • "dataJobInterval": 60,
  • "notes": "Some notes about the license",
  • "isActive": true
}

Response samples

Content type
application/json
"string"

Delete

Delete a service license by ID

This API method allows you to delete a service license from the system based on its unique identifier (ID). Once deleted, the license and its associated API key and secret will no longer be available for use.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
id
required
integer <int32>

The ID of the license to delete.

Responses

Response samples

Content type
application/json
"string"

Get License By Id

This API method allows you to retrieve a specific service license by its unique identifier (ID).

The retrieved license contains details such as API key, secret, and associated information.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
id
required
integer <int32>

The ID of the license to retrieve.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "License A",
  • "licenseNumber": "SAGE001",
  • "apiKey": "ws_key_123",
  • "apiSecret": "ws_secret_456",
  • "notes": "Some notes about the license",
  • "isActive": true,
  • "preferences": {
    }
}

Logs

Master Logs

Retrieves all log entries in the master database.

This API method retrieves all log entries stored in the master database.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

query Parameters
page
integer <int32>
Default: 1

The page number to retrieve.

pageSize
integer <int32>
Default: 10

The number of stocks per page.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Master Log Detail

Retrieves a specific log entry from the master database.

This API method retrieves a specific log entry stored in the system using the log ID. It decrypts sensitive fields before returning the log.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
logid
required
integer <int32>

The ID of the log entry to be retrieved.

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "logLevel": 0,
  • "logDate": "2024-06-19T09:00:00",
  • "apiEndpoint": "/api/companies",
  • "httpMethod": "GET",
  • "requestContent": "{\"name\": \"Acme Corporation\"}",
  • "responseContent": "{\"id\": 1, \"name\": \"Acme Corporation\"}",
  • "notes": "Request processed without issues."
}

Company Logs

Retrieves all log entries for a specific company from the company database.

This API method retrieves all log entries stored in the system for the specified company. It decrypts sensitive fields before returning the logs.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company whose logs are being retrieved.

query Parameters
page
integer <int32>
Default: 1

The page number to retrieve.

pageSize
integer <int32>
Default: 10

The number of stocks per page.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Company Log Detail

Retrieves a specific log entry from the company database.

This API method retrieves a specific log entry stored in the system using the log ID. It decrypts sensitive fields before returning the log.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company.

logId
required
integer <int32>

The ID of the log entry to be retrieved.

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "logLevel": 0,
  • "logDate": "2024-06-19T09:00:00",
  • "apiEndpoint": "/api/companies",
  • "httpMethod": "GET",
  • "requestContent": "{\"name\": \"Acme Corporation\"}",
  • "responseContent": "{\"id\": 1, \"name\": \"Acme Corporation\"}",
  • "notes": "Request processed without issues."
}

PaymentMethods

Get All

This method retrieves all payment methods stored in the system for a specific company.

The response includes details such as code and name for each payment method.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company to retrieve payment methods for.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

PendingDocuments

Get By Client

This API method retrieves all pending documents stored in the system for a specific company and client.

Pending documents represent invoices or other documents that are due for payment. The response includes details such as document type, serial, number, dates, and amounts.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company to retrieve pending documents for.

customercode
required
string

The code of the customer to retrieve pending documents.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

ProductFamilies

Get All

This method retrieves all product families stored in the system for a specific company.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company to retrieve product families for.

query Parameters
page
integer <int32>
Default: 1
pageSize
integer <int32>
Default: 10

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get By Level

This method retrieves product families by level stored in the system for a specific company.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company to retrieve product families for.

level
required
integer <int32>
query Parameters
page
integer <int32>
Default: 1
pageSize
integer <int32>
Default: 10

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get By Parent Code

This method retrieves product families by parent code stored in the system for a specific company.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company to retrieve product families for.

parentCode
required
string
query Parameters
page
integer <int32>
Default: 1
pageSize
integer <int32>
Default: 10

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get By Family Code

This method retrieves product families by parent code stored in the system for a specific company.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company to retrieve product families for.

familyCode
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Products

Get All

This API method retrieves all products stored in the system for a specific company.

The response includes details such as code, name, prices and others product information

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company to retrieve customers for.

query Parameters
page
integer <int32>
Default: 1

The page number to retrieve.

pageSize
integer <int32>
Default: 10

The number of products per page.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get By Code

Retrieves all products stored in the system for a specific company.

The response includes details such as product code, name, prices, and other information.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company to retrieve the products for.

productCode
required
string

The product code to be retrieved.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Receipts

Create

Creates a new receipt entry in the queue.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company.

Request Body schema:
type
string or null

The type of the receipt.

series
string or null

The series of the receipt.

customerCode
string or null

Code of the Customer.

notes
string or null

Additional notes or comments about the receipt.

sourceReference
string or null

Reference to the source system of the document.

Array of objects or null (ReceiptLineQueue)

List of receipt line items.

Array of objects or null (ReceiptPaymentQueue)

List of receipt payments.

Responses

Request samples

Content type
{
  • "type": "Invoice",
  • "series": "A",
  • "customerCode": "C12345",
  • "notes": "This receipt is for the purchase of goods.",
  • "sourceReference": "SYSTEM123",
  • "lines": [
    ],
  • "payments": [
    ]
}

Response samples

Content type
application/json
{
  • "uid": "12345-abcde",
  • "date": "2023-07-01",
  • "type": "Invoice",
  • "series": "A",
  • "customerCode": "C12345",
  • "notes": "This receipt is for the purchase of goods.",
  • "sourceReference": "SYSTEM123",
  • "status": "WaitingPendingProcessing",
  • "lines": [
    ],
  • "payments": [
    ]
}

Update

Updates a receipt and its lines.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company.

Request Body schema:
uid
string <uuid>

Unique identifier for the document.

date
string <date-time>

The date of the receipt.

type
string or null

The type of the receipt.

series
string or null

The series of the receipt.

customerCode
string or null <= 50 characters

Code of the Customer.

notes
string or null

Additional notes or comments about the receipt.

sourceReference
string or null <= 100 characters

Reference to the source system of the document.

Array of objects or null (UpdateReceiptLineRequest)

Gets or sets the lines of the receipt.

Array of objects or null (UpdateReceiptPaymentRequest)

Gets or sets the payments of the receipt.

Responses

Request samples

Content type
{
  • "uid": "12345-abcde",
  • "date": "2023-07-01",
  • "type": "Invoice",
  • "series": "A",
  • "customerCode": "C12345",
  • "notes": "This receipt is for the purchase of goods.",
  • "sourceReference": "SYSTEM123",
  • "lines": [
    ],
  • "payments": [
    ]
}

Response samples

Content type
application/json
"string"

Reprocess

Reprocesses a receipt by unmarking it as pending and requeuing it for processing.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company.

uid
required
string <uuid>

Responses

Response samples

Content type
application/json
"string"

Get Company Queue

Retrieves receipts in queue for a specific company.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Pending Queue

Retrieves receipt queue that needs attention for a specific company.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get History Queue

Retrieves receipt history queue for a specific company.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company.

query Parameters
page
integer <int32>
Default: 1

The page number to retrieve.

pageSize
integer <int32>
Default: 10

The number of stocks per page.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Receipt Status

Retrieves a specific receipt queue by its ID.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company.

uid
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "uid": "12345-abcde",
  • "date": "2023-07-01",
  • "type": "Invoice",
  • "series": "A",
  • "customerCode": "C12345",
  • "notes": "This receipt is for the purchase of goods.",
  • "sourceReference": "SYSTEM123",
  • "status": "WaitingPendingProcessing",
  • "lines": [
    ],
  • "payments": [
    ]
}

Status

Check API Status

This API method allows you to check if the Casulo Web API is online and functioning correctly. It is useful for monitoring and ensuring the availability of the service. When invoked, it returns a simple status message indicating that the API is online.

Purpose: This endpoint is primarily used for health checks and to verify that the API service is running.

Usage: You can use this endpoint as part of a monitoring system to automatically check the status of the API at regular intervals.

Response: The response will contain a status message indicating that the API is online.

Responses

Get API Version

This API method allows you to retrieve the current version of the Casulo Web API.

Purpose: This endpoint provides information about the version of the API currently deployed. It can be useful for debugging, documentation, and ensuring compatibility.

Usage: Call this endpoint to get the version number of the API. This can help in identifying which version of the API is running in different environments (e.g., development, staging, production).

Response: The response will contain the version number of the API.

Responses

Stocks

Get All

This method retrieves all stocks stored in the system for a specific company with pagination support.

The response includes details such as code, name and stock information.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company to retrieve stocks for.

query Parameters
page
integer <int32>
Default: 1

The page number to retrieve.

pageSize
integer <int32>
Default: 10

The number of stocks per page.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get By Product Code

This API method retrieves all stocks stored in the system for a specific company.

The response includes details such as code, name and stock information.

Authentication

This endpoint requires a valid Bearer token to be included in the Authorization header of the request. Make sure to obtain a valid token before making requests to this endpoint.

path Parameters
companyId
required
integer <int32>

The ID of the company to retrieve customers for.

productcode
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]