Get Invoice Detail

Get Invoice Detail #

Get a detailed breakdown of all items being invoiced for a specific invoice. A ZIP file is returned from this query which contains a detailed JSON file and a simplified CSV file. Each file contains a record of every transaction in the invoice.

GET /v1.0/billingdata/{INVOICE_ID}/detail

Example #

This request will retrieve a breakdown of items for a specific invoice id.

Request #

GET <https://api.na.myreports.cloud/api/v1.0/billingdata/{INVOICE_ID}/detail> HTTP/1.1
Authorisation: Bearer {TOKEN}

Response #

HTTP/1.1 200 OK
Content-Type: application/octet-stream; charset=utf-8
Content-Length: xx
{
	"status": "success",
	"timestamp": "2019-01-01T10:00:00.2890319Z"
}

Example JSON Output #

{
	"tenantId": "00000000-0000-0000-0000-123456789123",
	"invoiceId": "00000000000000000000000a",
	"invoiceNumber": "9000004",
	"accountName": "Example Tenant 1",
	"billingPeriodStart": "2020-04-01T00:00:00.0000000",
	"billingPeriodEnd": "2020-04-30T23:59:59.0000000",
	"invoiceDate": "2020-04-09T00:00:00.0000000",
	"invoiceValue": 17.50,
	"invoiceItems": \[
		{
			"id": "000000000000000000000001",
			"quantity": 1.0,
			"value": 1.25,
			"fromDate": "2020-04-01T00:00:00.000+00:00",
			"toDate": "2020-04-30T23:59:59.000+00:00",
			"calculationOrder": 1,
			"operatorUsed": "PRICE",
			"operatorValueUsed": 1.25,
			"productTagName": "Essential User #XDM00001",
			"billingOutputTags": ["PurchaseResult"][ "PurchaseResult" ],
			"stringValues": [
				{
					"name": "Role",
					"value": "customer.user.pbx"
				},
				{
					"name": "ResellerCode",
					"value": "00000000-0000-0000-0000-000000000222"
				},
				{
					"name": "ResellerCodeExt",
					"value": "reseller ref 1"
				},
				{
					"name": "ResellerName",
					"value": "ABC Reseller"
				},
				{
					"name": "TenantCode",
					"value": "00000000-0000-0000-0000-000000000111"
				},
				{
					"name": "TenantCodeExt",
					"value": "custom ref 1"
				},
				{
					"name": "TenantName",
					"value": "Example Customer 1"
				},
				{
					"name": "UserId",
					"value": "00000000-0000-0000-0000-000000000001"
				},
				{
					"name": "UserName",
					"value": "[email protected]"
				}
			][
				{
					"name": "Role",
					"value": "customer.user.pbx"
				},
				{
					"name": "ResellerCode",
					"value": "00000000-0000-0000-0000-000000000222"
				},
				{
					"name": "ResellerCodeExt",
					"value": "reseller ref 1"
				},
				{
					"name": "ResellerName",
					"value": "ABC Reseller"
				},
				{
					"name": "TenantCode",
					"value": "00000000-0000-0000-0000-000000000111"
				},
				{
					"name": "TenantCodeExt",
					"value": "custom ref 1"
				},
				{
					"name": "TenantName",
					"value": "Example Customer 1"
				},
				{
					"name": "UserId",
					"value": "00000000-0000-0000-0000-000000000001"
				},
				{
					"name": "UserName",
					"value": "[email protected]"
				}
			],
			"numericValues": [
				{
					"name": "customer_licence_count",
					"value": 1
				}
			][
				{
					"name": "customer_licence_count",
					"value": 1
				}
			]
		},
		{
			"id": "000000000000000000000003",
			"quantity": 1.0,
			"value": 15.0,
			"fromDate": "2020-04-01T00:00:00.000+00:00",
			"toDate": "2020-04-30T23:59:59.000+00:00",
			"calculationOrder": 3,
			"operatorUsed": "PRICE",
			"operatorValueUsed": 15.00,
			"productTagName": "Real-Time Supervisor #XDM00010",
			"billingOutputTags": ["PurchaseResult"][ "PurchaseResult" ],
			"stringValues": [
				{
					"name": "Role",
					"value": "customer.user.supervisorl2"
				},
				{
					"name": "ResellerCode",
					"value": "00000000-0000-0000-0000-000000000222"
				},
				{
					"name": "ResellerCodeExt",
					"value": "reseller ref 1"
				},
				{
					"name": "ResellerName",
					"value": "ABC Reseller"
				},
				{
					"name": "TenantCode",
					"value": "00000000-0000-0000-0000-000000000111"
				},
				{
					"name": "TenantCodeExt",
					"value": "custom ref 1"
				},
				{
					"name": "TenantName",
					"value": "Example Customer 1"
				},
				{
					"name": "UserId",
					"value": "00000000-0000-0000-0000-000000000001"
				},
				{
					"name": "UserName",
					"value": "[email protected]"
				}
			][
				{
					"name": "Role",
					"value": "customer.user.supervisorl2"
				},
				{
					"name": "ResellerCode",
					"value": "00000000-0000-0000-0000-000000000222"
				},
				{
					"name": "ResellerCodeExt",
					"value": "reseller ref 1"
				},
				{
					"name": "ResellerName",
					"value": "ABC Reseller"
				},
				{
					"name": "TenantCode",
					"value": "00000000-0000-0000-0000-000000000111"
				},
				{
					"name": "TenantCodeExt",
					"value": "custom ref 1"
				},
				{
					"name": "TenantName",
					"value": "Example Customer 1"
				},
				{
					"name": "UserId",
					"value": "00000000-0000-0000-0000-000000000001"
				},
				{
					"name": "UserName",
					"value": "[email protected]"
				}
			],
			"numericValues": [
				{
					"name": "customer_licence_count",
					"value": 1
				}
			][
				{
					"name": "customer_licence_count",
					"value": 1
				}
			]
		},
		{
			"id": "000000000000000000000004",
			"quantity": 3.0,
			"value": 17.50,
			"fromDate": "2020-04-01T00:00:00.000+00:00",
			"toDate": "2020-04-30T23:59:59.000+00:00",
			"calculationOrder": 4,
			"operatorUsed": "SUM",
			"operatorValueUsed": 0.0,
			"productTagName": "All Products",
			"billingOutputTags": ["Summary", "Total", "GL", "GL_Entry:0000;credit;"][ "Summary", "Total", "GL", "GL_Entry:0000;credit;" ],
			"stringValues": [][ ]
		},
		{
			"id": "000000000000000000000005",
			"quantity": 3.0,
			"value": 17.50,
			"fromDate": "2020-04-01T00:00:00.000+00:00",
			"toDate": "2020-04-30T23:59:59.000+00:00",
			"calculationOrder": 5,
			"operatorUsed": "ADJUSTPERCENTAGE",
			"operatorValueUsed": 0.0,
			"productTagName": "All Products",
			"billingOutputTags": ["TotalInclVAT", "Summary", "GL_Balance", "GL_Entry:2222;debit;Debtors"][ "TotalInclVAT", "Summary", "GL_Balance", "GL_Entry:2222;debit;Debtors" ],
			"stringValues": [][ ]
		},
		{
			"id": "000000000000000000000006",
			"quantity": 345.0,
			"value": 0.0,
			"fromDate": "2020-04-01T00:00:00.000+00:00",
			"toDate": "2020-04-30T23:59:59.000+00:00",
			"calculationOrder": 6,
			"operatorUsed": "ADJUSTPERCENTAGE",
			"operatorValueUsed": 0.0,
			"productTagName": "All Products",
			"billingOutputTags": ["TotalVAT", "Summary", "GL_VAT", "VAT:S", "GL_Entry:1111;credit;VAT"][ "TotalVAT", "Summary", "GL_VAT", "VAT:S", "GL_Entry:1111;credit;VAT" ],
			"stringValues": [][ ]
		}
	],
	"invoiceType": 0
}

