Reference

Coworkerproduct

The coworkerproduct object

Attributes
Id: int required, autogenerated, unique
The unique identifier for this coworkerproduct
Activated: bool optional read-only
ActivateNow: bool optional
BusinessId: Id required
ContractDepositUniqueId: Guid? optional read-only
CoworkerId: Id required
DueDate: DateTime? optional
FromTariff: bool optional read-only
Invoiced: bool optional
InvoicedOn: DateTime? optional read-only
InvoiceOn: DateTime? optional
InvoiceThisCoworker: bool optional
Notes: string optional
OrderNumber: string optional read-only
Price: decimal? optional
ProductId: Id required
Quantity: int required
RegularCharge: bool optional
RepeatCycle: Nexudus.Coworking.Core.Enums.eRecurrentChargePattern optional
RepeatFrom: DateTime? optional
RepeatUnit: int? optional
RepeatUntil: DateTime? optional
SaleDate: DateTime? optional
UniqueId: Guid required, autogenerated, unique
The globally unique identifier for this coworkerproduct
SystemId: string optional api-only
User defined data about this coworkerproduct. This property can only be seen and updated using the API.

Json Structure Example


{
  "Id": 1234567,
  "Activated": false,
  "ActivateNow": false,
  "BusinessId": 12345678,
  "ContractDepositUniqueId": ,
  "CoworkerId": 12345678,
  "DueDate": ,
  "FromTariff": false,
  "Invoiced": false,
  "InvoicedOn": ,
  "InvoiceOn": ,
  "InvoiceThisCoworker": false,
  "Notes": "Notes",
  "OrderNumber": "null",
  "Price": ,
  "ProductId": 12345678,
  "Quantity": ,
  "RegularCharge": false,
  "RepeatCycle": 1,
  "RepeatFrom": ,
  "RepeatUnit": ,
  "RepeatUntil": ,
  "SaleDate": ,
  "UniqueId": "5b034057-414c-44d5-8a8e-f185986572bc",
  "SystemId": "{ metadata: { id: 887766, processed: true } }"
}


Find a CoworkerProduct

This endpoint allows you to GET a list of coworkerproducts based on one or more filter querystring parameters.

GET https://spaces.nexudus.com/api/billing/coworkerproducts?...

πŸ”’ Requires role "CoworkerProduct-List"

Pagination querystring parameters
Lets control how many records to return at a time and their order.
page integer optional
?page=1
size integer optional default=25
Sets the maximum number of records to return each page of results.
?size=25
orderby string optional default=CreatedOn
Sets the property to use when ordering the results of the search.
?orderby=Id
dir 'ascending' or 'descending' optional default=SortDirection.Ascending
Sets the direction to use when ordering the records.
?sort=ascending

Search querystring parameters
Lets you search coworkerproduct records based on their different properties.
Id number
?Id=12345678
CoworkerProduct_Activated bool
?CoworkerProduct_Activated=...
CoworkerProduct_ActivateNow bool
?CoworkerProduct_ActivateNow=...
CoworkerProduct_Business Business
?CoworkerProduct_Business=...
CoworkerProduct_ContractDepositUniqueId Guid?
?CoworkerProduct_ContractDepositUniqueId=...
CoworkerProduct_Coworker Coworker
?CoworkerProduct_Coworker=...
CoworkerProduct_DueDate DateTime?
?CoworkerProduct_DueDate=...
CoworkerProduct_FromTariff bool
?CoworkerProduct_FromTariff=...
CoworkerProduct_Invoiced bool
?CoworkerProduct_Invoiced=...
CoworkerProduct_InvoicedOn DateTime?
?CoworkerProduct_InvoicedOn=...
CoworkerProduct_InvoiceOn DateTime?
?CoworkerProduct_InvoiceOn=...
CoworkerProduct_InvoiceThisCoworker bool
?CoworkerProduct_InvoiceThisCoworker=...
CoworkerProduct_Notes string
?CoworkerProduct_Notes=...
CoworkerProduct_OrderNumber string
?CoworkerProduct_OrderNumber=...
CoworkerProduct_Price decimal?
?CoworkerProduct_Price=...
CoworkerProduct_Product Product
?CoworkerProduct_Product=...
CoworkerProduct_Quantity int
?CoworkerProduct_Quantity=...
CoworkerProduct_RegularCharge bool
?CoworkerProduct_RegularCharge=...
CoworkerProduct_RepeatCycle Nexudus.Coworking.Core.Enums.eRecurrentChargePattern
?CoworkerProduct_RepeatCycle=...
CoworkerProduct_RepeatFrom DateTime?
?CoworkerProduct_RepeatFrom=...
CoworkerProduct_RepeatUnit int?
?CoworkerProduct_RepeatUnit=...
CoworkerProduct_RepeatUntil DateTime?
?CoworkerProduct_RepeatUntil=...
CoworkerProduct_SaleDate DateTime?
?CoworkerProduct_SaleDate=...
CoworkerProduct_ProductName string
?CoworkerProduct_ProductName=...
CoworkerProduct_ProductPrice string
?CoworkerProduct_ProductPrice=...
CoworkerProduct_ProductCurrency_Code string
?CoworkerProduct_ProductCurrency_Code=...

