Reference

Invoice

The invoice object

Attributes
Id: int required, autogenerated, unique
The unique identifier for this invoice
BillToAddress: string required
BillToCity: string required
BillToCountryId: Id required
BillToFax: string optional
BillToName: string required
BillToPhone: string optional
BillToPostCode: string required
BillToTaxIDNumber: string optional
BusinessId: Id required
CurrencyId: Id required read-only
CustomData: string optional read-only
Description: string optional read-only
DiscountAmount: decimal required read-only
DueDate: DateTime? optional read-only
InvoiceFromDate: DateTime? optional read-only
InvoiceNumber: string required read-only
InvoiceToDate: DateTime? optional read-only
Paid: bool optional read-only
PaidOn: DateTime? optional read-only
PaymentAttemptsCount: int required read-only
TaxAmount: decimal required read-only
TotalAmount: decimal required read-only
UniqueId: Guid required, autogenerated, unique
The globally unique identifier for this invoice
SystemId: string optional api-only
User defined data about this invoice. This property can only be seen and updated using the API.

Json Structure Example


{
  "Id": 1234567,
  "BillToAddress": "BillToAddress",
  "BillToCity": "BillToCity",
  "BillToCountryId": 12345678,
  "BillToFax": "BillToFax",
  "BillToName": "BillToName",
  "BillToPhone": "BillToPhone",
  "BillToPostCode": "BillToPostCode",
  "BillToTaxIDNumber": "123456",
  "BusinessId": 12345678,
  "CurrencyId": 12345678,
  "CustomData": "null",
  "Description": "[DataType(DataType.MultilineText)]",
  "DiscountAmount": 1.2,
  "DueDate": ,
  "InvoiceFromDate": ,
  "InvoiceNumber": "00001",
  "InvoiceToDate": ,
  "Paid": false,
  "PaidOn": ,
  "PaymentAttemptsCount": ,
  "TaxAmount": 1.2,
  "TotalAmount": 1.2,
  "UniqueId": "a5f4fd6a-3d6a-4d73-aa0d-c6aaff4bba96",
  "SystemId": "{ metadata: { id: 887766, processed: true } }"
}


Find a Invoice

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

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

๐Ÿ”’ Requires role "Invoice-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 invoice records based on their different properties.
Id number
?Id=12345678
Invoice_BillToAddress string
?Invoice_BillToAddress=...
Invoice_BillToCity string
?Invoice_BillToCity=...
Invoice_BillToCountry Country
?Invoice_BillToCountry=...
Invoice_BillToFax string
?Invoice_BillToFax=...
Invoice_BillToName string
?Invoice_BillToName=...
Invoice_BillToPhone string
?Invoice_BillToPhone=...
Invoice_BillToPostCode string
?Invoice_BillToPostCode=...
Invoice_BillToTaxIDNumber string
?Invoice_BillToTaxIDNumber=...
Invoice_Business Business
?Invoice_Business=...
Invoice_Currency Currency
?Invoice_Currency=...
Invoice_CustomData string
?Invoice_CustomData=...
Invoice_Description string
?Invoice_Description=...
Invoice_DiscountAmount decimal
?Invoice_DiscountAmount=...
Invoice_DueDate DateTime?
?Invoice_DueDate=...
Invoice_InvoiceFromDate DateTime?
?Invoice_InvoiceFromDate=...
Invoice_InvoiceNumber string
?Invoice_InvoiceNumber=...
Invoice_InvoiceToDate DateTime?
?Invoice_InvoiceToDate=...
Invoice_Paid bool
?Invoice_Paid=...
Invoice_PaidOn DateTime?
?Invoice_PaidOn=...
Invoice_PaymentAttemptsCount int
?Invoice_PaymentAttemptsCount=...
Invoice_TaxAmount decimal
?Invoice_TaxAmount=...
Invoice_TotalAmount decimal
?Invoice_TotalAmount=...
Invoice_BillToCountryName string
?Invoice_BillToCountryName=...
Invoice_CurrencyCode string
?Invoice_CurrencyCode=...

