#CaReS

1 messages ยท Page 1 of 1 (latest)

neon atlasBOT
fast forge
#
[
  "automatic_tax" => []
  "customer" => "cus_MPxEgAH..."
  "invoice_items" => array:2 [
    "price" => "pdc_agencies_yearly_M0..."
    "quantity" => 10
  ]
]

  return $this->request('get', '/v1/invoices/upcoming', $params, $opts);
#

Can you share the response?

#

And the req_xxx ID

frank narwhal
#

response is null

#

where I can get req_xxx?

fast forge
frank narwhal
#

req_6IAOBneLqIxOYU

fast forge
#

I don't think that's the same request as the one for the code you shared above, that's a GET /v1/customers/cus_MPxEgAHUGtSlnC req

frank narwhal
#

Using Laravel Cashier

#

every request generate new unique id

fast forge
#

Yup, I know that. But req_6IAOBneLqIxOYU is not the request from that code

frank narwhal
#

Hmm, ok, can't understand where is the problem

#

๐Ÿค”

fast forge
#

In which you're passing an invalid param, it should be:

invoice_items => [[
  'price' => ...,
  'quantity' => 
]]
#

You should log and return these errors from your backend!

frank narwhal
#

double array ?

fast forge
#

That's how PHP syntax works

#

[] denotes both a hash and an array

frank narwhal
#

that's strange

#

because in double array

#

I got same result

#

null

fast forge
#

Well you have a different error now

#

You'd know this if you were logging and returning what we return from the API

#
{
  error: {
    message: "The price specified is set to `type=recurring` but this field only accepts prices with `type=one_time`.",
    param: "invoice_items[0][price]",
    type: "invalid_request_error"
  }
}
frank narwhal
#

Understood, thanks ๐Ÿ™