Bad invoice items URL
jcbages opened this issue · 2 comments
Issue
The URL for interacting with invoice items should be /invoiceitems
but right now it's /invoice_items
which makes stripe get ii_invoice_item_id
calls fail
Expected Behavior
Calling stripe get
with an invoice item ID should show the JSON object for the invoice item. Instead, it's showing an error that the URL is not valid as it's trying to fetch v1/invoice_items
instead of v1/invoiceitems
: https://docs.stripe.com/api/invoiceitems
Steps to reproduce
Run a command to get some invoice item with its ID:
stripe get ii_im_an_invoice_item_id
The current CLI returns the following error:
{
"error": {
"message": "Unrecognized request URL (GET: /v1/invoice_items/ii_im_an_invoice_item_id). Please see https://stripe.com/docs or we can help at https://support.stripe.com/.",
"type": "invalid_request_error"
}
}
However, getting the full path will correctly return the JSON object, which is the expected behavior from the first command:
stripe get v1/invoiceitems/ii_im_an_invoice_item_id
Traceback
{
"error": {
"message": "Unrecognized request URL (GET: /v1/invoice_items/ii_im_an_invoice_item_id). Please see https://stripe.com/docs or we can help at https://support.stripe.com/.",
"type": "invalid_request_error"
}
}
Environment
macOS
Hey @jcbages, what version of the CLI are you using? This looks like it's configured correctly (at least on the newest version):
stripe-cli/pkg/requests/ids.go
Line 19 in 683f1bf
I tried it locally too and it seems to be working:
➜ stripe get ii_0P3JuV589O8KAxCGZ0onWjq7
{
"id": "ii_0P3JuV589O8KAxCGZ0onWjq7",
"object": "invoiceitem",
"amount": 100,
"currency": "usd",
...
@tomer-stripe ya I opened this for the PR that fixed it #1157 so I'll close now :)