#bradley-invoice-dotnet
1 messages · Page 1 of 1 (latest)
moving the message here for complete context
using the following
await service.GetAsync(invoiceItemId);
I get No such invoice: <invoiceItemId> where the variables are valid invoice Item IDs
Are you getting this as API error? Can you share the request ID?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
@errant nebula any additional inforamtion so that we can help you? The error message you shared happens when you call a different API, the Retrieve Invoice API https://stripe.com/docs/api/invoices/retrieve
bradley-invoice-dotnet
let me check
I'm using the SDK to call the invoiceItemsService:
var service = new InvoiceItemService();
var requestOptions = new RequestOptions()
{
ApiKey = credential.ApiKey.Value
};
I mean you think you are but the error message is pretty clear that you are not. My guess is that this code is not what errors, you're confusing this code with something else.
Add clear logs before/after that code and you'll see you don't get there
req_OycQHA66NTuSIk
ah my bad, damn that error message is bad, I'll get it fixed this week, it's super confusing
Thanks! Is there something wrong?
where did you get that InvoiceItem id exactly?
okay can you tweak the code to add clear logs that outputs the ids of every InvoiceItem and clearly print it? I want to see what id you get before you get that error
sure, one sec
oh, so I am not passsing in the requestOptions which contain the API key here (var results = await service.GetAsync(invoiceItemId);) but I am in my unit test. That's what's causing the issue I think
ah gotcha
totally fine 🙂