コード例 #1
0
        public APIGetPartnerAccessTokensResponse GetPartnerAccessTokens(string password, string partnerTaxId)
        {
            Invoicing_v2.InvoicingSoapClient client = GetAPIClient();

            var serviceResponse = client.GetPartnerAccessTokensAsync(GetAPISpecialAuthenticationCredentials(password), partnerTaxId).Result;

            return(GetPartnerAccessTokenAPIResponse(serviceResponse));
        }
コード例 #2
0
        public APIDocumentGetResponse DocumentGet(int documentId)
        {
            Invoicing_v2.InvoicingSoapClient client = GetAPIClient();

            var serviceResponse = client.DocumentGetAsync(GetAuthenticationCredentials(), documentId).Result;

            return(DocumentGetAPIResponse(serviceResponse));
        }
コード例 #3
0
        public Task <APIGetPartnerAccessTokensResponse> GetPartnerAccessTokensAsync(string password, string partnerTaxId)
        {
            Invoicing_v2.InvoicingSoapClient client = GetAPIClient();

            return(Task.Run <APIGetPartnerAccessTokensResponse>(async() => {
                var serviceResponse = await client.GetPartnerAccessTokensAsync(GetAPISpecialAuthenticationCredentials(password), partnerTaxId);

                return GetPartnerAccessTokenAPIResponse(serviceResponse);
            }));
        }
コード例 #4
0
        public Task <APIDocumentGetResponse> DocumentGetAsync(int documentId)
        {
            Invoicing_v2.InvoicingSoapClient client = GetAPIClient();

            return(Task.Run <APIDocumentGetResponse>(async() => {
                var serviceResponse = await client.DocumentGetAsync(GetAuthenticationCredentials(), documentId);

                return DocumentGetAPIResponse(serviceResponse);
            }));
        }
コード例 #5
0
        /// <summary>
        /// Create simplified invoice
        /// </summary>
        /// <param name="client">Client identification</param>
        /// <param name="invoice">Purchase information</param>
        /// <param name="isToClose">Should the document be closed (true) in which case it cannot be later changed and a PDF and document number are generated or should the document be created as a draft (false) in which case no PDF or document number are generated.</param>
        /// <param name="sentTo">Upon closing the document an email can be sent with a notification of the document to an email address.</param>
        public APIDocumentCreateResponse InvoiceSimplifiedCreate(Models.Client client, SimplifiedInvoice invoice, bool isToClose, string sentTo)
        {
            Invoicing_v2.InvoicingSoapClient apiClient = GetAPIClient();
            Invoicing_v2.Client invoiceClient          = ToInvoicingClient(client);

            DocumentIn document = ToInvoicingDocument(invoice);

            var serviceResponse = apiClient.DocumentCreateAsync(GetAuthenticationCredentials(), invoiceClient, document, isToClose, sentTo).Result;

            return(new APIDocumentCreateResponse(serviceResponse));
        }
コード例 #6
0
        public APIAddPartnerResponse AddPartner(PartnerInformation newPartner)
        {
            Invoicing_v2.InvoicingSoapClient client = GetAPIClient();

            var request = new NewPartnerInformation()
            {
                UserName         = newPartner.UserName,
                UserEmail        = newPartner.UserEmail,
                UserPhone        = newPartner.UserPhone,
                CompanyTaxId     = newPartner.CompanyTaxId,
                CompanyLegalName = newPartner.CompanyLegalName,
                CompanyAddress   = newPartner.CompanyAddress,
                CompanyCity      = newPartner.CompanyCity,
                CompanyPostCode  = newPartner.CompanyPostCode,
                CompanyCountry   = newPartner.CompanyCountry
            };

            var serviceResponse = client.AddPartnerAsync(GetAuthenticationCredentials(), request).Result;

            return(AddPartnerAPIResponse(serviceResponse));
        }