Reference

Charge

The charge object

Attributes
Id: int required, autogenerated, unique
The unique identifier for this charge
BusinessId: Id required
ChargeNumber: string optional read-only
CoworkerId: Id required
CoworkerChargeUniqueId: Guid? optional read-only
CoworkerContractUniqueId: Guid? optional read-only
CoworkerExtraServiceUniqueId: Guid? optional read-only
CoworkerTimePassUniqueId: Guid? optional read-only
Description: string optional
DiscountAmount: decimal required
DueDate: DateTime? optional
EventAttendeeUniqueId: Guid? optional read-only
FinancialAccountId: Id optional
Invoiced: bool optional
InvoicedOn: DateTime? optional read-only
InvoiceFromDate: DateTime? optional read-only
InvoiceToDate: DateTime? optional read-only
RegularCharge: bool optional
TaxRateId: Id optional
TotalAmount: decimal required
UniqueId: Guid required, autogenerated, unique
The globally unique identifier for this charge
SystemId: string optional api-only
User defined data about this charge. This property can only be seen and updated using the API.

Json Structure Example


{
  "Id": 1234567,
  "BusinessId": 12345678,
  "ChargeNumber": "00001",
  "CoworkerId": 12345678,
  "CoworkerChargeUniqueId": ,
  "CoworkerContractUniqueId": ,
  "CoworkerExtraServiceUniqueId": ,
  "CoworkerTimePassUniqueId": ,
  "Description": "[DataType(DataType.MultilineText)]",
  "DiscountAmount": 1.2,
  "DueDate": ,
  "EventAttendeeUniqueId": ,
  "FinancialAccountId": 12345678,
  "Invoiced": false,
  "InvoicedOn": ,
  "InvoiceFromDate": ,
  "InvoiceToDate": ,
  "RegularCharge": false,
  "TaxRateId": 12345678,
  "TotalAmount": 1.2,
  "UniqueId": "f1879568-5d6d-42d8-9e55-0b9dd92bac52",
  "SystemId": "{ metadata: { id: 887766, processed: true } }"
}


Find a Charge

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

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

πŸ”’ Requires role "Charge-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=Id
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 charge records based on their different properties.
Id number
?Id=12345678
Charge_Business Business
?Charge_Business=...
Charge_ChargeNumber string
?Charge_ChargeNumber=...
Charge_Coworker Coworker
?Charge_Coworker=...
Charge_CoworkerChargeUniqueId Guid?
?Charge_CoworkerChargeUniqueId=...
Charge_CoworkerContractUniqueId Guid?
?Charge_CoworkerContractUniqueId=...
Charge_CoworkerExtraServiceUniqueId Guid?
?Charge_CoworkerExtraServiceUniqueId=...
Charge_CoworkerTimePassUniqueId Guid?
?Charge_CoworkerTimePassUniqueId=...
Charge_Description string
?Charge_Description=...
Charge_DiscountAmount decimal
?Charge_DiscountAmount=...
Charge_DueDate DateTime?
?Charge_DueDate=...
Charge_EventAttendeeUniqueId Guid?
?Charge_EventAttendeeUniqueId=...
Charge_FinancialAccount FinancialAccount
?Charge_FinancialAccount=...
Charge_Invoiced bool
?Charge_Invoiced=...
Charge_InvoicedOn DateTime?
?Charge_InvoicedOn=...
Charge_InvoiceFromDate DateTime?
?Charge_InvoiceFromDate=...
Charge_InvoiceToDate DateTime?
?Charge_InvoiceToDate=...
Charge_RegularCharge bool
?Charge_RegularCharge=...
Charge_TaxRate TaxRate
?Charge_TaxRate=...
Charge_TotalAmount decimal
?Charge_TotalAmount=...
Charge_BusinessName string
?Charge_BusinessName=...
Charge_BusinessCurrency_Code string
?Charge_BusinessCurrency_Code=...

