Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
PUT | /eaccounting/customers | Update E-Accounting Customer |
---|
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
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class InvoiceAddress:
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 EAccountingTermsOfPayment:
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 CustomerLabel:
id: Optional[str] = None
name: Optional[str] = None
description: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DirectDebitCustomerSettings:
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 CreateEAccountingCustomer(InvoiceAddress):
customer_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
email_address: Optional[str] = None
email_address_order: Optional[str] = None
email_address_quote: Optional[str] = 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[EAccountingTermsOfPayment] = 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: Decimal = decimal.Decimal(0)
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: Optional[List[str]] = None
customer_labels: Optional[List[CustomerLabel]] = None
message_threads: Optional[List[str]] = None
notes: Optional[List[str]] = None
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[DirectDebitCustomerSettings] = 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 EAccountingCustomerResponse(CreateEAccountingCustomer):
id: Optional[str] = None
# @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
# @ValidateRequest(Validator="IsAuthenticated")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UpdateEaccountingCustomer(ICompany):
# @ApiMember(Description="Customer Id in e-accounting.", IsRequired=true)
id: Optional[str] = None
"""
Customer Id in e-accounting.
"""
# @ApiMember(Description="")
invoice_city: Optional[str] = None
"""
"""
# @ApiMember(Description="Max length: 10 characters")
invoice_postal_code: Optional[str] = None
"""
Max length: 10 characters
"""
# @ApiMember(Description="Max length: 50 characters")
name: Optional[str] = None
"""
Max length: 50 characters
"""
# @ApiMember(Description="")
terms_of_payment_id: Optional[str] = None
"""
"""
# @ApiMember(Description="")
is_private_person: bool = False
"""
"""
# @ApiMember(Description="")
is_active: bool = False
"""
"""
# @ApiMember(Description="")
telephone: Optional[str] = None
"""
"""
# @ApiMember(Description="")
email_address: Optional[str] = None
"""
"""
# @ApiMember(Description="")
mobile_phone: Optional[str] = None
"""
"""
# @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
company_id: Optional[str] = None
"""
The company id, if empty will use the company id for the user you are logged in with.
"""
Python UpdateEaccountingCustomer DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /eaccounting/customers HTTP/1.1
Host: api.bokamera.se
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<EAccountingDtos.UpdateEaccountingCustomer xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<EmailAddress>String</EmailAddress>
<Id>String</Id>
<InvoiceCity>String</InvoiceCity>
<InvoicePostalCode>String</InvoicePostalCode>
<IsActive>false</IsActive>
<IsPrivatePerson>false</IsPrivatePerson>
<MobilePhone>String</MobilePhone>
<Name>String</Name>
<Telephone>String</Telephone>
<TermsOfPaymentId>String</TermsOfPaymentId>
</EAccountingDtos.UpdateEaccountingCustomer>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <EAccountingClientDtos.EAccountingCustomerResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <CorporateIdentityNumber>String</CorporateIdentityNumber> <InvoiceAddress1>String</InvoiceAddress1> <InvoiceAddress2>String</InvoiceAddress2> <InvoiceCity>String</InvoiceCity> <InvoiceCountryCode>String</InvoiceCountryCode> <InvoicePostalCode>String</InvoicePostalCode> <AutoInvoiceActivationEmailSentDate>0001-01-01T00:00:00</AutoInvoiceActivationEmailSentDate> <AutoInvoiceRegistrationRequestSentDate>0001-01-01T00:00:00</AutoInvoiceRegistrationRequestSentDate> <ChangedUtc>0001-01-01T00:00:00</ChangedUtc> <ContactPersonEmail>String</ContactPersonEmail> <ContactPersonMobile>String</ContactPersonMobile> <ContactPersonName>String</ContactPersonName> <ContactPersonPhone>String</ContactPersonPhone> <CurrencyCode>String</CurrencyCode> <CustomerLabels> <EAccountingClientDtos.CustomerLabel> <Description>String</Description> <Id>String</Id> <Name>String</Name> </EAccountingClientDtos.CustomerLabel> </CustomerLabels> <CustomerNumber>String</CustomerNumber> <DeliveryAddress1>String</DeliveryAddress1> <DeliveryAddress2>String</DeliveryAddress2> <DeliveryBasedVat>false</DeliveryBasedVat> <DeliveryCity>String</DeliveryCity> <DeliveryCountryCode>String</DeliveryCountryCode> <DeliveryCustomerName>String</DeliveryCustomerName> <DeliveryMethodId>String</DeliveryMethodId> <DeliveryPostalCode>String</DeliveryPostalCode> <DeliveryTermId>String</DeliveryTermId> <DirectDebitCustomerSettings> <EndDate>0001-01-01T00:00:00</EndDate> <LatestDirectDebit>0001-01-01T00:00:00</LatestDirectDebit> <MandateId>String</MandateId> <MandateType>0</MandateType> <SequenceType>0</SequenceType> <SigningDate>0001-01-01T00:00:00</SigningDate> </DirectDebitCustomerSettings> <DiscountAgreementId>String</DiscountAgreementId> <DiscountPercentage>0</DiscountPercentage> <EAccountingTermsOfPayment> <AvailableForPurchase>false</AvailableForPurchase> <AvailableForSales>false</AvailableForSales> <Id>String</Id> <Name>String</Name> <NameEnglish>String</NameEnglish> <NumberOfDays>0</NumberOfDays> <TermsOfPaymentTypeId>0</TermsOfPaymentTypeId> <TermsOfPaymentTypeText>String</TermsOfPaymentTypeText> </EAccountingTermsOfPayment> <EdiGlnNumber>String</EdiGlnNumber> <EdiServiceDelivererId>String</EdiServiceDelivererId> <ElectronicAddress>String</ElectronicAddress> <ElectronicReference>String</ElectronicReference> <EmailAddress>String</EmailAddress> <EmailAddressOrder>String</EmailAddressOrder> <EmailAddressQuote>String</EmailAddressQuote> <EmailAddresses xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:string>String</d2p1:string> </EmailAddresses> <ForceBookkeepVat>false</ForceBookkeepVat> <GLN>String</GLN> <Iban>String</Iban> <IsActive>false</IsActive> <IsFutureInvoiceDateAllowed>false</IsFutureInvoiceDateAllowed> <IsNorthernIreland>false</IsNorthernIreland> <IsPrivatePerson>false</IsPrivatePerson> <LastInvoiceDate>String</LastInvoiceDate> <MessageThreads xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:string>String</d2p1:string> </MessageThreads> <MobilePhone>String</MobilePhone> <Name>String</Name> <Note>String</Note> <Notes xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:string>String</d2p1:string> </Notes> <PayToAccountId>String</PayToAccountId> <ReverseChargeOnConstructionServices>false</ReverseChargeOnConstructionServices> <SalesDocumentLanguage>String</SalesDocumentLanguage> <SalesPriceListId>String</SalesPriceListId> <Telephone>String</Telephone> <TermsOfPaymentId>String</TermsOfPaymentId> <UnpaidInvoicesAmount>0</UnpaidInvoicesAmount> <VatNumber>String</VatNumber> <WebshopCustomerNumber>0</WebshopCustomerNumber> <WwwAddress>String</WwwAddress> <Id>String</Id> </EAccountingClientDtos.EAccountingCustomerResponse>