BokaMera.API.Host

<back to all web services

CreateInvoiceDraft

The following routes are available for this service:
POST/eaccounting/invoicedraft
CreateInvoiceDraft Parameters:
NameParameterData TypeRequiredDescription
BookingIdbodyintYesThe booking id, to be used to create the customer.
TermsOfPaymentIdbodyGuidYesThe Term of payment Id, to be used to create the invoice.
NotesbodyList<string>NoNote id's to add to this invoice
InvoiceCustomerNamebodystringNoInvoice Customer name
RotPropertyTypebodyRotPropertyTypes?Yes1 = Apartment, 2 = Property Leave blank or set to null if you do not intend to use ROT or Green Technology functionality.
RotReducedInvoicingTypebodyRotReducedInvoicingTypes?Yes0 = Normal, 1 = Rot, 2 = Rut = ['0', '1', '2']
CompanyIdbodyGuid?NoThe company id, if empty will use the company id for the user you are logged in with.
InvoiceAddress Parameters:
NameParameterData TypeRequiredDescription
CorporateIdentityNumberformstringNo
InvoiceAddress1formstringNo
InvoiceAddress2formstringNo
InvoiceCityformstringNo
InvoicePostalCodeformstringNo
InvoiceCountryCodeformstringNo
RotPropertyTypes Enum:
NameValue
Apartment1
Property2
RotReducedInvoicingTypes Enum:
Normal
Rot
Rut
CreateInvoiceDraftQueryResponse Parameters:
NameParameterData TypeRequiredDescription
InvoiceformInvoiceDraftQueryResponseNo
InvoiceUriformstringNo
ResponseStatusformResponseStatusNo
InvoiceDraftQueryResponse Parameters:
NameParameterData TypeRequiredDescription
InvoiceIdformGuidNo
CreatedDateformDateTime?No
TotalAmountformdecimal?No
TotalVatAmountformdecimal?No
CustomerIdformstringNo
RowsformList<InvoiceDraftLineQueryResponse>No
InvoiceDateformstringNo
DueDateformstringNo
DeliveryDateformDateTime?No
PersonsformList<Person>No
InvoiceCustomerNameformstringNo
InvoiceAddressformInvoiceAddressNo
CustomerIsPrivatePersonformboolNo
CustomerNumberformstringNo
NotesformList<NoteQueryResponse>No
NoteIdsformList<string>No
CreatedUtcformDateTimeNo
IncludesVatformboolNo
PriceSignformstringNo
BookingIdformstringNo
InvoiceDraftLineQueryResponse Parameters:
NameParameterData TypeRequiredDescription
ArticleNumberformstringNo
ArticleIdformstringNo
IsServiceArticleformbool?No
AmountNoVatformdecimalNo
PercentVatformdecimalNo
LineNumberformint?No
IsTextRowformboolNo
TextformstringNo
UnitPriceformdecimal?No
UnitAbbreviationformstringNo
UnitAbbreviationEnglishformstringNo
DiscountPercentageformdecimal?No
Quantityformdouble?No
IsWorkCostformboolNo
IsVatFreeformboolNo
CostCenterItemId1formstringNo
CostCenterItemId2formstringNo
CostCenterItemId3formstringNo
UnitIdformstringNo
ProjectIdformstringNo
WorkCostTypeformint?No
WorkHoursformdouble?No
MaterialCostsformdecimal?No
GreenTechnologyTypeformGreenTechnologyType?No
ContributionMarginformContributionMarginNo
GreenTechnologyType Enum:
None
SolarCellInstallation
ElectricEnergyStorageInstallation
ElectricVehicleChargingPointInstallation
ContributionMargin Parameters:
NameParameterData TypeRequiredDescription
Amountformint?No
Percentageformint?No
Person Parameters:
NameParameterData TypeRequiredDescription
SsnformstringNo
AmountformintNo
NoteQueryResponse Parameters:
NameParameterData TypeRequiredDescription
IdformstringNo
TextformstringNo
CreatedUtcformDateTimeNo
ModifiedUtcformDateTimeNo

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /eaccounting/invoicedraft HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	BookingId: 0,
	Notes: 
	[
		String
	],
	InvoiceCustomerName: String,
	RotPropertyType: 0,
	RotReducedInvoicingType: Normal,
	CompanyId: 00000000-0000-0000-0000-000000000000,
	CorporateIdentityNumber: String,
	InvoiceAddress1: String,
	InvoiceAddress2: String,
	InvoiceCity: String,
	InvoicePostalCode: String,
	InvoiceCountryCode: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Invoice: 
	{
		CreatedDate: "0001-01-01T00:00:00",
		TotalAmount: 0,
		TotalVatAmount: 0,
		CustomerId: String,
		Rows: 
		[
			{
				ArticleNumber: String,
				ArticleId: String,
				IsServiceArticle: False,
				AmountNoVat: 0,
				PercentVat: 0,
				LineNumber: 0,
				IsTextRow: False,
				Text: String,
				UnitPrice: 0,
				UnitAbbreviation: String,
				UnitAbbreviationEnglish: String,
				DiscountPercentage: 0,
				Quantity: 0,
				IsWorkCost: False,
				IsVatFree: False,
				CostCenterItemId1: String,
				CostCenterItemId2: String,
				CostCenterItemId3: String,
				UnitId: String,
				ProjectId: String,
				WorkCostType: 0,
				WorkHours: 0,
				MaterialCosts: 0,
				GreenTechnologyType: None,
				ContributionMargin: 
				{
					Amount: 0,
					Percentage: 0
				}
			}
		],
		InvoiceDate: String,
		DueDate: String,
		DeliveryDate: "0001-01-01T00:00:00",
		Persons: 
		[
			{
				Ssn: String,
				Amount: 0
			}
		],
		InvoiceCustomerName: String,
		InvoiceAddress: 
		{
			CorporateIdentityNumber: String,
			InvoiceAddress1: String,
			InvoiceAddress2: String,
			InvoiceCity: String,
			InvoicePostalCode: String,
			InvoiceCountryCode: String
		},
		CustomerIsPrivatePerson: False,
		CustomerNumber: String,
		Notes: 
		[
			{
				Id: String,
				Text: String
			}
		],
		NoteIds: 
		[
			String
		],
		IncludesVat: False,
		PriceSign: String,
		BookingId: String
	},
	InvoiceUri: String,
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}