Range search querystring parameters
Lets you search coworkerproduct records based on a range of date or numeric values.
To_CoworkerProduct_CreatedOn date
?To_CoworkerProduct_CreatedOn=2010-01-01T20:32
From_CoworkerProduct_CreatedOn date
?From_CoworkerProduct_CreatedOn=2010-01-01T20:32
To_CoworkerProduct_UpdatedOn date
?To_CoworkerProduct_UpdatedOn=2010-01-01T20:32
From_CoworkerProduct_UpdatedOn date
?From_CoworkerProduct_UpdatedOn=2010-01-01T20:32
To_CoworkerProduct_Price number
?To_CoworkerProduct_Price=0
From_CoworkerProduct_Price number
?From_CoworkerProduct_Price=10
To_CoworkerProduct_Quantity number
?To_CoworkerProduct_Quantity=0
From_CoworkerProduct_Quantity number
?From_CoworkerProduct_Quantity=10
To_CoworkerProduct_RepeatUnit number
?To_CoworkerProduct_RepeatUnit=0
From_CoworkerProduct_RepeatUnit number
?From_CoworkerProduct_RepeatUnit=10
To_CoworkerProduct_InvoiceOn date
?To_CoworkerProduct_InvoiceOn=2010-01-01T20:32
From_CoworkerProduct_InvoiceOn date
?From_CoworkerProduct_InvoiceOn=2010-01-01T20:32
To_CoworkerProduct_RepeatFrom date
?To_CoworkerProduct_RepeatFrom=2010-01-01T20:32
From_CoworkerProduct_RepeatFrom date
?From_CoworkerProduct_RepeatFrom=2010-01-01T20:32
To_CoworkerProduct_RepeatUntil date
?To_CoworkerProduct_RepeatUntil=2010-01-01T20:32
From_CoworkerProduct_RepeatUntil date
?From_CoworkerProduct_RepeatUntil=2010-01-01T20:32
To_CoworkerProduct_SaleDate date
?To_CoworkerProduct_SaleDate=2010-01-01T20:32
From_CoworkerProduct_SaleDate date
?From_CoworkerProduct_SaleDate=2010-01-01T20:32
To_CoworkerProduct_DueDate date
?To_CoworkerProduct_DueDate=2010-01-01T20:32
From_CoworkerProduct_DueDate date
?From_CoworkerProduct_DueDate=2010-01-01T20:32
To_CoworkerProduct_InvoicedOn date
?To_CoworkerProduct_InvoicedOn=2010-01-01T20:32
From_CoworkerProduct_InvoicedOn date
?From_CoworkerProduct_InvoicedOn=2010-01-01T20:32

Example request

GET https://spaces.nexudus.com/api/billing/coworkerproducts?CoworkerProduct_ProductName=...
Content-Type: application/json
Authentication: Basic ZXhhbXBsZUBuZXh1ZHVzLmNvbTpFeGFtcGxlMTIzNA==

Example response


