XeroAPI / Xero-NetStandard

A wrapper of the Xero API in the .NetStandard 2.0 framework. Supports Accounting, Payroll AU/US, and Files
MIT License
120 stars 119 forks source link

Update Accounting.Contact.BrandingTheme API does not work #450

Closed liuyu0723 closed 1 year ago

liuyu0723 commented 1 year ago

SDK you're using (please complete the following information): Xero.NetStandard.OAuth2 (3.29.1) Xero.NetStandard.OAuth2Client (1.6.0)

Describe the bug Could not update Contact's Branding Theme with the SDK.

To Reproduce Steps to reproduce the behavior:

  1. Get a Branding Themes by calling: Xero.NetStandard.OAuth2.Api.AccountingApi.GetBrandingThemesAsync()
  2. Pick one of the Themes from the list
  3. Get a Xero Contact from API
  4. Set Xero.NetStandard.OAuth2.Model.Accounting.Contact.BrandingTheme = PickedTheme
  5. Call Xero.NetStandard.OAuth2.Api.AccountingApi.UpdateContactAsync to update Contact

Here is my UpdateContact request header & body:

Request Path /api.xro/2.0/Contacts/xxxxxxxx

Body:

{
   "Contacts":[
      {
         "ContactID":"xxx",
         "ContactNumber":"xxx",
         "AccountNumber":"xxx",
         "Name":"xxx",
         "FirstName":"xxx",
         "LastName":"xxx",
         "EmailAddress":"xxxx@xxx.com",
         "ContactPersons":[
            {
               "FirstName":"xxx",
               "LastName":"xxx",
               "EmailAddress":"xxxx@xxx.com",
               "IncludeInEmails":false
            }
         ],
         "Addresses":[
            {
               "AddressType":"STREET",
               "AddressLine1":"",
               "AddressLine2":"338 Street",
               "AddressLine3":"xxx",
               "AddressLine4":"xxx",
               "City":"xxx",
               "PostalCode":"1111",
               "AttentionTo":"xxxx"
            },
            {
               "AddressType":"POBOX",
               "AddressLine1":"",
               "AddressLine2":"338 Street",
               "AddressLine3":"xxx",
               "AddressLine4":"xxx",
               "City":"xxx",
               "PostalCode":"1111",
               "AttentionTo":"xxx"
            }
         ],
         "IsCustomer":true,
         "BrandingTheme":{
            "Type":"INVOICE",
            "BrandingThemeID":"xxxxxxxxx",
            "Name":"Website Standard",
            "LogoUrl":"https://in.xero.com/logo?id=zzzzzzz",
            "SortOrder":1,
            "CreatedDateUTC":"2022-03-29T02:19:43.69Z"
         }
      }
   ]
}

Expected behavior All Contact detail has been updated after calling UpdateContactAsync, but the Contact.BrandingTheme does not change.

JRising-Xero commented 1 year ago

Hi liuyu0723, Unfortunately updating BrandingTheme is not supported by our Accounting API at this time, you can review the documentation for contacts here. However, this feature has been requested on our feature request page, you can upvote the request to give it a greater priority.

Thanks.