Closed junaid33 closed 1 year ago
Hi @junaid33
The requestParameters
of getAnItem
is an ItemsApiGetAnItemRequest
object, which requires properties that you are not passing in.
The correct input would be
const lineItems = await itemsApi.getAnItem({
id: '4390580943850',
productIdType: 'SKU',
authorization: '',
wMSECACCESSTOKEN: '',
wMQOSCORRELATIONID: '',
wMSVCNAME: ''
});
Which is how the library is generated based on the OpenApi spec that Walmart provides.
However, our library does provide a helpful util to help facilitate not having to constantly pass these in.
import { defaultParams } from '@whitebox-co/walmart-marketplace-api';
const exampleOrder = await ordersApi.getAnOrder({
...defaultParams,
id: '4390580943850',
productIdType: 'SKU',
});
In the future, I have plans to add functionality to update all these to optional during auto-generation and pass this along for the user ... for now though they must be passed in.
Feel free to re-open the issue if this doesn't work.
Hope this helps!
I'm using the ItemsApi like so:
But, I'm getting an error:
I'm using the OrdersApi in the same function, could that be causing the issue?