{
    "Records": [{
        "Id": 1234567,
        "Coworker": ,
        "Business": ,
        "Product": ,
        "Notes": "Notes",
        "OrderNumber": "null",
        "Activated": false,
        "ActivateNow": false,
        "InvoiceThisCoworker": false,
        "Price": ,
        "Quantity": ,
        "RegularCharge": false,
        "RepeatCycle": 1,
        "RepeatUnit": ,
        "InvoiceOn": ,
        "RepeatFrom": ,
        "RepeatUntil": ,
        "SaleDate": ,
        "DueDate": ,
        "Invoiced": false,
        "InvoicedOn": ,
        "FromTariff": false,
        "ContractDepositUniqueId": ,
        "CoworkerProductProductName": "...",
        "CoworkerProductProductPrice": "...",
        "CoworkerProductProductCurrency_Code": "...",
        "CreatedOn": "2018-07-03T06:23:01Z",
        "UpdatedOn": "2020-01-01T21:57:21Z",
        "UpdatedBy": "System",
        "UniqueId": "5a1ecdce-caea-43d0-a3da-2dcc4ca9855b",
        "SystemId": "{ metadata: { id: 887766, processed: true } }"
    }],
    "CurrentPageSize": 25,
    "CurrentPage": 1,
    "CurrentOrderField": "Id",
    "CurrentSortDirection": 1,
    "FirstItem": 1,
    "HasNextPage": true,
    "HasPreviousPage": false,
    "LastItem": 25,
    "PageNumber": 1,
    "PageSize": 25,
    "TotalItems": 60,
    "TotalPages": 3
}


Find CoworkerProducts by IDs

Gets one or more coworkerproduct records based on their Id.
GET https://spaces.nexudus.com/api/billing/coworkerproducts?CoworkerProduct_Id=[:id1,:id2,...]

πŸ”’ Requires role "CoworkerProduct-List"

Querystring parameters
CoworkerProduct_Id: array requried
?CoworkerProduct_Id=[12345678,87654651]

Example request

GET https://spaces.nexudus.com/api/billing/coworkerproducts?CoworkerProduct_Id=[1234567,9876541]
Content-Type: application/json
Authentication: Basic ZXhhbXBsZUBuZXh1ZHVzLmNvbTpFeGFtcGxlMTIzNA==

Example response


{
    "Records": [{
        "Id": 1234567,
        "Coworker": ,
        "Business": ,
        "Product": ,
        "Notes": "Notes",
        "OrderNumber": "null",
        "Activated": false,
        "ActivateNow": false,
        "InvoiceThisCoworker": false,
        "Price": ,
        "Quantity": ,
        "RegularCharge": false,
        "RepeatCycle": 1,
        "RepeatUnit": ,
        "InvoiceOn": ,
        "RepeatFrom": ,
        "RepeatUntil": ,
        "SaleDate": ,
        "DueDate": ,
        "Invoiced": false,
        "InvoicedOn": ,
        "FromTariff": false,
        "ContractDepositUniqueId": ,
        "CoworkerProductProductName": "...",
        "CoworkerProductProductPrice": "...",
        "CoworkerProductProductCurrency_Code": "...",
        "CreatedOn": "2018-07-03T06:23:01Z",
        "UpdatedOn": "2020-01-01T21:57:21Z",
        "UpdatedBy": "System",
        "UniqueId": "fd992702-9476-4a06-b30e-1f0d237116ae",
        "SystemId": "{ metadata: { id: 887766, processed: true } }"
    }],
    "CurrentPageSize": 25,
    "CurrentPage": 1,
    "CurrentOrderField": "CreatedOn",
    "CurrentSortDirection": 1,
    "FirstItem": 1,
    "HasNextPage": true,
    "HasPreviousPage": false,
    "LastItem": 1,
    "PageNumber": 1,
    "PageSize": 25,
    "TotalItems": 1,
    "TotalPages": 1
}


Get single CoworkerProduct by Id

Gets one coworkerproduct record by its Id.
GET https://spaces.nexudus.com/api/billing/coworkerproducts/:Id

πŸ”’ Requires role "CoworkerProduct-Read"

URL parameters
Id: number requried

Example request

GET https://spaces.nexudus.com/api/billing/coworkerproducts/1234567
Content-Type: application/json
Authentication: Basic ZXhhbXBsZUBuZXh1ZHVzLmNvbTpFeGFtcGxlMTIzNA==

Example response


{
  "Id": 1234567,
  "Activated": false,
  "ActivateNow": false,
  "BusinessId": 12345678,
  "ContractDepositUniqueId": ,
  "CoworkerId": 12345678,
  "DueDate": ,
  "FromTariff": false,
  "Invoiced": false,
  "InvoicedOn": ,
  "InvoiceOn": ,
  "InvoiceThisCoworker": false,
  "Notes": "Notes",
  "OrderNumber": "null",
  "Price": ,
  "ProductId": 12345678,
  "Quantity": ,
  "RegularCharge": false,
  "RepeatCycle": 1,
  "RepeatFrom": ,
  "RepeatUnit": ,
  "RepeatUntil": ,
  "SaleDate": ,
  "CreatedOn": "2018-07-03T06:23:01Z",
  "UpdatedOn": "2020-01-01T21:57:21Z",
  "UpdatedBy": "System",
  "UniqueId": "fbc4eee9-d7f2-43e3-b8bd-2c7cd809b8d5",
  "SystemId": "{ metadata: { id: 887766, processed: true } }"
}


