XeroAPI / Xero-NetStandard

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

Error when adding Business Unit - Purchase Orders #485

Open guilhermeblima opened 9 months ago

guilhermeblima commented 9 months ago

SDK you're using (please complete the following information):

Describe the bug When attempting to create a Purchase Order via the API, I consistently encounter the following validation error:

"Unknown tracking details. A Tracking Category did not match a known Active TrackingCategory."

  1. I can confidently confirm that the tracking category used is valid, as it is successfully used for invoices within the system.

  2. This error persists when using the API Explorer, which suggests that it's not an isolated issue on my end.

To Reproduce Steps to reproduce the behavior:

  1. Make a call to CreatePurchaseOrdersAsync with a LineItem containing a valid LineItemTracking
  2. API returns the following error: "Unknown tracking details. A Tracking Category did not match a known Active TrackingCategory"

Expected behavior The API should accept the valid tracking (Business Unit) details without triggering a validation error.

Additional context I've noticed a similar issue here Example payload: { "PurchaseOrders": [ { "Contact": { "ContactID": ContactID }, "LineItems": [ { "Description": "Purchase Order - Terms and Conditions, "UnitAmount": 1.0000, "TaxType": "INPUT2", "TaxAmount": 0.15, "LineAmount": 1.00, "AccountCode": "811", "Tracking": [ { "TrackingCategoryID": TrackingCategoryID, "TrackingOptionID": TrackingOptionID "Options": [], "ValidationErrors": [] } ], "Quantity": 1.0000, "ValidationErrors": [] } ], "Date": "2023-09-18" } ] }

github-actions[bot] commented 9 months ago

PETOSS-348

github-actions[bot] commented 9 months ago

Thanks for raising an issue, a ticket has been created to track your request