Range search querystring parameters
Lets you search invoice records based on a range of date or numeric values.
To_Invoice_CreatedOn date
?To_Invoice_CreatedOn=2010-01-01T20:32
From_Invoice_CreatedOn date
?From_Invoice_CreatedOn=2010-01-01T20:32
To_Invoice_UpdatedOn date
?To_Invoice_UpdatedOn=2010-01-01T20:32
From_Invoice_UpdatedOn date
?From_Invoice_UpdatedOn=2010-01-01T20:32
To_Invoice_DiscountAmount number
?To_Invoice_DiscountAmount=0
From_Invoice_DiscountAmount number
?From_Invoice_DiscountAmount=10
To_Invoice_DueDate date
?To_Invoice_DueDate=2010-01-01T20:32
From_Invoice_DueDate date
?From_Invoice_DueDate=2010-01-01T20:32
To_Invoice_InvoiceFromDate date
?To_Invoice_InvoiceFromDate=2010-01-01T20:32
From_Invoice_InvoiceFromDate date
?From_Invoice_InvoiceFromDate=2010-01-01T20:32
To_Invoice_InvoiceToDate date
?To_Invoice_InvoiceToDate=2010-01-01T20:32
From_Invoice_InvoiceToDate date
?From_Invoice_InvoiceToDate=2010-01-01T20:32
To_Invoice_TotalAmount number
?To_Invoice_TotalAmount=0
From_Invoice_TotalAmount number
?From_Invoice_TotalAmount=10
To_Invoice_TaxAmount number
?To_Invoice_TaxAmount=0
From_Invoice_TaxAmount number
?From_Invoice_TaxAmount=10
To_Invoice_PaidOn date
?To_Invoice_PaidOn=2010-01-01T20:32
From_Invoice_PaidOn date
?From_Invoice_PaidOn=2010-01-01T20:32
To_Invoice_PaymentAttemptsCount number
?To_Invoice_PaymentAttemptsCount=0
From_Invoice_PaymentAttemptsCount number
?From_Invoice_PaymentAttemptsCount=10

Example request

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

Example response


