BokaMera.API.Host

<back to all web services

EAccountingCustomerQuery

The following routes are available for this service:
GET/eaccounting/customers
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
Object = TypeVar('Object')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QueryBase:
    skip: Optional[int] = None
    take: Optional[int] = None
    order_by: Optional[str] = None
    order_by_desc: Optional[str] = None
    include: Optional[str] = None
    fields: Optional[str] = None
    meta: Optional[Dict[str, str]] = None


T = TypeVar('T')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QueryData(Generic[T], QueryBase, IReturn[QueryResponse[T]]):
    @staticmethod
    def response_type(): return QueryResponse[T]


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EAccountingInvoiceAddress:
    corporate_identity_number: Optional[str] = None
    invoice_address1: Optional[str] = None
    invoice_address2: Optional[str] = None
    invoice_city: Optional[str] = None
    invoice_postal_code: Optional[str] = None
    invoice_country_code: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EAccountingTermsOfPaymentQueryResponse:
    id: Optional[str] = None
    name: Optional[str] = None
    name_english: Optional[str] = None
    number_of_days: int = 0
    terms_of_payment_type_id: int = 0
    terms_of_payment_type_text: Optional[str] = None
    available_for_sales: bool = False
    available_for_purchase: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomerLabelQueryResponse:
    id: Optional[str] = None
    name: Optional[str] = None
    description: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DirectDebitCustomerSettingsQueryResponse:
    mandate_id: Optional[str] = None
    mandate_type: int = 0
    sequence_type: int = 0
    signing_date: datetime.datetime = datetime.datetime(1, 1, 1)
    end_date: datetime.datetime = datetime.datetime(1, 1, 1)
    latest_direct_debit: datetime.datetime = datetime.datetime(1, 1, 1)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EAccountingCustomerQueryResponse:
    id: Optional[str] = None
    customer_number: Optional[str] = None
    corporate_identity_number: Optional[str] = None
    contact_person_email: Optional[str] = None
    contact_person_mobile: Optional[str] = None
    contact_person_name: Optional[str] = None
    contact_person_phone: Optional[str] = None
    currency_code: Optional[str] = None
    gln: Optional[str] = None
    invoice_city: Optional[str] = None
    invoice_postal_code: Optional[str] = None
    email_address: Optional[str] = None
    email_address_order: Optional[str] = None
    email_address_quote: Optional[str] = None
    invoice_address: Optional[EAccountingInvoiceAddress] = None
    delivery_customer_name: Optional[str] = None
    delivery_address1: Optional[str] = None
    delivery_address2: Optional[str] = None
    delivery_city: Optional[str] = None
    delivery_country_code: Optional[str] = None
    delivery_postal_code: Optional[str] = None
    delivery_method_id: Optional[str] = None
    delivery_term_id: Optional[str] = None
    pay_to_account_id: Optional[str] = None
    name: Optional[str] = None
    note: Optional[str] = None
    reverse_charge_on_construction_services: bool = False
    webshop_customer_number: Optional[int] = None
    mobile_phone: Optional[str] = None
    telephone: Optional[str] = None
    terms_of_payment_id: Optional[str] = None
    e_accounting_terms_of_payment: Optional[EAccountingTermsOfPaymentQueryResponse] = None
    vat_number: Optional[str] = None
    www_address: Optional[str] = None
    last_invoice_date: Optional[str] = None
    is_private_person: bool = False
    is_northern_ireland: bool = False
    discount_percentage: Optional[Decimal] = None
    changed_utc: Optional[datetime.datetime] = None
    is_active: bool = False
    force_bookkeep_vat: bool = False
    edi_gln_number: Optional[str] = None
    sales_document_language: Optional[str] = None
    electronic_address: Optional[str] = None
    electronic_reference: Optional[str] = None
    edi_service_deliverer_id: Optional[str] = None
    auto_invoice_activation_email_sent_date: Optional[datetime.datetime] = None
    auto_invoice_registration_request_sent_date: Optional[datetime.datetime] = None
    email_addresses: List[str] = field(default_factory=list)
    customer_labels: List[CustomerLabelQueryResponse] = field(default_factory=list)
    message_threads: List[str] = field(default_factory=list)
    notes: List[str] = field(default_factory=list)
    is_future_invoice_date_allowed: bool = False
    delivery_based_vat: bool = False
    sales_price_list_id: Optional[str] = None
    iban: Optional[str] = None
    direct_debit_customer_settings: Optional[DirectDebitCustomerSettingsQueryResponse] = None
    discount_agreement_id: Optional[str] = None
    unpaid_invoices_amount: Decimal = decimal.Decimal(0)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EAccountingCustomerQuery(QueryData[EAccountingCustomerQueryResponse], ICompany):
    company_id: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AccessKeyTypeResponse:
    id: int = 0
    key_type: Optional[str] = None
    description: Optional[str] = None