Range search querystring parameters
Lets you search charge records based on a range of date or numeric values.
To_Charge_CreatedOn date
?To_Charge_CreatedOn=2010-01-01T20:32
From_Charge_CreatedOn date
?From_Charge_CreatedOn=2010-01-01T20:32
To_Charge_UpdatedOn date
?To_Charge_UpdatedOn=2010-01-01T20:32
From_Charge_UpdatedOn date
?From_Charge_UpdatedOn=2010-01-01T20:32
To_Charge_DiscountAmount number
?To_Charge_DiscountAmount=0
From_Charge_DiscountAmount number
?From_Charge_DiscountAmount=10
To_Charge_DueDate date
?To_Charge_DueDate=2010-01-01T20:32
From_Charge_DueDate date
?From_Charge_DueDate=2010-01-01T20:32
To_Charge_TotalAmount number
?To_Charge_TotalAmount=0
From_Charge_TotalAmount number
?From_Charge_TotalAmount=10
To_Charge_InvoicedOn date
?To_Charge_InvoicedOn=2010-01-01T20:32
From_Charge_InvoicedOn date
?From_Charge_InvoicedOn=2010-01-01T20:32
To_Charge_InvoiceFromDate date
?To_Charge_InvoiceFromDate=2010-01-01T20:32
From_Charge_InvoiceFromDate date
?From_Charge_InvoiceFromDate=2010-01-01T20:32
To_Charge_InvoiceToDate date
?To_Charge_InvoiceToDate=2010-01-01T20:32
From_Charge_InvoiceToDate date
?From_Charge_InvoiceToDate=2010-01-01T20:32

Example request

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

Example response