Create new CoworkerProduct

Creates a new coworkerproduct.
POST https://spaces.nexudus.com/api/billing/coworkerproducts

πŸ”’ Requires role "CoworkerProduct-Create"

Body parameters
CoworkerId: number required
BusinessId: number required
ProductId: number required
Notes: string optional
ActivateNow: bool optional
InvoiceThisCoworker: bool optional
Price: decimal? optional
Quantity: int required
RegularCharge: bool optional
RepeatCycle: Nexudus.Coworking.Core.Enums.eRecurrentChargePattern optional
RepeatUnit: int? optional
InvoiceOn: DateTime? optional
RepeatFrom: DateTime? optional
RepeatUntil: DateTime? optional
SaleDate: DateTime? optional
DueDate: DateTime? optional
Invoiced: bool optional

Example request

POST https://spaces.nexudus.com/api/billing/coworkerproducts
Content-Type: application/json
Authentication: Basic ZXhhbXBsZUBuZXh1ZHVzLmNvbTpFeGFtcGxlMTIzNA==

{
    "CoworkerId": 12345678,
    "BusinessId": 12345678,
    "ProductId": 12345678,
    "Notes": "Notes",
    "ActivateNow": false,
    "InvoiceThisCoworker": false,
    "Price": ,
    "Quantity": ,
    "RegularCharge": false,
    "RepeatCycle": 1, //(check Enumerated values section below)
    "RepeatUnit": ,
    "InvoiceOn": ,
    "RepeatFrom": ,
    "RepeatUntil": ,
    "SaleDate": ,
    "DueDate": ,
    "Invoiced": false,
}


Example valid response


{
    "Status": 200,
    "WasSuccessful": true,
    "Message": "Record 'Name of the record' has been succesfully created.",
    "Value": {
        "Id": 12354678
    }
}


Example invalid response


{
    "Status": 500,
    "Message": "Name: may not be null or empty",
    "Value": null,
    "WasSuccessful": false,
    "Errors": [
        {
            "AttemptedValue": null,
            "Message": "may not be null or empty",
            "PropertyName": "Name"
        },
    ]
}


Update CoworkerProduct

Updates an existing coworkerproduct.
PUT https://spaces.nexudus.com/api/billing/coworkerproducts

PUT requests require ALL record properties to be submitted with every request. Any missing properties will be cleared or set to false.

πŸ”’ Requires role "CoworkerProduct-Edit"

Body parameters
Id: number required
The unique Id of the coworkerproduct to update.
CoworkerId: number cleared if missing
BusinessId: number cleared if missing
ProductId: number cleared if missing
Notes: string cleared if missing
InvoiceThisCoworker: bool cleared if missing
Price: decimal? cleared if missing
Quantity: int cleared if missing
RegularCharge: bool cleared if missing
RepeatCycle: Nexudus.Coworking.Core.Enums.eRecurrentChargePattern cleared if missing
RepeatUnit: int? cleared if missing
InvoiceOn: DateTime? cleared if missing
RepeatFrom: DateTime? cleared if missing
RepeatUntil: DateTime? cleared if missing
SaleDate: DateTime? cleared if missing
DueDate: DateTime? cleared if missing
Invoiced: bool cleared if missing

Example request

PUT https://spaces.nexudus.com/api/billing/coworkerproducts
Content-Type: application/json
Authentication: Basic ZXhhbXBsZUBuZXh1ZHVzLmNvbTpFeGFtcGxlMTIzNA==

{
    "Id": 12345678,
    "CoworkerId": 12345678,
    "BusinessId": 12345678,
    "ProductId": 12345678,
    "Notes": "Notes",
    "ActivateNow": false,
    "InvoiceThisCoworker": false,
    "Price": ,
    "Quantity": ,
    "RegularCharge": false,
    "RepeatCycle": 1, //(check Enumerated values section below)
    "RepeatUnit": ,
    "InvoiceOn": ,
    "RepeatFrom": ,
    "RepeatUntil": ,
    "SaleDate": ,
    "DueDate": ,
    "Invoiced": false,
}


