| POST | /eaccounting/invoicedraft |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
public static class CreateInvoiceDraft extends InvoiceAddressResponse implements ICompany
{
/**
* The booking id, to be used to create the customer.
*/
@ApiMember(Description="The booking id, to be used to create the customer.", IsRequired=true)
public Integer BookingId = null;
/**
* The Term of payment Id, to be used to create the invoice.
*/
@ApiMember(Description="The Term of payment Id, to be used to create the invoice.", IsRequired=true)
public UUID TermsOfPaymentId = null;
/**
* Note id's to add to this invoice
*/
@ApiMember(Description="Note id's to add to this invoice")
public ArrayList<String> Notes = null;
/**
* Invoice Customer name
*/
@ApiMember(Description="Invoice Customer name")
public String InvoiceCustomerName = null;
/**
* 1 = Apartment, 2 = Property Leave blank or set to null if you do not intend to use ROT or Green Technology functionality.
*/
@ApiMember(Description="1 = Apartment, 2 = Property Leave blank or set to null if you do not intend to use ROT or Green Technology functionality.", IsRequired=true)
public RotPropertyTypes RotPropertyType = null;
/**
* 0 = Normal, 1 = Rot, 2 = Rut = ['0', '1', '2']
*/
@ApiMember(Description="0 = Normal, 1 = Rot, 2 = Rut = ['0', '1', '2']", IsRequired=true)
public RotReducedInvoicingTypes RotReducedInvoicingType = null;
/**
* The company id, if empty will use the company id for the user you are logged in with.
*/
@ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
public UUID CompanyId = null;
public Integer getBookingId() { return BookingId; }
public CreateInvoiceDraft setBookingId(Integer value) { this.BookingId = value; return this; }
public UUID getTermsOfPaymentId() { return TermsOfPaymentId; }
public CreateInvoiceDraft setTermsOfPaymentId(UUID value) { this.TermsOfPaymentId = value; return this; }
public ArrayList<String> getNotes() { return Notes; }
public CreateInvoiceDraft setNotes(ArrayList<String> value) { this.Notes = value; return this; }
public String getInvoiceCustomerName() { return InvoiceCustomerName; }
public CreateInvoiceDraft setInvoiceCustomerName(String value) { this.InvoiceCustomerName = value; return this; }
public RotPropertyTypes getRotPropertyType() { return RotPropertyType; }
public CreateInvoiceDraft setRotPropertyType(RotPropertyTypes value) { this.RotPropertyType = value; return this; }
public RotReducedInvoicingTypes getRotReducedInvoicingType() { return RotReducedInvoicingType; }
public CreateInvoiceDraft setRotReducedInvoicingType(RotReducedInvoicingTypes value) { this.RotReducedInvoicingType = value; return this; }
public UUID getCompanyId() { return CompanyId; }
public CreateInvoiceDraft setCompanyId(UUID value) { this.CompanyId = value; return this; }
}
public static class InvoiceAddressResponse
{
public UUID InvoiceAddressId = null;
public UUID UserId = null;
public String CorporateIdentityNumber = null;
public String InvoiceAddress1 = null;
public String InvoiceAddress2 = null;
public String InvoiceCity = null;
public String InvoicePostalCode = null;
public String InvoiceCountryCode = null;
public UUID getInvoiceAddressId() { return InvoiceAddressId; }
public InvoiceAddressResponse setInvoiceAddressId(UUID value) { this.InvoiceAddressId = value; return this; }
public UUID getUserId() { return UserId; }
public InvoiceAddressResponse setUserId(UUID value) { this.UserId = value; return this; }
public String getCorporateIdentityNumber() { return CorporateIdentityNumber; }
public InvoiceAddressResponse setCorporateIdentityNumber(String value) { this.CorporateIdentityNumber = value; return this; }
public String getInvoiceAddress1() { return InvoiceAddress1; }
public InvoiceAddressResponse setInvoiceAddress1(String value) { this.InvoiceAddress1 = value; return this; }
public String getInvoiceAddress2() { return InvoiceAddress2; }
public InvoiceAddressResponse setInvoiceAddress2(String value) { this.InvoiceAddress2 = value; return this; }
public String getInvoiceCity() { return InvoiceCity; }
public InvoiceAddressResponse setInvoiceCity(String value) { this.InvoiceCity = value; return this; }
public String getInvoicePostalCode() { return InvoicePostalCode; }
public InvoiceAddressResponse setInvoicePostalCode(String value) { this.InvoicePostalCode = value; return this; }
public String getInvoiceCountryCode() { return InvoiceCountryCode; }
public InvoiceAddressResponse setInvoiceCountryCode(String value) { this.InvoiceCountryCode = value; return this; }
}
public static enum RotPropertyTypes
{
Apartment(1),
Property(2);
private final int value;
RotPropertyTypes(final int intValue) { value = intValue; }
public int getValue() { return value; }
}
public static enum RotReducedInvoicingTypes
{
Normal,
Rot,
Rut;
}
public static class CreateInvoiceDraftQueryResponse
{
public InvoiceDraftQueryResponse Invoice = null;
public String InvoiceUri = null;
public ResponseStatus ResponseStatus = null;
public InvoiceDraftQueryResponse getInvoice() { return Invoice; }
public CreateInvoiceDraftQueryResponse setInvoice(InvoiceDraftQueryResponse value) { this.Invoice = value; return this; }
public String getInvoiceUri() { return InvoiceUri; }
public CreateInvoiceDraftQueryResponse setInvoiceUri(String value) { this.InvoiceUri = value; return this; }
public ResponseStatus getResponseStatus() { return ResponseStatus; }
public CreateInvoiceDraftQueryResponse setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
}
public static class InvoiceDraftQueryResponse
{
public UUID InvoiceId = null;
public Date CreatedDate = null;
public BigDecimal TotalAmount = null;
public BigDecimal TotalVatAmount = null;
public String CustomerId = null;
public ArrayList<InvoiceDraftLineQueryResponse> Rows = new ArrayList<InvoiceDraftLineQueryResponse>();
public String InvoiceDate = null;
public String DueDate = null;
public Date DeliveryDate = null;
public ArrayList<Person> Persons = new ArrayList<Person>();
public String InvoiceCustomerName = null;
public EAccountingInvoiceAddress InvoiceAddress = null;
public Boolean CustomerIsPrivatePerson = null;
public String CustomerNumber = null;
public ArrayList<NoteQueryResponse> Notes = new ArrayList<NoteQueryResponse>();
public ArrayList<String> NoteIds = new ArrayList<String>();
public Date CreatedUtc = null;
public Boolean IncludesVat = null;
public String PriceSign = null;
public String BookingId = null;
public UUID getInvoiceId() { return InvoiceId; }
public InvoiceDraftQueryResponse setInvoiceId(UUID value) { this.InvoiceId = value; return this; }
public Date getCreatedDate() { return CreatedDate; }
public InvoiceDraftQueryResponse setCreatedDate(Date value) { this.CreatedDate = value; return this; }
public BigDecimal getTotalAmount() { return TotalAmount; }
public InvoiceDraftQueryResponse setTotalAmount(BigDecimal value) { this.TotalAmount = value; return this; }
public BigDecimal getTotalVatAmount() { return TotalVatAmount; }
public InvoiceDraftQueryResponse setTotalVatAmount(BigDecimal value) { this.TotalVatAmount = value; return this; }
public String getCustomerId() { return CustomerId; }
public InvoiceDraftQueryResponse setCustomerId(String value) { this.CustomerId = value; return this; }
public ArrayList<InvoiceDraftLineQueryResponse> getRows() { return Rows; }
public InvoiceDraftQueryResponse setRows(ArrayList<InvoiceDraftLineQueryResponse> value) { this.Rows = value; return this; }
public String getInvoiceDate() { return InvoiceDate; }
public InvoiceDraftQueryResponse setInvoiceDate(String value) { this.InvoiceDate = value; return this; }
public String getDueDate() { return DueDate; }
public InvoiceDraftQueryResponse setDueDate(String value) { this.DueDate = value; return this; }
public Date getDeliveryDate() { return DeliveryDate; }
public InvoiceDraftQueryResponse setDeliveryDate(Date value) { this.DeliveryDate = value; return this; }
public ArrayList<Person> getPersons() { return Persons; }
public InvoiceDraftQueryResponse setPersons(ArrayList<Person> value) { this.Persons = value; return this; }
public String getInvoiceCustomerName() { return InvoiceCustomerName; }
public InvoiceDraftQueryResponse setInvoiceCustomerName(String value) { this.InvoiceCustomerName = value; return this; }
public EAccountingInvoiceAddress getInvoiceAddress() { return InvoiceAddress; }
public InvoiceDraftQueryResponse setInvoiceAddress(EAccountingInvoiceAddress value) { this.InvoiceAddress = value; return this; }
public Boolean isCustomerIsPrivatePerson() { return CustomerIsPrivatePerson; }
public InvoiceDraftQueryResponse setCustomerIsPrivatePerson(Boolean value) { this.CustomerIsPrivatePerson = value; return this; }
public String getCustomerNumber() { return CustomerNumber; }
public InvoiceDraftQueryResponse setCustomerNumber(String value) { this.CustomerNumber = value; return this; }
public ArrayList<NoteQueryResponse> getNotes() { return Notes; }
public InvoiceDraftQueryResponse setNotes(ArrayList<NoteQueryResponse> value) { this.Notes = value; return this; }
public ArrayList<String> getNoteIds() { return NoteIds; }
public InvoiceDraftQueryResponse setNoteIds(ArrayList<String> value) { this.NoteIds = value; return this; }
public Date getCreatedUtc() { return CreatedUtc; }
public InvoiceDraftQueryResponse setCreatedUtc(Date value) { this.CreatedUtc = value; return this; }
public Boolean isIncludesVat() { return IncludesVat; }
public InvoiceDraftQueryResponse setIncludesVat(Boolean value) { this.IncludesVat = value; return this; }
public String getPriceSign() { return PriceSign; }
public InvoiceDraftQueryResponse setPriceSign(String value) { this.PriceSign = value; return this; }
public String getBookingId() { return BookingId; }
public InvoiceDraftQueryResponse setBookingId(String value) { this.BookingId = value; return this; }
}
public static class InvoiceDraftLineQueryResponse
{
public String ArticleNumber = null;
public String ArticleId = null;
public Boolean IsServiceArticle = null;
public BigDecimal AmountNoVat = null;
public BigDecimal PercentVat = null;
public Integer LineNumber = null;
public Boolean IsTextRow = null;
public String Text = null;
public BigDecimal UnitPrice = null;
public String UnitAbbreviation = null;
public String UnitAbbreviationEnglish = null;
public BigDecimal DiscountPercentage = null;
public Double Quantity = null;
public Boolean IsWorkCost = null;
public Boolean IsVatFree = null;
public String CostCenterItemId1 = null;
public String CostCenterItemId2 = null;
public String CostCenterItemId3 = null;
public String UnitId = null;
public String ProjectId = null;
public Integer WorkCostType = null;
public Double WorkHours = null;
public BigDecimal MaterialCosts = null;
public GreenTechnologyType GreenTechnologyType = null;
public ContributionMargin ContributionMargin = null;
public String getArticleNumber() { return ArticleNumber; }
public InvoiceDraftLineQueryResponse setArticleNumber(String value) { this.ArticleNumber = value; return this; }
public String getArticleId() { return ArticleId; }
public InvoiceDraftLineQueryResponse setArticleId(String value) { this.ArticleId = value; return this; }
public Boolean getIsServiceArticle() { return IsServiceArticle; }
public InvoiceDraftLineQueryResponse setIsServiceArticle(Boolean value) { this.IsServiceArticle = value; return this; }
public BigDecimal getAmountNoVat() { return AmountNoVat; }
public InvoiceDraftLineQueryResponse setAmountNoVat(BigDecimal value) { this.AmountNoVat = value; return this; }
public BigDecimal getPercentVat() { return PercentVat; }
public InvoiceDraftLineQueryResponse setPercentVat(BigDecimal value) { this.PercentVat = value; return this; }
public Integer getLineNumber() { return LineNumber; }
public InvoiceDraftLineQueryResponse setLineNumber(Integer value) { this.LineNumber = value; return this; }
public Boolean getIsTextRow() { return IsTextRow; }
public InvoiceDraftLineQueryResponse setIsTextRow(Boolean value) { this.IsTextRow = value; return this; }
public String getText() { return Text; }
public InvoiceDraftLineQueryResponse setText(String value) { this.Text = value; return this; }
public BigDecimal getUnitPrice() { return UnitPrice; }
public InvoiceDraftLineQueryResponse setUnitPrice(BigDecimal value) { this.UnitPrice = value; return this; }
public String getUnitAbbreviation() { return UnitAbbreviation; }
public InvoiceDraftLineQueryResponse setUnitAbbreviation(String value) { this.UnitAbbreviation = value; return this; }
public String getUnitAbbreviationEnglish() { return UnitAbbreviationEnglish; }
public InvoiceDraftLineQueryResponse setUnitAbbreviationEnglish(String value) { this.UnitAbbreviationEnglish = value; return this; }
public BigDecimal getDiscountPercentage() { return DiscountPercentage; }
public InvoiceDraftLineQueryResponse setDiscountPercentage(BigDecimal value) { this.DiscountPercentage = value; return this; }
public Double getQuantity() { return Quantity; }
public InvoiceDraftLineQueryResponse setQuantity(Double value) { this.Quantity = value; return this; }
public Boolean getIsWorkCost() { return IsWorkCost; }
public InvoiceDraftLineQueryResponse setIsWorkCost(Boolean value) { this.IsWorkCost = value; return this; }
public Boolean getIsVatFree() { return IsVatFree; }
public InvoiceDraftLineQueryResponse setIsVatFree(Boolean value) { this.IsVatFree = value; return this; }
public String getCostCenterItemId1() { return CostCenterItemId1; }
public InvoiceDraftLineQueryResponse setCostCenterItemId1(String value) { this.CostCenterItemId1 = value; return this; }
public String getCostCenterItemId2() { return CostCenterItemId2; }
public InvoiceDraftLineQueryResponse setCostCenterItemId2(String value) { this.CostCenterItemId2 = value; return this; }
public String getCostCenterItemId3() { return CostCenterItemId3; }
public InvoiceDraftLineQueryResponse setCostCenterItemId3(String value) { this.CostCenterItemId3 = value; return this; }
public String getUnitId() { return UnitId; }
public InvoiceDraftLineQueryResponse setUnitId(String value) { this.UnitId = value; return this; }
public String getProjectId() { return ProjectId; }
public InvoiceDraftLineQueryResponse setProjectId(String value) { this.ProjectId = value; return this; }
public Integer getWorkCostType() { return WorkCostType; }
public InvoiceDraftLineQueryResponse setWorkCostType(Integer value) { this.WorkCostType = value; return this; }
public Double getWorkHours() { return WorkHours; }
public InvoiceDraftLineQueryResponse setWorkHours(Double value) { this.WorkHours = value; return this; }
public BigDecimal getMaterialCosts() { return MaterialCosts; }
public InvoiceDraftLineQueryResponse setMaterialCosts(BigDecimal value) { this.MaterialCosts = value; return this; }
public GreenTechnologyType getGreenTechnologyType() { return GreenTechnologyType; }
public InvoiceDraftLineQueryResponse setGreenTechnologyType(GreenTechnologyType value) { this.GreenTechnologyType = value; return this; }
public ContributionMargin getContributionMargin() { return ContributionMargin; }
public InvoiceDraftLineQueryResponse setContributionMargin(ContributionMargin value) { this.ContributionMargin = value; return this; }
}
public static enum GreenTechnologyType
{
None,
SolarCellInstallation,
ElectricEnergyStorageInstallation,
ElectricVehicleChargingPointInstallation;
}
public static class ContributionMargin
{
public Integer Amount = null;
public Integer Percentage = null;
public Integer getAmount() { return Amount; }
public ContributionMargin setAmount(Integer value) { this.Amount = value; return this; }
public Integer getPercentage() { return Percentage; }
public ContributionMargin setPercentage(Integer value) { this.Percentage = value; return this; }
}
public static class Person
{
public String Ssn = null;
public Integer Amount = null;
public String getSsn() { return Ssn; }
public Person setSsn(String value) { this.Ssn = value; return this; }
public Integer getAmount() { return Amount; }
public Person setAmount(Integer value) { this.Amount = value; return this; }
}
public static class EAccountingInvoiceAddress
{
public String CorporateIdentityNumber = null;
public String InvoiceAddress1 = null;
public String InvoiceAddress2 = null;
public String InvoiceCity = null;
public String InvoicePostalCode = null;
public String InvoiceCountryCode = null;
public String getCorporateIdentityNumber() { return CorporateIdentityNumber; }
public EAccountingInvoiceAddress setCorporateIdentityNumber(String value) { this.CorporateIdentityNumber = value; return this; }
public String getInvoiceAddress1() { return InvoiceAddress1; }
public EAccountingInvoiceAddress setInvoiceAddress1(String value) { this.InvoiceAddress1 = value; return this; }
public String getInvoiceAddress2() { return InvoiceAddress2; }
public EAccountingInvoiceAddress setInvoiceAddress2(String value) { this.InvoiceAddress2 = value; return this; }
public String getInvoiceCity() { return InvoiceCity; }
public EAccountingInvoiceAddress setInvoiceCity(String value) { this.InvoiceCity = value; return this; }
public String getInvoicePostalCode() { return InvoicePostalCode; }
public EAccountingInvoiceAddress setInvoicePostalCode(String value) { this.InvoicePostalCode = value; return this; }
public String getInvoiceCountryCode() { return InvoiceCountryCode; }
public EAccountingInvoiceAddress setInvoiceCountryCode(String value) { this.InvoiceCountryCode = value; return this; }
}
public static class NoteQueryResponse
{
public String Id = null;
public String Text = null;
public Date CreatedUtc = null;
public Date ModifiedUtc = null;
public String getId() { return Id; }
public NoteQueryResponse setId(String value) { this.Id = value; return this; }
public String getText() { return Text; }
public NoteQueryResponse setText(String value) { this.Text = value; return this; }
public Date getCreatedUtc() { return CreatedUtc; }
public NoteQueryResponse setCreatedUtc(Date value) { this.CreatedUtc = value; return this; }
public Date getModifiedUtc() { return ModifiedUtc; }
public NoteQueryResponse setModifiedUtc(Date value) { this.ModifiedUtc = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=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: api.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,
UserId: 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
}
}
}