Shopify / shopify-cli

Shopify CLI helps you build against the Shopify platform faster.
https://shopify.dev/tools/cli
Other
1.01k stars 201 forks source link

[Bug]: <Shopify Orders Refunds> #2728

Closed 20vitality12 closed 1 year ago

20vitality12 commented 1 year ago

Please confirm that you:

What type of project are you working on?

script

Expected behavior

I want to get ALL orders with status refunded.

Actual behavior

I can see only 50+ orders if I use this code

await client.get({
    path: 'orders',
    query: {
      limit: 250, status: 'any', financial_status: 'refunded',
      created_at_min: new Date(2022, 10, 24).toISOString(),
      created_at_max: new Date(2023, 0).toISOString()
    }
  });
  console.log('orders length', response.body.orders.length)

And if I try to do it without created_at_max i can see orders for last 2 month. For example, request on 15.02.2023 will show me last order from 15.12.2022. (this is only for orders with financial_status: 'refunded') But when I try to count this orders with api, I can see 200+ count

await client.get({
    path: 'orders/count',
    query: {
      limit: 250, status: 'any', financial_status: 'refunded',
      created_at_min: new Date(2022, 10, 24).toISOString(),
      created_at_max: new Date(2023, 0).toISOString()
    }
  });
console.log('orders/count of refund from 24.11.2022 to 01.01.2023', response.body.count);

Stack trace

No response

Reproduction steps

  1. run this code
    const client = new Shopify.Clients.Rest(shop, accessToken);
    const response = await client.get({
    path: 'orders',
    query: {
      limit: 250, status: 'any', financial_status: 'refunded',
      created_at_min: new Date(2022, 10, 24).toISOString(),
      created_at_max: new Date(2023, 0).toISOString()
    }
    });

Operating System

Windows 11, MacOS

CLI version (run shopify version if you're not sure)

3.43.0

Shell

Git Bash

Ruby version (run ruby -v if you're not sure)

No response

What language and version are you using in your application?

Node 18.12.1

github-actions[bot] commented 1 year ago

This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action.

→ If there's no activity within a week, then a bot will automatically close this.

Thanks for helping to improve Shopify's dev tooling and experience.