Example valid response


{
    "Status": 200,
    "WasSuccessful": true,
    "Message": "Record 'Name of the record' has been succesfully updated.",
    "Value": {
        "Id": 12354678
    }
}


Example invalid response


{
    "Status": 500,
    "Message": "Name: may not be null or empty",
    "Value": null,
    "WasSuccessful": false,
    "Errors": [
        {
            "AttemptedValue": null,
            "Message": "may not be null or empty",
            "PropertyName": "Name"
        },
    ]
}


Delete CoworkerProduct

Deletes an existing coworkerproduct by its Id.
DELETE https://spaces.nexudus.com/api/billing/coworkerproducts/:Id

πŸ”’ Requires role "CoworkerProduct-Delete"

URL parameters
Id: number required
The unique Id of the coworkerproduct to update.

Example request

DELETE https://spaces.nexudus.com/api/billing/coworkerproducts/12345678
Content-Type: application/json
Authentication: Basic ZXhhbXBsZUBuZXh1ZHVzLmNvbTpFeGFtcGxlMTIzNA==

Example valid response


{
    "Status": 200,
    "WasSuccessful": true,
    "Message": "The record was deleted successfully.",
    "Value": null,
    "OpenInDialog": false,
    "RedirectURL": null,
    "JavaScript": null,
    "Errors": null
}


Commands

Commands allow to perform actions against one or more coworkerproduct records. Some commands accept only one record while others can run an action for a number of records at the same time. Each command has metadata with information about how it can be used and the amount of records, if any, it needs to run.

Get Commands

Get all commands available to run for coworkerproduct records.
GET https://spaces.nexudus.com/api/billing/coworkerproducts/commands

Example request

GET https://spaces.nexudus.com/api/billing/coworkerproducts/commands
Content-Type: application/json
Authentication: Basic ZXhhbXBsZUBuZXh1ZHVzLmNvbTpFeGFtcGxlMTIzNA==

Example valid response


[
	{
		"Key": "COMMAND_KEY_1",
		"Name": "Command 1 english description",
		"AppliesOnlyToMultipleEntities": false,
		"DisplayInDropdown": true,
		"DisplayInDropdownV2": true,
		"AppliesOnlyToOneEntity": false,
		"AppliesOnlyToTwoEntities": false,
		"DisplayInGrid": false,
		"NeedsEntitiesToRun": true,
		"Order": 2,
		"RequiresParameters": []
	},
	{
		"Key": "COMMAND_KEY_2",
		"Name": "Command 2 english description",
		"AppliesOnlyToMultipleEntities": false,
		"DisplayInDropdown": true,
		"DisplayInDropdownV2": true,
		"AppliesOnlyToOneEntity": true,
		"AppliesOnlyToTwoEntities": false,
		"DisplayInGrid": true,
		"NeedsEntitiesToRun": true,
		"Order": 10,
		"RequiresParameters": 
		[
			{
				"Name": "Parameter 1 description",
				"Type": "string",
			},
			{
				"Name": "Parameter 2 description",
				"Type": "Boolean",
			}
		]
	},
	...
]


Run Command

Runs a command based on its Key and one or more coworkerproduct record IDs.
POST https://spaces.nexudus.com/api/billing/coworkerproducts/runacommand
πŸ”’ Requires role "CoworkerProduct-Edit"

Example request

POST https://spaces.nexudus.com/api/billing/coworkerproducts/runcommand
Content-Type: application/json
Authentication: Basic ZXhhbXBsZUBuZXh1ZHVzLmNvbTpFeGFtcGxlMTIzNA==

{
	"Ids":[1329961649],
	"Parameters": 
	[
		{ 
			"Type": "string"
			"Value":987654321
		},
		{
			"Type": "Boolean",
			"Value":true
		},
		...
	],
	"Key":"COMMAND_KEY_2"
}


Example valid response


{
	"Errors": null
	"JavaScript": null
	"Message": "Result description"
	"OpenInDialog": false
	"OpenInWindow": false
	"RedirectURL": null
	"Status": 200
	"UpdatedBy": "email@example.net"
	"UpdatedOn: "2020-06-04T11:40:20Z"
	"Value: {Id: 12345678}
	"WasSuccessful: true
}


Enumerated values

RepeatCycle

GET /api/utils/enums?name=eRecurrentChargePattern

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Please sign in to leave a comment.