Payouts endopoint gocardless pro client php not working fine

19 Views Asked by At

i'm trying to take my payouts between specific dates, but ut seems not working:

$params = [
  'created_at' => 'between',
  'created_at_gte' => (new DateTime('2023-03-31 22:00:00'))->format('Y-m-d\TH:i:s.u\Z'),
  'created_at_lte' => (new DateTime('2023-06-31 22:00:00'))->format('Y-m-d\TH:i:s.u\Z'),
  'limit' => 500,
  'status' => 'paid'
];
$payouts = $client->payouts()->list($params)->records;

The dates seems to be ignored. I've trieds to put it hardly in the code, in the manager, the date in url seems to works like that: /payouts?created_at=between&created_at_gte=2023-03-31T22%3A00%3A00.000Z&created_at_lte=2023-07-01T21%3A59%3A59.999Z&status=paid

i've also tried with this params:

$params = [
  'created_at[gte]' => '2023-03-31T22:00:00.000Z',
  'created_at_[lte]' => '2023-07-01T21:59:59.999Z',
  'limit' => 500,
];
$payouts = $client->payouts()->list($params)->records;

But it's not working fine. I've 50 results on the api with date not in an not in the range, and 35 results in the manager. Thanks to you

I want to have to good results with good payouts between my 2 dates

1

There are 1 best solutions below

0
On

Works fine with this params:

$params = [
  'params' => [
    'created_at[gte]' => '2023-03-31T22:00:00.000Z',
    'created_at[lte]' => '2023-07-01T21:59:59.999Z',
    'limit' => 500,
  ]
];