Closed WebcrazyDylan closed 2 years ago
I faced errors when I added whishlist any product as below. Someone who know the solution, I'd appreciate it if you could help me.
BigcommerceApiError: Big Commerce API error (422) Headers: { "connection": "keep-alive", "content-encoding": "gzip", "content-type": "application/json", "strict-transport-security": "max-age=31536000; includeSubDomains", "transfer-encoding": "chunked", "vary": "Accept-Encoding", "x-rate-limit-requests-left": "147", "x-rate-limit-requests-quota": "150", "x-rate-limit-time-reset-ms": "27320", "x-rate-limit-time-window-ms": "30000", "x-request-id": "0cef4f8ea2727df064c786f3fb4b09db" } { "status": 422, "title": "JSON data is missing or invalid", "type": "https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes", "errors": { "customer_id": "error.expected.jsnumber" } } at Object.eval [as storeApiFetch] (webpack-internal:///./framework/bigcommerce/api/utils/fetch-store-api.ts:32:19) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:95:5) at async Object.addItem (webpack-internal:///./framework/bigcommerce/api/endpoints/wishlist/add-item.ts:56:110) at async Object.wishlistEndpoint [as handler] (webpack-internal:///./framework/commerce/api/endpoints/wishlist.ts:38:20) at async Object.apiResolver (D:\Dev_RenuBio\Next.js-commerce\node_modules\next\dist\server\api-utils.js:102:9) at async DevServer.handleApiRequest (D:\Dev_RenuBio\Next.js-commerce\node_modules\next\dist\server\next-server.js:1014:9) at async Object.fn (D:\Dev_RenuBio\Next.js-commerce\node_modules\next\dist\server\next-server.js:901:37) at async Router.execute (D:\Dev_RenuBio\Next.js-commerce\node_modules\next\dist\server\router.js:210:32) at async DevServer.run (D:\Dev_RenuBio\Next.js-commerce\node_modules\next\dist\server\next-server.js:1085:29) { status: 422, res: Response { size: 0, timeout: 0, [Symbol(Body internals)]: { body: [Gunzip], disturbed: true, error: null },
url: 'https://35.227.219.245/stores/18k1o4rvii/v3/wishlists', status: 422, statusText: 'Unprocessable Entity', headers: [Headers], counter: 0 }, [Symbol(dnsCachedUrl)]: 'https://35.227.219.245/stores/18k1o4rvii/v3/wishlists'
}, data: { status: 422, title: 'JSON data is missing or invalid', type: 'https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes', errors: { customer_id: 'error.expected.jsnumber' } } }
Thanks for reporting! I'll be working on it. BigCommerce introduced a breaking change. We'll add some testing too.
Merged! Thank you
I faced errors when I added whishlist any product as below. Someone who know the solution, I'd appreciate it if you could help me.
BigcommerceApiError: Big Commerce API error (422) Headers: { "connection": "keep-alive", "content-encoding": "gzip", "content-type": "application/json", "strict-transport-security": "max-age=31536000; includeSubDomains", "transfer-encoding": "chunked", "vary": "Accept-Encoding", "x-rate-limit-requests-left": "147", "x-rate-limit-requests-quota": "150", "x-rate-limit-time-reset-ms": "27320", "x-rate-limit-time-window-ms": "30000", "x-request-id": "0cef4f8ea2727df064c786f3fb4b09db" } { "status": 422, "title": "JSON data is missing or invalid", "type": "https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes", "errors": { "customer_id": "error.expected.jsnumber" } } at Object.eval [as storeApiFetch] (webpack-internal:///./framework/bigcommerce/api/utils/fetch-store-api.ts:32:19) at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Object.addItem (webpack-internal:///./framework/bigcommerce/api/endpoints/wishlist/add-item.ts:56:110)
at async Object.wishlistEndpoint [as handler] (webpack-internal:///./framework/commerce/api/endpoints/wishlist.ts:38:20)
at async Object.apiResolver (D:\Dev_RenuBio\Next.js-commerce\node_modules\next\dist\server\api-utils.js:102:9)
at async DevServer.handleApiRequest (D:\Dev_RenuBio\Next.js-commerce\node_modules\next\dist\server\next-server.js:1014:9)
at async Object.fn (D:\Dev_RenuBio\Next.js-commerce\node_modules\next\dist\server\next-server.js:901:37)
at async Router.execute (D:\Dev_RenuBio\Next.js-commerce\node_modules\next\dist\server\router.js:210:32)
at async DevServer.run (D:\Dev_RenuBio\Next.js-commerce\node_modules\next\dist\server\next-server.js:1085:29) {
status: 422,
res: Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: { body: [Gunzip], disturbed: true, error: null },
}, data: { status: 422, title: 'JSON data is missing or invalid', type: 'https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes', errors: { customer_id: 'error.expected.jsnumber' } } }