{
    "Records": [{
        "Id": 1234567,
        "Business": ,
        "InvoiceNumber": "00001",
        "BillToName": "BillToName",
        "BillToAddress": "BillToAddress",
        "BillToCity": "BillToCity",
        "BillToTaxIDNumber": "123456",
        "BillToPostCode": "BillToPostCode",
        "BillToPhone": "BillToPhone",
        "BillToFax": "BillToFax",
        "BillToCountry": ,
        "Description": "[DataType(DataType.MultilineText)]",
        "DiscountAmount": 1.2,
        "DueDate": ,
        "InvoiceFromDate": ,
        "InvoiceToDate": ,
        "TotalAmount": 1.2,
        "Currency": ,
        "TaxAmount": 1.2,
        "Paid": false,
        "PaidOn": ,
        "CustomData": "null",
        "PaymentAttemptsCount": ,
        "InvoiceBillToCountryName": "...",
        "InvoiceCurrencyCode": "...",
        "CreatedOn": "2018-07-03T06:23:01Z",
        "UpdatedOn": "2020-01-01T21:57:21Z",
        "UpdatedBy": "System",
        "UniqueId": "ab3f5310-ecb9-4d7d-abc3-823ab5d4cfa9",
        "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 Invoices by IDs

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

๐Ÿ”’ Requires role "Invoice-List"

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

Example request

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

Example response


{
    "Records": [{
        "Id": 1234567,
        "Business": ,
        "InvoiceNumber": "00001",
        "BillToName": "BillToName",
        "BillToAddress": "BillToAddress",
        "BillToCity": "BillToCity",
        "BillToTaxIDNumber": "123456",
        "BillToPostCode": "BillToPostCode",
        "BillToPhone": "BillToPhone",
        "BillToFax": "BillToFax",
        "BillToCountry": ,
        "Description": "[DataType(DataType.MultilineText)]",
        "DiscountAmount": 1.2,
        "DueDate": ,
        "InvoiceFromDate": ,
        "InvoiceToDate": ,
        "TotalAmount": 1.2,
        "Currency": ,
        "TaxAmount": 1.2,
        "Paid": false,
        "PaidOn": ,
        "CustomData": "null",
        "PaymentAttemptsCount": ,
        "InvoiceBillToCountryName": "...",
        "InvoiceCurrencyCode": "...",
        "CreatedOn": "2018-07-03T06:23:01Z",
        "UpdatedOn": "2020-01-01T21:57:21Z",
        "UpdatedBy": "System",
        "UniqueId": "4bc7d5cc-74f7-4b26-9ae4-5bb85ade73a4",
        "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 Invoice by Id

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

๐Ÿ”’ Requires role "Invoice-Read"

URL parameters
Id: number requried

Example request

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

Example response


{
  "Id": 1234567,
  "BillToAddress": "BillToAddress",
  "BillToCity": "BillToCity",
  "BillToCountryId": 12345678,
  "BillToFax": "BillToFax",
  "BillToName": "BillToName",
  "BillToPhone": "BillToPhone",
  "BillToPostCode": "BillToPostCode",
  "BillToTaxIDNumber": "123456",
  "BusinessId": 12345678,
  "CurrencyId": 12345678,
  "CustomData": "null",
  "Description": "[DataType(DataType.MultilineText)]",
  "DiscountAmount": 1.2,
  "DueDate": ,
  "InvoiceFromDate": ,
  "InvoiceNumber": "00001",
  "InvoiceToDate": ,
  "Paid": false,
  "PaidOn": ,
  "PaymentAttemptsCount": ,
  "TaxAmount": 1.2,
  "TotalAmount": 1.2,
  "CreatedOn": "2018-07-03T06:23:01Z",
  "UpdatedOn": "2020-01-01T21:57:21Z",
  "UpdatedBy": "System",
  "UniqueId": "0c1869cb-003f-4e3c-b983-7a286e8b5aba",
  "SystemId": "{ metadata: { id: 887766, processed: true } }"
}


Create new Invoice

Creates a new invoice.
POST https://spaces.nexudus.com/api/billing/invoices

๐Ÿ”’ Requires role "Invoice-Create"

Body parameters
BusinessId: number required
BillToName: string required
BillToAddress: string required
BillToCity: string required
BillToTaxIDNumber: string optional
BillToPostCode: string required
BillToPhone: string optional
BillToFax: string optional
BillToCountryId: number required

Example request

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

{
    "BusinessId": 12345678,
    "BillToName": "BillToName",
    "BillToAddress": "BillToAddress",
    "BillToCity": "BillToCity",
    "BillToTaxIDNumber": "123456",
    "BillToPostCode": "BillToPostCode",
    "BillToPhone": "BillToPhone",
    "BillToFax": "BillToFax",
    "BillToCountryId": 12345678,
}


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 Invoice

Updates an existing invoice.
PUT https://spaces.nexudus.com/api/billing/invoices

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

๐Ÿ”’ Requires role "Invoice-Edit"

Body parameters
Id: number required
The unique Id of the invoice to update.
BusinessId: number cleared if missing
BillToName: string cleared if missing
BillToAddress: string cleared if missing
BillToCity: string cleared if missing
BillToTaxIDNumber: string cleared if missing
BillToPostCode: string cleared if missing
BillToPhone: string cleared if missing
BillToFax: string cleared if missing
BillToCountryId: number cleared if missing

Example request

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

{
    "Id": 12345678,
    "BusinessId": 12345678,
    "BillToName": "BillToName",
    "BillToAddress": "BillToAddress",
    "BillToCity": "BillToCity",
    "BillToTaxIDNumber": "123456",
    "BillToPostCode": "BillToPostCode",
    "BillToPhone": "BillToPhone",
    "BillToFax": "BillToFax",
    "BillToCountryId": 12345678,
}


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"
        },
    ]
}


Commands

Commands allow to perform actions against one or more invoice 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 invoice records.
GET https://spaces.nexudus.com/api/billing/invoices/commands

Example request

GET https://spaces.nexudus.com/api/billing/invoices/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 invoice record IDs.
POST https://spaces.nexudus.com/api/billing/invoices/runacommand
๐Ÿ”’ Requires role "Invoice-Edit"

Example request

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