Example CSV Output #

id,quantity,value,fromdate,todate,productname,partnumber,tenantcode,tenantcodeext,tenantname,userid,username,resellercode,resellercodeext,resellername,role
000000000000000000000001,1,1.25,2020-04-01T00:00:00.000+00:00,2020-04-30T23:59:59.000+00:00,Essential User,#XDM00001,00000000-0000-0000-0000-000000000111,custom ref 1,Example Customer 1,00000000-0000-0000-0000-000000000001,[[email protected]](mailto:[email protected]),00000000-0000-0000-0000-000000000222,reseller ref 1,ABC Reseller,customer.user.pbx
000000000000000000000003,1,15,2020-04-01T00:00:00.000+00:00,2020-04-30T23:59:59.000+00:00,Real-Time Supervisor,#XDM00010,00000000-0000-0000-0000-000000000111,custom ref 1,Example Customer 1,00000000-0000-0000-0000-000000000001,[[email protected]](mailto:[email protected]),00000000-0000-0000-0000-000000000222,reseller ref 1,ABC Reseller,customer.user.supervisorl2

Errors #

Unauthorised #

When the token is not provided, invalid or expired

HTTP/1.1 401 Unauthorised

Not Found #

When there are no invoices that have a matching invoice id

HTTP/1.1 404 Not Found
Date: Thu, 06 Feb 2020 12:46:58 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 95
{
	"error": 404,
	"message": "Not Found",
	"status": "error",
	"timestamp": "2020-02-06T12:46:58.7669535Z"
}