XeroAPI / xero-php-oauth2

Xero PHP SDK for oAuth 2 generated from Xero API OpenAPI Spec 3.0
MIT License
90 stars 64 forks source link

Unable to fetch Purchase Orders when using numeric PurchaseOrderNumber #251

Open colorninja opened 2 years ago

colorninja commented 2 years ago

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

Describe the bug

Client can not fetch purchase order by PurchaseOrderNumber if it's numeric.

It must be a data type bug, but it seems like an API bug rather than the wrapper library bug, but I don't have access to Xero developer forums because you need to pay for that!

To Reproduce Steps to reproduce the behavior:

  1. Create a purchase order with a numeric PurchaseOrderNumber - eg. "19200"
  2. Try to fetch if
    
    <?php
    [$po] = $this->accountingApi()->getPurchaseOrderByNumber('', '19200');

3. You get a 404 error
4. Ament the entry and add a letter to the PurchaseOrderNumber - eg. "A19200"
5. Try to fetch
6. It works now

**Expected behavior**
Correctly fetched purchase order by it's PurchaseOrderNumber when it's numeric