T = TypeVar('T')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QueryResponse(Generic[T]):
    offset: int = 0
    total: int = 0
    results: List[AccessKeyTypeResponse] = field(default_factory=list)
    meta: Optional[Dict[str, str]] = None
    response_status: Optional[ResponseStatus] = None

Python EAccountingCustomerQuery DTOs

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.

GET /eaccounting/customers HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Offset: 0,
	Total: 0,
	Results: 
	[
		{
			Id: String,
			CustomerNumber: String,
			CorporateIdentityNumber: String,
			ContactPersonEmail: String,
			ContactPersonMobile: String,
			ContactPersonName: String,
			ContactPersonPhone: String,
			CurrencyCode: String,
			GLN: String,
			InvoiceCity: String,
			InvoicePostalCode: String,
			EmailAddress: String,
			EmailAddressOrder: String,
			EmailAddressQuote: String,
			InvoiceAddress: 
			{
				CorporateIdentityNumber: String,
				InvoiceAddress1: String,
				InvoiceAddress2: String,
				InvoiceCity: String,
				InvoicePostalCode: String,
				InvoiceCountryCode: String
			},
			DeliveryCustomerName: String,
			DeliveryAddress1: String,
			DeliveryAddress2: String,
			DeliveryCity: String,
			DeliveryCountryCode: String,
			DeliveryPostalCode: String,
			DeliveryMethodId: String,
			DeliveryTermId: String,
			PayToAccountId: String,
			Name: String,
			Note: String,
			ReverseChargeOnConstructionServices: False,
			WebshopCustomerNumber: 0,
			MobilePhone: String,
			Telephone: String,
			TermsOfPaymentId: String,
			EAccountingTermsOfPayment: 
			{
				Id: String,
				Name: String,
				NameEnglish: String,
				NumberOfDays: 0,
				TermsOfPaymentTypeId: 0,
				TermsOfPaymentTypeText: String,
				AvailableForSales: False,
				AvailableForPurchase: False
			},
			VatNumber: String,
			WwwAddress: String,
			LastInvoiceDate: String,
			IsPrivatePerson: False,
			IsNorthernIreland: False,
			DiscountPercentage: 0,
			ChangedUtc: "0001-01-01T00:00:00",
			IsActive: False,
			ForceBookkeepVat: False,
			EdiGlnNumber: String,
			SalesDocumentLanguage: String,
			ElectronicAddress: String,
			ElectronicReference: String,
			EdiServiceDelivererId: String,
			AutoInvoiceActivationEmailSentDate: "0001-01-01T00:00:00",
			AutoInvoiceRegistrationRequestSentDate: "0001-01-01T00:00:00",
			EmailAddresses: 
			[
				String
			],
			CustomerLabels: 
			[
				{
					Id: String,
					Name: String,
					Description: String
				}
			],
			MessageThreads: 
			[
				String
			],
			Notes: 
			[
				String
			],
			IsFutureInvoiceDateAllowed: False,
			DeliveryBasedVat: False,
			SalesPriceListId: String,
			Iban: String,
			DirectDebitCustomerSettings: 
			{
				MandateId: String,
				MandateType: 0,
				SequenceType: 0
			},
			DiscountAgreementId: String,
			UnpaidInvoicesAmount: 0
		}
	],
	Meta: 
	{
		String: String
	},
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}