{
    "Records": [{
        "Id": 1234567,
        "Coworker": ,
        "Business": ,
        "ChargeNumber": "00001",
        "Description": "[DataType(DataType.MultilineText)]",
        "RegularCharge": false,
        "DiscountAmount": 1.2,
        "DueDate": ,
        "TotalAmount": 1.2,
        "TaxRate": ,
        "FinancialAccount": ,
        "Invoiced": false,
        "InvoicedOn": ,
        "CoworkerContractUniqueId": ,
        "CoworkerExtraServiceUniqueId": ,
        "CoworkerTimePassUniqueId": ,
        "CoworkerChargeUniqueId": ,
        "EventAttendeeUniqueId": ,
        "InvoiceFromDate": ,
        "InvoiceToDate": ,
        "ChargeBusinessName": "...",
        "ChargeBusinessCurrency_Code": "...",
        "CreatedOn": "2018-07-03T06:23:01Z",
        "UpdatedOn": "2020-01-01T21:57:21Z",
        "UpdatedBy": "System",
        "UniqueId": "53a291e6-aaa7-4298-b640-7f1da47c82a7",
        "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 Charges by IDs

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

πŸ”’ Requires role "Charge-List"

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

Example request

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

Example response


{
    "Records": [{
        "Id": 1234567,
        "Coworker": ,
        "Business": ,
        "ChargeNumber": "00001",
        "Description": "[DataType(DataType.MultilineText)]",
        "RegularCharge": false,
        "DiscountAmount": 1.2,
        "DueDate": ,
        "TotalAmount": 1.2,
        "TaxRate": ,
        "FinancialAccount": ,
        "Invoiced": false,
        "InvoicedOn": ,
        "CoworkerContractUniqueId": ,
        "CoworkerExtraServiceUniqueId": ,
        "CoworkerTimePassUniqueId": ,
        "CoworkerChargeUniqueId": ,
        "EventAttendeeUniqueId": ,
        "InvoiceFromDate": ,
        "InvoiceToDate": ,
        "ChargeBusinessName": "...",
        "ChargeBusinessCurrency_Code": "...",
        "CreatedOn": "2018-07-03T06:23:01Z",
        "UpdatedOn": "2020-01-01T21:57:21Z",
        "UpdatedBy": "System",
        "UniqueId": "aee6c54f-73dc-43ad-bbf2-fb03ea7d0761",
        "SystemId": "{ metadata: { id: 887766, processed: true } }"
    }],
    "CurrentPageSize": 25,
    "CurrentPage": 1,
    "CurrentOrderField": "Id",
    "CurrentSortDirection": 1,
    "FirstItem": 1,
    "HasNextPage": true,
    "HasPreviousPage": false,
    "LastItem": 1,
    "PageNumber": 1,
    "PageSize": 25,
    "TotalItems": 1,
    "TotalPages": 1
}


Get single Charge by Id

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

πŸ”’ Requires role "Charge-Read"

URL parameters
Id: number requried

Example request

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

Example response


{
  "Id": 1234567,
  "BusinessId": 12345678,
  "ChargeNumber": "00001",
  "CoworkerId": 12345678,
  "CoworkerChargeUniqueId": ,
  "CoworkerContractUniqueId": ,
  "CoworkerExtraServiceUniqueId": ,
  "CoworkerTimePassUniqueId": ,
  "Description": "[DataType(DataType.MultilineText)]",
  "DiscountAmount": 1.2,
  "DueDate": ,
  "EventAttendeeUniqueId": ,
  "FinancialAccountId": 12345678,
  "Invoiced": false,
  "InvoicedOn": ,
  "InvoiceFromDate": ,
  "InvoiceToDate": ,
  "RegularCharge": false,
  "TaxRateId": 12345678,
  "TotalAmount": 1.2,
  "CreatedOn": "2018-07-03T06:23:01Z",
  "UpdatedOn": "2020-01-01T21:57:21Z",
  "UpdatedBy": "System",
  "UniqueId": "dd4831f6-4852-4182-ae5a-717be661a6da",
  "SystemId": "{ metadata: { id: 887766, processed: true } }"
}


Create new Charge

Creates a new charge.
POST https://spaces.nexudus.com/api/billing/charges

πŸ”’ Requires role "Charge-Create"

Body parameters
CoworkerId: number required
BusinessId: number required
Description: string optional
RegularCharge: bool optional
DiscountAmount: decimal required
DueDate: DateTime? optional
TotalAmount: decimal required
TaxRateId: number optional
FinancialAccountId: number optional
Invoiced: bool optional

Example request

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

{
    "CoworkerId": 12345678,
    "BusinessId": 12345678,
    "Description": "[DataType(DataType.MultilineText)]",
    "RegularCharge": false,
    "DiscountAmount": 1.2,
    "DueDate": ,
    "TotalAmount": 1.2,
    "TaxRateId": 12345678,
    "FinancialAccountId": 12345678,
    "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 Charge

Updates an existing charge.
PUT https://spaces.nexudus.com/api/billing/charges

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

πŸ”’ Requires role "Charge-Edit"

Body parameters
Id: number required
The unique Id of the charge to update.
CoworkerId: number cleared if missing
BusinessId: number cleared if missing
Description: string cleared if missing
RegularCharge: bool cleared if missing
DiscountAmount: decimal cleared if missing
DueDate: DateTime? cleared if missing
TotalAmount: decimal cleared if missing
TaxRateId: number cleared if missing
FinancialAccountId: number cleared if missing
Invoiced: bool cleared if missing

Example request

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

{
    "Id": 12345678,
    "CoworkerId": 12345678,
    "BusinessId": 12345678,
    "Description": "[DataType(DataType.MultilineText)]",
    "RegularCharge": false,
    "DiscountAmount": 1.2,
    "DueDate": ,
    "TotalAmount": 1.2,
    "TaxRateId": 12345678,
    "FinancialAccountId": 12345678,
    "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 Charge

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

πŸ”’ Requires role "Charge-Delete"

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

Example request

DELETE https://spaces.nexudus.com/api/billing/charges/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 charge 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 charge records.
GET https://spaces.nexudus.com/api/billing/charges/commands

Example request

GET https://spaces.nexudus.com/api/billing/charges/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 charge record IDs.
POST https://spaces.nexudus.com/api/billing/charges/runacommand
πŸ”’ Requires role "Charge-Edit"

Example request

POST https://spaces.nexudus.com/api/billing/charges/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
}


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.